@c4a/server-cli 0.4.15-alpha.4 → 0.4.15-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -5
- package/index.js +954 -85
- package/package.json +1 -1
- package/serve.js +2016 -216
- package/web/assets/ContentDetail--oZBzWh0.js +1 -0
- package/web/assets/ContentDetail-B5s8bbFo.js +1 -0
- package/web/assets/ContentDetail-C3kXsx-i.js +1 -0
- package/web/assets/ContentDetail-CcLGF_Yi.js +1 -0
- package/web/assets/ContentDetail-D-2xyerw.js +1 -0
- package/web/assets/ContentDetail-DlQ8URkx.js +1 -0
- package/web/assets/ContentDetail-TPc0m0eM.js +1 -0
- package/web/assets/ContentDetail-y0yi2qln.js +1 -0
- package/web/assets/EntityDetail-3CFtMmgQ.js +1 -0
- package/web/assets/EntityDetail-BI3etmj4.js +1 -0
- package/web/assets/EntityDetail-CoFb-qZW.js +1 -0
- package/web/assets/EntityDetail-D_WP7tD4.js +1 -0
- package/web/assets/EntityDetail-DiJPemDY.js +1 -0
- package/web/assets/EntityDetail-DihnDvhA.js +1 -0
- package/web/assets/EntityDetail-DyDH4GAw.js +1 -0
- package/web/assets/EntityDetail-dIZiNN2t.js +1 -0
- package/web/assets/RelationDetail-B2gHrceI.js +1 -0
- package/web/assets/RelationDetail-CEq9vopD.js +1 -0
- package/web/assets/RelationDetail-CaYrspaS.js +1 -0
- package/web/assets/RelationDetail-CpoGdy25.js +1 -0
- package/web/assets/RelationDetail-DU9ECyHi.js +1 -0
- package/web/assets/RelationDetail-Dz7HAlU5.js +1 -0
- package/web/assets/RelationDetail-Wh3IgNaF.js +1 -0
- package/web/assets/RelationDetail-zZ_ZfkYX.js +1 -0
- package/web/assets/index-BPMqeFze.js +111 -0
- package/web/assets/index-BgRuvBL5.js +111 -0
- package/web/assets/index-CcrkBEZl.js +111 -0
- package/web/assets/index-DGDx8sCs.js +111 -0
- package/web/assets/index-DIyAwnqE.js +111 -0
- package/web/assets/index-DW1cCA8v.js +111 -0
- package/web/assets/index-DiAYi5t8.css +1 -0
- package/web/assets/index-FOCWvgW_.css +1 -0
- package/web/assets/index-daOjyLzy.css +1 -0
- package/web/assets/index-moF8uSEi.js +111 -0
- package/web/assets/index-sPNyENFN.js +111 -0
- package/web/assets/index-uGqDxUnx.css +1 -0
- package/web/index.html +2 -2
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA-rfuFy.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/angular-ts-BrjP3tb8.js","assets/scss-D5BDwBP9.js","assets/astro-HNnZUWAn.js","assets/json-Cp-IABpG.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-BjGOyj-B.js","assets/html-derivative-DlHx6ybY.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/sql-BLtJtn59.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/haml-D5jkg6IW.js","assets/handlebars-BpdQsYii.js","assets/yaml-Buea-lGh.js","assets/http-jrhK8wxY.js","assets/shellscript-Yzrsuije.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/jinja-f2NsQr07.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/python-B6aJPvgy.js","assets/r-Dspwwk_N.js","assets/marko-DjSrsDqO.js","assets/less-B1dDrJ26.js","assets/mdc-DTYItulj.js","assets/markdown-Cvjx9yec.js","assets/php-R6g_5hLQ.js","assets/pug-DKIMFp6K.js","assets/svelte-Cy7k_4gC.js","assets/ts-tags-DQrlYJgV.js","assets/vue-D2xRrEX4.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-BEDo0Tqx.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
function Yj(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(a,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>a[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(o){if(o.ep)return;o.ep=!0;const l=r(o);fetch(o.href,l)}})();function $_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ap={exports:{}},$i={};var Lb;function Kj(){if(Lb)return $i;Lb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var f in o)f!=="key"&&(l[f]=o[f])}else l=o;return o=l.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:l}}return $i.Fragment=t,$i.jsx=r,$i.jsxs=r,$i}var Db;function Xj(){return Db||(Db=1,Ap.exports=Kj()),Ap.exports}var c=Xj();const Ke=e=>typeof e=="string",Bi=()=>{let e,t;const r=new Promise((a,o)=>{e=a,t=o});return r.resolve=e,r.reject=t,r},Ob=e=>e==null?"":""+e,Qj=(e,t,r)=>{e.forEach(a=>{t[a]&&(r[a]=t[a])})},Zj=/###/g,Mb=e=>e&&e.indexOf("###")>-1?e.replace(Zj,"."):e,zb=e=>!e||Ke(e),ll=(e,t,r)=>{const a=Ke(t)?t.split("."):t;let o=0;for(;o<a.length-1;){if(zb(e))return{};const l=Mb(a[o]);!e[l]&&r&&(e[l]=new r),Object.prototype.hasOwnProperty.call(e,l)?e=e[l]:e={},++o}return zb(e)?{}:{obj:e,k:Mb(a[o])}},$b=(e,t,r)=>{const{obj:a,k:o}=ll(e,t,Object);if(a!==void 0||t.length===1){a[o]=r;return}let l=t[t.length-1],u=t.slice(0,t.length-1),f=ll(e,u,Object);for(;f.obj===void 0&&u.length;)l=`${u[u.length-1]}.${l}`,u=u.slice(0,u.length-1),f=ll(e,u,Object),f?.obj&&typeof f.obj[`${f.k}.${l}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${l}`]=r},Jj=(e,t,r,a)=>{const{obj:o,k:l}=ll(e,t,Object);o[l]=o[l]||[],o[l].push(r)},Mu=(e,t)=>{const{obj:r,k:a}=ll(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,a))return r[a]},Wj=(e,t,r)=>{const a=Mu(e,r);return a!==void 0?a:Mu(t,r)},B_=(e,t,r)=>{for(const a in t)a!=="__proto__"&&a!=="constructor"&&(a in e?Ke(e[a])||e[a]instanceof String||Ke(t[a])||t[a]instanceof String?r&&(e[a]=t[a]):B_(e[a],t[a],r):e[a]=t[a]);return e},Rs=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var e2={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const t2=e=>Ke(e)?e.replace(/[&<>"'\/]/g,t=>e2[t]):e;class n2{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const a=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,a),this.regExpQueue.push(t),a}}const r2=[" ",",","?","!",";"],a2=new n2(20),s2=(e,t,r)=>{t=t||"",r=r||"";const a=r2.filter(u=>t.indexOf(u)<0&&r.indexOf(u)<0);if(a.length===0)return!0;const o=a2.getRegExp(`(${a.map(u=>u==="?"?"\\?":u).join("|")})`);let l=!o.test(e);if(!l){const u=e.indexOf(r);u>0&&!o.test(e.substring(0,u))&&(l=!0)}return l},gh=(e,t,r=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const a=t.split(r);let o=e;for(let l=0;l<a.length;){if(!o||typeof o!="object")return;let u,f="";for(let h=l;h<a.length;++h)if(h!==l&&(f+=r),f+=a[h],u=o[f],u!==void 0){if(["string","number","boolean"].indexOf(typeof u)>-1&&h<a.length-1)continue;l+=h-l+1;break}o=u}return o},pl=e=>e?.replace("_","-"),o2={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class zu{constructor(t,r={}){this.init(t,r)}init(t,r={}){this.prefix=r.prefix||"i18next:",this.logger=t||o2,this.options=r,this.debug=r.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,a,o){return o&&!this.debug?null:(Ke(t[0])&&(t[0]=`${a}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new zu(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new zu(this.logger,t)}}var Kr=new zu;class rd{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(a=>{this.observers[a]||(this.observers[a]=new Map);const o=this.observers[a].get(r)||0;this.observers[a].set(r,o+1)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t].delete(r)}}emit(t,...r){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,l])=>{for(let u=0;u<l;u++)o(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,l])=>{for(let u=0;u<l;u++)o.apply(o,[t,...r])})}}class Bb extends rd{constructor(t,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,a,o={}){const l=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;t.indexOf(".")>-1?f=t.split("."):(f=[t,r],a&&(Array.isArray(a)?f.push(...a):Ke(a)&&l?f.push(...a.split(l)):f.push(a)));const h=Mu(this.data,f);return!h&&!r&&!a&&t.indexOf(".")>-1&&(t=f[0],r=f[1],a=f.slice(2).join(".")),h||!u||!Ke(a)?h:gh(this.data?.[t]?.[r],a,l)}addResource(t,r,a,o,l={silent:!1}){const u=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let f=[t,r];a&&(f=f.concat(u?a.split(u):a)),t.indexOf(".")>-1&&(f=t.split("."),o=r,r=f[1]),this.addNamespaces(r),$b(this.data,f,o),l.silent||this.emit("added",t,r,a,o)}addResources(t,r,a,o={silent:!1}){for(const l in a)(Ke(a[l])||Array.isArray(a[l]))&&this.addResource(t,r,l,a[l],{silent:!0});o.silent||this.emit("added",t,r,a)}addResourceBundle(t,r,a,o,l,u={silent:!1,skipCopy:!1}){let f=[t,r];t.indexOf(".")>-1&&(f=t.split("."),o=a,a=r,r=f[1]),this.addNamespaces(r);let h=Mu(this.data,f)||{};u.skipCopy||(a=JSON.parse(JSON.stringify(a))),o?B_(h,a,l):h={...h,...a},$b(this.data,f,h),u.silent||this.emit("added",t,r,a)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(o=>r[o]&&Object.keys(r[o]).length>0)}toJSON(){return this.data}}var I_={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,a,o){return e.forEach(l=>{t=this.processors[l]?.process(t,r,a,o)??t}),t}};const U_=Symbol("i18next/PATH_KEY");function i2(){const e=[],t=Object.create(null);let r;return t.get=(a,o)=>(r?.revoke?.(),o===U_?e:(e.push(o),r=Proxy.revocable(a,t),r.proxy)),Proxy.revocable(Object.create(null),t).proxy}function xh(e,t){const{[U_]:r}=e(i2());return r.join(t?.keySeparator??".")}const Ib={},Rp=e=>!Ke(e)&&typeof e!="boolean"&&typeof e!="number";class $u extends rd{constructor(t,r={}){super(),Qj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Kr.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,r={interpolation:{}}){const a={...r};if(t==null)return!1;const o=this.resolve(t,a);if(o?.res===void 0)return!1;const l=Rp(o.res);return!(a.returnObjects===!1&&l)}extractFromKey(t,r){let a=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let l=r.ns||this.options.defaultNS||[];const u=a&&t.indexOf(a)>-1,f=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!s2(t,a,o);if(u&&!f){const h=t.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:t,namespaces:Ke(l)?[l]:l};const p=t.split(a);(a!==o||a===o&&this.options.ns.indexOf(p[0])>-1)&&(l=p.shift()),t=p.join(o)}return{key:t,namespaces:Ke(l)?[l]:l}}translate(t,r,a){let o=typeof r=="object"?{...r}:r;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),t==null)return"";typeof t=="function"&&(t=xh(t,{...this.options,...o})),Array.isArray(t)||(t=[String(t)]);const l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:f,namespaces:h}=this.extractFromKey(t[t.length-1],o),p=h[h.length-1];let m=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;m===void 0&&(m=":");const x=o.lng||this.language,v=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(x?.toLowerCase()==="cimode")return v?l?{res:`${p}${m}${f}`,usedKey:f,exactUsedKey:f,usedLng:x,usedNS:p,usedParams:this.getUsedParamsDetails(o)}:`${p}${m}${f}`:l?{res:f,usedKey:f,exactUsedKey:f,usedLng:x,usedNS:p,usedParams:this.getUsedParamsDetails(o)}:f;const _=this.resolve(t,o);let w=_?.res;const S=_?.usedKey||f,k=_?.exactUsedKey||f,N=["[object Number]","[object Function]","[object RegExp]"],A=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,D=o.count!==void 0&&!Ke(o.count),L=$u.hasDefaultValue(o),$=D?this.pluralResolver.getSuffix(x,o.count,o):"",z=o.ordinal&&D?this.pluralResolver.getSuffix(x,o.count,{ordinal:!1}):"",R=D&&!o.ordinal&&o.count===0,B=R&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${$}`]||o[`defaultValue${z}`]||o.defaultValue;let H=w;E&&!w&&L&&(H=B);const J=Rp(H),oe=Object.prototype.toString.apply(H);if(E&&H&&J&&N.indexOf(oe)<0&&!(Ke(A)&&Array.isArray(H))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ce=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,H,{...o,ns:h}):`key '${f} (${this.language})' returned an object instead of string.`;return l?(_.res=ce,_.usedParams=this.getUsedParamsDetails(o),_):ce}if(u){const ce=Array.isArray(H),M=ce?[]:{},P=ce?k:S;for(const T in H)if(Object.prototype.hasOwnProperty.call(H,T)){const q=`${P}${u}${T}`;L&&!w?M[T]=this.translate(q,{...o,defaultValue:Rp(B)?B[T]:void 0,joinArrays:!1,ns:h}):M[T]=this.translate(q,{...o,joinArrays:!1,ns:h}),M[T]===q&&(M[T]=H[T])}w=M}}else if(E&&Ke(A)&&Array.isArray(w))w=w.join(A),w&&(w=this.extendTranslation(w,t,o,a));else{let ce=!1,M=!1;!this.isValidLookup(w)&&L&&(ce=!0,w=B),this.isValidLookup(w)||(M=!0,w=f);const T=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&M?void 0:w,q=L&&B!==w&&this.options.updateMissing;if(M||ce||q){if(this.logger.log(q?"updateKey":"missingKey",x,p,f,q?B:w),u){const O=this.resolve(f,{...o,keySeparator:!1});O&&O.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 ee=[];const ae=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ae&&ae[0])for(let O=0;O<ae.length;O++)ee.push(ae[O]);else this.options.saveMissingTo==="all"?ee=this.languageUtils.toResolveHierarchy(o.lng||this.language):ee.push(o.lng||this.language);const W=(O,V,re)=>{const se=L&&re!==w?re:T;this.options.missingKeyHandler?this.options.missingKeyHandler(O,p,V,se,q,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(O,p,V,se,q,o),this.emit("missingKey",O,p,V,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?ee.forEach(O=>{const V=this.pluralResolver.getSuffixes(O,o);R&&o[`defaultValue${this.options.pluralSeparator}zero`]&&V.indexOf(`${this.options.pluralSeparator}zero`)<0&&V.push(`${this.options.pluralSeparator}zero`),V.forEach(re=>{W([O],f+re,o[`defaultValue${re}`]||B)})}):W(ee,f,B))}w=this.extendTranslation(w,t,o,_,a),M&&w===f&&this.options.appendNamespaceToMissingKey&&(w=`${p}${m}${f}`),(M||ce)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${m}${f}`:f,ce?w:void 0,o))}return l?(_.res=w,_.usedParams=this.getUsedParamsDetails(o),_):w}extendTranslation(t,r,a,o,l){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...a},a.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init({...a,interpolation:{...this.options.interpolation,...a.interpolation}});const h=Ke(t)&&(a?.interpolation?.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(h){const x=t.match(this.interpolator.nestingRegexp);p=x&&x.length}let m=a.replace&&!Ke(a.replace)?a.replace:a;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),t=this.interpolator.interpolate(t,m,a.lng||this.language||o.usedLng,a),h){const x=t.match(this.interpolator.nestingRegexp),v=x&&x.length;p<v&&(a.nest=!1)}!a.lng&&o&&o.res&&(a.lng=this.language||o.usedLng),a.nest!==!1&&(t=this.interpolator.nest(t,(...x)=>l?.[0]===x[0]&&!a.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${r[0]}`),null):this.translate(...x,r),a)),a.interpolation&&this.interpolator.reset()}const u=a.postProcess||this.options.postProcess,f=Ke(u)?[u]:u;return t!=null&&f?.length&&a.applyPostProcessor!==!1&&(t=I_.handle(f,t,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(a)},...a}:a,this)),t}resolve(t,r={}){let a,o,l,u,f;return Ke(t)&&(t=[t]),t.forEach(h=>{if(this.isValidLookup(a))return;const p=this.extractFromKey(h,r),m=p.key;o=m;let x=p.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const v=r.count!==void 0&&!Ke(r.count),_=v&&!r.ordinal&&r.count===0,w=r.context!==void 0&&(Ke(r.context)||typeof r.context=="number")&&r.context!=="",S=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);x.forEach(k=>{this.isValidLookup(a)||(f=k,!Ib[`${S[0]}-${k}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(f)&&(Ib[`${S[0]}-${k}`]=!0,this.logger.warn(`key "${o}" for languages "${S.join(", ")}" won't get resolved as namespace "${f}" 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!!!")),S.forEach(N=>{if(this.isValidLookup(a))return;u=N;const A=[m];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(A,m,N,k,r);else{let D;v&&(D=this.pluralResolver.getSuffix(N,r.count,r));const L=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(r.ordinal&&D.indexOf($)===0&&A.push(m+D.replace($,this.options.pluralSeparator)),A.push(m+D),_&&A.push(m+L)),w){const z=`${m}${this.options.contextSeparator||"_"}${r.context}`;A.push(z),v&&(r.ordinal&&D.indexOf($)===0&&A.push(z+D.replace($,this.options.pluralSeparator)),A.push(z+D),_&&A.push(z+L))}}let E;for(;E=A.pop();)this.isValidLookup(a)||(l=E,a=this.getResource(N,k,E,r))}))})}),{res:a,usedKey:o,exactUsedKey:l,usedLng:u,usedNS:f}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,a,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,r,a,o):this.resourceStore.getResource(t,r,a,o)}getUsedParamsDetails(t={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],a=t.replace&&!Ke(t.replace);let o=a?t.replace:t;if(a&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!a){o={...o};for(const l of r)delete o[l]}return o}static hasDefaultValue(t){const r="defaultValue";for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&r===a.substring(0,r.length)&&t[a]!==void 0)return!0;return!1}}class Ub{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kr.create("languageUtils")}getScriptPartFromCode(t){if(t=pl(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=pl(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(Ke(t)&&t.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(t)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(a=>{if(r)return;const o=this.formatLanguageCode(a);(!this.options.supportedLngs||this.isSupportedCode(o))&&(r=o)}),!r&&this.options.supportedLngs&&t.forEach(a=>{if(r)return;const o=this.getScriptPartFromCode(a);if(this.isSupportedCode(o))return r=o;const l=this.getLanguagePartFromCode(a);if(this.isSupportedCode(l))return r=l;r=this.options.supportedLngs.find(u=>{if(u===l)return u;if(!(u.indexOf("-")<0&&l.indexOf("-")<0)&&(u.indexOf("-")>0&&l.indexOf("-")<0&&u.substring(0,u.indexOf("-"))===l||u.indexOf(l)===0&&l.length>1))return u})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),Ke(t)&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];let a=t[r];return a||(a=t[this.getScriptPartFromCode(r)]),a||(a=t[this.formatLanguageCode(r)]),a||(a=t[this.getLanguagePartFromCode(r)]),a||(a=t.default),a||[]}toResolveHierarchy(t,r){const a=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],t),o=[],l=u=>{u&&(this.isSupportedCode(u)?o.push(u):this.logger.warn(`rejecting language code not found in supportedLngs: ${u}`))};return Ke(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&l(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&l(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&l(this.getLanguagePartFromCode(t))):Ke(t)&&l(this.formatLanguageCode(t)),a.forEach(u=>{o.indexOf(u)<0&&l(this.formatLanguageCode(u))}),o}}const Pb={zero:0,one:1,two:2,few:3,many:4,other:5},Hb={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class l2{constructor(t,r={}){this.languageUtils=t,this.options=r,this.logger=Kr.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,r={}){const a=pl(t==="dev"?"en":t),o=r.ordinal?"ordinal":"cardinal",l=JSON.stringify({cleanedCode:a,type:o});if(l in this.pluralRulesCache)return this.pluralRulesCache[l];let u;try{u=new Intl.PluralRules(a,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Hb;if(!t.match(/-|_/))return Hb;const h=this.languageUtils.getLanguagePartFromCode(t);u=this.getRule(h,r)}return this.pluralRulesCache[l]=u,u}needsPlural(t,r={}){let a=this.getRule(t,r);return a||(a=this.getRule("dev",r)),a?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,r,a={}){return this.getSuffixes(t,a).map(o=>`${r}${o}`)}getSuffixes(t,r={}){let a=this.getRule(t,r);return a||(a=this.getRule("dev",r)),a?a.resolvedOptions().pluralCategories.sort((o,l)=>Pb[o]-Pb[l]).map(o=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,r,a={}){const o=this.getRule(t,a);return o?`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${o.select(r)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",r,a))}}const Fb=(e,t,r,a=".",o=!0)=>{let l=Wj(e,t,r);return!l&&o&&Ke(r)&&(l=gh(e,r,a),l===void 0&&(l=gh(t,r,a))),l},Tp=e=>e.replace(/\$/g,"$$$$");class qb{constructor(t={}){this.logger=Kr.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:a,useRawValueToEscape:o,prefix:l,prefixEscaped:u,suffix:f,suffixEscaped:h,formatSeparator:p,unescapeSuffix:m,unescapePrefix:x,nestingPrefix:v,nestingPrefixEscaped:_,nestingSuffix:w,nestingSuffixEscaped:S,nestingOptionsSeparator:k,maxReplaces:N,alwaysFormat:A}=t.interpolation;this.escape=r!==void 0?r:t2,this.escapeValue=a!==void 0?a:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=l?Rs(l):u||"{{",this.suffix=f?Rs(f):h||"}}",this.formatSeparator=p||",",this.unescapePrefix=m?"":x||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=v?Rs(v):_||Rs("$t("),this.nestingSuffix=w?Rs(w):S||Rs(")"),this.nestingOptionsSeparator=k||",",this.maxReplaces=N||1e3,this.alwaysFormat=A!==void 0?A:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,a)=>r?.source===a?(r.lastIndex=0,r):new RegExp(a,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,r,a,o){let l,u,f;const h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=_=>{if(_.indexOf(this.formatSeparator)<0){const N=Fb(r,h,_,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(N,void 0,a,{...o,...r,interpolationkey:_}):N}const w=_.split(this.formatSeparator),S=w.shift().trim(),k=w.join(this.formatSeparator).trim();return this.format(Fb(r,h,S,this.options.keySeparator,this.options.ignoreJSONStructure),k,a,{...o,...r,interpolationkey:S})};this.resetRegExp();const m=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,x=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:_=>Tp(_)},{regex:this.regexp,safeValue:_=>this.escapeValue?Tp(this.escape(_)):Tp(_)}].forEach(_=>{for(f=0;l=_.regex.exec(t);){const w=l[1].trim();if(u=p(w),u===void 0)if(typeof m=="function"){const k=m(t,l,o);u=Ke(k)?k:""}else if(o&&Object.prototype.hasOwnProperty.call(o,w))u="";else if(x){u=l[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${t}`),u="";else!Ke(u)&&!this.useRawValueToEscape&&(u=Ob(u));const S=_.safeValue(u);if(t=t.replace(l[0],S),x?(_.regex.lastIndex+=u.length,_.regex.lastIndex-=l[0].length):_.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),t}nest(t,r,a={}){let o,l,u;const f=(h,p)=>{const m=this.nestingOptionsSeparator;if(h.indexOf(m)<0)return h;const x=h.split(new RegExp(`${Rs(m)}[ ]*{`));let v=`{${x[1]}`;h=x[0],v=this.interpolate(v,u);const _=v.match(/'/g),w=v.match(/"/g);((_?.length??0)%2===0&&!w||(w?.length??0)%2!==0)&&(v=v.replace(/'/g,'"'));try{u=JSON.parse(v),p&&(u={...p,...u})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,S),`${h}${m}${v}`}return u.defaultValue&&u.defaultValue.indexOf(this.prefix)>-1&&delete u.defaultValue,h};for(;o=this.nestingRegexp.exec(t);){let h=[];u={...a},u=u.replace&&!Ke(u.replace)?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;const p=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(p!==-1&&(h=o[1].slice(p).split(this.formatSeparator).map(m=>m.trim()).filter(Boolean),o[1]=o[1].slice(0,p)),l=r(f.call(this,o[1].trim(),u),u),l&&o[0]===t&&!Ke(l))return l;Ke(l)||(l=Ob(l)),l||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),l=""),h.length&&(l=h.reduce((m,x)=>this.format(m,x,a.lng,{...a,interpolationkey:o[1].trim()}),l.trim())),t=t.replace(o[0],l),this.regexp.lastIndex=0}return t}}const c2=e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const a=e.split("(");t=a[0].toLowerCase().trim();const o=a[1].substring(0,a[1].length-1);t==="currency"&&o.indexOf(":")<0?r.currency||(r.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?r.range||(r.range=o.trim()):o.split(";").forEach(u=>{if(u){const[f,...h]=u.split(":"),p=h.join(":").trim().replace(/^'+|'+$/g,""),m=f.trim();r[m]||(r[m]=p),p==="false"&&(r[m]=!1),p==="true"&&(r[m]=!0),isNaN(p)||(r[m]=parseInt(p,10))}})}return{formatName:t,formatOptions:r}},Gb=e=>{const t={};return(r,a,o)=>{let l=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(l={...l,[o.interpolationkey]:void 0});const u=a+JSON.stringify(l);let f=t[u];return f||(f=e(pl(a),o),t[u]=f),f(r)}},u2=e=>(t,r,a)=>e(pl(r),a)(t);class d2{constructor(t={}){this.logger=Kr.create("formatter"),this.options=t,this.init(t)}init(t,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const a=r.cacheInBuiltFormats?Gb:u2;this.formats={number:a((o,l)=>{const u=new Intl.NumberFormat(o,{...l});return f=>u.format(f)}),currency:a((o,l)=>{const u=new Intl.NumberFormat(o,{...l,style:"currency"});return f=>u.format(f)}),datetime:a((o,l)=>{const u=new Intl.DateTimeFormat(o,{...l});return f=>u.format(f)}),relativetime:a((o,l)=>{const u=new Intl.RelativeTimeFormat(o,{...l});return f=>u.format(f,l.range||"day")}),list:a((o,l)=>{const u=new Intl.ListFormat(o,{...l});return f=>u.format(f)})}}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=Gb(r)}format(t,r,a,o={}){const l=r.split(this.formatSeparator);if(l.length>1&&l[0].indexOf("(")>1&&l[0].indexOf(")")<0&&l.find(f=>f.indexOf(")")>-1)){const f=l.findIndex(h=>h.indexOf(")")>-1);l[0]=[l[0],...l.splice(1,f)].join(this.formatSeparator)}return l.reduce((f,h)=>{const{formatName:p,formatOptions:m}=c2(h);if(this.formats[p]){let x=f;try{const v=o?.formatParams?.[o.interpolationkey]||{},_=v.locale||v.lng||o.locale||o.lng||a;x=this.formats[p](f,_,{...m,...o,...v})}catch(v){this.logger.warn(v)}return x}else this.logger.warn(`there was no format function for ${p}`);return f},t)}}const f2=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class p2 extends rd{constructor(t,r,a,o={}){super(),this.backend=t,this.store=r,this.services=a,this.languageUtils=a.languageUtils,this.options=o,this.logger=Kr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(a,o.backend,o)}queueLoad(t,r,a,o){const l={},u={},f={},h={};return t.forEach(p=>{let m=!0;r.forEach(x=>{const v=`${p}|${x}`;!a.reload&&this.store.hasResourceBundle(p,x)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?u[v]===void 0&&(u[v]=!0):(this.state[v]=1,m=!1,u[v]===void 0&&(u[v]=!0),l[v]===void 0&&(l[v]=!0),h[x]===void 0&&(h[x]=!0)))}),m||(f[p]=!0)}),(Object.keys(l).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(l),pending:Object.keys(u),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(h)}}loaded(t,r,a){const o=t.split("|"),l=o[0],u=o[1];r&&this.emit("failedLoading",l,u,r),!r&&a&&this.store.addResourceBundle(l,u,a,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&a&&(this.state[t]=0);const f={};this.queue.forEach(h=>{Jj(h.loaded,[l],u),f2(h,t),r&&h.errors.push(r),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(p=>{f[p]||(f[p]={});const m=h.loaded[p];m.length&&m.forEach(x=>{f[p][x]===void 0&&(f[p][x]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(h=>!h.done)}read(t,r,a,o=0,l=this.retryTimeout,u){if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:a,tried:o,wait:l,callback:u});return}this.readingCalls++;const f=(p,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const x=this.waitingReads.shift();this.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(p&&m&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,a,o+1,l*2,u)},l);return}u(p,m)},h=this.backend[a].bind(this.backend);if(h.length===2){try{const p=h(t,r);p&&typeof p.then=="function"?p.then(m=>f(null,m)).catch(f):f(null,p)}catch(p){f(p)}return}return h(t,r,f)}prepareLoading(t,r,a={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Ke(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ke(r)&&(r=[r]);const l=this.queueLoad(t,r,a,o);if(!l.toLoad.length)return l.pending.length||o(),null;l.toLoad.forEach(u=>{this.loadOne(u)})}load(t,r,a){this.prepareLoading(t,r,{},a)}reload(t,r,a){this.prepareLoading(t,r,{reload:!0},a)}loadOne(t,r=""){const a=t.split("|"),o=a[0],l=a[1];this.read(o,l,"read",void 0,void 0,(u,f)=>{u&&this.logger.warn(`${r}loading namespace ${l} for language ${o} failed`,u),!u&&f&&this.logger.log(`${r}loaded namespace ${l} for language ${o}`,f),this.loaded(t,u,f)})}saveMissing(t,r,a,o,l,u={},f=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${a}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if(this.backend?.create){const h={...u,isUpdate:l},p=this.backend.create.bind(this.backend);if(p.length<6)try{let m;p.length===5?m=p(t,r,a,o,h):m=p(t,r,a,o),m&&typeof m.then=="function"?m.then(x=>f(null,x)).catch(f):f(null,m)}catch(m){f(m)}else p(t,r,a,o,f,h)}!t||!t[0]||this.store.addResource(t[0],r,a,o)}}}const Lp=()=>({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:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Ke(e[1])&&(t.defaultValue=e[1]),Ke(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(a=>{t[a]=r[a]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Vb=e=>(Ke(e.ns)&&(e.ns=[e.ns]),Ke(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ke(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),ru=()=>{},h2=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})},P_="__i18next_supportNoticeShown",m2=()=>typeof globalThis<"u"&&!!globalThis[P_],g2=()=>{typeof globalThis<"u"&&(globalThis[P_]=!0)},x2=e=>!!(e?.modules?.backend?.name?.indexOf("Locize")>0||e?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||e?.options?.backend?.backends&&e.options.backend.backends.some(t=>t?.name?.indexOf("Locize")>0||t?.constructor?.name?.indexOf("Locize")>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(t=>t?.projectId));class cl extends rd{constructor(t={},r){if(super(),this.options=Vb(t),this.services={},this.logger=Kr,this.modules={external:[]},h2(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(t={},r){this.isInitializing=!0,typeof t=="function"&&(r=t,t={}),t.defaultNS==null&&t.ns&&(Ke(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const a=Lp();this.options={...a,...this.options,...Vb(t)},this.options.interpolation={...a.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=a.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!x2(this)&&!m2()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),g2());const o=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?Kr.init(o(this.modules.logger),this.options):Kr.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=d2;const m=new Ub(this.options);this.store=new Bb(this.options.resources,this.options);const x=this.services;x.logger=Kr,x.resourceStore=this.store,x.languageUtils=m,x.pluralResolver=new l2(m,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==a.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"),p&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(x.formatter=o(p),x.formatter.init&&x.formatter.init(x,this.options),this.options.interpolation.format=x.formatter.format.bind(x.formatter)),x.interpolator=new qb(this.options),x.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},x.backendConnector=new p2(o(this.modules.backend),x.resourceStore,x,this.options),x.backendConnector.on("*",(_,...w)=>{this.emit(_,...w)}),this.modules.languageDetector&&(x.languageDetector=o(this.modules.languageDetector),x.languageDetector.init&&x.languageDetector.init(x,this.options.detection,this.options)),this.modules.i18nFormat&&(x.i18nFormat=o(this.modules.i18nFormat),x.i18nFormat.init&&x.i18nFormat.init(this)),this.translator=new $u(this.services,this.options),this.translator.on("*",(_,...w)=>{this.emit(_,...w)}),this.modules.external.forEach(_=>{_.init&&_.init(this)})}if(this.format=this.options.interpolation.format,r||(r=ru),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[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(p=>{this[p]=(...m)=>this.store[p](...m)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...m)=>(this.store[p](...m),this)});const f=Bi(),h=()=>{const p=(m,x)=>{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),f.resolve(x),r(m,x)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),f}loadResources(t,r=ru){let a=r;const o=Ke(t)?t:this.language;if(typeof t=="function"&&(a=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return a();const l=[],u=f=>{if(!f||f==="cimode")return;this.services.languageUtils.toResolveHierarchy(f).forEach(p=>{p!=="cimode"&&l.indexOf(p)<0&&l.push(p)})};o?u(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>u(h)),this.options.preload?.forEach?.(f=>u(f)),this.services.backendConnector.load(l,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),a(f)})}else a(null)}reloadResources(t,r,a){const o=Bi();return typeof t=="function"&&(a=t,t=void 0),typeof r=="function"&&(a=r,r=void 0),t||(t=this.languages),r||(r=this.options.ns),a||(a=ru),this.services.backendConnector.reload(t,r,l=>{o.resolve(),a(l)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&I_.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let r=0;r<this.languages.length;r++){const a=this.languages[r];if(!(["cimode","dev"].indexOf(a)>-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,r){this.isLanguageChangingTo=t;const a=Bi();this.emit("languageChanging",t);const o=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},l=(f,h)=>{h?this.isLanguageChangingTo===t&&(o(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,a.resolve((...p)=>this.t(...p)),r&&r(f,(...p)=>this.t(...p))},u=f=>{!t&&!f&&this.services.languageDetector&&(f=[]);const h=Ke(f)?f:f&&f[0],p=this.store.hasLanguageSomeTranslations(h)?h:this.services.languageUtils.getBestMatchFromCodes(Ke(f)?[f]:f);p&&(this.language||o(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector?.cacheUserLanguage?.(p)),this.loadResources(p,m=>{l(m,p)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(t),a}getFixedT(t,r,a){const o=(l,u,...f)=>{let h;typeof u!="object"?h=this.options.overloadTranslationOptionHandler([l,u].concat(f)):h={...u},h.lng=h.lng||o.lng,h.lngs=h.lngs||o.lngs,h.ns=h.ns||o.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||a||o.keyPrefix);const p=this.options.keySeparator||".";let m;return h.keyPrefix&&Array.isArray(l)?m=l.map(x=>(typeof x=="function"&&(x=xh(x,{...this.options,...u})),`${h.keyPrefix}${p}${x}`)):(typeof l=="function"&&(l=xh(l,{...this.options,...u})),m=h.keyPrefix?`${h.keyPrefix}${p}${l}`:l),this.t(m,h)};return Ke(t)?o.lng=t:o.lngs=t,o.ns=r,o.keyPrefix=a,o}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const a=r.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const u=(f,h)=>{const p=this.services.backendConnector.state[`${f}|${h}`];return p===-1||p===0||p===2};if(r.precheck){const f=r.precheck(this,u);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(a,t)&&(!o||u(l,t)))}loadNamespaces(t,r){const a=Bi();return this.options.ns?(Ke(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{a.resolve(),r&&r(o)}),a):(r&&r(),Promise.resolve())}loadLanguages(t,r){const a=Bi();Ke(t)&&(t=[t]);const o=this.options.preload||[],l=t.filter(u=>o.indexOf(u)<0&&this.services.languageUtils.isSupportedCode(u));return l.length?(this.options.preload=o.concat(l),this.loadResources(u=>{a.resolve(),r&&r(u)}),a):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=this.services?.languageUtils||new Ub(Lp());return t.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(a.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},r){const a=new cl(t,r);return a.createInstance=cl.createInstance,a}cloneInstance(t={},r=ru){const a=t.forkResourceStore;a&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},l=new cl(o);if((t.debug!==void 0||t.prefix!==void 0)&&(l.logger=l.logger.clone(t)),["store","services","language"].forEach(f=>{l[f]=this[f]}),l.services={...this.services},l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},a){const f=Object.keys(this.store.data).reduce((h,p)=>(h[p]={...this.store.data[p]},h[p]=Object.keys(h[p]).reduce((m,x)=>(m[x]={...h[p][x]},m),h[p]),h),{});l.store=new Bb(f,o),l.services.resourceStore=l.store}if(t.interpolation){const h={...Lp().interpolation,...this.options.interpolation,...t.interpolation},p={...o,interpolation:h};l.services.interpolator=new qb(p)}return l.translator=new $u(l.services,o),l.translator.on("*",(f,...h)=>{l.emit(f,...h)}),l.init(o,r),l.translator.options=o,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Cn=cl.createInstance();Cn.createInstance;Cn.dir;Cn.init;Cn.loadResources;Cn.reloadResources;Cn.use;Cn.changeLanguage;Cn.getFixedT;Cn.t;Cn.exists;Cn.setDefaultNamespace;Cn.hasLoadedNamespace;Cn.loadNamespaces;Cn.loadLanguages;var Dp={exports:{}},Qe={};var Yb;function y2(){if(Yb)return Qe;Yb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),v=Symbol.iterator;function _(O){return O===null||typeof O!="object"?null:(O=v&&O[v]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function N(O,V,re){this.props=O,this.context=V,this.refs=k,this.updater=re||w}N.prototype.isReactComponent={},N.prototype.setState=function(O,V){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,V,"setState")},N.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function A(){}A.prototype=N.prototype;function E(O,V,re){this.props=O,this.context=V,this.refs=k,this.updater=re||w}var D=E.prototype=new A;D.constructor=E,S(D,N.prototype),D.isPureReactComponent=!0;var L=Array.isArray;function $(){}var z={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function B(O,V,re){var se=re.ref;return{$$typeof:e,type:O,key:V,ref:se!==void 0?se:null,props:re}}function H(O,V){return B(O.type,V,O.props)}function J(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function oe(O){var V={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(re){return V[re]})}var ce=/\/+/g;function M(O,V){return typeof O=="object"&&O!==null&&O.key!=null?oe(""+O.key):V.toString(36)}function P(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then($,$):(O.status="pending",O.then(function(V){O.status==="pending"&&(O.status="fulfilled",O.value=V)},function(V){O.status==="pending"&&(O.status="rejected",O.reason=V)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function T(O,V,re,se,ne){var ge=typeof O;(ge==="undefined"||ge==="boolean")&&(O=null);var Ne=!1;if(O===null)Ne=!0;else switch(ge){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(O.$$typeof){case e:case t:Ne=!0;break;case m:return Ne=O._init,T(Ne(O._payload),V,re,se,ne)}}if(Ne)return ne=ne(O),Ne=se===""?"."+M(O,0):se,L(ne)?(re="",Ne!=null&&(re=Ne.replace(ce,"$&/")+"/"),T(ne,V,re,"",function(be){return be})):ne!=null&&(J(ne)&&(ne=H(ne,re+(ne.key==null||O&&O.key===ne.key?"":(""+ne.key).replace(ce,"$&/")+"/")+Ne)),V.push(ne)),1;Ne=0;var qe=se===""?".":se+":";if(L(O))for(var Fe=0;Fe<O.length;Fe++)se=O[Fe],ge=qe+M(se,Fe),Ne+=T(se,V,re,ge,ne);else if(Fe=_(O),typeof Fe=="function")for(O=Fe.call(O),Fe=0;!(se=O.next()).done;)se=se.value,ge=qe+M(se,Fe++),Ne+=T(se,V,re,ge,ne);else if(ge==="object"){if(typeof O.then=="function")return T(P(O),V,re,se,ne);throw V=String(O),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function q(O,V,re){if(O==null)return O;var se=[],ne=0;return T(O,se,"","",function(ge){return V.call(re,ge,ne++)}),se}function ee(O){if(O._status===-1){var V=O._result;V=V(),V.then(function(re){(O._status===0||O._status===-1)&&(O._status=1,O._result=re)},function(re){(O._status===0||O._status===-1)&&(O._status=2,O._result=re)}),O._status===-1&&(O._status=0,O._result=V)}if(O._status===1)return O._result.default;throw O._result}var ae=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},W={map:q,forEach:function(O,V,re){q(O,function(){V.apply(this,arguments)},re)},count:function(O){var V=0;return q(O,function(){V++}),V},toArray:function(O){return q(O,function(V){return V})||[]},only:function(O){if(!J(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Qe.Activity=x,Qe.Children=W,Qe.Component=N,Qe.Fragment=r,Qe.Profiler=o,Qe.PureComponent=E,Qe.StrictMode=a,Qe.Suspense=h,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(O){return z.H.useMemoCache(O)}},Qe.cache=function(O){return function(){return O.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(O,V,re){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var se=S({},O.props),ne=O.key;if(V!=null)for(ge in V.key!==void 0&&(ne=""+V.key),V)!R.call(V,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&V.ref===void 0||(se[ge]=V[ge]);var ge=arguments.length-2;if(ge===1)se.children=re;else if(1<ge){for(var Ne=Array(ge),qe=0;qe<ge;qe++)Ne[qe]=arguments[qe+2];se.children=Ne}return B(O.type,ne,se)},Qe.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:l,_context:O},O},Qe.createElement=function(O,V,re){var se,ne={},ge=null;if(V!=null)for(se in V.key!==void 0&&(ge=""+V.key),V)R.call(V,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ne[se]=V[se]);var Ne=arguments.length-2;if(Ne===1)ne.children=re;else if(1<Ne){for(var qe=Array(Ne),Fe=0;Fe<Ne;Fe++)qe[Fe]=arguments[Fe+2];ne.children=qe}if(O&&O.defaultProps)for(se in Ne=O.defaultProps,Ne)ne[se]===void 0&&(ne[se]=Ne[se]);return B(O,ge,ne)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(O){return{$$typeof:f,render:O}},Qe.isValidElement=J,Qe.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:ee}},Qe.memo=function(O,V){return{$$typeof:p,type:O,compare:V===void 0?null:V}},Qe.startTransition=function(O){var V=z.T,re={};z.T=re;try{var se=O(),ne=z.S;ne!==null&&ne(re,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then($,ae)}catch(ge){ae(ge)}finally{V!==null&&re.types!==null&&(V.types=re.types),z.T=V}},Qe.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Qe.use=function(O){return z.H.use(O)},Qe.useActionState=function(O,V,re){return z.H.useActionState(O,V,re)},Qe.useCallback=function(O,V){return z.H.useCallback(O,V)},Qe.useContext=function(O){return z.H.useContext(O)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(O,V){return z.H.useDeferredValue(O,V)},Qe.useEffect=function(O,V){return z.H.useEffect(O,V)},Qe.useEffectEvent=function(O){return z.H.useEffectEvent(O)},Qe.useId=function(){return z.H.useId()},Qe.useImperativeHandle=function(O,V,re){return z.H.useImperativeHandle(O,V,re)},Qe.useInsertionEffect=function(O,V){return z.H.useInsertionEffect(O,V)},Qe.useLayoutEffect=function(O,V){return z.H.useLayoutEffect(O,V)},Qe.useMemo=function(O,V){return z.H.useMemo(O,V)},Qe.useOptimistic=function(O,V){return z.H.useOptimistic(O,V)},Qe.useReducer=function(O,V,re){return z.H.useReducer(O,V,re)},Qe.useRef=function(O){return z.H.useRef(O)},Qe.useState=function(O){return z.H.useState(O)},Qe.useSyncExternalStore=function(O,V,re){return z.H.useSyncExternalStore(O,V,re)},Qe.useTransition=function(){return z.H.useTransition()},Qe.version="19.2.4",Qe}var Kb;function ad(){return Kb||(Kb=1,Dp.exports=y2()),Dp.exports}var b=ad();const Do=$_(b),b2=Yj({__proto__:null,default:Do},[b]),v2=(e,t,r,a)=>{const o=[r,{code:t,...a||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(o,"warn","react-i18next::",!0);Us(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...o):console?.warn&&console.warn(...o)},Xb={},H_=(e,t,r,a)=>{Us(r)&&Xb[r]||(Us(r)&&(Xb[r]=new Date),v2(e,t,r,a))},F_=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},yh=(e,t,r)=>{e.loadNamespaces(t,F_(e,r))},Qb=(e,t,r,a)=>{if(Us(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return yh(e,r,a);r.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,F_(e,a))},_2=(e,t,r={})=>!t.languages||!t.languages.length?(H_(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:r.lng,precheck:(a,o)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!o(a.isLanguageChangingTo,e))return!1}}),Us=e=>typeof e=="string",w2=e=>typeof e=="object"&&e!==null,S2=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,j2={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},k2=e=>j2[e],N2=e=>e.replace(S2,k2);let bh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:N2,transDefaultProps:void 0};const E2=(e={})=>{bh={...bh,...e}},C2=()=>bh;let q_;const A2=e=>{q_=e},R2=()=>q_,T2={type:"3rdParty",init(e){E2(e.options.react),A2(e)}},L2=b.createContext();class D2{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Op={exports:{}},Mp={};var Zb;function O2(){if(Zb)return Mp;Zb=1;var e=ad();function t(x,v){return x===v&&(x!==0||1/x===1/v)||x!==x&&v!==v}var r=typeof Object.is=="function"?Object.is:t,a=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(x,v){var _=v(),w=a({inst:{value:_,getSnapshot:v}}),S=w[0].inst,k=w[1];return l(function(){S.value=_,S.getSnapshot=v,h(S)&&k({inst:S})},[x,_,v]),o(function(){return h(S)&&k({inst:S}),x(function(){h(S)&&k({inst:S})})},[x]),u(_),_}function h(x){var v=x.getSnapshot;x=x.value;try{var _=v();return!r(x,_)}catch{return!0}}function p(x,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return Mp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Mp}var Jb;function M2(){return Jb||(Jb=1,Op.exports=O2()),Op.exports}var z2=M2();const $2=(e,t)=>Us(t)?t:w2(t)&&Us(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,B2={t:$2,ready:!1},I2=()=>()=>{},ye=(e,t={})=>{const{i18n:r}=t,{i18n:a,defaultNS:o}=b.useContext(L2)||{},l=r||a||R2();l&&!l.reportNamespaces&&(l.reportNamespaces=new D2),l||H_(l,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const u=b.useMemo(()=>({...C2(),...l?.options?.react,...t}),[l,t]),{useSuspense:f,keyPrefix:h}=u,p=o||l?.options?.defaultNS,m=Us(p)?[p]:p||["translation"],x=b.useMemo(()=>m,m);l?.reportNamespaces?.addUsedNamespaces?.(x);const v=b.useRef(0),_=b.useCallback(B=>{if(!l)return I2;const{bindI18n:H,bindI18nStore:J}=u,oe=()=>{v.current+=1,B()};return H&&l.on(H,oe),J&&l.store.on(J,oe),()=>{H&&H.split(" ").forEach(ce=>l.off(ce,oe)),J&&J.split(" ").forEach(ce=>l.store.off(ce,oe))}},[l,u]),w=b.useRef(),S=b.useCallback(()=>{if(!l)return B2;const B=!!(l.isInitialized||l.initializedStoreOnce)&&x.every(P=>_2(P,l,u)),H=t.lng||l.language,J=v.current,oe=w.current;if(oe&&oe.ready===B&&oe.lng===H&&oe.keyPrefix===h&&oe.revision===J)return oe;const M={t:l.getFixedT(H,u.nsMode==="fallback"?x:x[0],h),ready:B,lng:H,keyPrefix:h,revision:J};return w.current=M,M},[l,x,h,u,t.lng]),[k,N]=b.useState(0),{t:A,ready:E}=z2.useSyncExternalStore(_,S,S);b.useEffect(()=>{if(l&&!E&&!f){const B=()=>N(H=>H+1);t.lng?Qb(l,t.lng,x,B):yh(l,x,B)}},[l,t.lng,x,E,f,k]);const D=l||{},L=b.useRef(null),$=b.useRef(),z=B=>{const H=Object.getOwnPropertyDescriptors(B);H.__original&&delete H.__original;const J=Object.create(Object.getPrototypeOf(B),H);if(!Object.prototype.hasOwnProperty.call(J,"__original"))try{Object.defineProperty(J,"__original",{value:B,writable:!1,enumerable:!1,configurable:!1})}catch{}return J},R=b.useMemo(()=>{const B=D,H=B?.language;let J=B;B&&(L.current&&L.current.__original===B?$.current!==H?(J=z(B),L.current=J,$.current=H):J=L.current:(J=z(B),L.current=J,$.current=H));const oe=[A,J,E];return oe.t=A,oe.i18n=J,oe.ready=E,oe},[A,D,E,D.resolvedLanguage,D.language,D.languages]);if(l&&f&&!E)throw new Promise(B=>{const H=()=>B();t.lng?Qb(l,t.lng,x,H):yh(l,x,H)});return R},{slice:U2,forEach:P2}=[];function H2(e){return P2.call(U2.call(arguments,1),t=>{if(t)for(const r in t)e[r]===void 0&&(e[r]=t[r])}),e}function F2(e){return typeof e!="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(r=>r.test(e))}const Wb=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,q2=function(e,t){const a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(t);let l=`${e}=${o}`;if(a.maxAge>0){const u=a.maxAge-0;if(Number.isNaN(u))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(u)}`}if(a.domain){if(!Wb.test(a.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${a.domain}`}if(a.path){if(!Wb.test(a.path))throw new TypeError("option path is invalid");l+=`; Path=${a.path}`}if(a.expires){if(typeof a.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+=`; Expires=${a.expires.toUTCString()}`}if(a.httpOnly&&(l+="; HttpOnly"),a.secure&&(l+="; Secure"),a.sameSite)switch(typeof a.sameSite=="string"?a.sameSite.toLowerCase():a.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return a.partitioned&&(l+="; Partitioned"),l},e0={create(e,t,r,a){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),a&&(o.domain=a),document.cookie=q2(e,t,o)},read(e){const t=`${e}=`,r=document.cookie.split(";");for(let a=0;a<r.length;a++){let o=r[a];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return o.substring(t.length,o.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var G2={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return e0.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:a,cookieDomain:o,cookieOptions:l}=t;r&&typeof document<"u"&&e0.create(r,e,a,o,l)}},V2={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,r;if(typeof window<"u"){let{search:a}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(a=window.location.hash.substring(window.location.hash.indexOf("?")));const l=a.substring(1).split("&");for(let u=0;u<l.length;u++){const f=l[u].indexOf("=");f>0&&l[u].substring(0,f)===t&&(r=l[u].substring(f+1))}}return r}},Y2={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:r}=e,a;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const l=o.substring(1);if(t){const u=l.split("&");for(let f=0;f<u.length;f++){const h=u[f].indexOf("=");h>0&&u[f].substring(0,h)===t&&(a=u[f].substring(h+1))}}if(a)return a;if(!a&&r>-1){const u=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(u)?u[typeof r=="number"?r:0]?.replace("/",""):void 0}}}return a}};let Co=null;const t0=()=>{if(Co!==null)return Co;try{if(Co=typeof window<"u"&&window.localStorage!==null,!Co)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Co=!1}return Co};var K2={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&t0())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;r&&t0()&&window.localStorage.setItem(r,e)}};let Ao=null;const n0=()=>{if(Ao!==null)return Ao;try{if(Ao=typeof window<"u"&&window.sessionStorage!==null,!Ao)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Ao=!1}return Ao};var X2={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&n0())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&n0()&&window.sessionStorage.setItem(r,e)}},Q2={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:r,userLanguage:a,language:o}=navigator;if(r)for(let l=0;l<r.length;l++)t.push(r[l]);a&&t.push(a),o&&t.push(o)}return t.length>0?t:void 0}},Z2={name:"htmlTag",lookup(e){let{htmlTag:t}=e,r;const a=t||(typeof document<"u"?document.documentElement:null);return a&&typeof a.getAttribute=="function"&&(r=a.getAttribute("lang")),r}},J2={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof t=="number"?t:0]?.replace("/",""):void 0}},W2={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const r=typeof t=="number"?t+1:1,a=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(a)return a[r]}};let G_=!1;try{document.cookie,G_=!0}catch{}const V_=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];G_||V_.splice(1,1);const ek=()=>({order:V_,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Y_{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,r)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=H2(r,this.options||{},ek()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=a,this.addDetector(G2),this.addDetector(V2),this.addDetector(K2),this.addDetector(X2),this.addDetector(Q2),this.addDetector(Z2),this.addDetector(J2),this.addDetector(W2),this.addDetector(Y2)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return t.forEach(a=>{if(this.detectors[a]){let o=this.detectors[a].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),r=r.filter(a=>a!=null&&!F2(a)).map(a=>this.options.convertDetectedLanguage(a)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||r.forEach(a=>{this.detectors[a]&&this.detectors[a].cacheUserLanguage(t,this.options)}))}}Y_.type="languageDetector";const tk={"nav.home":"Home","nav.studio":"Studio","nav.docs":"Docs","nav.login":"Login","nav.logout":"Logout","header.status.connected":"Connected","header.status.disconnected":"Disconnected","header.status.reconnecting":"Reconnecting","footer.copyright":"GitHub · @Context4AI {{year}}. All rights reserved.","footer.copyright_compact":"@Context4AI {{year}}. All rights reserved.","footer.tagline":"Knowledge Factory","footer.theme.dark":"Dark","footer.theme.light":"Light","footer.theme.system":"System","studio.sidebar.sources":"Sources","studio.sidebar.modeling":"Modeling","studio.sidebar.brain":"Brain","studio.sidebar.discovery":"Discovery","studio.sidebar.sharing":"Sharing","studio.sidebar.collaboration":"Collaboration","studio.sidebar.settings":"Settings","placeholder.coming":"Coming in {{version}}","page.login.title":"Login","page.login.description":"Authentication and user management","login.title":"SIGN IN","login.provider_cta":"Sign in with {{name}}","login.loading":"LOADING...","login.authenticating":"AUTHENTICATING...","login.or":"OR","login.test_account":"Test Account","login.error":"Failed to load login options","login.retry":"Retry","user.menu.connect_source":"Connect Source","user.menu.sign_out":"Sign out","api_keys.title":"API Keys","api_keys.description":"API Keys for programmatic access to C4A API (AI Agent, CLI, CI/CD)","api_keys.create":"Create API Key","api_keys.created":"API Key Created","api_keys.copy_warning":"Copy now, this key won't be shown again.","api_keys.copy":"Copy","api_keys.copied":"Copied!","api_keys.done":"Done","api_keys.empty.title":"No API Keys","api_keys.empty.description":"API Keys for programmatic access to C4A API","api_keys.created_at":"Created {{date}}","api_keys.never_used":"Never used","api_keys.expires.never":"Never expires","api_keys.expires.30d":"30 days","api_keys.expires.90d":"90 days","api_keys.expires.1y":"1 year","api_keys.form.name":"Name","api_keys.form.name_placeholder":"My CLI key","api_keys.form.expiry":"Expiration (optional)","api_keys.delete.confirm":"Delete this API key? This action cannot be undone.","workspace.default_name":"My Brain","settings.tab.general":"General","settings.tab.api_keys":"API Keys","page.docs.title":"Docs","page.docs.description":"Public documentation portal","page.sources.title":"Sources","page.sources.description":"Add code repositories, documents, and other input materials for your brain to index","page.modeling.title":"Modeling","page.modeling.description":"Model indexed content with AI — only what stands up to scrutiny gets written to the knowledge graph","page.brain.title":"Brain","page.brain.description":"All modeled knowledge lives here — browse, search, analyze, and use it anytime","page.discovery.title":"Discovery","page.discovery.description":"Explore knowledge curated by others and add what's useful to your own brain","page.sharing.title":"Sharing","page.sharing.description":"Package and export knowledge from your brain for others and AI to use directly","page.collaboration.title":"Collaboration","page.collaboration.description":"Stay in sync with other brains — get notified on updates, no manual transfer needed","page.settings.title":"Settings","page.settings.description":"Manage workspace members and configuration","page.code_setup.title":"Code Setup","page.code_setup.description":"Repository selection and configuration for code modeling","page.code_compile.title":"Code Compile","page.code_compile.description":"Compilation progress tracking for code modeling","page.code_review.title":"Code Review","page.code_review.description":"Review and approve modeling results","page.code_result.title":"Code Result","page.code_result.description":"View final modeling results and generated knowledge graph","home.hero.title":"Context For AI","home.hero.description":"Transform code repositories and business documents into structured knowledge graphs.","home.hero.cta.studio":"Enter Studio","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"The page you're looking for doesn't exist.","notfound.back":"Back to Home","error.description":"Something went wrong. Please try again.","error.reload":"Reload","sources.menu.add_client":"Add Client","sources.menu.online":"online","sources.menu.offline":"offline","sources.menu.status_online":"{{machine}} connected","sources.menu.status_offline":"{{machine}} not connected, click for setup guide","sources.library.default_cloud_name":"My Drive","sources.library.rename":"Rename","sources.library.rename_placeholder":"Enter library name","sources.header.daemon_status":"{{online}}/{{total}} online","sources.header.all_offline":"All offline","sources.actions.new_folder":"New Folder","sources.folder.name_placeholder":"Enter folder name","sources.actions.import_repo":"Import Repository","sources.actions.rename":"Rename","sources.actions.move_to":"Move to...","sources.actions.delete":"Delete","sources.filter.all":"All","sources.filter.indexed":"Indexed","sources.filter.not_indexed":"Not Indexed","sources.status.none":"None","sources.status.indexed":"Indexed","sources.status.stale":"Index outdated","sources.type.code":"Code","sources.type.doc":"Document","sources.empty.cloud.title":"Your personal knowledge input zone","sources.empty.cloud.description":"Create folders to organize your documents and materials. These are visible only to you and will serve as the foundation for building your digital brain","sources.empty.daemon.title":"Connect your local code assets","sources.empty.daemon.description":"Import local code repositories. The system will automatically extract code structures and technical documents, transforming them into structured knowledge","sources.empty.indexed.title":"Knowledge not yet indexed","sources.empty.indexed.description":"Select sources and complete indexing. They will be transformed into structured summaries, providing material for your future speculations.","sources.empty.folder.title":"This folder is empty","sources.empty.folder.daemon_description":"You can add or edit documents locally, and they will appear here after the next sync.","sources.safety.notice.repo":"In local mode, your code has absolute privacy. Source code never leaves your computer. The system only extracts structured summaries for knowledge modeling (function signatures, dependencies, etc.).","sources.safety.notice.dir":"The system extracts document content and summaries for knowledge modeling. Although unsafe text is filtered, please ensure sensitive data is not included in indexing or modeling.","sources.import.title":"Import Repository","sources.import.step.select":"Select Repository","sources.import.step.version":"Select Version","sources.import.step.confirm":"Import Complete","sources.import.daemon_offline":"Client {{name}} is not connected. Please start the local Daemon and connect to the server before importing.","sources.import.view_guide":"View Connection Guide","sources.import.select_root":"Select repository root directory","sources.import.current_path":"Current path","sources.import.not_git":"This directory is not a Git repository. Please select a directory containing .git.","sources.import.branch":"Branch","sources.import.commit":"Commit","sources.import.branch_warning":"Currently based on {{branch}} branch HEAD","sources.import.uncommitted_warning":"Uncommitted changes will not be collected","sources.import.recognized":"Recognized {{packages}} packages and {{docs}} documents","sources.import.no_packages":"No package structure detected. Will be imported as a single-package repository.","sources.import.confirm_heading":"About to import the following repository to {{name}}:","sources.import.packages":"Packages","sources.import.documents":"Documents","sources.import.loading_repo":"Loading repository info...","sources.import.loading_repo_slow":"Large repositories (>10 GB) may take 5–10 seconds...","sources.import.importing":"Importing...","sources.import.error_title":"Import Failed","sources.import.success":"Import complete","sources.import.stage.prepare":"Preparing environment","sources.import.stage.clone":"Cloning repository","sources.import.stage.clone_polling":"","sources.import.stage.scan":"Scanning project","sources.import.stage.save":"Saving sources","sources.import.stage.done_suffix":"done","sources.import.stage.complete":"Import complete","sources.import.stage.fetch_tree":"Fetching file tree","sources.import.stage.read_packages":"Reading package descriptors","sources.import.step.loading":"Data Import","sources.import.done":"Done","sources.import.back":"Back","sources.import.retry":"Retry","sources.add_client.title":"Connect Local Knowledge Source","sources.add_client.description":"Start a client (Daemon) on your local computer to mount local code repositories as input material into your digital brain.","sources.add_client.step1":"Install Daemon","sources.add_client.step2":"Start Daemon","sources.add_client.step2_allow":"Restrict access to specific directories (does not affect existing imports)","sources.add_client.step3":"Wait for connection","sources.add_client.step3_desc":"This page will update automatically once connected.","sources.add_client.waiting":"Waiting for new client connection...","sources.add_client.detected":"New client detected","sources.add_client.machine_name":"Machine ID","sources.add_client.os":"Operating system","sources.add_client.daemon_version":"Daemon version","sources.add_client.client_name":"Client name","sources.add_client.confirm":"Confirm Add","sources.add_client.reconnected":"Client {{name}} has reconnected","sources.add_client.go_to":"Go to {{name}}","sources.detail.tab.original":"Original","sources.detail.tab.overview":"Overview","sources.detail.tab.digest":"Digest","sources.detail.tab.modeling":"Modeling Result","sources.detail.not_found_title":"Source Not Found","sources.detail.not_found_desc":"This source could not be found. It may have been deleted or the ID is invalid.","sources.detail.digest_placeholder":"Structured summary will be available here after indexing is complete.","sources.detail.modeling_placeholder":"Knowledge entities derived from this source will appear here after modeling in the speculation zone.","sources.detail.type":"Type","sources.detail.origin":"Origin","sources.detail.origin.upload":"Upload","sources.detail.origin.local":"Local file","sources.detail.path":"Path","sources.detail.status":"Status","sources.detail.repo":"Repository","sources.detail.branch":"Branch","sources.detail.commit":"Commit","sources.detail.tech_stack":"Tech stack","sources.detail.original_code_placeholder":"Package overview will be available after indexing.","sources.detail.original_doc_placeholder":"Document content will be available after upload.","sources.detail.dependencies":"Dependencies","sources.delete.confirm_title":"Confirm Delete","sources.delete.resource":"Are you sure you want to delete {{name}}?","sources.delete.resource_impact":"The following data will be permanently deleted: original content, structured digest (if any).","sources.delete.session_warning":"If your personal speculation zone is using this source, related candidate speculations will be affected.","sources.delete.entity_safe":"Formal knowledge already merged into the brain will not be affected.","sources.delete.folder":"Are you sure you want to delete folder {{name}}?","sources.delete.folder_impact":"All resources inside will be recursively deleted: {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_contents":"Contains {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_impact_generic":"All sub-folders and resources inside will be recursively deleted.","sources.delete.irreversible":"This action cannot be undone.","sources.delete.repo":"Are you sure you want to remove repository {{name}} from {{library}}?","sources.delete.repo_impact":"Will delete: {{packages}} package index records, {{docs}} document index records.","sources.delete.repo_contents":"Contains {{packages}} packages, {{docs}} documents.","sources.delete.indexed_hint":"{{indexed}}/{{total}} have been indexed; their index data will be deleted.","sources.delete.repo_impact_generic":"All package and document index records will be deleted.","sources.delete.local_safe":"Local files will not be affected.","sources.delete.client":"Are you sure you want to delete client {{name}}?","sources.delete.client_impact":"All imported repository records and related index data under this client will be deleted.","sources.delete.client_reregister":"This client will need to re-register on next connection.","sources.error.name_conflict":'An item named "{{name}}" already exists in this directory.',"sources.move.current":"Current","sources.move.target":"Move to","sources.breadcrumb.sources":"Sources","common.cancel":"Cancel","common.confirm":"Confirm","common.back":"Back","common.next":"Next","common.previous":"Previous","common.items":"{{count}} items","common.loading":"Loading...","sources.import.no_entries":"No entries found","sources.import.allowed_dirs":"Client authorized directories","sources.import.allowed_dirs_tooltip_restrict":"Restrict to specific directories:","sources.import.allowed_dirs_tooltip_all":"Or allow all directories (default):","sources.import.wildcard_home":"Home","sources.import.wildcard_path_placeholder":"Enter a directory path…","sources.import.wildcard_go":"Go","sources.import.wildcard_goto":"Go to","sources.import.wildcard_go_title":"Go to Directory","sources.import.wildcard_path_not_found":"Path does not exist on the remote machine","sources.import.already_imported":"Imported","sources.import.dir_title":"Import Directory","sources.import.dir_step.select":"Select Directory","sources.import.dir_step.scan":"Scan","sources.import.dir_step.confirm":"Confirm Import","sources.import.dir_confirm_heading":"About to import the following directory to {{name}}:","sources.import.dir_name":"Directory Name","sources.import.dir_name_hint":"Display name in the source tree after import. Leave empty to use the default repository name.","sources.import.dir_name_duplicate":"This name already exists. Please use a different name.","sources.import.dir_path":"Directory Path","sources.import.dir_files":"Files","sources.import.dir_subdirs":"Subdirectories","sources.import.dir_git_repos":"Repositories (skipped)","sources.import.dir_git_hint":"Git repositories inside the directory will not be expanded for indexing. Import them separately if needed.","sources.import.dir_scanning":"Scanning directory contents...","sources.import.dir_scan_complete":"Scan complete","sources.import.dir_scan_error":"Failed to scan directory","sources.import.dir_scan_retry":"Retry","sources.import.dir_code_packages":"Code Packages","sources.import.dir_code_packages_tip":"Supported: package.json, pyproject.toml, setup.py, go.mod, Cargo.toml, pom.xml, build.gradle","sources.import.dir_doc_files":"Documents","sources.import.dir_doc_files_tip":"Supported: Markdown (.md)","sources.import.dir_total_files":"Total Files","sources.import.dir_total_dirs":"Directories","sources.import.dir_git_skip_hint":"Git repos are skipped. Use 'Import Repository' instead.","sources.actions.upload":"Upload","sources.actions.upload_md":"Markdown Document","sources.actions.upload_doc":"Document","sources.actions.upload_document":"Upload Document","sources.actions.add":"Add","sources.actions.add_folder":"Folder","sources.actions.add_web":"Web Page","sources.actions.add_feishu":"Feishu Document","sources.actions.import_dir":"Import Directory","sources.actions.import_repo_url":"Import Repository","sources.upgrade.title":"Feature Upgrading","sources.upgrade.description":"This feature will be available in version 0.5.x. Stay tuned.","sources.upload.title":"Upload Documents","sources.upload.drop_hint":"Click to select or drag files here","sources.upload.supported_formats":"Supported: .md, .doc, .docx, .pdf, .ppt, .pptx, .txt (max 5MB each, up to 10 files)","sources.upload.file_too_large":'"{{name}}" exceeds 5MB limit',"sources.upload.too_many_files":"Maximum 10 files allowed, please re-select","sources.upload.unsupported_type":'"{{name}}" is not a supported file type',"sources.upload.uploading":"Uploading...","sources.upload.success":"Uploaded {{count}} documents","sources.upload.selected":"{{count}} files selected","sources.upload.remove":"Remove","sources.import_remote.title":"Import Remote Repository","sources.import_remote.step.loading":"Data Import","sources.import_remote.url_label":"Repository URL","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"Only HTTPS URLs are accepted. SSH support is planned for a future release","sources.import_remote.url_hint_public":"Supports public Git repositories without authentication, and Git services with OAuth configured: ","sources.import_remote.url_hint_no_auth":"Supports public Git repositories and Git services with OAuth configured","sources.import_remote.url_invalid":"Only HTTPS Git URLs are supported","sources.import_remote.ref_label":"Branch / Tag","sources.import_remote.ref_branches":"Branches","sources.import_remote.ref_tags":"Tags","sources.import_remote.ref_search":"Search branches or tags…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"Auto-filled with the latest commit of selected branch. You can also type or search","sources.import_remote.commit_search":"Search commit…","sources.import_remote.loading_refs":"Querying repository branches...","sources.import_remote.loading_refs_slow":"Large projects may take 10–30s, please wait...","sources.import_remote.summary_repo":"Repository","sources.import_remote.summary_branch":"Branch","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"Preparing environment","sources.import_remote.stage.clone":"Cloning repository","sources.import_remote.stage.scan":"Scanning project","sources.import_remote.stage.save":"Saving sources","sources.import_remote.complete":"Import complete","sources.import_remote.back_to_library":"Done","sources.import_remote.retry":"Retry","sources.import_remote.back":"Back","sources.import_remote.error.auth_required":"This repository requires authentication. Please configure an access token for {{host}} in Server Settings → Git Tokens.","sources.import_remote.error.auth_failed":"Authentication failed. Please check your Git token configuration.","sources.import_remote.error.not_found":"Repository not found or no access. Please check the URL.","sources.import_remote.error.network":"Cannot connect to the remote repository. Please check your network or try again later.","sources.import_remote.error.capacity":"Import queue is full. Please try again later.","sources.import_remote.error.clone_failed":"Clone failed","sources.import_remote.error.scan_failed":"Scan failed","sources.import_remote.error.save_failed":"Save failed","sources.import_remote.api.detected":"Detected {{platform}} repo, fetch via API with partial indexing support","sources.import_remote.api.fast_available":"Fast import available","sources.import_remote.api.will_use_clone":"Fetch repo data via Clone, full indexing","sources.import_remote.api.use_clone":"Fetch repo data via Clone, full indexing","sources.import_remote.api.sub_path":"Sub path (optional)","sources.import_remote.api.sub_path_hint":"For monorepos: import only a subdirectory","sources.import_remote.api.sub_path_placeholder":"Multiple paths separated by ;","sources.import_remote.api.select_sub_paths":"Select subdirectories","sources.import_remote.api.panel_selected":"Selected","sources.import_remote.api.selected_count":"{{count}} directories selected","sources.import_remote.api.confirm_full":"Confirm (full import)","sources.import_remote.api.back_to_ref":"Back to branch select","sources.import_remote.api.method":"Import method","sources.import_remote.api.method_api":"API (fast)","sources.import_remote.api.method_clone":"Clone","sources.import_remote.api.truncated_warning":"File tree exceeds 100,000 entries, API results may be incomplete","sources.import_remote.api.truncated_suggest":"Recommend using traditional clone for complete results","sources.import_remote.api.truncated_continue":"Continue import","sources.import_remote.api.truncated_use_clone":"Use clone","sources.import_remote.api.suggest_clone":"Recommend traditional clone","sources.import_remote.api.fallback_msg":"API import failed, switching to traditional clone","sources.import_remote.api.git_host_not_configured":"Git host {{host}} is not configured. Please add it to server.yaml git_hosts section with an access token.","sources.safety.notice.remote":"The remote repository will be cloned to the server for analysis. Code will not be uploaded to any third-party services.","content.detail.tab.raw":"Raw Content","content.detail.tab.digest":"Digest","content.detail.tab.extraction":"LLM Extraction","content.detail.tab.entities":"Entities","content.card.lines":"Lines {{start}}-{{end}}","content.detail.size":"Size","content.detail.created_at":"Created","content.detail.sources":"Sources","content.detail.language":"Language","content.detail.model":"Model","entity.detail.tab.overview":"Overview","entity.detail.tab.relations":"Relations","entity.detail.tab.contents":"Contents","entity.detail.tab.referrers":"Referrers","entity.detail.tab.neighbors":"Neighbors","entity.detail.type":"Type","entity.detail.kind":"Kind","entity.detail.perspective":"Perspective","entity.detail.scope":"Scope","relation.detail.tab.overview":"Overview","relation.detail.weight":"Weight","relation.detail.confidence":"Confidence","relation.detail.from":"From","relation.detail.to":"To","relation.detail.description":"Description","relation.detail.data":"Additional Data","relation.detail.source_refs":"Content Sources","relation.detail.meta":"Metadata","relation.detail.source_label":"Source","relation.detail.source_field_sync":"System-derived","relation.detail.source_explicit":"Explicitly declared","relation.filter.direction.all":"All Directions","relation.filter.direction.outgoing":"Outgoing →","relation.filter.direction.incoming":"← Incoming","relation.filter.type.all":"All Types","ref.stale":"Stale ref","ref.unknown":"Unknown entity","ref.retry":"Resolve failed, click to retry","confidence.high":"High confidence","confidence.high.tip":"Confidence ≥ 0.9, cross-validated by multiple signals","confidence.ai":"AI suggestion","confidence.ai.tip":"Confidence 0.7–0.9, AI-inferred but not fully verified","confidence.low":"Low confidence","confidence.low.tip":"Confidence < 0.7, insufficient info or conflicting signals","source.field_sync":"System-derived","source.explicit":"Explicitly declared","common.empty.content_raw.title":"Not yet indexed","common.empty.content_raw.description":"Content will be available after indexing.","common.empty.content_raw.cta":"Start indexing","common.empty.content_digest.title":"Not yet indexed","common.empty.content_digest.description":"This content has not been through structured indexing yet.","common.empty.content_extraction.title":"Not yet extracted","common.empty.content_extraction.description":"AI has not yet performed entity extraction and analysis on this content.","common.empty.content_entities.title":"No associated entities","common.empty.content_entities.description":"No entities have been extracted from this content yet.","common.empty.entity_relations.title":"No relations","common.empty.entity_relations.description":"This entity is currently an island with no connections to other entities.","common.empty.entity_contents.title":"No content sources","common.empty.entity_contents.description":"This entity is not linked to any source code or document content.","common.empty.entity_referrers.title":"No referrers","common.empty.entity_referrers.description":"No other entities currently reference this entity in their data fields.","common.empty.entity_neighbors.title":"No neighbors","common.empty.entity_neighbors.description":"This entity has no directly connected neighbor nodes in the graph.","common.error.not_found":"Resource not found","common.error.not_found_description":"The requested resource does not exist or has been removed.","common.error.load_failed":"Failed to load","common.error.load_failed_description":"An error occurred while loading data. Please try again.","explorer.mode.append":"Append","explorer.mode.replace":"Replace","explorer.mode.append_tooltip":"Open links in new tabs","explorer.mode.replace_tooltip":"Replace current tab","explorer.close_all":"Close All Tabs","explorer.type.content":"Content","explorer.type.entity":"Entity","explorer.type.relation":"Relation","explorer.type.call_graph":"Call Graph","explorer.type.import_deps":"Import Deps","explorer.type.inheritance":"Inheritance","version.selector_label":"Version","version.current":"Current","upload.no_change":"File content unchanged, upload ignored","upload.partial_no_change":"{{count}} file(s) unchanged, ignored","upload.new_version_title":"New Version","upload.new_version_desc":"File content has changed. Enter a new version number:","upload.version_label":"Version","upload.current_version":"Current version: {{version}}","upload.version_must_increase":"Version must be greater than {{version}}","upload.confirm":"Upload","package.last_commit":"Last Commit","package.dependencies":"Dependencies","package.files":"Files","package.no_dependencies":"No dependencies","package.unknown":"Unknown","index.code.go_index":"Index","index.code.reindex":"Re-index","index.code.indexing":"Indexing...","index.stage.daemon_starting":"Daemon","index.stage.cloning":"Cloning","index.stage.preparing":"Preparing","index.stage.scanning":"Scanning","index.stage.parsing":"Parsing","index.stage.analyzing":"Analyzing","index.stage.uploading":"Uploading","index.stage.skipping":"Skipping","index.code.complete":"Index complete","index.code.unchanged_count":"{{count}} module(s) unchanged, skipped","index.code.error":"Index failed","index.code.timeout":"Index timed out","index.code.dismiss":"Dismiss","index.code.skipped":"Already up to date","index.code.delete":"Delete index","index.code.delete_confirm":"Delete index for this resource? Original content, digest and extraction data will be removed.","index.code.delete_success":"Index deleted","index.code.delete_failed":"Delete index failed","index.code.auto_continue":"Auto-continue on complete","index.code.auto_continue_pending":"Auto-continuing shortly..","index.code.done_continue":"Done","index.log.daemon_starting":"Starting cloud Daemon...","index.log.daemon_ready":"Daemon ready","index.log.cloning":"Cloning repository...","index.log.clone_done":"Clone complete","index.log.preparing":"Preparing index version...","index.log.prepare_done":"Version ready","index.log.done_suffix":"done","index.log.scan_done":"Scan complete","index.log.parse_done":"Parse complete, {{count}} files","index.log.analyze_done":"Analysis complete","index.log.upload_done":"Data saved {{name}}","index.log.restored":"(Progress restored from server, previous logs unavailable)","index.error.commit_not_available":"Target commit unavailable, check remote","index.error.daemon_start_failed":"Cloud Daemon failed to start","index.error.git_archive_failed":"Version export failed","index.doc.error.llm_unavailable":"LLM service unavailable, check configuration","index.doc.error.embedding_unavailable":"Embedding service unavailable, check configuration","index.doc.error.content_missing":"Document content missing","index.doc.error.parse_failed":"Document parsing failed","index.doc.error.llm_exhausted":"LLM call failed: {{message}}","index.stage.chunking":"Chunking","index.stage.annotating":"Annotating","index.stage.post_processing":"Post-processing","index.stage.embedding":"Embedding","index.stage.storing":"Storing","index.doc.log.chunking":"Analyzing document structure...","index.doc.log.chunking_done":"Chunking complete ({{n}} chunks)","index.doc.log.annotating_start":"LLM annotation starting...","index.doc.log.annotating":"LLM annotating ({{n}}/{{m}})","index.doc.log.post_processing":"Entity resolution & quality checks...","index.doc.log.embedding":"Generating embeddings...","index.doc.log.storing":"Saving to storage...","index.doc.msg.chunking_result":"{{chunks}} chunks, {{sections}} sections","index.doc.msg.annotating_start":"{{n}} chunks","index.doc.msg.annotating_start_model":"{{n}} chunks, LLM {{model}}","index.doc.msg.annotating_chunk":"Chunk {{current}}/{{total}} {{step}} ({{calls}} calls, {{tokens}} tokens)","index.doc.msg.annotating_chunk_done":"Chunk {{current}}/{{total}} done, total {{calls}} calls {{tokens}} tokens","index.doc.msg.post_process_start":"Entity auto-complete & normalization","index.doc.msg.extraction_stats":"{{entities}} entities, {{relations}} relations, {{withAtoms}}/{{totalParas}} paragraphs with atoms","index.doc.msg.no_resolution":"No resolution candidates","index.doc.msg.resolving":"Resolving {{duplicates}} duplicates + {{noise}} noise candidates via LLM","index.doc.msg.resolution_parse_failed":"Entity resolution parse failed","index.doc.msg.resolution_result":"Resolution: {{merges}} merges ({{mergeRefs}} refs), {{removed}} removed ({{removeRefs}} instances), {{ambiguous}} ambiguous","index.doc.msg.resolution_failed":"Entity resolution failed (non-blocking)","index.doc.msg.embedding_model":"Embedding {{model}}","index.doc.msg.file_start":"[{{idx}}/{{total}}] {{file}} indexing started","index.doc.msg.file_done":"[{{idx}}/{{total}}] {{file}} indexing complete","index.doc.msg.file_error":"[{{idx}}/{{total}}] {{file}} indexing failed: {{error}}","index.doc.confirm_title":"Document indexing","index.doc.confirm_desc":"The following documents will be indexed using LLM, which will consume tokens:","index.doc.confirm_btn":"Confirm indexing","index.doc.estimating":"Estimating consumption...","index.doc.estimate_tokens":"Tokens","index.doc.estimate_calls":"LLM calls","index.doc.estimate_chunks":"Chunks","index.doc.estimate_summary":"Estimated ~{{tokens}} tokens, ~{{calls}} LLM calls","index.doc.cancel":"Cancel","digest.empty.title":"No code digest","digest.empty.description":"This content has not been code-indexed. Index to view structured code digest.","digest.empty.cta":"Start indexing","digest.doc.empty.title":"Document not yet indexed","digest.doc.empty.description":"Index to view the original text alongside structured annotations","digest.doc.empty.cta":"Index document","digest.doc.no_atoms":"No annotations or extracted in other paragraphs","digest.doc.atom.entities":"Entities","digest.doc.atom.relations":"Relations","digest.doc.atom.behaviors":"Behaviors","digest.doc.atom.attributes":"Attributes","digest.doc.atom.states":"States","digest.doc.atom.rules":"Rules","digest.doc.atom.transitions":"Transitions","digest.doc.atom.events":"Events","digest.doc.atom.decisions":"Decisions","digest.doc.atom.metrics":"Metrics","digest.doc.atom.roles":"Roles","digest.doc.atom.constraints":"Constraints","digest.doc.atom.comparisons":"Comparisons","digest.doc.atom.boundaries":"Boundaries","digest.stats.files":"Files","digest.stats.classes":"Classes","digest.stats.functions":"Functions","digest.stats.relations":"Relations","digest.tech_stack":"Tech stack","digest.modules":"Modules","daemon.offline_tooltip":"Please start the client","sources.detail.repo_url":"Repo URL","raw.basic_info":"Basic info","raw.field.name":"Name","raw.field.version":"Version","raw.field.license":"License","raw.field.description":"Description","raw.dependencies":"Dependencies","raw.dev_dependencies":"Dev dependencies","raw.no_dependencies":"No dependencies","raw.readme":"Readme","raw.code_files":"Code files","raw.doc_files":"Doc files","raw.total_files":"Total files","index.batch.title":"Select items to index","index.batch.panel_a_title":"Indexable content","index.batch.panel_b_title":"Selected","index.batch.selected_count":"Selected {{n}} / {{total}} available","index.batch.already_indexed":"Indexed","index.batch.reindex_tag":"Re-index","index.batch.skipped_unsupported":"Skipped (not yet supported)","index.batch.empty_selection":"Select items from the tree on the left","index.batch.warning_over_50":"Large number of items (>50), may take a while","index.batch.confirm":"Start indexing","index.batch.back":"Back","index.batch.tooltip":"Batch index","index.batch.tooltip_indexing":"Indexing...","index.batch.toast_skipped":"All selected items are up to date. No re-indexing needed.","index.batch.toast_partial_fail":"Some index tasks failed. Check console for details.","index.batch.error":"Batch index failed","error.dialog.console_hint":"Full error details have been printed to the browser console.","error.dialog.copy":"Copy","error.dialog.copied":"Copied","error.dialog.confirm":"OK","query.tab.label":"Query","query.indexing.title":"Indexing in progress","query.indexing.desc":"Query will be available once indexing completes.","query.symbol.search_placeholder":"Search symbols...","query.symbol.exported_only":"Exported only","query.symbol.load_more":"Load more ({{count}} remaining)","query.symbol.loading":"Loading symbols...","query.symbol.empty":"No symbols found","query.symbol.empty_desc":"This source has no code symbols to display.","query.symbol.methods":"Methods","query.symbol.properties":"Properties","query.symbol.extends":"Extends","query.symbol.implements":"Implements","query.symbol.signature":"Signature","query.symbol.parameters":"Parameters","query.symbol.returns":"Returns","query.symbol.async":"Async","query.call_graph.title":"Call Graph","query.call_graph.callers":"Callers","query.call_graph.callees":"Callees","query.call_graph.empty":"No call relations found","query.call_graph.empty_desc":"No {{direction}} found for this function.","query.call_graph.depth":"Depth","query.call_graph.open":"View call graph","query.import_deps.title":"Import Dependencies","query.import_deps.forward":"Imports","query.import_deps.reverse":"Imported by","query.import_deps.external":"External dependencies","query.import_deps.internal":"Internal dependencies","query.import_deps.empty":"No import relations found","query.import_deps.open":"View dependencies","query.inheritance.title":"Inheritance","query.inheritance.descendants":"Descendants","query.inheritance.ancestors":"Ancestors","query.inheritance.empty":"No inheritance relations found","query.inheritance.cross_source":"Searching {{count}} indexed code sources","query.inheritance.open":"View inheritance","query.doc.search_placeholder":"Search documents with natural language...","query.doc.search_button":"Search","query.doc.searching":"Searching...","query.doc.relevance.high":"High relevance","query.doc.relevance.medium":"Medium relevance","query.doc.relevance.low":"Low relevance","query.doc.empty.title":"No matching paragraphs","query.doc.empty.desc":"Try different keywords, or check if the document has been imported and indexed.","query.doc.error.title":"Document search failed","query.warning.more":"+{{count}} more"},nk={"nav.home":"首页","nav.studio":"工作台","nav.docs":"文档","nav.login":"登录","nav.logout":"退出登录","header.status.connected":"已连接","header.status.disconnected":"已断开","header.status.reconnecting":"重连中","footer.copyright":"GitHub · @Context4AI {{year}}. 版权所有","footer.copyright_compact":"@Context4AI {{year}}. 版权所有","footer.tagline":"知识工厂","footer.theme.dark":"暗色","footer.theme.light":"亮色","footer.theme.system":"跟随系统","studio.sidebar.sources":"知识索引","studio.sidebar.modeling":"知识建模","studio.sidebar.brain":"知识大脑","studio.sidebar.discovery":"发现知识","studio.sidebar.sharing":"分享知识","studio.sidebar.collaboration":"知识协同","studio.sidebar.settings":"设置","placeholder.coming":"计划在 {{version}} 版本实现","page.login.title":"登录","page.login.description":"身份验证与用户管理","login.title":"登录","login.provider_cta":"使用 {{name}} 登录","login.loading":"加载中...","login.authenticating":"认证中...","login.or":"或","login.test_account":"测试账户","login.error":"加载登录选项失败","login.retry":"重试","user.menu.connect_source":"接入知识源","user.menu.sign_out":"退出登录","api_keys.title":"API 密钥","api_keys.description":"API Key 用于程序化访问 C4A API(AI Agent、CLI、CI/CD)","api_keys.create":"创建 API Key","api_keys.created":"API Key 已创建","api_keys.copy_warning":"请立即复制,此 Key 不会再次显示。","api_keys.copy":"复制","api_keys.copied":"已复制!","api_keys.done":"完成","api_keys.empty.title":"尚无 API Key","api_keys.empty.description":"API Key 用于程序化访问 C4A API","api_keys.created_at":"创建于 {{date}}","api_keys.never_used":"从未使用","api_keys.expires.never":"永不过期","api_keys.expires.30d":"30 天","api_keys.expires.90d":"90 天","api_keys.expires.1y":"1 年","api_keys.form.name":"名称","api_keys.form.name_placeholder":"My CLI key","api_keys.form.expiry":"过期时间(可选)","api_keys.delete.confirm":"删除此 API Key?此操作不可撤销。","workspace.default_name":"我的大脑","settings.tab.general":"常规","settings.tab.api_keys":"API 密钥","page.docs.title":"文档","page.docs.description":"公开文档门户","page.sources.title":"知识索引","page.sources.description":"添加代码仓库、文档等输入材料,让大脑完成初步索引","page.modeling.title":"知识建模","page.modeling.description":"和 AI 一起对索引内容建模,只有经得起推敲的才写入知识图谱","page.brain.title":"知识大脑","page.brain.description":"建模完成的全部知识都在这里——浏览、搜索、分析,随时调用","page.discovery.title":"发现知识","page.discovery.description":"看看别人整理好的知识,发现有用的一键补充到自己的大脑","page.sharing.title":"分享知识","page.sharing.description":"把大脑中的知识打包输出,让别人和 AI 都能直接使用","page.collaboration.title":"知识协同","page.collaboration.description":"和其他大脑保持同步,知识更新时自动通知,不用手动搬运","page.settings.title":"设置","page.settings.description":"管理大脑的成员和配置","page.code_setup.title":"代码设置","page.code_setup.description":"代码建模的仓库选择与配置","page.code_compile.title":"代码编译","page.code_compile.description":"代码建模的编译进度追踪","page.code_review.title":"代码审查","page.code_review.description":"审查并确认建模结果","page.code_result.title":"代码结果","page.code_result.description":"查看最终建模结果与生成的知识图谱","home.hero.title":"Context For AI","home.hero.description":"将代码仓库和业务文档转化为结构化知识图谱。","home.hero.cta.studio":"进入工作台","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"您访问的页面不存在。","notfound.back":"返回首页","error.description":"页面出现了问题,请重试。","error.reload":"重新加载","sources.menu.add_client":"添加客户端","sources.menu.online":"在线","sources.menu.offline":"离线","sources.menu.status_online":"{{machine}} 已连接","sources.menu.status_offline":"{{machine}} 未连接,点击前往教程","sources.library.default_cloud_name":"我的云盘","sources.library.rename":"重命名","sources.library.rename_placeholder":"输入名称","sources.header.daemon_status":"{{online}}/{{total}} 在线","sources.header.all_offline":"全部离线","sources.actions.new_folder":"新文件夹","sources.folder.name_placeholder":"输入文件夹名称","sources.actions.import_repo":"导入仓库","sources.actions.rename":"重命名","sources.actions.move_to":"移动到...","sources.actions.delete":"删除","sources.filter.all":"全部","sources.filter.indexed":"已索引","sources.filter.not_indexed":"未索引","sources.status.none":"未索引","sources.status.indexed":"已索引","sources.status.stale":"有新变更未更新索引","sources.type.code":"代码","sources.type.doc":"文档","sources.empty.cloud.title":"这里是你专属的知识输入区","sources.empty.cloud.description":"创建文件夹来整理你的文档和材料。这些内容仅你个人可见,将成为后续推演、构建数字大脑的基础","sources.empty.daemon.title":"连接你的本地代码资产","sources.empty.daemon.description":"导入本地代码仓库,系统会自动提取代码结构与技术文档,将其转化为结构化知识","sources.empty.indexed.title":"这些知识尚未被索引","sources.empty.indexed.description":"选择资源并完成索引后,它们将转化为结构化摘要,为你后续的推演提供素材。","sources.empty.folder.title":"当前文件夹还没有内容","sources.empty.folder.daemon_description":"你可以在本地进行文档新增、编辑后查看。","sources.safety.notice.repo":"在本地模式下,你的代码保有绝对隐私,源代码永远不会离开你的电脑,系统仅提取用于知识建模的结构化摘要(函数签名、依赖关系等)。","sources.safety.notice.dir":"系统会提取用于知识建模的文档内容及摘要,尽管会过滤不安全的文本内容,但请确保敏感数据不要参与索引及建模。","sources.import.title":"导入代码仓库","sources.import.step.select":"选择仓库","sources.import.step.version":"选择版本","sources.import.step.confirm":"导入完成","sources.import.daemon_offline":"客户端 {{name}} 未连接,请先启动本地 Daemon 并连接到服务器后再导入仓库。","sources.import.view_guide":"查看连接指引","sources.import.select_root":"选择仓库根目录","sources.import.current_path":"当前路径","sources.import.not_git":"该目录不是 Git 仓库,请选择包含 .git 的目录。","sources.import.branch":"分支","sources.import.commit":"提交","sources.import.branch_warning":"当前基于 {{branch}} 分支的 HEAD","sources.import.uncommitted_warning":"未提交的修改不会被采集","sources.import.recognized":"已识别 {{packages}} 个包和 {{docs}} 篇文档","sources.import.no_packages":"未识别到包结构,将作为单包仓库导入。","sources.import.confirm_heading":"即将导入以下仓库到 {{name}}:","sources.import.packages":"包数","sources.import.documents":"文档","sources.import.loading_repo":"正在加载仓库信息...","sources.import.loading_repo_slow":"大型仓库(>10 GB)可能需要 5~10 秒...","sources.import.importing":"导入中...","sources.import.error_title":"导入失败","sources.import.success":"导入完成","sources.import.stage.prepare":"准备执行环境","sources.import.stage.clone":"克隆仓库","sources.import.stage.clone_polling":"","sources.import.stage.scan":"扫描项目","sources.import.stage.save":"保存数据源","sources.import.stage.done_suffix":"✓","sources.import.stage.complete":"导入完成","sources.import.stage.fetch_tree":"获取文件树","sources.import.stage.read_packages":"读取包描述文件","sources.import.step.loading":"数据导入","sources.import.done":"完成","sources.import.back":"返回","sources.import.retry":"重试","sources.add_client.title":"接入本地知识源","sources.add_client.description":"在本地计算机上启动客户端 (Daemon),即可将本地代码仓库作为输入材料,挂载到你的数字大脑中。","sources.add_client.step1":"安装 Daemon","sources.add_client.step2":"启动 Daemon","sources.add_client.step2_allow":"限制访问目录(不影响已有导入)","sources.add_client.step3":"等待连接","sources.add_client.step3_desc":"连接成功后,本页面将自动更新。","sources.add_client.waiting":"等待新的客户端连接...","sources.add_client.detected":"检测到新的本地客户端","sources.add_client.machine_name":"机器标识","sources.add_client.os":"操作系统","sources.add_client.daemon_version":"Daemon 版本","sources.add_client.client_name":"客户端名称","sources.add_client.confirm":"确认添加","sources.add_client.reconnected":"客户端 {{name}} 已重新连接","sources.add_client.go_to":"前往 {{name}}","sources.detail.tab.original":"原文","sources.detail.tab.overview":"概览","sources.detail.tab.digest":"摘要","sources.detail.tab.modeling":"建模结果","sources.detail.not_found_title":"来源不存在","sources.detail.not_found_desc":"未找到此来源,可能已被删除或 ID 无效。","sources.detail.digest_placeholder":"完成索引后,即可在此查看结构化摘要。","sources.detail.modeling_placeholder":"在推演区完成建模后,此处将展示由该源产生的知识实体。","sources.detail.type":"类型","sources.detail.origin":"来源","sources.detail.origin.upload":"直接上传","sources.detail.origin.local":"本地文件","sources.detail.path":"路径","sources.detail.status":"状态","sources.detail.repo":"仓库","sources.detail.branch":"分支","sources.detail.commit":"提交","sources.detail.tech_stack":"技术栈","sources.detail.original_code_placeholder":"完成索引后即可查看包概览。","sources.detail.original_doc_placeholder":"文档内容将在上传后展示。","sources.detail.dependencies":"依赖","sources.delete.confirm_title":"确认删除","sources.delete.resource":"确定要删除 {{name}}?","sources.delete.resource_impact":"以下数据将被永久删除:原文内容、结构化摘要(如有)。","sources.delete.session_warning":"如果你的个人推演区正在使用此知识源,相关的候选推演将受到影响。","sources.delete.entity_safe":"已汇入大脑的正式知识不受影响。","sources.delete.folder":"确定要删除文件夹 {{name}}?","sources.delete.folder_impact":"文件夹内的所有资源将被递归删除:{{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_contents":"包含 {{folders}} 个子文件夹、{{sources}} 个知识源。","sources.delete.folder_impact_generic":"文件夹内的所有子文件夹和知识源将被递归删除。","sources.delete.irreversible":"此操作不可撤销。","sources.delete.repo":"确定要从 {{library}} 中移除仓库 {{name}}?","sources.delete.repo_impact":"将删除:{{packages}} 个包的索引记录、{{docs}} 篇文档的索引记录。","sources.delete.repo_contents":"包含 {{packages}} 个包、{{docs}} 个文档。","sources.delete.indexed_hint":"其中 {{indexed}}/{{total}} 个已建立索引,索引数据将被删除。","sources.delete.repo_impact_generic":"所有包和文档的索引记录将被删除。","sources.delete.local_safe":"本地文件不受影响。","sources.delete.client":"确定要删除客户端 {{name}}?","sources.delete.client_impact":"该客户端下的所有已导入仓库记录和相关索引数据将被删除。","sources.delete.client_reregister":"该客户端下次连接时将触发重新注册。","sources.error.name_conflict":'该目录下已存在同名项"{{name}}"。',"sources.move.current":"当前位置","sources.move.target":"移动到","sources.breadcrumb.sources":"知识索引","common.cancel":"取消","common.confirm":"确认","common.back":"返回","common.next":"下一步","common.previous":"上一步","common.items":"{{count}} 项","common.loading":"加载中...","sources.import.no_entries":"未找到任何条目","sources.import.allowed_dirs":"客户端授权目录","sources.import.allowed_dirs_tooltip_restrict":"通过参数设定有权限的目录:","sources.import.allowed_dirs_tooltip_all":"或默认允许全部目录:","sources.import.wildcard_home":"主目录","sources.import.wildcard_path_placeholder":"输入目录路径…","sources.import.wildcard_go":"前往","sources.import.wildcard_goto":"前往","sources.import.wildcard_go_title":"前往目录","sources.import.wildcard_path_not_found":"该路径在远程机器上不存在","sources.import.already_imported":"已导入","sources.import.dir_title":"导入目录","sources.import.dir_step.select":"选择目录","sources.import.dir_step.scan":"扫描","sources.import.dir_step.confirm":"确认导入","sources.import.dir_confirm_heading":"即将导入以下目录到 {{name}}:","sources.import.dir_name":"目录名","sources.import.dir_name_hint":"导入后在目录树中的显示名称,留空使用默认仓库名。","sources.import.dir_name_duplicate":"该名称已存在,请使用其他名称。","sources.import.dir_path":"目录路径","sources.import.dir_files":"文件数","sources.import.dir_subdirs":"子目录数","sources.import.dir_git_repos":"仓库(已跳过)","sources.import.dir_git_hint":"目录内的 Git 仓库不会被展开索引,如需索引请单独导入仓库。","sources.import.dir_scanning":"正在扫描目录内容...","sources.import.dir_scan_complete":"扫描完成","sources.import.dir_scan_error":"目录扫描失败","sources.import.dir_scan_retry":"重试","sources.import.dir_code_packages":"代码包","sources.import.dir_code_packages_tip":"支持:package.json、pyproject.toml、setup.py、go.mod、Cargo.toml、pom.xml、build.gradle","sources.import.dir_doc_files":"文档","sources.import.dir_doc_files_tip":"支持:Markdown (.md)","sources.import.dir_total_files":"文件总数","sources.import.dir_total_dirs":"目录","sources.import.dir_git_skip_hint":"Git 仓库将被跳过,建议单独使用「导入仓库」。","sources.actions.upload":"上传","sources.actions.upload_md":"Markdown 文档","sources.actions.upload_doc":"文档","sources.actions.upload_document":"上传文档","sources.actions.add":"新增","sources.actions.add_folder":"文件夹","sources.actions.add_web":"网页","sources.actions.add_feishu":"飞书文档","sources.actions.import_dir":"导入目录","sources.actions.import_repo_url":"导入仓库","sources.upgrade.title":"功能升级中","sources.upgrade.description":"此功能将在 0.5.x 版本中推出,敬请期待。","sources.upload.title":"上传文档","sources.upload.drop_hint":"点击选择文件或拖拽至此","sources.upload.supported_formats":"支持格式:.md, .doc, .docx, .pdf, .ppt, .pptx, .txt(每个最大 5MB,最多 10 个)","sources.upload.file_too_large":'"{{name}}" 超过 5MB 限制',"sources.upload.too_many_files":"最多上传 10 个文件,请重新选择","sources.upload.unsupported_type":'"{{name}}" 不是支持的文件类型',"sources.upload.uploading":"上传中...","sources.upload.success":"已上传 {{count}} 个文档","sources.upload.selected":"已选择 {{count}} 个文件","sources.upload.remove":"移除","sources.import_remote.title":"导入远程仓库","sources.import_remote.step.loading":"数据导入","sources.import_remote.url_label":"仓库地址","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"仅接受 HTTPS 地址,SSH 地址未来版本支持","sources.import_remote.url_hint_public":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务:","sources.import_remote.url_hint_no_auth":"除了支持无需鉴权的公开 Git 仓库,也支持已配置 OAuth 的 Git 服务","sources.import_remote.url_invalid":"仅支持 HTTPS 格式的 Git URL","sources.import_remote.ref_label":"分支 / Tag","sources.import_remote.ref_branches":"分支","sources.import_remote.ref_tags":"Tag","sources.import_remote.ref_search":"搜索分支或 Tag…","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"已自动填入所选分支最新 commit,也可手动输入或搜索","sources.import_remote.commit_search":"搜索 commit…","sources.import_remote.loading_refs":"正在查询仓库分支...","sources.import_remote.loading_refs_slow":"大型项目可能需要 10~30s,请耐心等待...","sources.import_remote.summary_repo":"仓库","sources.import_remote.summary_branch":"分支","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"准备执行环境","sources.import_remote.stage.clone":"克隆仓库","sources.import_remote.stage.scan":"识别项目结构","sources.import_remote.stage.save":"写入知识源","sources.import_remote.complete":"导入完成","sources.import_remote.back_to_library":"完成","sources.import_remote.retry":"重试","sources.import_remote.back":"返回","sources.import_remote.error.auth_required":"该仓库需要认证。请在 服务设置 → Git 令牌 中配置 {{host}} 的访问令牌。","sources.import_remote.error.auth_failed":"认证失败,请检查 Git 令牌配置。","sources.import_remote.error.not_found":"仓库不存在或无权访问。请检查 URL 是否正确。","sources.import_remote.error.network":"无法连接到远程仓库。请检查网络或稍后重试。","sources.import_remote.error.capacity":"当前导入任务已满,请稍后再试。","sources.import_remote.error.clone_failed":"克隆失败","sources.import_remote.error.scan_failed":"识别失败","sources.import_remote.error.save_failed":"写入失败","sources.import_remote.api.detected":"已识别 {{platform}} 仓库,使用 API 获取仓库数据,支持局部索引","sources.import_remote.api.fast_available":"快速导入可用","sources.import_remote.api.will_use_clone":"使用 Clone 方式获取仓库数据,全量索引","sources.import_remote.api.use_clone":"使用 Clone 方式获取仓库数据,全量索引","sources.import_remote.api.sub_path":"子路径(可选)","sources.import_remote.api.sub_path_hint":"大仓场景:仅导入指定子目录","sources.import_remote.api.sub_path_placeholder":"多个路径用 ; 分隔,留空表示全量导入","sources.import_remote.api.select_sub_paths":"选择子目录","sources.import_remote.api.panel_selected":"已选内容","sources.import_remote.api.selected_count":"已选 {{count}} 个目录","sources.import_remote.api.confirm_full":"确认(全量导入)","sources.import_remote.api.back_to_ref":"返回分支选择","sources.import_remote.api.method":"导入方式","sources.import_remote.api.method_api":"API(快速)","sources.import_remote.api.method_clone":"Clone","sources.import_remote.api.truncated_warning":"文件树超过 100,000 个条目,API 返回结果可能不完整","sources.import_remote.api.truncated_suggest":"建议使用传统克隆方式以获取完整结果","sources.import_remote.api.truncated_continue":"继续导入","sources.import_remote.api.truncated_use_clone":"传统导入","sources.import_remote.api.suggest_clone":"建议使用传统克隆方式","sources.import_remote.api.fallback_msg":"API 导入失败,切换到传统方式","sources.import_remote.api.git_host_not_configured":"Git 主机 {{host}} 未配置。请在 server.yaml 的 git_hosts 中添加该主机及访问令牌。","sources.safety.notice.remote":"远程仓库将被克隆到服务器本地进行分析,代码不会上传到任何第三方服务。","content.detail.tab.raw":"原始内容","content.detail.tab.digest":"索引摘要","content.detail.tab.extraction":"LLM 提取","content.detail.tab.entities":"关联实体","content.detail.size":"大小","content.detail.created_at":"创建时间","content.detail.sources":"来源","content.detail.language":"语言","content.detail.model":"模型","entity.detail.tab.overview":"概览","entity.detail.tab.relations":"关系","entity.detail.tab.contents":"内容来源","entity.detail.tab.referrers":"被引用","entity.detail.tab.neighbors":"邻居","entity.detail.type":"类型","entity.detail.kind":"种类","entity.detail.perspective":"视角","entity.detail.scope":"作用域","relation.detail.tab.overview":"概览","relation.detail.weight":"权重","relation.detail.confidence":"置信度","relation.detail.from":"起点","relation.detail.to":"终点","relation.detail.description":"描述","relation.detail.data":"附加数据","relation.detail.source_refs":"内容来源","relation.detail.meta":"元信息","relation.detail.source_label":"生成方式","relation.detail.source_field_sync":"系统推导","relation.detail.source_explicit":"显式声明","relation.filter.direction.all":"全部方向","relation.filter.direction.outgoing":"出边 →","relation.filter.direction.incoming":"← 入边","relation.filter.type.all":"全部类型","ref.stale":"已失效引用","ref.unknown":"未知实体","ref.retry":"解析失败,点击重试","confidence.high":"高确信","confidence.high.tip":"置信度 ≥ 0.9,多个信号交叉验证","confidence.ai":"AI 建议","confidence.ai.tip":"置信度 0.7–0.9,由 AI 推断但未充分验证","confidence.low":"低确信","confidence.low.tip":"置信度 < 0.7,信息不足或存在矛盾","source.field_sync":"系统推导","source.explicit":"显式声明","common.empty.content_raw.title":"尚未索引","common.empty.content_raw.description":"索引后可查看结构化内容。","common.empty.content_raw.cta":"开始索引","common.empty.content_digest.title":"尚未索引","common.empty.content_digest.description":"此内容尚未经过结构化索引处理。","common.empty.content_extraction.title":"尚未提取","common.empty.content_extraction.description":"AI 尚未对此内容进行实体提取和分析。","common.empty.content_entities.title":"暂无关联实体","common.empty.content_entities.description":"尚未从此内容中提取出任何实体。","common.empty.entity_relations.title":"暂无关系","common.empty.entity_relations.description":"该实体目前是一个孤岛,尚未与其他实体建立关联。","common.empty.entity_contents.title":"暂无内容来源","common.empty.entity_contents.description":"该实体未关联任何源代码或文档内容。","common.empty.entity_referrers.title":"暂无被引用","common.empty.entity_referrers.description":"目前没有其他实体在 data 字段中引用此实体。","common.empty.entity_neighbors.title":"暂无邻居","common.empty.entity_neighbors.description":"该实体在图谱中没有直接关联的邻居节点。","common.error.not_found":"资源不存在","common.error.not_found_description":"请求的资源不存在或已被移除。","common.error.load_failed":"加载失败","common.error.load_failed_description":"加载数据时发生错误,请重试。","explorer.mode.append":"追加","explorer.mode.replace":"替换","explorer.mode.append_tooltip":"在新标签中打开链接","explorer.mode.replace_tooltip":"替换当前标签","explorer.close_all":"关闭所有标签","explorer.type.content":"内容","explorer.type.entity":"实体","explorer.type.relation":"关系","explorer.type.call_graph":"调用图","explorer.type.import_deps":"依赖导入","explorer.type.inheritance":"继承关系","version.selector_label":"版本","version.current":"当前","upload.no_change":"文件内容无变化,已忽略上传","upload.partial_no_change":"{{count}} 个文件内容无变化,已忽略","upload.new_version_title":"新版本","upload.new_version_desc":"文件内容已变化,请输入新版本号:","upload.version_label":"版本号","upload.current_version":"当前版本:{{version}}","upload.version_must_increase":"版本号必须大于 {{version}}","upload.confirm":"上传","package.last_commit":"最后提交","package.dependencies":"依赖","package.files":"文件","package.no_dependencies":"无依赖","package.unknown":"未知","content.card.lines":"第 {{start}}-{{end}} 行","index.code.go_index":"索引","index.code.reindex":"重新索引","index.code.indexing":"索引中...","index.stage.daemon_starting":"启动 Daemon","index.stage.cloning":"克隆仓库","index.stage.preparing":"版本准备","index.stage.scanning":"扫描中","index.stage.parsing":"解析中","index.stage.analyzing":"分析中","index.stage.uploading":"上传中","index.stage.skipping":"跳过","index.code.complete":"索引完成","index.code.unchanged_count":"{{count}} 个模块无变化,已跳过","index.code.error":"索引失败","index.code.timeout":"索引超时","index.code.dismiss":"关闭","index.code.skipped":"已是最新","index.code.delete":"删除索引","index.code.delete_confirm":"确定要删除该资源的索引?原始内容、摘要和提取数据将被清除。","index.code.delete_success":"索引已删除","index.code.delete_failed":"删除索引失败","index.code.auto_continue":"完成后自动继续","index.code.auto_continue_pending":"即将自动继续..","index.code.done_continue":"完成","index.log.daemon_starting":"正在启动云端 Daemon...","index.log.daemon_ready":"Daemon 就绪","index.log.cloning":"正在克隆仓库...","index.log.clone_done":"克隆完成","index.log.preparing":"正在准备索引版本...","index.log.prepare_done":"版本准备完成","index.log.done_suffix":"完成","index.log.scan_done":"扫描完成","index.log.parse_done":"解析完成 {{count}}个","index.log.analyze_done":"分析完成","index.log.upload_done":"数据已保存 {{name}}","index.log.restored":"(已从服务器恢复进度,之前的日志不可用)","index.error.commit_not_available":"目标版本不可用,请检查远程仓库","index.error.daemon_start_failed":"云端 Daemon 启动失败","index.error.git_archive_failed":"版本导出失败","index.doc.error.llm_unavailable":"LLM 服务不可用,请检查配置","index.doc.error.embedding_unavailable":"Embedding 服务不可用,请检查配置","index.doc.error.content_missing":"文档内容缺失","index.doc.error.parse_failed":"文档解析失败","index.doc.error.llm_exhausted":"LLM 调用失败:{{message}}","index.stage.chunking":"分片中","index.stage.annotating":"标注中","index.stage.post_processing":"后处理","index.stage.embedding":"向量化","index.stage.storing":"存储中","index.doc.log.chunking":"分析文档结构...","index.doc.log.chunking_done":"分片完成({{n}} 个分片)","index.doc.log.annotating_start":"LLM 标注开始...","index.doc.log.annotating":"LLM 标注中 ({{n}}/{{m}})","index.doc.log.post_processing":"实体归一化 & 质量检查...","index.doc.log.embedding":"生成向量...","index.doc.log.storing":"正在保存...","index.doc.msg.chunking_result":"{{chunks}} 个分片,{{sections}} 个章节","index.doc.msg.annotating_start":"{{n}} 个分片","index.doc.msg.annotating_start_model":"{{n}} 个分片,LLM {{model}}","index.doc.msg.annotating_chunk":"分片 {{current}}/{{total}} {{step}}({{calls}} 次调用,{{tokens}} tokens)","index.doc.msg.annotating_chunk_done":"分片 {{current}}/{{total}} 完成,累计 {{calls}} 次调用 {{tokens}} tokens","index.doc.msg.post_process_start":"实体自动补全 & 归一化","index.doc.msg.extraction_stats":"{{entities}} 个实体,{{relations}} 个关系,{{withAtoms}}/{{totalParas}} 段落含标注","index.doc.msg.no_resolution":"无需实体归一化","index.doc.msg.resolving":"归一化中:{{duplicates}} 对重复 + {{noise}} 个噪声候选","index.doc.msg.resolution_parse_failed":"实体归一化解析失败","index.doc.msg.resolution_result":"归一化完成:{{merges}} 次合并({{mergeRefs}} 处引用),移除 {{removed}} 个({{removeRefs}} 处),{{ambiguous}} 个待定","index.doc.msg.resolution_failed":"实体归一化失败(非阻塞)","index.doc.msg.embedding_model":"向量化 {{model}}","index.doc.msg.file_start":"[{{idx}}/{{total}}] {{file}} 开始索引","index.doc.msg.file_done":"[{{idx}}/{{total}}] {{file}} 索引完成","index.doc.msg.file_error":"[{{idx}}/{{total}}] {{file}} 索引失败: {{error}}","index.doc.confirm_title":"文档索引确认","index.doc.confirm_desc":"以下文档将使用 LLM 进行结构化索引,会产生 token 消耗:","index.doc.confirm_btn":"确认索引","index.doc.estimating":"正在估算消耗...","index.doc.estimate_tokens":"预估 Token","index.doc.estimate_calls":"LLM 调用","index.doc.estimate_chunks":"分片数","index.doc.estimate_summary":"预计消耗约 ~{{tokens}} tokens,~{{calls}} 次 LLM 调用","index.doc.cancel":"取消","digest.empty.title":"暂无代码摘要","digest.empty.description":"该内容尚未进行代码索引,索引后可查看结构化代码摘要。","digest.empty.cta":"开始索引","digest.doc.empty.title":"文档尚未完成 LLM 索引","digest.doc.empty.description":"索引后可查看原文与结构化标注的对照视图","digest.doc.empty.cta":"索引文档","digest.doc.no_atoms":"无标注或已提取到其他段落","digest.doc.atom.entities":"实体","digest.doc.atom.relations":"关系","digest.doc.atom.behaviors":"行为","digest.doc.atom.attributes":"属性","digest.doc.atom.states":"状态","digest.doc.atom.rules":"规则","digest.doc.atom.transitions":"转换","digest.doc.atom.events":"事件","digest.doc.atom.decisions":"决策","digest.doc.atom.metrics":"指标","digest.doc.atom.roles":"角色","digest.doc.atom.constraints":"约束","digest.doc.atom.comparisons":"对比","digest.doc.atom.boundaries":"边界","digest.stats.files":"文件","digest.stats.classes":"类","digest.stats.functions":"函数","digest.stats.relations":"关系","digest.tech_stack":"技术栈","digest.modules":"模块","daemon.offline_tooltip":"请启动客户端","sources.detail.repo_url":"仓库地址","raw.basic_info":"基本信息","raw.field.name":"名称","raw.field.version":"版本","raw.field.license":"许可证","raw.field.description":"描述","raw.dependencies":"依赖","raw.dev_dependencies":"开发依赖","raw.no_dependencies":"无依赖","raw.readme":"说明文档","raw.code_files":"代码文件","raw.doc_files":"文档文件","raw.total_files":"总文件数","index.batch.title":"选择待索引内容","index.batch.panel_a_title":"可索引内容","index.batch.panel_b_title":"已选内容","index.batch.selected_count":"已选 {{n}} / 可选 {{total}}","index.batch.already_indexed":"已索引","index.batch.reindex_tag":"重索引","index.batch.skipped_unsupported":"已跳过(暂不支持)","index.batch.empty_selection":"请在左侧勾选要索引的内容","index.batch.warning_over_50":"待索引数量较多(>50),可能需要较长时间","index.batch.confirm":"开始索引","index.batch.back":"返回","index.batch.tooltip":"批量索引","index.batch.tooltip_indexing":"索引中...","index.batch.toast_skipped":"选中的内容均已是最新状态,无需重新索引。","index.batch.toast_partial_fail":"部分索引任务失败,详情请查看控制台。","index.batch.error":"批量索引失败","error.dialog.console_hint":"完整错误信息已打印到浏览器控制台。","error.dialog.copy":"复制","error.dialog.copied":"已复制","error.dialog.confirm":"确定","query.tab.label":"查询","query.indexing.title":"索引进行中","query.indexing.desc":"索引完成后即可使用查询功能。","query.symbol.search_placeholder":"搜索符号...","query.symbol.exported_only":"仅导出","query.symbol.load_more":"加载更多(剩余 {{count}} 个)","query.symbol.loading":"加载符号中...","query.symbol.empty":"未找到符号","query.symbol.empty_desc":"该源没有可展示的代码符号。","query.symbol.methods":"方法","query.symbol.properties":"属性","query.symbol.extends":"继承","query.symbol.implements":"实现","query.symbol.signature":"签名","query.symbol.parameters":"参数","query.symbol.returns":"返回值","query.symbol.async":"异步","query.call_graph.title":"调用图","query.call_graph.callers":"调用者","query.call_graph.callees":"被调用","query.call_graph.empty":"未找到调用关系","query.call_graph.empty_desc":"未找到该函数的{{direction}}。","query.call_graph.depth":"深度","query.call_graph.open":"查看调用图","query.import_deps.title":"导入依赖","query.import_deps.forward":"导入","query.import_deps.reverse":"被导入","query.import_deps.external":"外部依赖","query.import_deps.internal":"内部依赖","query.import_deps.empty":"未找到导入关系","query.import_deps.open":"查看依赖","query.inheritance.title":"继承关系","query.inheritance.descendants":"子类","query.inheritance.ancestors":"父类","query.inheritance.empty":"未找到继承关系","query.inheritance.cross_source":"正在搜索 {{count}} 个已索引代码源","query.inheritance.open":"查看继承","query.doc.search_placeholder":"用自然语言搜索文档...","query.doc.search_button":"搜索","query.doc.searching":"搜索中...","query.doc.relevance.high":"高相关度","query.doc.relevance.medium":"中相关度","query.doc.relevance.low":"低相关度","query.doc.empty.title":"未找到匹配段落","query.doc.empty.desc":"请尝试更换关键词,或检查相关文档是否已导入并完成索引。","query.doc.error.title":"文档搜索失败","query.warning.more":"还有 {{count}} 条"};Cn.use(Y_).use(T2).init({resources:{en:{translation:tk},zh:{translation:nk}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var zp={exports:{}},Ii={},$p={exports:{}},Bp={};var r0;function rk(){return r0||(r0=1,(function(e){function t(T,q){var ee=T.length;T.push(q);e:for(;0<ee;){var ae=ee-1>>>1,W=T[ae];if(0<o(W,q))T[ae]=q,T[ee]=W,ee=ae;else break e}}function r(T){return T.length===0?null:T[0]}function a(T){if(T.length===0)return null;var q=T[0],ee=T.pop();if(ee!==q){T[0]=ee;e:for(var ae=0,W=T.length,O=W>>>1;ae<O;){var V=2*(ae+1)-1,re=T[V],se=V+1,ne=T[se];if(0>o(re,ee))se<W&&0>o(ne,re)?(T[ae]=ne,T[se]=ee,ae=se):(T[ae]=re,T[V]=ee,ae=V);else if(se<W&&0>o(ne,ee))T[ae]=ne,T[se]=ee,ae=se;else break e}}return q}function o(T,q){var ee=T.sortIndex-q.sortIndex;return ee!==0?ee:T.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],p=[],m=1,x=null,v=3,_=!1,w=!1,S=!1,k=!1,N=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function D(T){for(var q=r(p);q!==null;){if(q.callback===null)a(p);else if(q.startTime<=T)a(p),q.sortIndex=q.expirationTime,t(h,q);else break;q=r(p)}}function L(T){if(S=!1,D(T),!w)if(r(h)!==null)w=!0,$||($=!0,oe());else{var q=r(p);q!==null&&P(L,q.startTime-T)}}var $=!1,z=-1,R=5,B=-1;function H(){return k?!0:!(e.unstable_now()-B<R)}function J(){if(k=!1,$){var T=e.unstable_now();B=T;var q=!0;try{e:{w=!1,S&&(S=!1,A(z),z=-1),_=!0;var ee=v;try{t:{for(D(T),x=r(h);x!==null&&!(x.expirationTime>T&&H());){var ae=x.callback;if(typeof ae=="function"){x.callback=null,v=x.priorityLevel;var W=ae(x.expirationTime<=T);if(T=e.unstable_now(),typeof W=="function"){x.callback=W,D(T),q=!0;break t}x===r(h)&&a(h),D(T)}else a(h);x=r(h)}if(x!==null)q=!0;else{var O=r(p);O!==null&&P(L,O.startTime-T),q=!1}}break e}finally{x=null,v=ee,_=!1}q=void 0}}finally{q?oe():$=!1}}}var oe;if(typeof E=="function")oe=function(){E(J)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,M=ce.port2;ce.port1.onmessage=J,oe=function(){M.postMessage(null)}}else oe=function(){N(J,0)};function P(T,q){z=N(function(){T(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(T){switch(v){case 1:case 2:case 3:var q=3;break;default:q=v}var ee=v;v=q;try{return T()}finally{v=ee}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(T,q){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var ee=v;v=T;try{return q()}finally{v=ee}},e.unstable_scheduleCallback=function(T,q,ee){var ae=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?ae+ee:ae):ee=ae,T){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=ee+W,T={id:m++,callback:q,priorityLevel:T,startTime:ee,expirationTime:W,sortIndex:-1},ee>ae?(T.sortIndex=ee,t(p,T),r(h)===null&&T===r(p)&&(S?(A(z),z=-1):S=!0,P(L,ee-ae))):(T.sortIndex=W,t(h,T),w||_||(w=!0,$||($=!0,oe()))),T},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(T){var q=v;return function(){var ee=v;v=q;try{return T.apply(this,arguments)}finally{v=ee}}}})(Bp)),Bp}var a0;function ak(){return a0||(a0=1,$p.exports=rk()),$p.exports}var Ip={exports:{}},Sn={};var s0;function sk(){if(s0)return Sn;s0=1;var e=ad();function t(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(h,p,m){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:h,containerInfo:p,implementation:m}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Sn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Sn.createPortal=function(h,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return l(h,p,null,m)},Sn.flushSync=function(h){var p=u.T,m=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=p,a.p=m,a.d.f()}},Sn.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(h,p))},Sn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Sn.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var m=p.as,x=f(m,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,_=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?a.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:v,fetchPriority:_}):m==="script"&&a.d.X(h,{crossOrigin:x,integrity:v,fetchPriority:_,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Sn.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=f(p.as,p.crossOrigin);a.d.M(h,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(h)},Sn.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,x=f(m,p.crossOrigin);a.d.L(h,m,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Sn.preloadModule=function(h,p){if(typeof h=="string")if(p){var m=f(p.as,p.crossOrigin);a.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(h)},Sn.requestFormReset=function(h){a.d.r(h)},Sn.unstable_batchedUpdates=function(h,p){return h(p)},Sn.useFormState=function(h,p,m){return u.H.useFormState(h,p,m)},Sn.useFormStatus=function(){return u.H.useHostTransitionStatus()},Sn.version="19.2.4",Sn}var o0;function ok(){if(o0)return Ip.exports;o0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ip.exports=sk(),Ip.exports}var i0;function ik(){if(i0)return Ii;i0=1;var e=ak(),t=ad(),r=ok();function a(n){var s="https://react.dev/errors/"+n;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)s+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+n+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var s=n,i=n;if(n.alternate)for(;s.return;)s=s.return;else{n=s;do s=n,(s.flags&4098)!==0&&(i=s.return),n=s.return;while(n)}return s.tag===3?i:null}function u(n){if(n.tag===13){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function f(n){if(n.tag===31){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function h(n){if(l(n)!==n)throw Error(a(188))}function p(n){var s=n.alternate;if(!s){if(s=l(n),s===null)throw Error(a(188));return s!==n?null:n}for(var i=n,d=s;;){var g=i.return;if(g===null)break;var y=g.alternate;if(y===null){if(d=g.return,d!==null){i=d;continue}break}if(g.child===y.child){for(y=g.child;y;){if(y===i)return h(g),n;if(y===d)return h(g),s;y=y.sibling}throw Error(a(188))}if(i.return!==d.return)i=g,d=y;else{for(var j=!1,C=g.child;C;){if(C===i){j=!0,i=g,d=y;break}if(C===d){j=!0,d=g,i=y;break}C=C.sibling}if(!j){for(C=y.child;C;){if(C===i){j=!0,i=y,d=g;break}if(C===d){j=!0,d=y,i=g;break}C=C.sibling}if(!j)throw Error(a(189))}}if(i.alternate!==d)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?n:s}function m(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n;for(n=n.child;n!==null;){if(s=m(n),s!==null)return s;n=n.sibling}return null}var x=Object.assign,v=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),E=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function oe(n){return n===null||typeof n!="object"?null:(n=J&&n[J]||n["@@iterator"],typeof n=="function"?n:null)}var ce=Symbol.for("react.client.reference");function M(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ce?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case N:return"Profiler";case k:return"StrictMode";case L:return"Suspense";case $:return"SuspenseList";case B:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case E:return n.displayName||"Context";case A:return(n._context.displayName||"Context")+".Consumer";case D:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case z:return s=n.displayName||null,s!==null?s:M(n.type)||"Memo";case R:s=n._payload,n=n._init;try{return M(n(s))}catch{}}return null}var P=Array.isArray,T=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},ae=[],W=-1;function O(n){return{current:n}}function V(n){0>W||(n.current=ae[W],ae[W]=null,W--)}function re(n,s){W++,ae[W]=n.current,n.current=s}var se=O(null),ne=O(null),ge=O(null),Ne=O(null);function qe(n,s){switch(re(ge,s),re(ne,n),re(se,null),s.nodeType){case 9:case 11:n=(n=s.documentElement)&&(n=n.namespaceURI)?tb(n):0;break;default:if(n=s.tagName,s=s.namespaceURI)s=tb(s),n=nb(s,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}V(se),re(se,n)}function Fe(){V(se),V(ne),V(ge)}function be(n){n.memoizedState!==null&&re(Ne,n);var s=se.current,i=nb(s,n.type);s!==i&&(re(ne,n),re(se,i))}function fe(n){ne.current===n&&(V(se),V(ne)),Ne.current===n&&(V(Ne),Di._currentValue=ee)}var _e,he;function ve(n){if(_e===void 0)try{throw Error()}catch(i){var s=i.stack.trim().match(/\n( *(at )?)/);_e=s&&s[1]||"",he=-1<i.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+_e+n+he}var Ve=!1;function De(n,s){if(!n||Ve)return"";Ve=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(s){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(te){var Q=te}Reflect.construct(n,[],pe)}else{try{pe.call()}catch(te){Q=te}n.call(pe.prototype)}}else{try{throw Error()}catch(te){Q=te}(pe=n())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(te){if(te&&Q&&typeof te.stack=="string")return[te.stack,Q.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),j=y[0],C=y[1];if(j&&C){var U=j.split(`
|
|
5
|
+
`),X=C.split(`
|
|
6
|
+
`);for(g=d=0;d<U.length&&!U[d].includes("DetermineComponentFrameRoot");)d++;for(;g<X.length&&!X[g].includes("DetermineComponentFrameRoot");)g++;if(d===U.length||g===X.length)for(d=U.length-1,g=X.length-1;1<=d&&0<=g&&U[d]!==X[g];)g--;for(;1<=d&&0<=g;d--,g--)if(U[d]!==X[g]){if(d!==1||g!==1)do if(d--,g--,0>g||U[d]!==X[g]){var ie=`
|
|
7
|
+
`+U[d].replace(" at new "," at ");return n.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",n.displayName)),ie}while(1<=d&&0<=g);break}}}finally{Ve=!1,Error.prepareStackTrace=i}return(i=n?n.displayName||n.name:"")?ve(i):""}function Xe(n,s){switch(n.tag){case 26:case 27:case 5:return ve(n.type);case 16:return ve("Lazy");case 13:return n.child!==s&&s!==null?ve("Suspense Fallback"):ve("Suspense");case 19:return ve("SuspenseList");case 0:case 15:return De(n.type,!1);case 11:return De(n.type.render,!1);case 1:return De(n.type,!0);case 31:return ve("Activity");default:return""}}function It(n){try{var s="",i=null;do s+=Xe(n,i),i=n,n=n.return;while(n);return s}catch(d){return`
|
|
8
|
+
Error generating stack: `+d.message+`
|
|
9
|
+
`+d.stack}}var un=Object.prototype.hasOwnProperty,Vt=e.unstable_scheduleCallback,Bn=e.unstable_cancelCallback,cr=e.unstable_shouldYield,Xn=e.unstable_requestPaint,Ht=e.unstable_now,An=e.unstable_getCurrentPriorityLevel,Le=e.unstable_ImmediatePriority,Ze=e.unstable_UserBlockingPriority,We=e.unstable_NormalPriority,Nt=e.unstable_LowPriority,ft=e.unstable_IdlePriority,Rn=e.log,mn=e.unstable_setDisableYieldValue,gn=null,Lt=null;function Et(n){if(typeof Rn=="function"&&mn(n),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(gn,n)}catch{}}var Pt=Math.clz32?Math.clz32:sa,Er=Math.log,zr=Math.LN2;function sa(n){return n>>>=0,n===0?32:31-(Er(n)/zr|0)|0}var me=256,Ue=262144,St=4194304;function nt(n){var s=n&42;if(s!==0)return s;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Ct(n,s,i){var d=n.pendingLanes;if(d===0)return 0;var g=0,y=n.suspendedLanes,j=n.pingedLanes;n=n.warmLanes;var C=d&134217727;return C!==0?(d=C&~y,d!==0?g=nt(d):(j&=C,j!==0?g=nt(j):i||(i=C&~n,i!==0&&(g=nt(i))))):(C=d&~y,C!==0?g=nt(C):j!==0?g=nt(j):i||(i=d&~n,i!==0&&(g=nt(i)))),g===0?0:s!==0&&s!==g&&(s&y)===0&&(y=g&-g,i=s&-s,y>=i||y===32&&(i&4194048)!==0)?s:g}function Dt(n,s){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&s)===0}function Oa(n,s){switch(n){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function oa(){var n=St;return St<<=1,(St&62914560)===0&&(St=4194304),n}function ur(n){for(var s=[],i=0;31>i;i++)s.push(n);return s}function Tn(n,s){n.pendingLanes|=s,s!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function $r(n,s,i,d,g,y){var j=n.pendingLanes;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=i,n.entangledLanes&=i,n.errorRecoveryDisabledLanes&=i,n.shellSuspendCounter=0;var C=n.entanglements,U=n.expirationTimes,X=n.hiddenUpdates;for(i=j&~i;0<i;){var ie=31-Pt(i),pe=1<<ie;C[ie]=0,U[ie]=-1;var Q=X[ie];if(Q!==null)for(X[ie]=null,ie=0;ie<Q.length;ie++){var te=Q[ie];te!==null&&(te.lane&=-536870913)}i&=~pe}d!==0&&ia(n,d,0),y!==0&&g===0&&n.tag!==0&&(n.suspendedLanes|=y&~(j&~s))}function ia(n,s,i){n.pendingLanes|=s,n.suspendedLanes&=~s;var d=31-Pt(s);n.entangledLanes|=s,n.entanglements[d]=n.entanglements[d]|1073741824|i&261930}function Ma(n,s){var i=n.entangledLanes|=s;for(n=n.entanglements;i;){var d=31-Pt(i),g=1<<d;g&s|n[d]&s&&(n[d]|=s),i&=~g}}function I(n,s){var i=s&-s;return i=(i&42)!==0?1:G(i),(i&(n.suspendedLanes|s))!==0?0:i}function G(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Z(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function xe(){var n=q.p;return n!==0?n:(n=window.event,n===void 0?32:kb(n.type))}function we(n,s){var i=q.p;try{return q.p=n,s()}finally{q.p=i}}var Ae=Math.random().toString(36).slice(2),je="__reactFiber$"+Ae,ke="__reactProps$"+Ae,Ce="__reactContainer$"+Ae,Ie="__reactEvents$"+Ae,Pe="__reactListeners$"+Ae,Be="__reactHandles$"+Ae,dt="__reactResources$"+Ae,ue="__reactMarker$"+Ae;function Ee(n){delete n[je],delete n[ke],delete n[Ie],delete n[Pe],delete n[Be]}function Re(n){var s=n[je];if(s)return s;for(var i=n.parentNode;i;){if(s=i[Ce]||i[je]){if(i=s.alternate,s.child!==null||i!==null&&i.child!==null)for(n=cb(n);n!==null;){if(i=n[je])return i;n=cb(n)}return s}n=i,i=n.parentNode}return null}function Ge(n){if(n=n[je]||n[Ce]){var s=n.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return n}return null}function Oe(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n.stateNode;throw Error(a(33))}function gt(n){var s=n[dt];return s||(s=n[dt]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function it(n){n[ue]=!0}var an=new Set,_n={};function dn(n,s){Br(n,s),Br(n+"Capture",s)}function Br(n,s){for(_n[n]=s,n=0;n<s.length;n++)an.add(s[n])}var fs=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ir={},ps={};function Gs(n){return un.call(ps,n)?!0:un.call(Ir,n)?!1:fs.test(n)?ps[n]=!0:(Ir[n]=!0,!1)}function at(n,s,i){if(Gs(s))if(i===null)n.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":n.removeAttribute(s);return;case"boolean":var d=s.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(s);return}}n.setAttribute(s,""+i)}}function Yt(n,s,i){if(i===null)n.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttribute(s,""+i)}}function wn(n,s,i,d){if(d===null)n.removeAttribute(i);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttributeNS(s,i,""+d)}}function Jt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Ot(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Vs(n,s,i){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,s);if(!n.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var g=d.get,y=d.set;return Object.defineProperty(n,s,{configurable:!0,get:function(){return g.call(this)},set:function(j){i=""+j,y.call(this,j)}}),Object.defineProperty(n,s,{enumerable:d.enumerable}),{getValue:function(){return i},setValue:function(j){i=""+j},stopTracking:function(){n._valueTracker=null,delete n[s]}}}}function Ys(n){if(!n._valueTracker){var s=Ot(n)?"checked":"value";n._valueTracker=Vs(n,s,""+n[s])}}function Vl(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var i=s.getValue(),d="";return n&&(d=Ot(n)?n.checked?"true":"false":n.value),n=d,n!==i?(s.setValue(n),!0):!1}function Yl(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Pw=/[\n"\\]/g;function dr(n){return n.replace(Pw,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function wd(n,s,i,d,g,y,j,C){n.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.type=j:n.removeAttribute("type"),s!=null?j==="number"?(s===0&&n.value===""||n.value!=s)&&(n.value=""+Jt(s)):n.value!==""+Jt(s)&&(n.value=""+Jt(s)):j!=="submit"&&j!=="reset"||n.removeAttribute("value"),s!=null?Sd(n,j,Jt(s)):i!=null?Sd(n,j,Jt(i)):d!=null&&n.removeAttribute("value"),g==null&&y!=null&&(n.defaultChecked=!!y),g!=null&&(n.checked=g&&typeof g!="function"&&typeof g!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.name=""+Jt(C):n.removeAttribute("name")}function Xm(n,s,i,d,g,y,j,C){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(n.type=y),s!=null||i!=null){if(!(y!=="submit"&&y!=="reset"||s!=null)){Ys(n);return}i=i!=null?""+Jt(i):"",s=s!=null?""+Jt(s):i,C||s===n.value||(n.value=s),n.defaultValue=s}d=d??g,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=C?n.checked:!!d,n.defaultChecked=!!d,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(n.name=j),Ys(n)}function Sd(n,s,i){s==="number"&&Yl(n.ownerDocument)===n||n.defaultValue===""+i||(n.defaultValue=""+i)}function Ks(n,s,i,d){if(n=n.options,s){s={};for(var g=0;g<i.length;g++)s["$"+i[g]]=!0;for(i=0;i<n.length;i++)g=s.hasOwnProperty("$"+n[i].value),n[i].selected!==g&&(n[i].selected=g),g&&d&&(n[i].defaultSelected=!0)}else{for(i=""+Jt(i),s=null,g=0;g<n.length;g++){if(n[g].value===i){n[g].selected=!0,d&&(n[g].defaultSelected=!0);return}s!==null||n[g].disabled||(s=n[g])}s!==null&&(s.selected=!0)}}function Qm(n,s,i){if(s!=null&&(s=""+Jt(s),s!==n.value&&(n.value=s),i==null)){n.defaultValue!==s&&(n.defaultValue=s);return}n.defaultValue=i!=null?""+Jt(i):""}function Zm(n,s,i,d){if(s==null){if(d!=null){if(i!=null)throw Error(a(92));if(P(d)){if(1<d.length)throw Error(a(93));d=d[0]}i=d}i==null&&(i=""),s=i}i=Jt(s),n.defaultValue=i,d=n.textContent,d===i&&d!==""&&d!==null&&(n.value=d),Ys(n)}function Xs(n,s){if(s){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=s;return}}n.textContent=s}var Hw=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Jm(n,s,i){var d=s.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?d?n.setProperty(s,""):s==="float"?n.cssFloat="":n[s]="":d?n.setProperty(s,i):typeof i!="number"||i===0||Hw.has(s)?s==="float"?n.cssFloat=i:n[s]=(""+i).trim():n[s]=i+"px"}function Wm(n,s,i){if(s!=null&&typeof s!="object")throw Error(a(62));if(n=n.style,i!=null){for(var d in i)!i.hasOwnProperty(d)||s!=null&&s.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var g in s)d=s[g],s.hasOwnProperty(g)&&i[g]!==d&&Jm(n,g,d)}else for(var y in s)s.hasOwnProperty(y)&&Jm(n,y,s[y])}function jd(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fw=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),qw=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Kl(n){return qw.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function la(){}var kd=null;function Nd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Qs=null,Zs=null;function eg(n){var s=Ge(n);if(s&&(n=s.stateNode)){var i=n[ke]||null;e:switch(n=s.stateNode,s.type){case"input":if(wd(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),s=i.name,i.type==="radio"&&s!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+dr(""+s)+'"][type="radio"]'),s=0;s<i.length;s++){var d=i[s];if(d!==n&&d.form===n.form){var g=d[ke]||null;if(!g)throw Error(a(90));wd(d,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(s=0;s<i.length;s++)d=i[s],d.form===n.form&&Vl(d)}break e;case"textarea":Qm(n,i.value,i.defaultValue);break e;case"select":s=i.value,s!=null&&Ks(n,!!i.multiple,s,!1)}}}var Ed=!1;function tg(n,s,i){if(Ed)return n(s,i);Ed=!0;try{var d=n(s);return d}finally{if(Ed=!1,(Qs!==null||Zs!==null)&&(Mc(),Qs&&(s=Qs,n=Zs,Zs=Qs=null,eg(s),n)))for(s=0;s<n.length;s++)eg(n[s])}}function Qo(n,s){var i=n.stateNode;if(i===null)return null;var d=i[ke]||null;if(d===null)return null;i=d[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(a(231,s,typeof i));return i}var ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cd=!1;if(ca)try{var Zo={};Object.defineProperty(Zo,"passive",{get:function(){Cd=!0}}),window.addEventListener("test",Zo,Zo),window.removeEventListener("test",Zo,Zo)}catch{Cd=!1}var za=null,Ad=null,Xl=null;function ng(){if(Xl)return Xl;var n,s=Ad,i=s.length,d,g="value"in za?za.value:za.textContent,y=g.length;for(n=0;n<i&&s[n]===g[n];n++);var j=i-n;for(d=1;d<=j&&s[i-d]===g[y-d];d++);return Xl=g.slice(n,1<d?1-d:void 0)}function Ql(n){var s=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&s===13&&(n=13)):n=s,n===10&&(n=13),32<=n||n===13?n:0}function Zl(){return!0}function rg(){return!1}function In(n){function s(i,d,g,y,j){this._reactName=i,this._targetInst=g,this.type=d,this.nativeEvent=y,this.target=j,this.currentTarget=null;for(var C in n)n.hasOwnProperty(C)&&(i=n[C],this[C]=i?i(y):y[C]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Zl:rg,this.isPropagationStopped=rg,this}return x(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Zl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Zl)},persist:function(){},isPersistent:Zl}),s}var hs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jl=In(hs),Jo=x({},hs,{view:0,detail:0}),Gw=In(Jo),Rd,Td,Wo,Wl=x({},Jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Wo&&(Wo&&n.type==="mousemove"?(Rd=n.screenX-Wo.screenX,Td=n.screenY-Wo.screenY):Td=Rd=0,Wo=n),Rd)},movementY:function(n){return"movementY"in n?n.movementY:Td}}),ag=In(Wl),Vw=x({},Wl,{dataTransfer:0}),Yw=In(Vw),Kw=x({},Jo,{relatedTarget:0}),Ld=In(Kw),Xw=x({},hs,{animationName:0,elapsedTime:0,pseudoElement:0}),Qw=In(Xw),Zw=x({},hs,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Jw=In(Zw),Ww=x({},hs,{data:0}),sg=In(Ww),eS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},nS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rS(n){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(n):(n=nS[n])?!!s[n]:!1}function Dd(){return rS}var aS=x({},Jo,{key:function(n){if(n.key){var s=eS[n.key]||n.key;if(s!=="Unidentified")return s}return n.type==="keypress"?(n=Ql(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?tS[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dd,charCode:function(n){return n.type==="keypress"?Ql(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Ql(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),sS=In(aS),oS=x({},Wl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),og=In(oS),iS=x({},Jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dd}),lS=In(iS),cS=x({},hs,{propertyName:0,elapsedTime:0,pseudoElement:0}),uS=In(cS),dS=x({},Wl,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),fS=In(dS),pS=x({},hs,{newState:0,oldState:0}),hS=In(pS),mS=[9,13,27,32],Od=ca&&"CompositionEvent"in window,ei=null;ca&&"documentMode"in document&&(ei=document.documentMode);var gS=ca&&"TextEvent"in window&&!ei,ig=ca&&(!Od||ei&&8<ei&&11>=ei),lg=" ",cg=!1;function ug(n,s){switch(n){case"keyup":return mS.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Js=!1;function xS(n,s){switch(n){case"compositionend":return dg(s);case"keypress":return s.which!==32?null:(cg=!0,lg);case"textInput":return n=s.data,n===lg&&cg?null:n;default:return null}}function yS(n,s){if(Js)return n==="compositionend"||!Od&&ug(n,s)?(n=ng(),Xl=Ad=za=null,Js=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return ig&&s.locale!=="ko"?null:s.data;default:return null}}var bS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function fg(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s==="input"?!!bS[n.type]:s==="textarea"}function pg(n,s,i,d){Qs?Zs?Zs.push(d):Zs=[d]:Qs=d,s=Hc(s,"onChange"),0<s.length&&(i=new Jl("onChange","change",null,i,d),n.push({event:i,listeners:s}))}var ti=null,ni=null;function vS(n){Xy(n,0)}function ec(n){var s=Oe(n);if(Vl(s))return n}function hg(n,s){if(n==="change")return s}var mg=!1;if(ca){var Md;if(ca){var zd="oninput"in document;if(!zd){var gg=document.createElement("div");gg.setAttribute("oninput","return;"),zd=typeof gg.oninput=="function"}Md=zd}else Md=!1;mg=Md&&(!document.documentMode||9<document.documentMode)}function xg(){ti&&(ti.detachEvent("onpropertychange",yg),ni=ti=null)}function yg(n){if(n.propertyName==="value"&&ec(ni)){var s=[];pg(s,ni,n,Nd(n)),tg(vS,s)}}function _S(n,s,i){n==="focusin"?(xg(),ti=s,ni=i,ti.attachEvent("onpropertychange",yg)):n==="focusout"&&xg()}function wS(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return ec(ni)}function SS(n,s){if(n==="click")return ec(s)}function jS(n,s){if(n==="input"||n==="change")return ec(s)}function kS(n,s){return n===s&&(n!==0||1/n===1/s)||n!==n&&s!==s}var Qn=typeof Object.is=="function"?Object.is:kS;function ri(n,s){if(Qn(n,s))return!0;if(typeof n!="object"||n===null||typeof s!="object"||s===null)return!1;var i=Object.keys(n),d=Object.keys(s);if(i.length!==d.length)return!1;for(d=0;d<i.length;d++){var g=i[d];if(!un.call(s,g)||!Qn(n[g],s[g]))return!1}return!0}function bg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function vg(n,s){var i=bg(n);n=0;for(var d;i;){if(i.nodeType===3){if(d=n+i.textContent.length,n<=s&&d>=s)return{node:i,offset:s-n};n=d}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=bg(i)}}function _g(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?_g(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function wg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var s=Yl(n.document);s instanceof n.HTMLIFrameElement;){try{var i=typeof s.contentWindow.location.href=="string"}catch{i=!1}if(i)n=s.contentWindow;else break;s=Yl(n.document)}return s}function $d(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}var NS=ca&&"documentMode"in document&&11>=document.documentMode,Ws=null,Bd=null,ai=null,Id=!1;function Sg(n,s,i){var d=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Id||Ws==null||Ws!==Yl(d)||(d=Ws,"selectionStart"in d&&$d(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),ai&&ri(ai,d)||(ai=d,d=Hc(Bd,"onSelect"),0<d.length&&(s=new Jl("onSelect","select",null,s,i),n.push({event:s,listeners:d}),s.target=Ws)))}function ms(n,s){var i={};return i[n.toLowerCase()]=s.toLowerCase(),i["Webkit"+n]="webkit"+s,i["Moz"+n]="moz"+s,i}var eo={animationend:ms("Animation","AnimationEnd"),animationiteration:ms("Animation","AnimationIteration"),animationstart:ms("Animation","AnimationStart"),transitionrun:ms("Transition","TransitionRun"),transitionstart:ms("Transition","TransitionStart"),transitioncancel:ms("Transition","TransitionCancel"),transitionend:ms("Transition","TransitionEnd")},Ud={},jg={};ca&&(jg=document.createElement("div").style,"AnimationEvent"in window||(delete eo.animationend.animation,delete eo.animationiteration.animation,delete eo.animationstart.animation),"TransitionEvent"in window||delete eo.transitionend.transition);function gs(n){if(Ud[n])return Ud[n];if(!eo[n])return n;var s=eo[n],i;for(i in s)if(s.hasOwnProperty(i)&&i in jg)return Ud[n]=s[i];return n}var kg=gs("animationend"),Ng=gs("animationiteration"),Eg=gs("animationstart"),ES=gs("transitionrun"),CS=gs("transitionstart"),AS=gs("transitioncancel"),Cg=gs("transitionend"),Ag=new Map,Pd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Pd.push("scrollEnd");function Cr(n,s){Ag.set(n,s),dn(s,[n])}var tc=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},fr=[],to=0,Hd=0;function nc(){for(var n=to,s=Hd=to=0;s<n;){var i=fr[s];fr[s++]=null;var d=fr[s];fr[s++]=null;var g=fr[s];fr[s++]=null;var y=fr[s];if(fr[s++]=null,d!==null&&g!==null){var j=d.pending;j===null?g.next=g:(g.next=j.next,j.next=g),d.pending=g}y!==0&&Rg(i,g,y)}}function rc(n,s,i,d){fr[to++]=n,fr[to++]=s,fr[to++]=i,fr[to++]=d,Hd|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function Fd(n,s,i,d){return rc(n,s,i,d),ac(n)}function xs(n,s){return rc(n,null,null,s),ac(n)}function Rg(n,s,i){n.lanes|=i;var d=n.alternate;d!==null&&(d.lanes|=i);for(var g=!1,y=n.return;y!==null;)y.childLanes|=i,d=y.alternate,d!==null&&(d.childLanes|=i),y.tag===22&&(n=y.stateNode,n===null||n._visibility&1||(g=!0)),n=y,y=y.return;return n.tag===3?(y=n.stateNode,g&&s!==null&&(g=31-Pt(i),n=y.hiddenUpdates,d=n[g],d===null?n[g]=[s]:d.push(s),s.lane=i|536870912),y):null}function ac(n){if(50<Ni)throw Ni=0,Wf=null,Error(a(185));for(var s=n.return;s!==null;)n=s,s=n.return;return n.tag===3?n.stateNode:null}var no={};function RS(n,s,i,d){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zn(n,s,i,d){return new RS(n,s,i,d)}function qd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ua(n,s){var i=n.alternate;return i===null?(i=Zn(n.tag,s,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=s,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&65011712,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,s=n.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i.refCleanup=n.refCleanup,i}function Tg(n,s){n.flags&=65011714;var i=n.alternate;return i===null?(n.childLanes=0,n.lanes=s,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=i.childLanes,n.lanes=i.lanes,n.child=i.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=i.memoizedProps,n.memoizedState=i.memoizedState,n.updateQueue=i.updateQueue,n.type=i.type,s=i.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),n}function sc(n,s,i,d,g,y){var j=0;if(d=n,typeof n=="function")qd(n)&&(j=1);else if(typeof n=="string")j=Mj(n,i,se.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case B:return n=Zn(31,i,s,g),n.elementType=B,n.lanes=y,n;case S:return ys(i.children,g,y,s);case k:j=8,g|=24;break;case N:return n=Zn(12,i,s,g|2),n.elementType=N,n.lanes=y,n;case L:return n=Zn(13,i,s,g),n.elementType=L,n.lanes=y,n;case $:return n=Zn(19,i,s,g),n.elementType=$,n.lanes=y,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case E:j=10;break e;case A:j=9;break e;case D:j=11;break e;case z:j=14;break e;case R:j=16,d=null;break e}j=29,i=Error(a(130,n===null?"null":typeof n,"")),d=null}return s=Zn(j,i,s,g),s.elementType=n,s.type=d,s.lanes=y,s}function ys(n,s,i,d){return n=Zn(7,n,d,s),n.lanes=i,n}function Gd(n,s,i){return n=Zn(6,n,null,s),n.lanes=i,n}function Lg(n){var s=Zn(18,null,null,0);return s.stateNode=n,s}function Vd(n,s,i){return s=Zn(4,n.children!==null?n.children:[],n.key,s),s.lanes=i,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}var Dg=new WeakMap;function pr(n,s){if(typeof n=="object"&&n!==null){var i=Dg.get(n);return i!==void 0?i:(s={value:n,source:s,stack:It(s)},Dg.set(n,s),s)}return{value:n,source:s,stack:It(s)}}var ro=[],ao=0,oc=null,si=0,hr=[],mr=0,$a=null,Ur=1,Pr="";function da(n,s){ro[ao++]=si,ro[ao++]=oc,oc=n,si=s}function Og(n,s,i){hr[mr++]=Ur,hr[mr++]=Pr,hr[mr++]=$a,$a=n;var d=Ur;n=Pr;var g=32-Pt(d)-1;d&=~(1<<g),i+=1;var y=32-Pt(s)+g;if(30<y){var j=g-g%5;y=(d&(1<<j)-1).toString(32),d>>=j,g-=j,Ur=1<<32-Pt(s)+g|i<<g|d,Pr=y+n}else Ur=1<<y|i<<g|d,Pr=n}function Yd(n){n.return!==null&&(da(n,1),Og(n,1,0))}function Kd(n){for(;n===oc;)oc=ro[--ao],ro[ao]=null,si=ro[--ao],ro[ao]=null;for(;n===$a;)$a=hr[--mr],hr[mr]=null,Pr=hr[--mr],hr[mr]=null,Ur=hr[--mr],hr[mr]=null}function Mg(n,s){hr[mr++]=Ur,hr[mr++]=Pr,hr[mr++]=$a,Ur=s.id,Pr=s.overflow,$a=n}var xn=null,Mt=null,ut=!1,Ba=null,gr=!1,Xd=Error(a(519));function Ia(n){var s=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw oi(pr(s,n)),Xd}function zg(n){var s=n.stateNode,i=n.type,d=n.memoizedProps;switch(s[je]=n,s[ke]=d,i){case"dialog":ot("cancel",s),ot("close",s);break;case"iframe":case"object":case"embed":ot("load",s);break;case"video":case"audio":for(i=0;i<Ci.length;i++)ot(Ci[i],s);break;case"source":ot("error",s);break;case"img":case"image":case"link":ot("error",s),ot("load",s);break;case"details":ot("toggle",s);break;case"input":ot("invalid",s),Xm(s,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":ot("invalid",s);break;case"textarea":ot("invalid",s),Zm(s,d.value,d.defaultValue,d.children)}i=d.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||s.textContent===""+i||d.suppressHydrationWarning===!0||Wy(s.textContent,i)?(d.popover!=null&&(ot("beforetoggle",s),ot("toggle",s)),d.onScroll!=null&&ot("scroll",s),d.onScrollEnd!=null&&ot("scrollend",s),d.onClick!=null&&(s.onclick=la),s=!0):s=!1,s||Ia(n,!0)}function $g(n){for(xn=n.return;xn;)switch(xn.tag){case 5:case 31:case 13:gr=!1;return;case 27:case 3:gr=!0;return;default:xn=xn.return}}function so(n){if(n!==xn)return!1;if(!ut)return $g(n),ut=!0,!1;var s=n.tag,i;if((i=s!==3&&s!==27)&&((i=s===5)&&(i=n.type,i=!(i!=="form"&&i!=="button")||hp(n.type,n.memoizedProps)),i=!i),i&&Mt&&Ia(n),$g(n),s===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Mt=lb(n)}else if(s===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Mt=lb(n)}else s===27?(s=Mt,Wa(n.type)?(n=bp,bp=null,Mt=n):Mt=s):Mt=xn?yr(n.stateNode.nextSibling):null;return!0}function bs(){Mt=xn=null,ut=!1}function Qd(){var n=Ba;return n!==null&&(Fn===null?Fn=n:Fn.push.apply(Fn,n),Ba=null),n}function oi(n){Ba===null?Ba=[n]:Ba.push(n)}var Zd=O(null),vs=null,fa=null;function Ua(n,s,i){re(Zd,s._currentValue),s._currentValue=i}function pa(n){n._currentValue=Zd.current,V(Zd)}function Jd(n,s,i){for(;n!==null;){var d=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,d!==null&&(d.childLanes|=s)):d!==null&&(d.childLanes&s)!==s&&(d.childLanes|=s),n===i)break;n=n.return}}function Wd(n,s,i,d){var g=n.child;for(g!==null&&(g.return=n);g!==null;){var y=g.dependencies;if(y!==null){var j=g.child;y=y.firstContext;e:for(;y!==null;){var C=y;y=g;for(var U=0;U<s.length;U++)if(C.context===s[U]){y.lanes|=i,C=y.alternate,C!==null&&(C.lanes|=i),Jd(y.return,i,n),d||(j=null);break e}y=C.next}}else if(g.tag===18){if(j=g.return,j===null)throw Error(a(341));j.lanes|=i,y=j.alternate,y!==null&&(y.lanes|=i),Jd(j,i,n),j=null}else j=g.child;if(j!==null)j.return=g;else for(j=g;j!==null;){if(j===n){j=null;break}if(g=j.sibling,g!==null){g.return=j.return,j=g;break}j=j.return}g=j}}function oo(n,s,i,d){n=null;for(var g=s,y=!1;g!==null;){if(!y){if((g.flags&524288)!==0)y=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var j=g.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var C=g.type;Qn(g.pendingProps.value,j.value)||(n!==null?n.push(C):n=[C])}}else if(g===Ne.current){if(j=g.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(n!==null?n.push(Di):n=[Di])}g=g.return}n!==null&&Wd(s,n,i,d),s.flags|=262144}function ic(n){for(n=n.firstContext;n!==null;){if(!Qn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function _s(n){vs=n,fa=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function yn(n){return Bg(vs,n)}function lc(n,s){return vs===null&&_s(n),Bg(n,s)}function Bg(n,s){var i=s._currentValue;if(s={context:s,memoizedValue:i,next:null},fa===null){if(n===null)throw Error(a(308));fa=s,n.dependencies={lanes:0,firstContext:s},n.flags|=524288}else fa=fa.next=s;return i}var TS=typeof AbortController<"u"?AbortController:function(){var n=[],s=this.signal={aborted:!1,addEventListener:function(i,d){n.push(d)}};this.abort=function(){s.aborted=!0,n.forEach(function(i){return i()})}},LS=e.unstable_scheduleCallback,DS=e.unstable_NormalPriority,Wt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ef(){return{controller:new TS,data:new Map,refCount:0}}function ii(n){n.refCount--,n.refCount===0&&LS(DS,function(){n.controller.abort()})}var li=null,tf=0,io=0,lo=null;function OS(n,s){if(li===null){var i=li=[];tf=0,io=sp(),lo={status:"pending",value:void 0,then:function(d){i.push(d)}}}return tf++,s.then(Ig,Ig),s}function Ig(){if(--tf===0&&li!==null){lo!==null&&(lo.status="fulfilled");var n=li;li=null,io=0,lo=null;for(var s=0;s<n.length;s++)(0,n[s])()}}function MS(n,s){var i=[],d={status:"pending",value:null,reason:null,then:function(g){i.push(g)}};return n.then(function(){d.status="fulfilled",d.value=s;for(var g=0;g<i.length;g++)(0,i[g])(s)},function(g){for(d.status="rejected",d.reason=g,g=0;g<i.length;g++)(0,i[g])(void 0)}),d}var Ug=T.S;T.S=function(n,s){Sy=Ht(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&OS(n,s),Ug!==null&&Ug(n,s)};var ws=O(null);function nf(){var n=ws.current;return n!==null?n:jt.pooledCache}function cc(n,s){s===null?re(ws,ws.current):re(ws,s.pool)}function Pg(){var n=nf();return n===null?null:{parent:Wt._currentValue,pool:n}}var co=Error(a(460)),rf=Error(a(474)),uc=Error(a(542)),dc={then:function(){}};function Hg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Fg(n,s,i){switch(i=n[i],i===void 0?n.push(s):i!==s&&(s.then(la,la),s=i),s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,Gg(n),n;default:if(typeof s.status=="string")s.then(la,la);else{if(n=jt,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=s,n.status="pending",n.then(function(d){if(s.status==="pending"){var g=s;g.status="fulfilled",g.value=d}},function(d){if(s.status==="pending"){var g=s;g.status="rejected",g.reason=d}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,Gg(n),n}throw js=s,co}}function Ss(n){try{var s=n._init;return s(n._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(js=i,co):i}}var js=null;function qg(){if(js===null)throw Error(a(459));var n=js;return js=null,n}function Gg(n){if(n===co||n===uc)throw Error(a(483))}var uo=null,ci=0;function fc(n){var s=ci;return ci+=1,uo===null&&(uo=[]),Fg(uo,n,s)}function ui(n,s){s=s.props.ref,n.ref=s!==void 0?s:null}function pc(n,s){throw s.$$typeof===v?Error(a(525)):(n=Object.prototype.toString.call(s),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":n)))}function Vg(n){function s(Y,F){if(n){var K=Y.deletions;K===null?(Y.deletions=[F],Y.flags|=16):K.push(F)}}function i(Y,F){if(!n)return null;for(;F!==null;)s(Y,F),F=F.sibling;return null}function d(Y){for(var F=new Map;Y!==null;)Y.key!==null?F.set(Y.key,Y):F.set(Y.index,Y),Y=Y.sibling;return F}function g(Y,F){return Y=ua(Y,F),Y.index=0,Y.sibling=null,Y}function y(Y,F,K){return Y.index=K,n?(K=Y.alternate,K!==null?(K=K.index,K<F?(Y.flags|=67108866,F):K):(Y.flags|=67108866,F)):(Y.flags|=1048576,F)}function j(Y){return n&&Y.alternate===null&&(Y.flags|=67108866),Y}function C(Y,F,K,de){return F===null||F.tag!==6?(F=Gd(K,Y.mode,de),F.return=Y,F):(F=g(F,K),F.return=Y,F)}function U(Y,F,K,de){var He=K.type;return He===S?ie(Y,F,K.props.children,de,K.key):F!==null&&(F.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===R&&Ss(He)===F.type)?(F=g(F,K.props),ui(F,K),F.return=Y,F):(F=sc(K.type,K.key,K.props,null,Y.mode,de),ui(F,K),F.return=Y,F)}function X(Y,F,K,de){return F===null||F.tag!==4||F.stateNode.containerInfo!==K.containerInfo||F.stateNode.implementation!==K.implementation?(F=Vd(K,Y.mode,de),F.return=Y,F):(F=g(F,K.children||[]),F.return=Y,F)}function ie(Y,F,K,de,He){return F===null||F.tag!==7?(F=ys(K,Y.mode,de,He),F.return=Y,F):(F=g(F,K),F.return=Y,F)}function pe(Y,F,K){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=Gd(""+F,Y.mode,K),F.return=Y,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case _:return K=sc(F.type,F.key,F.props,null,Y.mode,K),ui(K,F),K.return=Y,K;case w:return F=Vd(F,Y.mode,K),F.return=Y,F;case R:return F=Ss(F),pe(Y,F,K)}if(P(F)||oe(F))return F=ys(F,Y.mode,K,null),F.return=Y,F;if(typeof F.then=="function")return pe(Y,fc(F),K);if(F.$$typeof===E)return pe(Y,lc(Y,F),K);pc(Y,F)}return null}function Q(Y,F,K,de){var He=F!==null?F.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return He!==null?null:C(Y,F,""+K,de);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case _:return K.key===He?U(Y,F,K,de):null;case w:return K.key===He?X(Y,F,K,de):null;case R:return K=Ss(K),Q(Y,F,K,de)}if(P(K)||oe(K))return He!==null?null:ie(Y,F,K,de,null);if(typeof K.then=="function")return Q(Y,F,fc(K),de);if(K.$$typeof===E)return Q(Y,F,lc(Y,K),de);pc(Y,K)}return null}function te(Y,F,K,de,He){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return Y=Y.get(K)||null,C(F,Y,""+de,He);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case _:return Y=Y.get(de.key===null?K:de.key)||null,U(F,Y,de,He);case w:return Y=Y.get(de.key===null?K:de.key)||null,X(F,Y,de,He);case R:return de=Ss(de),te(Y,F,K,de,He)}if(P(de)||oe(de))return Y=Y.get(K)||null,ie(F,Y,de,He,null);if(typeof de.then=="function")return te(Y,F,K,fc(de),He);if(de.$$typeof===E)return te(Y,F,K,lc(F,de),He);pc(F,de)}return null}function Te(Y,F,K,de){for(var He=null,pt=null,Me=F,et=F=0,ct=null;Me!==null&&et<K.length;et++){Me.index>et?(ct=Me,Me=null):ct=Me.sibling;var ht=Q(Y,Me,K[et],de);if(ht===null){Me===null&&(Me=ct);break}n&&Me&&ht.alternate===null&&s(Y,Me),F=y(ht,F,et),pt===null?He=ht:pt.sibling=ht,pt=ht,Me=ct}if(et===K.length)return i(Y,Me),ut&&da(Y,et),He;if(Me===null){for(;et<K.length;et++)Me=pe(Y,K[et],de),Me!==null&&(F=y(Me,F,et),pt===null?He=Me:pt.sibling=Me,pt=Me);return ut&&da(Y,et),He}for(Me=d(Me);et<K.length;et++)ct=te(Me,Y,et,K[et],de),ct!==null&&(n&&ct.alternate!==null&&Me.delete(ct.key===null?et:ct.key),F=y(ct,F,et),pt===null?He=ct:pt.sibling=ct,pt=ct);return n&&Me.forEach(function(as){return s(Y,as)}),ut&&da(Y,et),He}function Ye(Y,F,K,de){if(K==null)throw Error(a(151));for(var He=null,pt=null,Me=F,et=F=0,ct=null,ht=K.next();Me!==null&&!ht.done;et++,ht=K.next()){Me.index>et?(ct=Me,Me=null):ct=Me.sibling;var as=Q(Y,Me,ht.value,de);if(as===null){Me===null&&(Me=ct);break}n&&Me&&as.alternate===null&&s(Y,Me),F=y(as,F,et),pt===null?He=as:pt.sibling=as,pt=as,Me=ct}if(ht.done)return i(Y,Me),ut&&da(Y,et),He;if(Me===null){for(;!ht.done;et++,ht=K.next())ht=pe(Y,ht.value,de),ht!==null&&(F=y(ht,F,et),pt===null?He=ht:pt.sibling=ht,pt=ht);return ut&&da(Y,et),He}for(Me=d(Me);!ht.done;et++,ht=K.next())ht=te(Me,Y,et,ht.value,de),ht!==null&&(n&&ht.alternate!==null&&Me.delete(ht.key===null?et:ht.key),F=y(ht,F,et),pt===null?He=ht:pt.sibling=ht,pt=ht);return n&&Me.forEach(function(Vj){return s(Y,Vj)}),ut&&da(Y,et),He}function _t(Y,F,K,de){if(typeof K=="object"&&K!==null&&K.type===S&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case _:e:{for(var He=K.key;F!==null;){if(F.key===He){if(He=K.type,He===S){if(F.tag===7){i(Y,F.sibling),de=g(F,K.props.children),de.return=Y,Y=de;break e}}else if(F.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===R&&Ss(He)===F.type){i(Y,F.sibling),de=g(F,K.props),ui(de,K),de.return=Y,Y=de;break e}i(Y,F);break}else s(Y,F);F=F.sibling}K.type===S?(de=ys(K.props.children,Y.mode,de,K.key),de.return=Y,Y=de):(de=sc(K.type,K.key,K.props,null,Y.mode,de),ui(de,K),de.return=Y,Y=de)}return j(Y);case w:e:{for(He=K.key;F!==null;){if(F.key===He)if(F.tag===4&&F.stateNode.containerInfo===K.containerInfo&&F.stateNode.implementation===K.implementation){i(Y,F.sibling),de=g(F,K.children||[]),de.return=Y,Y=de;break e}else{i(Y,F);break}else s(Y,F);F=F.sibling}de=Vd(K,Y.mode,de),de.return=Y,Y=de}return j(Y);case R:return K=Ss(K),_t(Y,F,K,de)}if(P(K))return Te(Y,F,K,de);if(oe(K)){if(He=oe(K),typeof He!="function")throw Error(a(150));return K=He.call(K),Ye(Y,F,K,de)}if(typeof K.then=="function")return _t(Y,F,fc(K),de);if(K.$$typeof===E)return _t(Y,F,lc(Y,K),de);pc(Y,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,F!==null&&F.tag===6?(i(Y,F.sibling),de=g(F,K),de.return=Y,Y=de):(i(Y,F),de=Gd(K,Y.mode,de),de.return=Y,Y=de),j(Y)):i(Y,F)}return function(Y,F,K,de){try{ci=0;var He=_t(Y,F,K,de);return uo=null,He}catch(Me){if(Me===co||Me===uc)throw Me;var pt=Zn(29,Me,null,Y.mode);return pt.lanes=de,pt.return=Y,pt}}}var ks=Vg(!0),Yg=Vg(!1),Pa=!1;function af(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sf(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Ha(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Fa(n,s,i){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(mt&2)!==0){var g=d.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),d.pending=s,s=ac(n),Rg(n,null,i),s}return rc(n,d,s,i),ac(n)}function di(n,s,i){if(s=s.updateQueue,s!==null&&(s=s.shared,(i&4194048)!==0)){var d=s.lanes;d&=n.pendingLanes,i|=d,s.lanes=i,Ma(n,i)}}function of(n,s){var i=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,i===d)){var g=null,y=null;if(i=i.firstBaseUpdate,i!==null){do{var j={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};y===null?g=y=j:y=y.next=j,i=i.next}while(i!==null);y===null?g=y=s:y=y.next=s}else g=y=s;i={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=s:n.next=s,i.lastBaseUpdate=s}var lf=!1;function fi(){if(lf){var n=lo;if(n!==null)throw n}}function pi(n,s,i,d){lf=!1;var g=n.updateQueue;Pa=!1;var y=g.firstBaseUpdate,j=g.lastBaseUpdate,C=g.shared.pending;if(C!==null){g.shared.pending=null;var U=C,X=U.next;U.next=null,j===null?y=X:j.next=X,j=U;var ie=n.alternate;ie!==null&&(ie=ie.updateQueue,C=ie.lastBaseUpdate,C!==j&&(C===null?ie.firstBaseUpdate=X:C.next=X,ie.lastBaseUpdate=U))}if(y!==null){var pe=g.baseState;j=0,ie=X=U=null,C=y;do{var Q=C.lane&-536870913,te=Q!==C.lane;if(te?(lt&Q)===Q:(d&Q)===Q){Q!==0&&Q===io&&(lf=!0),ie!==null&&(ie=ie.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var Te=n,Ye=C;Q=s;var _t=i;switch(Ye.tag){case 1:if(Te=Ye.payload,typeof Te=="function"){pe=Te.call(_t,pe,Q);break e}pe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Ye.payload,Q=typeof Te=="function"?Te.call(_t,pe,Q):Te,Q==null)break e;pe=x({},pe,Q);break e;case 2:Pa=!0}}Q=C.callback,Q!==null&&(n.flags|=64,te&&(n.flags|=8192),te=g.callbacks,te===null?g.callbacks=[Q]:te.push(Q))}else te={lane:Q,tag:C.tag,payload:C.payload,callback:C.callback,next:null},ie===null?(X=ie=te,U=pe):ie=ie.next=te,j|=Q;if(C=C.next,C===null){if(C=g.shared.pending,C===null)break;te=C,C=te.next,te.next=null,g.lastBaseUpdate=te,g.shared.pending=null}}while(!0);ie===null&&(U=pe),g.baseState=U,g.firstBaseUpdate=X,g.lastBaseUpdate=ie,y===null&&(g.shared.lanes=0),Ka|=j,n.lanes=j,n.memoizedState=pe}}function Kg(n,s){if(typeof n!="function")throw Error(a(191,n));n.call(s)}function Xg(n,s){var i=n.callbacks;if(i!==null)for(n.callbacks=null,n=0;n<i.length;n++)Kg(i[n],s)}var fo=O(null),hc=O(0);function Qg(n,s){n=wa,re(hc,n),re(fo,s),wa=n|s.baseLanes}function cf(){re(hc,wa),re(fo,fo.current)}function uf(){wa=hc.current,V(fo),V(hc)}var Jn=O(null),xr=null;function qa(n){var s=n.alternate;re(Kt,Kt.current&1),re(Jn,n),xr===null&&(s===null||fo.current!==null||s.memoizedState!==null)&&(xr=n)}function df(n){re(Kt,Kt.current),re(Jn,n),xr===null&&(xr=n)}function Zg(n){n.tag===22?(re(Kt,Kt.current),re(Jn,n),xr===null&&(xr=n)):Ga()}function Ga(){re(Kt,Kt.current),re(Jn,Jn.current)}function Wn(n){V(Jn),xr===n&&(xr=null),V(Kt)}var Kt=O(0);function mc(n){for(var s=n;s!==null;){if(s.tag===13){var i=s.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||xp(i)||yp(i)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var ha=0,Je=null,bt=null,en=null,gc=!1,po=!1,Ns=!1,xc=0,hi=0,ho=null,zS=0;function Ft(){throw Error(a(321))}function ff(n,s){if(s===null)return!1;for(var i=0;i<s.length&&i<n.length;i++)if(!Qn(n[i],s[i]))return!1;return!0}function pf(n,s,i,d,g,y){return ha=y,Je=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,T.H=n===null||n.memoizedState===null?Ox:Cf,Ns=!1,y=i(d,g),Ns=!1,po&&(y=Wg(s,i,d,g)),Jg(n),y}function Jg(n){T.H=xi;var s=bt!==null&&bt.next!==null;if(ha=0,en=bt=Je=null,gc=!1,hi=0,ho=null,s)throw Error(a(300));n===null||tn||(n=n.dependencies,n!==null&&ic(n)&&(tn=!0))}function Wg(n,s,i,d){Je=n;var g=0;do{if(po&&(ho=null),hi=0,po=!1,25<=g)throw Error(a(301));if(g+=1,en=bt=null,n.updateQueue!=null){var y=n.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}T.H=Mx,y=s(i,d)}while(po);return y}function $S(){var n=T.H,s=n.useState()[0];return s=typeof s.then=="function"?mi(s):s,n=n.useState()[0],(bt!==null?bt.memoizedState:null)!==n&&(Je.flags|=1024),s}function hf(){var n=xc!==0;return xc=0,n}function mf(n,s,i){s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~i}function gf(n){if(gc){for(n=n.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}gc=!1}ha=0,en=bt=Je=null,po=!1,hi=xc=0,ho=null}function Ln(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?Je.memoizedState=en=n:en=en.next=n,en}function Xt(){if(bt===null){var n=Je.alternate;n=n!==null?n.memoizedState:null}else n=bt.next;var s=en===null?Je.memoizedState:en.next;if(s!==null)en=s,bt=n;else{if(n===null)throw Je.alternate===null?Error(a(467)):Error(a(310));bt=n,n={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},en===null?Je.memoizedState=en=n:en=en.next=n}return en}function yc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function mi(n){var s=hi;return hi+=1,ho===null&&(ho=[]),n=Fg(ho,n,s),s=Je,(en===null?s.memoizedState:en.next)===null&&(s=s.alternate,T.H=s===null||s.memoizedState===null?Ox:Cf),n}function bc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return mi(n);if(n.$$typeof===E)return yn(n)}throw Error(a(438,String(n)))}function xf(n){var s=null,i=Je.updateQueue;if(i!==null&&(s=i.memoCache),s==null){var d=Je.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(s={data:d.data.map(function(g){return g.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),i===null&&(i=yc(),Je.updateQueue=i),i.memoCache=s,i=s.data[s.index],i===void 0)for(i=s.data[s.index]=Array(n),d=0;d<n;d++)i[d]=H;return s.index++,i}function ma(n,s){return typeof s=="function"?s(n):s}function vc(n){var s=Xt();return yf(s,bt,n)}function yf(n,s,i){var d=n.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=i;var g=n.baseQueue,y=d.pending;if(y!==null){if(g!==null){var j=g.next;g.next=y.next,y.next=j}s.baseQueue=g=y,d.pending=null}if(y=n.baseState,g===null)n.memoizedState=y;else{s=g.next;var C=j=null,U=null,X=s,ie=!1;do{var pe=X.lane&-536870913;if(pe!==X.lane?(lt&pe)===pe:(ha&pe)===pe){var Q=X.revertLane;if(Q===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),pe===io&&(ie=!0);else if((ha&Q)===Q){X=X.next,Q===io&&(ie=!0);continue}else pe={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},U===null?(C=U=pe,j=y):U=U.next=pe,Je.lanes|=Q,Ka|=Q;pe=X.action,Ns&&i(y,pe),y=X.hasEagerState?X.eagerState:i(y,pe)}else Q={lane:pe,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},U===null?(C=U=Q,j=y):U=U.next=Q,Je.lanes|=pe,Ka|=pe;X=X.next}while(X!==null&&X!==s);if(U===null?j=y:U.next=C,!Qn(y,n.memoizedState)&&(tn=!0,ie&&(i=lo,i!==null)))throw i;n.memoizedState=y,n.baseState=j,n.baseQueue=U,d.lastRenderedState=y}return g===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function bf(n){var s=Xt(),i=s.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=n;var d=i.dispatch,g=i.pending,y=s.memoizedState;if(g!==null){i.pending=null;var j=g=g.next;do y=n(y,j.action),j=j.next;while(j!==g);Qn(y,s.memoizedState)||(tn=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),i.lastRenderedState=y}return[y,d]}function ex(n,s,i){var d=Je,g=Xt(),y=ut;if(y){if(i===void 0)throw Error(a(407));i=i()}else i=s();var j=!Qn((bt||g).memoizedState,i);if(j&&(g.memoizedState=i,tn=!0),g=g.queue,wf(rx.bind(null,d,g,n),[n]),g.getSnapshot!==s||j||en!==null&&en.memoizedState.tag&1){if(d.flags|=2048,mo(9,{destroy:void 0},nx.bind(null,d,g,i,s),null),jt===null)throw Error(a(349));y||(ha&127)!==0||tx(d,s,i)}return i}function tx(n,s,i){n.flags|=16384,n={getSnapshot:s,value:i},s=Je.updateQueue,s===null?(s=yc(),Je.updateQueue=s,s.stores=[n]):(i=s.stores,i===null?s.stores=[n]:i.push(n))}function nx(n,s,i,d){s.value=i,s.getSnapshot=d,ax(s)&&sx(n)}function rx(n,s,i){return i(function(){ax(s)&&sx(n)})}function ax(n){var s=n.getSnapshot;n=n.value;try{var i=s();return!Qn(n,i)}catch{return!0}}function sx(n){var s=xs(n,2);s!==null&&qn(s,n,2)}function vf(n){var s=Ln();if(typeof n=="function"){var i=n;if(n=i(),Ns){Et(!0);try{i()}finally{Et(!1)}}}return s.memoizedState=s.baseState=n,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:n},s}function ox(n,s,i,d){return n.baseState=i,yf(n,bt,typeof d=="function"?d:ma)}function BS(n,s,i,d,g){if(Sc(n))throw Error(a(485));if(n=s.action,n!==null){var y={payload:g,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){y.listeners.push(j)}};T.T!==null?i(!0):y.isTransition=!1,d(y),i=s.pending,i===null?(y.next=s.pending=y,ix(s,y)):(y.next=i.next,s.pending=i.next=y)}}function ix(n,s){var i=s.action,d=s.payload,g=n.state;if(s.isTransition){var y=T.T,j={};T.T=j;try{var C=i(g,d),U=T.S;U!==null&&U(j,C),lx(n,s,C)}catch(X){_f(n,s,X)}finally{y!==null&&j.types!==null&&(y.types=j.types),T.T=y}}else try{y=i(g,d),lx(n,s,y)}catch(X){_f(n,s,X)}}function lx(n,s,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(d){cx(n,s,d)},function(d){return _f(n,s,d)}):cx(n,s,i)}function cx(n,s,i){s.status="fulfilled",s.value=i,ux(s),n.state=i,s=n.pending,s!==null&&(i=s.next,i===s?n.pending=null:(i=i.next,s.next=i,ix(n,i)))}function _f(n,s,i){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do s.status="rejected",s.reason=i,ux(s),s=s.next;while(s!==d)}n.action=null}function ux(n){n=n.listeners;for(var s=0;s<n.length;s++)(0,n[s])()}function dx(n,s){return s}function fx(n,s){if(ut){var i=jt.formState;if(i!==null){e:{var d=Je;if(ut){if(Mt){t:{for(var g=Mt,y=gr;g.nodeType!==8;){if(!y){g=null;break t}if(g=yr(g.nextSibling),g===null){g=null;break t}}y=g.data,g=y==="F!"||y==="F"?g:null}if(g){Mt=yr(g.nextSibling),d=g.data==="F!";break e}}Ia(d)}d=!1}d&&(s=i[0])}}return i=Ln(),i.memoizedState=i.baseState=s,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dx,lastRenderedState:s},i.queue=d,i=Tx.bind(null,Je,d),d.dispatch=i,d=vf(!1),y=Ef.bind(null,Je,!1,d.queue),d=Ln(),g={state:s,dispatch:null,action:n,pending:null},d.queue=g,i=BS.bind(null,Je,g,y,i),g.dispatch=i,d.memoizedState=n,[s,i,!1]}function px(n){var s=Xt();return hx(s,bt,n)}function hx(n,s,i){if(s=yf(n,s,dx)[0],n=vc(ma)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var d=mi(s)}catch(j){throw j===co?uc:j}else d=s;s=Xt();var g=s.queue,y=g.dispatch;return i!==s.memoizedState&&(Je.flags|=2048,mo(9,{destroy:void 0},IS.bind(null,g,i),null)),[d,y,n]}function IS(n,s){n.action=s}function mx(n){var s=Xt(),i=bt;if(i!==null)return hx(s,i,n);Xt(),s=s.memoizedState,i=Xt();var d=i.queue.dispatch;return i.memoizedState=n,[s,d,!1]}function mo(n,s,i,d){return n={tag:n,create:i,deps:d,inst:s,next:null},s=Je.updateQueue,s===null&&(s=yc(),Je.updateQueue=s),i=s.lastEffect,i===null?s.lastEffect=n.next=n:(d=i.next,i.next=n,n.next=d,s.lastEffect=n),n}function gx(){return Xt().memoizedState}function _c(n,s,i,d){var g=Ln();Je.flags|=n,g.memoizedState=mo(1|s,{destroy:void 0},i,d===void 0?null:d)}function wc(n,s,i,d){var g=Xt();d=d===void 0?null:d;var y=g.memoizedState.inst;bt!==null&&d!==null&&ff(d,bt.memoizedState.deps)?g.memoizedState=mo(s,y,i,d):(Je.flags|=n,g.memoizedState=mo(1|s,y,i,d))}function xx(n,s){_c(8390656,8,n,s)}function wf(n,s){wc(2048,8,n,s)}function US(n){Je.flags|=4;var s=Je.updateQueue;if(s===null)s=yc(),Je.updateQueue=s,s.events=[n];else{var i=s.events;i===null?s.events=[n]:i.push(n)}}function yx(n){var s=Xt().memoizedState;return US({ref:s,nextImpl:n}),function(){if((mt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}function bx(n,s){return wc(4,2,n,s)}function vx(n,s){return wc(4,4,n,s)}function _x(n,s){if(typeof s=="function"){n=n();var i=s(n);return function(){typeof i=="function"?i():s(null)}}if(s!=null)return n=n(),s.current=n,function(){s.current=null}}function wx(n,s,i){i=i!=null?i.concat([n]):null,wc(4,4,_x.bind(null,s,n),i)}function Sf(){}function Sx(n,s){var i=Xt();s=s===void 0?null:s;var d=i.memoizedState;return s!==null&&ff(s,d[1])?d[0]:(i.memoizedState=[n,s],n)}function jx(n,s){var i=Xt();s=s===void 0?null:s;var d=i.memoizedState;if(s!==null&&ff(s,d[1]))return d[0];if(d=n(),Ns){Et(!0);try{n()}finally{Et(!1)}}return i.memoizedState=[d,s],d}function jf(n,s,i){return i===void 0||(ha&1073741824)!==0&&(lt&261930)===0?n.memoizedState=s:(n.memoizedState=i,n=ky(),Je.lanes|=n,Ka|=n,i)}function kx(n,s,i,d){return Qn(i,s)?i:fo.current!==null?(n=jf(n,i,d),Qn(n,s)||(tn=!0),n):(ha&42)===0||(ha&1073741824)!==0&&(lt&261930)===0?(tn=!0,n.memoizedState=i):(n=ky(),Je.lanes|=n,Ka|=n,s)}function Nx(n,s,i,d,g){var y=q.p;q.p=y!==0&&8>y?y:8;var j=T.T,C={};T.T=C,Ef(n,!1,s,i);try{var U=g(),X=T.S;if(X!==null&&X(C,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ie=MS(U,d);gi(n,s,ie,nr(n))}else gi(n,s,d,nr(n))}catch(pe){gi(n,s,{then:function(){},status:"rejected",reason:pe},nr())}finally{q.p=y,j!==null&&C.types!==null&&(j.types=C.types),T.T=j}}function PS(){}function kf(n,s,i,d){if(n.tag!==5)throw Error(a(476));var g=Ex(n).queue;Nx(n,g,s,ee,i===null?PS:function(){return Cx(n),i(d)})}function Ex(n){var s=n.memoizedState;if(s!==null)return s;s={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:ee},next:null};var i={};return s.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:i},next:null},n.memoizedState=s,n=n.alternate,n!==null&&(n.memoizedState=s),s}function Cx(n){var s=Ex(n);s.next===null&&(s=n.alternate.memoizedState),gi(n,s.next.queue,{},nr())}function Nf(){return yn(Di)}function Ax(){return Xt().memoizedState}function Rx(){return Xt().memoizedState}function HS(n){for(var s=n.return;s!==null;){switch(s.tag){case 24:case 3:var i=nr();n=Ha(i);var d=Fa(s,n,i);d!==null&&(qn(d,s,i),di(d,s,i)),s={cache:ef()},n.payload=s;return}s=s.return}}function FS(n,s,i){var d=nr();i={lane:d,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Sc(n)?Lx(s,i):(i=Fd(n,s,i,d),i!==null&&(qn(i,n,d),Dx(i,s,d)))}function Tx(n,s,i){var d=nr();gi(n,s,i,d)}function gi(n,s,i,d){var g={lane:d,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Sc(n))Lx(s,g);else{var y=n.alternate;if(n.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var j=s.lastRenderedState,C=y(j,i);if(g.hasEagerState=!0,g.eagerState=C,Qn(C,j))return rc(n,s,g,0),jt===null&&nc(),!1}catch{}if(i=Fd(n,s,g,d),i!==null)return qn(i,n,d),Dx(i,s,d),!0}return!1}function Ef(n,s,i,d){if(d={lane:2,revertLane:sp(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Sc(n)){if(s)throw Error(a(479))}else s=Fd(n,i,d,2),s!==null&&qn(s,n,2)}function Sc(n){var s=n.alternate;return n===Je||s!==null&&s===Je}function Lx(n,s){po=gc=!0;var i=n.pending;i===null?s.next=s:(s.next=i.next,i.next=s),n.pending=s}function Dx(n,s,i){if((i&4194048)!==0){var d=s.lanes;d&=n.pendingLanes,i|=d,s.lanes=i,Ma(n,i)}}var xi={readContext:yn,use:bc,useCallback:Ft,useContext:Ft,useEffect:Ft,useImperativeHandle:Ft,useLayoutEffect:Ft,useInsertionEffect:Ft,useMemo:Ft,useReducer:Ft,useRef:Ft,useState:Ft,useDebugValue:Ft,useDeferredValue:Ft,useTransition:Ft,useSyncExternalStore:Ft,useId:Ft,useHostTransitionStatus:Ft,useFormState:Ft,useActionState:Ft,useOptimistic:Ft,useMemoCache:Ft,useCacheRefresh:Ft};xi.useEffectEvent=Ft;var Ox={readContext:yn,use:bc,useCallback:function(n,s){return Ln().memoizedState=[n,s===void 0?null:s],n},useContext:yn,useEffect:xx,useImperativeHandle:function(n,s,i){i=i!=null?i.concat([n]):null,_c(4194308,4,_x.bind(null,s,n),i)},useLayoutEffect:function(n,s){return _c(4194308,4,n,s)},useInsertionEffect:function(n,s){_c(4,2,n,s)},useMemo:function(n,s){var i=Ln();s=s===void 0?null:s;var d=n();if(Ns){Et(!0);try{n()}finally{Et(!1)}}return i.memoizedState=[d,s],d},useReducer:function(n,s,i){var d=Ln();if(i!==void 0){var g=i(s);if(Ns){Et(!0);try{i(s)}finally{Et(!1)}}}else g=s;return d.memoizedState=d.baseState=g,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:g},d.queue=n,n=n.dispatch=FS.bind(null,Je,n),[d.memoizedState,n]},useRef:function(n){var s=Ln();return n={current:n},s.memoizedState=n},useState:function(n){n=vf(n);var s=n.queue,i=Tx.bind(null,Je,s);return s.dispatch=i,[n.memoizedState,i]},useDebugValue:Sf,useDeferredValue:function(n,s){var i=Ln();return jf(i,n,s)},useTransition:function(){var n=vf(!1);return n=Nx.bind(null,Je,n.queue,!0,!1),Ln().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,s,i){var d=Je,g=Ln();if(ut){if(i===void 0)throw Error(a(407));i=i()}else{if(i=s(),jt===null)throw Error(a(349));(lt&127)!==0||tx(d,s,i)}g.memoizedState=i;var y={value:i,getSnapshot:s};return g.queue=y,xx(rx.bind(null,d,y,n),[n]),d.flags|=2048,mo(9,{destroy:void 0},nx.bind(null,d,y,i,s),null),i},useId:function(){var n=Ln(),s=jt.identifierPrefix;if(ut){var i=Pr,d=Ur;i=(d&~(1<<32-Pt(d)-1)).toString(32)+i,s="_"+s+"R_"+i,i=xc++,0<i&&(s+="H"+i.toString(32)),s+="_"}else i=zS++,s="_"+s+"r_"+i.toString(32)+"_";return n.memoizedState=s},useHostTransitionStatus:Nf,useFormState:fx,useActionState:fx,useOptimistic:function(n){var s=Ln();s.memoizedState=s.baseState=n;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=i,s=Ef.bind(null,Je,!0,i),i.dispatch=s,[n,s]},useMemoCache:xf,useCacheRefresh:function(){return Ln().memoizedState=HS.bind(null,Je)},useEffectEvent:function(n){var s=Ln(),i={impl:n};return s.memoizedState=i,function(){if((mt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}},Cf={readContext:yn,use:bc,useCallback:Sx,useContext:yn,useEffect:wf,useImperativeHandle:wx,useInsertionEffect:bx,useLayoutEffect:vx,useMemo:jx,useReducer:vc,useRef:gx,useState:function(){return vc(ma)},useDebugValue:Sf,useDeferredValue:function(n,s){var i=Xt();return kx(i,bt.memoizedState,n,s)},useTransition:function(){var n=vc(ma)[0],s=Xt().memoizedState;return[typeof n=="boolean"?n:mi(n),s]},useSyncExternalStore:ex,useId:Ax,useHostTransitionStatus:Nf,useFormState:px,useActionState:px,useOptimistic:function(n,s){var i=Xt();return ox(i,bt,n,s)},useMemoCache:xf,useCacheRefresh:Rx};Cf.useEffectEvent=yx;var Mx={readContext:yn,use:bc,useCallback:Sx,useContext:yn,useEffect:wf,useImperativeHandle:wx,useInsertionEffect:bx,useLayoutEffect:vx,useMemo:jx,useReducer:bf,useRef:gx,useState:function(){return bf(ma)},useDebugValue:Sf,useDeferredValue:function(n,s){var i=Xt();return bt===null?jf(i,n,s):kx(i,bt.memoizedState,n,s)},useTransition:function(){var n=bf(ma)[0],s=Xt().memoizedState;return[typeof n=="boolean"?n:mi(n),s]},useSyncExternalStore:ex,useId:Ax,useHostTransitionStatus:Nf,useFormState:mx,useActionState:mx,useOptimistic:function(n,s){var i=Xt();return bt!==null?ox(i,bt,n,s):(i.baseState=n,[n,i.queue.dispatch])},useMemoCache:xf,useCacheRefresh:Rx};Mx.useEffectEvent=yx;function Af(n,s,i,d){s=n.memoizedState,i=i(d,s),i=i==null?s:x({},s,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var Rf={enqueueSetState:function(n,s,i){n=n._reactInternals;var d=nr(),g=Ha(d);g.payload=s,i!=null&&(g.callback=i),s=Fa(n,g,d),s!==null&&(qn(s,n,d),di(s,n,d))},enqueueReplaceState:function(n,s,i){n=n._reactInternals;var d=nr(),g=Ha(d);g.tag=1,g.payload=s,i!=null&&(g.callback=i),s=Fa(n,g,d),s!==null&&(qn(s,n,d),di(s,n,d))},enqueueForceUpdate:function(n,s){n=n._reactInternals;var i=nr(),d=Ha(i);d.tag=2,s!=null&&(d.callback=s),s=Fa(n,d,i),s!==null&&(qn(s,n,i),di(s,n,i))}};function zx(n,s,i,d,g,y,j){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,y,j):s.prototype&&s.prototype.isPureReactComponent?!ri(i,d)||!ri(g,y):!0}function $x(n,s,i,d){n=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(i,d),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(i,d),s.state!==n&&Rf.enqueueReplaceState(s,s.state,null)}function Es(n,s){var i=s;if("ref"in s){i={};for(var d in s)d!=="ref"&&(i[d]=s[d])}if(n=n.defaultProps){i===s&&(i=x({},i));for(var g in n)i[g]===void 0&&(i[g]=n[g])}return i}function Bx(n){tc(n)}function Ix(n){console.error(n)}function Ux(n){tc(n)}function jc(n,s){try{var i=n.onUncaughtError;i(s.value,{componentStack:s.stack})}catch(d){setTimeout(function(){throw d})}}function Px(n,s,i){try{var d=n.onCaughtError;d(i.value,{componentStack:i.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Tf(n,s,i){return i=Ha(i),i.tag=3,i.payload={element:null},i.callback=function(){jc(n,s)},i}function Hx(n){return n=Ha(n),n.tag=3,n}function Fx(n,s,i,d){var g=i.type.getDerivedStateFromError;if(typeof g=="function"){var y=d.value;n.payload=function(){return g(y)},n.callback=function(){Px(s,i,d)}}var j=i.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){Px(s,i,d),typeof g!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var C=d.stack;this.componentDidCatch(d.value,{componentStack:C!==null?C:""})})}function qS(n,s,i,d,g){if(i.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(s=i.alternate,s!==null&&oo(s,i,g,!0),i=Jn.current,i!==null){switch(i.tag){case 31:case 13:return xr===null?zc():i.alternate===null&&qt===0&&(qt=3),i.flags&=-257,i.flags|=65536,i.lanes=g,d===dc?i.flags|=16384:(s=i.updateQueue,s===null?i.updateQueue=new Set([d]):s.add(d),np(n,d,g)),!1;case 22:return i.flags|=65536,d===dc?i.flags|=16384:(s=i.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([d])},i.updateQueue=s):(i=s.retryQueue,i===null?s.retryQueue=new Set([d]):i.add(d)),np(n,d,g)),!1}throw Error(a(435,i.tag))}return np(n,d,g),zc(),!1}if(ut)return s=Jn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=g,d!==Xd&&(n=Error(a(422),{cause:d}),oi(pr(n,i)))):(d!==Xd&&(s=Error(a(423),{cause:d}),oi(pr(s,i))),n=n.current.alternate,n.flags|=65536,g&=-g,n.lanes|=g,d=pr(d,i),g=Tf(n.stateNode,d,g),of(n,g),qt!==4&&(qt=2)),!1;var y=Error(a(520),{cause:d});if(y=pr(y,i),ki===null?ki=[y]:ki.push(y),qt!==4&&(qt=2),s===null)return!0;d=pr(d,i),i=s;do{switch(i.tag){case 3:return i.flags|=65536,n=g&-g,i.lanes|=n,n=Tf(i.stateNode,d,n),of(i,n),!1;case 1:if(s=i.type,y=i.stateNode,(i.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Xa===null||!Xa.has(y))))return i.flags|=65536,g&=-g,i.lanes|=g,g=Hx(g),Fx(g,n,i,d),of(i,g),!1}i=i.return}while(i!==null);return!1}var Lf=Error(a(461)),tn=!1;function bn(n,s,i,d){s.child=n===null?Yg(s,null,i,d):ks(s,n.child,i,d)}function qx(n,s,i,d,g){i=i.render;var y=s.ref;if("ref"in d){var j={};for(var C in d)C!=="ref"&&(j[C]=d[C])}else j=d;return _s(s),d=pf(n,s,i,j,y,g),C=hf(),n!==null&&!tn?(mf(n,s,g),ga(n,s,g)):(ut&&C&&Yd(s),s.flags|=1,bn(n,s,d,g),s.child)}function Gx(n,s,i,d,g){if(n===null){var y=i.type;return typeof y=="function"&&!qd(y)&&y.defaultProps===void 0&&i.compare===null?(s.tag=15,s.type=y,Vx(n,s,y,d,g)):(n=sc(i.type,null,d,s,s.mode,g),n.ref=s.ref,n.return=s,s.child=n)}if(y=n.child,!Uf(n,g)){var j=y.memoizedProps;if(i=i.compare,i=i!==null?i:ri,i(j,d)&&n.ref===s.ref)return ga(n,s,g)}return s.flags|=1,n=ua(y,d),n.ref=s.ref,n.return=s,s.child=n}function Vx(n,s,i,d,g){if(n!==null){var y=n.memoizedProps;if(ri(y,d)&&n.ref===s.ref)if(tn=!1,s.pendingProps=d=y,Uf(n,g))(n.flags&131072)!==0&&(tn=!0);else return s.lanes=n.lanes,ga(n,s,g)}return Df(n,s,i,d,g)}function Yx(n,s,i,d){var g=d.children,y=n!==null?n.memoizedState:null;if(n===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((s.flags&128)!==0){if(y=y!==null?y.baseLanes|i:i,n!==null){for(d=s.child=n.child,g=0;d!==null;)g=g|d.lanes|d.childLanes,d=d.sibling;d=g&~y}else d=0,s.child=null;return Kx(n,s,y,i,d)}if((i&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},n!==null&&cc(s,y!==null?y.cachePool:null),y!==null?Qg(s,y):cf(),Zg(s);else return d=s.lanes=536870912,Kx(n,s,y!==null?y.baseLanes|i:i,i,d)}else y!==null?(cc(s,y.cachePool),Qg(s,y),Ga(),s.memoizedState=null):(n!==null&&cc(s,null),cf(),Ga());return bn(n,s,g,i),s.child}function yi(n,s){return n!==null&&n.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Kx(n,s,i,d,g){var y=nf();return y=y===null?null:{parent:Wt._currentValue,pool:y},s.memoizedState={baseLanes:i,cachePool:y},n!==null&&cc(s,null),cf(),Zg(s),n!==null&&oo(n,s,d,!0),s.childLanes=g,null}function kc(n,s){return s=Ec({mode:s.mode,children:s.children},n.mode),s.ref=n.ref,n.child=s,s.return=n,s}function Xx(n,s,i){return ks(s,n.child,null,i),n=kc(s,s.pendingProps),n.flags|=2,Wn(s),s.memoizedState=null,n}function GS(n,s,i){var d=s.pendingProps,g=(s.flags&128)!==0;if(s.flags&=-129,n===null){if(ut){if(d.mode==="hidden")return n=kc(s,d),s.lanes=536870912,yi(null,n);if(df(s),(n=Mt)?(n=ib(n,gr),n=n!==null&&n.data==="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:$a!==null?{id:Ur,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},i=Lg(n),i.return=s,s.child=i,xn=s,Mt=null)):n=null,n===null)throw Ia(s);return s.lanes=536870912,null}return kc(s,d)}var y=n.memoizedState;if(y!==null){var j=y.dehydrated;if(df(s),g)if(s.flags&256)s.flags&=-257,s=Xx(n,s,i);else if(s.memoizedState!==null)s.child=n.child,s.flags|=128,s=null;else throw Error(a(558));else if(tn||oo(n,s,i,!1),g=(i&n.childLanes)!==0,tn||g){if(d=jt,d!==null&&(j=I(d,i),j!==0&&j!==y.retryLane))throw y.retryLane=j,xs(n,j),qn(d,n,j),Lf;zc(),s=Xx(n,s,i)}else n=y.treeContext,Mt=yr(j.nextSibling),xn=s,ut=!0,Ba=null,gr=!1,n!==null&&Mg(s,n),s=kc(s,d),s.flags|=4096;return s}return n=ua(n.child,{mode:d.mode,children:d.children}),n.ref=s.ref,s.child=n,n.return=s,n}function Nc(n,s){var i=s.ref;if(i===null)n!==null&&n.ref!==null&&(s.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(a(284));(n===null||n.ref!==i)&&(s.flags|=4194816)}}function Df(n,s,i,d,g){return _s(s),i=pf(n,s,i,d,void 0,g),d=hf(),n!==null&&!tn?(mf(n,s,g),ga(n,s,g)):(ut&&d&&Yd(s),s.flags|=1,bn(n,s,i,g),s.child)}function Qx(n,s,i,d,g,y){return _s(s),s.updateQueue=null,i=Wg(s,d,i,g),Jg(n),d=hf(),n!==null&&!tn?(mf(n,s,y),ga(n,s,y)):(ut&&d&&Yd(s),s.flags|=1,bn(n,s,i,y),s.child)}function Zx(n,s,i,d,g){if(_s(s),s.stateNode===null){var y=no,j=i.contextType;typeof j=="object"&&j!==null&&(y=yn(j)),y=new i(d,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Rf,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=d,y.state=s.memoizedState,y.refs={},af(s),j=i.contextType,y.context=typeof j=="object"&&j!==null?yn(j):no,y.state=s.memoizedState,j=i.getDerivedStateFromProps,typeof j=="function"&&(Af(s,i,j,d),y.state=s.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(j=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),j!==y.state&&Rf.enqueueReplaceState(y,y.state,null),pi(s,d,y,g),fi(),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308),d=!0}else if(n===null){y=s.stateNode;var C=s.memoizedProps,U=Es(i,C);y.props=U;var X=y.context,ie=i.contextType;j=no,typeof ie=="object"&&ie!==null&&(j=yn(ie));var pe=i.getDerivedStateFromProps;ie=typeof pe=="function"||typeof y.getSnapshotBeforeUpdate=="function",C=s.pendingProps!==C,ie||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(C||X!==j)&&$x(s,y,d,j),Pa=!1;var Q=s.memoizedState;y.state=Q,pi(s,d,y,g),fi(),X=s.memoizedState,C||Q!==X||Pa?(typeof pe=="function"&&(Af(s,i,pe,d),X=s.memoizedState),(U=Pa||zx(s,i,U,d,Q,X,j))?(ie||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(s.flags|=4194308)):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=d,s.memoizedState=X),y.props=d,y.state=X,y.context=j,d=U):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),d=!1)}else{y=s.stateNode,sf(n,s),j=s.memoizedProps,ie=Es(i,j),y.props=ie,pe=s.pendingProps,Q=y.context,X=i.contextType,U=no,typeof X=="object"&&X!==null&&(U=yn(X)),C=i.getDerivedStateFromProps,(X=typeof C=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(j!==pe||Q!==U)&&$x(s,y,d,U),Pa=!1,Q=s.memoizedState,y.state=Q,pi(s,d,y,g),fi();var te=s.memoizedState;j!==pe||Q!==te||Pa||n!==null&&n.dependencies!==null&&ic(n.dependencies)?(typeof C=="function"&&(Af(s,i,C,d),te=s.memoizedState),(ie=Pa||zx(s,i,ie,d,Q,te,U)||n!==null&&n.dependencies!==null&&ic(n.dependencies))?(X||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,te,U),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,te,U)),typeof y.componentDidUpdate=="function"&&(s.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof y.componentDidUpdate!="function"||j===n.memoizedProps&&Q===n.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&Q===n.memoizedState||(s.flags|=1024),s.memoizedProps=d,s.memoizedState=te),y.props=d,y.state=te,y.context=U,d=ie):(typeof y.componentDidUpdate!="function"||j===n.memoizedProps&&Q===n.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&Q===n.memoizedState||(s.flags|=1024),d=!1)}return y=d,Nc(n,s),d=(s.flags&128)!==0,y||d?(y=s.stateNode,i=d&&typeof i.getDerivedStateFromError!="function"?null:y.render(),s.flags|=1,n!==null&&d?(s.child=ks(s,n.child,null,g),s.child=ks(s,null,i,g)):bn(n,s,i,g),s.memoizedState=y.state,n=s.child):n=ga(n,s,g),n}function Jx(n,s,i,d){return bs(),s.flags|=256,bn(n,s,i,d),s.child}var Of={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mf(n){return{baseLanes:n,cachePool:Pg()}}function zf(n,s,i){return n=n!==null?n.childLanes&~i:0,s&&(n|=tr),n}function Wx(n,s,i){var d=s.pendingProps,g=!1,y=(s.flags&128)!==0,j;if((j=y)||(j=n!==null&&n.memoizedState===null?!1:(Kt.current&2)!==0),j&&(g=!0,s.flags&=-129),j=(s.flags&32)!==0,s.flags&=-33,n===null){if(ut){if(g?qa(s):Ga(),(n=Mt)?(n=ib(n,gr),n=n!==null&&n.data!=="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:$a!==null?{id:Ur,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},i=Lg(n),i.return=s,s.child=i,xn=s,Mt=null)):n=null,n===null)throw Ia(s);return yp(n)?s.lanes=32:s.lanes=536870912,null}var C=d.children;return d=d.fallback,g?(Ga(),g=s.mode,C=Ec({mode:"hidden",children:C},g),d=ys(d,g,i,null),C.return=s,d.return=s,C.sibling=d,s.child=C,d=s.child,d.memoizedState=Mf(i),d.childLanes=zf(n,j,i),s.memoizedState=Of,yi(null,d)):(qa(s),$f(s,C))}var U=n.memoizedState;if(U!==null&&(C=U.dehydrated,C!==null)){if(y)s.flags&256?(qa(s),s.flags&=-257,s=Bf(n,s,i)):s.memoizedState!==null?(Ga(),s.child=n.child,s.flags|=128,s=null):(Ga(),C=d.fallback,g=s.mode,d=Ec({mode:"visible",children:d.children},g),C=ys(C,g,i,null),C.flags|=2,d.return=s,C.return=s,d.sibling=C,s.child=d,ks(s,n.child,null,i),d=s.child,d.memoizedState=Mf(i),d.childLanes=zf(n,j,i),s.memoizedState=Of,s=yi(null,d));else if(qa(s),yp(C)){if(j=C.nextSibling&&C.nextSibling.dataset,j)var X=j.dgst;j=X,d=Error(a(419)),d.stack="",d.digest=j,oi({value:d,source:null,stack:null}),s=Bf(n,s,i)}else if(tn||oo(n,s,i,!1),j=(i&n.childLanes)!==0,tn||j){if(j=jt,j!==null&&(d=I(j,i),d!==0&&d!==U.retryLane))throw U.retryLane=d,xs(n,d),qn(j,n,d),Lf;xp(C)||zc(),s=Bf(n,s,i)}else xp(C)?(s.flags|=192,s.child=n.child,s=null):(n=U.treeContext,Mt=yr(C.nextSibling),xn=s,ut=!0,Ba=null,gr=!1,n!==null&&Mg(s,n),s=$f(s,d.children),s.flags|=4096);return s}return g?(Ga(),C=d.fallback,g=s.mode,U=n.child,X=U.sibling,d=ua(U,{mode:"hidden",children:d.children}),d.subtreeFlags=U.subtreeFlags&65011712,X!==null?C=ua(X,C):(C=ys(C,g,i,null),C.flags|=2),C.return=s,d.return=s,d.sibling=C,s.child=d,yi(null,d),d=s.child,C=n.child.memoizedState,C===null?C=Mf(i):(g=C.cachePool,g!==null?(U=Wt._currentValue,g=g.parent!==U?{parent:U,pool:U}:g):g=Pg(),C={baseLanes:C.baseLanes|i,cachePool:g}),d.memoizedState=C,d.childLanes=zf(n,j,i),s.memoizedState=Of,yi(n.child,d)):(qa(s),i=n.child,n=i.sibling,i=ua(i,{mode:"visible",children:d.children}),i.return=s,i.sibling=null,n!==null&&(j=s.deletions,j===null?(s.deletions=[n],s.flags|=16):j.push(n)),s.child=i,s.memoizedState=null,i)}function $f(n,s){return s=Ec({mode:"visible",children:s},n.mode),s.return=n,n.child=s}function Ec(n,s){return n=Zn(22,n,null,s),n.lanes=0,n}function Bf(n,s,i){return ks(s,n.child,null,i),n=$f(s,s.pendingProps.children),n.flags|=2,s.memoizedState=null,n}function ey(n,s,i){n.lanes|=s;var d=n.alternate;d!==null&&(d.lanes|=s),Jd(n.return,s,i)}function If(n,s,i,d,g,y){var j=n.memoizedState;j===null?n.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:d,tail:i,tailMode:g,treeForkCount:y}:(j.isBackwards=s,j.rendering=null,j.renderingStartTime=0,j.last=d,j.tail=i,j.tailMode=g,j.treeForkCount=y)}function ty(n,s,i){var d=s.pendingProps,g=d.revealOrder,y=d.tail;d=d.children;var j=Kt.current,C=(j&2)!==0;if(C?(j=j&1|2,s.flags|=128):j&=1,re(Kt,j),bn(n,s,d,i),d=ut?si:0,!C&&n!==null&&(n.flags&128)!==0)e:for(n=s.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&ey(n,i,s);else if(n.tag===19)ey(n,i,s);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===s)break e;for(;n.sibling===null;){if(n.return===null||n.return===s)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(g){case"forwards":for(i=s.child,g=null;i!==null;)n=i.alternate,n!==null&&mc(n)===null&&(g=i),i=i.sibling;i=g,i===null?(g=s.child,s.child=null):(g=i.sibling,i.sibling=null),If(s,!1,g,i,y,d);break;case"backwards":case"unstable_legacy-backwards":for(i=null,g=s.child,s.child=null;g!==null;){if(n=g.alternate,n!==null&&mc(n)===null){s.child=g;break}n=g.sibling,g.sibling=i,i=g,g=n}If(s,!0,i,null,y,d);break;case"together":If(s,!1,null,null,void 0,d);break;default:s.memoizedState=null}return s.child}function ga(n,s,i){if(n!==null&&(s.dependencies=n.dependencies),Ka|=s.lanes,(i&s.childLanes)===0)if(n!==null){if(oo(n,s,i,!1),(i&s.childLanes)===0)return null}else return null;if(n!==null&&s.child!==n.child)throw Error(a(153));if(s.child!==null){for(n=s.child,i=ua(n,n.pendingProps),s.child=i,i.return=s;n.sibling!==null;)n=n.sibling,i=i.sibling=ua(n,n.pendingProps),i.return=s;i.sibling=null}return s.child}function Uf(n,s){return(n.lanes&s)!==0?!0:(n=n.dependencies,!!(n!==null&&ic(n)))}function VS(n,s,i){switch(s.tag){case 3:qe(s,s.stateNode.containerInfo),Ua(s,Wt,n.memoizedState.cache),bs();break;case 27:case 5:be(s);break;case 4:qe(s,s.stateNode.containerInfo);break;case 10:Ua(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,df(s),null;break;case 13:var d=s.memoizedState;if(d!==null)return d.dehydrated!==null?(qa(s),s.flags|=128,null):(i&s.child.childLanes)!==0?Wx(n,s,i):(qa(s),n=ga(n,s,i),n!==null?n.sibling:null);qa(s);break;case 19:var g=(n.flags&128)!==0;if(d=(i&s.childLanes)!==0,d||(oo(n,s,i,!1),d=(i&s.childLanes)!==0),g){if(d)return ty(n,s,i);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),re(Kt,Kt.current),d)break;return null;case 22:return s.lanes=0,Yx(n,s,i,s.pendingProps);case 24:Ua(s,Wt,n.memoizedState.cache)}return ga(n,s,i)}function ny(n,s,i){if(n!==null)if(n.memoizedProps!==s.pendingProps)tn=!0;else{if(!Uf(n,i)&&(s.flags&128)===0)return tn=!1,VS(n,s,i);tn=(n.flags&131072)!==0}else tn=!1,ut&&(s.flags&1048576)!==0&&Og(s,si,s.index);switch(s.lanes=0,s.tag){case 16:e:{var d=s.pendingProps;if(n=Ss(s.elementType),s.type=n,typeof n=="function")qd(n)?(d=Es(n,d),s.tag=1,s=Zx(null,s,n,d,i)):(s.tag=0,s=Df(null,s,n,d,i));else{if(n!=null){var g=n.$$typeof;if(g===D){s.tag=11,s=qx(null,s,n,d,i);break e}else if(g===z){s.tag=14,s=Gx(null,s,n,d,i);break e}}throw s=M(n)||n,Error(a(306,s,""))}}return s;case 0:return Df(n,s,s.type,s.pendingProps,i);case 1:return d=s.type,g=Es(d,s.pendingProps),Zx(n,s,d,g,i);case 3:e:{if(qe(s,s.stateNode.containerInfo),n===null)throw Error(a(387));d=s.pendingProps;var y=s.memoizedState;g=y.element,sf(n,s),pi(s,d,null,i);var j=s.memoizedState;if(d=j.cache,Ua(s,Wt,d),d!==y.cache&&Wd(s,[Wt],i,!0),fi(),d=j.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:j.cache},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){s=Jx(n,s,d,i);break e}else if(d!==g){g=pr(Error(a(424)),s),oi(g),s=Jx(n,s,d,i);break e}else for(n=s.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,Mt=yr(n.firstChild),xn=s,ut=!0,Ba=null,gr=!0,i=Yg(s,null,d,i),s.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(bs(),d===g){s=ga(n,s,i);break e}bn(n,s,d,i)}s=s.child}return s;case 26:return Nc(n,s),n===null?(i=pb(s.type,null,s.pendingProps,null))?s.memoizedState=i:ut||(i=s.type,n=s.pendingProps,d=Fc(ge.current).createElement(i),d[je]=s,d[ke]=n,vn(d,i,n),it(d),s.stateNode=d):s.memoizedState=pb(s.type,n.memoizedProps,s.pendingProps,n.memoizedState),null;case 27:return be(s),n===null&&ut&&(d=s.stateNode=ub(s.type,s.pendingProps,ge.current),xn=s,gr=!0,g=Mt,Wa(s.type)?(bp=g,Mt=yr(d.firstChild)):Mt=g),bn(n,s,s.pendingProps.children,i),Nc(n,s),n===null&&(s.flags|=4194304),s.child;case 5:return n===null&&ut&&((g=d=Mt)&&(d=wj(d,s.type,s.pendingProps,gr),d!==null?(s.stateNode=d,xn=s,Mt=yr(d.firstChild),gr=!1,g=!0):g=!1),g||Ia(s)),be(s),g=s.type,y=s.pendingProps,j=n!==null?n.memoizedProps:null,d=y.children,hp(g,y)?d=null:j!==null&&hp(g,j)&&(s.flags|=32),s.memoizedState!==null&&(g=pf(n,s,$S,null,null,i),Di._currentValue=g),Nc(n,s),bn(n,s,d,i),s.child;case 6:return n===null&&ut&&((n=i=Mt)&&(i=Sj(i,s.pendingProps,gr),i!==null?(s.stateNode=i,xn=s,Mt=null,n=!0):n=!1),n||Ia(s)),null;case 13:return Wx(n,s,i);case 4:return qe(s,s.stateNode.containerInfo),d=s.pendingProps,n===null?s.child=ks(s,null,d,i):bn(n,s,d,i),s.child;case 11:return qx(n,s,s.type,s.pendingProps,i);case 7:return bn(n,s,s.pendingProps,i),s.child;case 8:return bn(n,s,s.pendingProps.children,i),s.child;case 12:return bn(n,s,s.pendingProps.children,i),s.child;case 10:return d=s.pendingProps,Ua(s,s.type,d.value),bn(n,s,d.children,i),s.child;case 9:return g=s.type._context,d=s.pendingProps.children,_s(s),g=yn(g),d=d(g),s.flags|=1,bn(n,s,d,i),s.child;case 14:return Gx(n,s,s.type,s.pendingProps,i);case 15:return Vx(n,s,s.type,s.pendingProps,i);case 19:return ty(n,s,i);case 31:return GS(n,s,i);case 22:return Yx(n,s,i,s.pendingProps);case 24:return _s(s),d=yn(Wt),n===null?(g=nf(),g===null&&(g=jt,y=ef(),g.pooledCache=y,y.refCount++,y!==null&&(g.pooledCacheLanes|=i),g=y),s.memoizedState={parent:d,cache:g},af(s),Ua(s,Wt,g)):((n.lanes&i)!==0&&(sf(n,s),pi(s,null,null,i),fi()),g=n.memoizedState,y=s.memoizedState,g.parent!==d?(g={parent:d,cache:d},s.memoizedState=g,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=g),Ua(s,Wt,d)):(d=y.cache,Ua(s,Wt,d),d!==g.cache&&Wd(s,[Wt],i,!0))),bn(n,s,s.pendingProps.children,i),s.child;case 29:throw s.pendingProps}throw Error(a(156,s.tag))}function xa(n){n.flags|=4}function Pf(n,s,i,d,g){if((s=(n.mode&32)!==0)&&(s=!1),s){if(n.flags|=16777216,(g&335544128)===g)if(n.stateNode.complete)n.flags|=8192;else if(Ay())n.flags|=8192;else throw js=dc,rf}else n.flags&=-16777217}function ry(n,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!yb(s))if(Ay())n.flags|=8192;else throw js=dc,rf}function Cc(n,s){s!==null&&(n.flags|=4),n.flags&16384&&(s=n.tag!==22?oa():536870912,n.lanes|=s,bo|=s)}function bi(n,s){if(!ut)switch(n.tailMode){case"hidden":s=n.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var d=null;i!==null;)i.alternate!==null&&(d=i),i=i.sibling;d===null?s||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function zt(n){var s=n.alternate!==null&&n.alternate.child===n.child,i=0,d=0;if(s)for(var g=n.child;g!==null;)i|=g.lanes|g.childLanes,d|=g.subtreeFlags&65011712,d|=g.flags&65011712,g.return=n,g=g.sibling;else for(g=n.child;g!==null;)i|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=n,g=g.sibling;return n.subtreeFlags|=d,n.childLanes=i,s}function YS(n,s,i){var d=s.pendingProps;switch(Kd(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(s),null;case 1:return zt(s),null;case 3:return i=s.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),pa(Wt),Fe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(so(s)?xa(s):n===null||n.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Qd())),zt(s),null;case 26:var g=s.type,y=s.memoizedState;return n===null?(xa(s),y!==null?(zt(s),ry(s,y)):(zt(s),Pf(s,g,null,d,i))):y?y!==n.memoizedState?(xa(s),zt(s),ry(s,y)):(zt(s),s.flags&=-16777217):(n=n.memoizedProps,n!==d&&xa(s),zt(s),Pf(s,g,n,d,i)),null;case 27:if(fe(s),i=ge.current,g=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==d&&xa(s);else{if(!d){if(s.stateNode===null)throw Error(a(166));return zt(s),null}n=se.current,so(s)?zg(s):(n=ub(g,d,i),s.stateNode=n,xa(s))}return zt(s),null;case 5:if(fe(s),g=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==d&&xa(s);else{if(!d){if(s.stateNode===null)throw Error(a(166));return zt(s),null}if(y=se.current,so(s))zg(s);else{var j=Fc(ge.current);switch(y){case 1:y=j.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:y=j.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":y=j.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":y=j.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":y=j.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof d.is=="string"?j.createElement("select",{is:d.is}):j.createElement("select"),d.multiple?y.multiple=!0:d.size&&(y.size=d.size);break;default:y=typeof d.is=="string"?j.createElement(g,{is:d.is}):j.createElement(g)}}y[je]=s,y[ke]=d;e:for(j=s.child;j!==null;){if(j.tag===5||j.tag===6)y.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===s)break e;for(;j.sibling===null;){if(j.return===null||j.return===s)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}s.stateNode=y;e:switch(vn(y,g,d),g){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&xa(s)}}return zt(s),Pf(s,s.type,n===null?null:n.memoizedProps,s.pendingProps,i),null;case 6:if(n&&s.stateNode!=null)n.memoizedProps!==d&&xa(s);else{if(typeof d!="string"&&s.stateNode===null)throw Error(a(166));if(n=ge.current,so(s)){if(n=s.stateNode,i=s.memoizedProps,d=null,g=xn,g!==null)switch(g.tag){case 27:case 5:d=g.memoizedProps}n[je]=s,n=!!(n.nodeValue===i||d!==null&&d.suppressHydrationWarning===!0||Wy(n.nodeValue,i)),n||Ia(s,!0)}else n=Fc(n).createTextNode(d),n[je]=s,s.stateNode=n}return zt(s),null;case 31:if(i=s.memoizedState,n===null||n.memoizedState!==null){if(d=so(s),i!==null){if(n===null){if(!d)throw Error(a(318));if(n=s.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[je]=s}else bs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;zt(s),n=!1}else i=Qd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=i),n=!0;if(!n)return s.flags&256?(Wn(s),s):(Wn(s),null);if((s.flags&128)!==0)throw Error(a(558))}return zt(s),null;case 13:if(d=s.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(g=so(s),d!==null&&d.dehydrated!==null){if(n===null){if(!g)throw Error(a(318));if(g=s.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(a(317));g[je]=s}else bs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;zt(s),g=!1}else g=Qd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=g),g=!0;if(!g)return s.flags&256?(Wn(s),s):(Wn(s),null)}return Wn(s),(s.flags&128)!==0?(s.lanes=i,s):(i=d!==null,n=n!==null&&n.memoizedState!==null,i&&(d=s.child,g=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(g=d.alternate.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==g&&(d.flags|=2048)),i!==n&&i&&(s.child.flags|=8192),Cc(s,s.updateQueue),zt(s),null);case 4:return Fe(),n===null&&cp(s.stateNode.containerInfo),zt(s),null;case 10:return pa(s.type),zt(s),null;case 19:if(V(Kt),d=s.memoizedState,d===null)return zt(s),null;if(g=(s.flags&128)!==0,y=d.rendering,y===null)if(g)bi(d,!1);else{if(qt!==0||n!==null&&(n.flags&128)!==0)for(n=s.child;n!==null;){if(y=mc(n),y!==null){for(s.flags|=128,bi(d,!1),n=y.updateQueue,s.updateQueue=n,Cc(s,n),s.subtreeFlags=0,n=i,i=s.child;i!==null;)Tg(i,n),i=i.sibling;return re(Kt,Kt.current&1|2),ut&&da(s,d.treeForkCount),s.child}n=n.sibling}d.tail!==null&&Ht()>Dc&&(s.flags|=128,g=!0,bi(d,!1),s.lanes=4194304)}else{if(!g)if(n=mc(y),n!==null){if(s.flags|=128,g=!0,n=n.updateQueue,s.updateQueue=n,Cc(s,n),bi(d,!0),d.tail===null&&d.tailMode==="hidden"&&!y.alternate&&!ut)return zt(s),null}else 2*Ht()-d.renderingStartTime>Dc&&i!==536870912&&(s.flags|=128,g=!0,bi(d,!1),s.lanes=4194304);d.isBackwards?(y.sibling=s.child,s.child=y):(n=d.last,n!==null?n.sibling=y:s.child=y,d.last=y)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=Ht(),n.sibling=null,i=Kt.current,re(Kt,g?i&1|2:i&1),ut&&da(s,d.treeForkCount),n):(zt(s),null);case 22:case 23:return Wn(s),uf(),d=s.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(s.flags|=8192):d&&(s.flags|=8192),d?(i&536870912)!==0&&(s.flags&128)===0&&(zt(s),s.subtreeFlags&6&&(s.flags|=8192)):zt(s),i=s.updateQueue,i!==null&&Cc(s,i.retryQueue),i=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==i&&(s.flags|=2048),n!==null&&V(ws),null;case 24:return i=null,n!==null&&(i=n.memoizedState.cache),s.memoizedState.cache!==i&&(s.flags|=2048),pa(Wt),zt(s),null;case 25:return null;case 30:return null}throw Error(a(156,s.tag))}function KS(n,s){switch(Kd(s),s.tag){case 1:return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return pa(Wt),Fe(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 26:case 27:case 5:return fe(s),null;case 31:if(s.memoizedState!==null){if(Wn(s),s.alternate===null)throw Error(a(340));bs()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 13:if(Wn(s),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(a(340));bs()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return V(Kt),null;case 4:return Fe(),null;case 10:return pa(s.type),null;case 22:case 23:return Wn(s),uf(),n!==null&&V(ws),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 24:return pa(Wt),null;case 25:return null;default:return null}}function ay(n,s){switch(Kd(s),s.tag){case 3:pa(Wt),Fe();break;case 26:case 27:case 5:fe(s);break;case 4:Fe();break;case 31:s.memoizedState!==null&&Wn(s);break;case 13:Wn(s);break;case 19:V(Kt);break;case 10:pa(s.type);break;case 22:case 23:Wn(s),uf(),n!==null&&V(ws);break;case 24:pa(Wt)}}function vi(n,s){try{var i=s.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var g=d.next;i=g;do{if((i.tag&n)===n){d=void 0;var y=i.create,j=i.inst;d=y(),j.destroy=d}i=i.next}while(i!==g)}}catch(C){yt(s,s.return,C)}}function Va(n,s,i){try{var d=s.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var y=g.next;d=y;do{if((d.tag&n)===n){var j=d.inst,C=j.destroy;if(C!==void 0){j.destroy=void 0,g=s;var U=i,X=C;try{X()}catch(ie){yt(g,U,ie)}}}d=d.next}while(d!==y)}}catch(ie){yt(s,s.return,ie)}}function sy(n){var s=n.updateQueue;if(s!==null){var i=n.stateNode;try{Xg(s,i)}catch(d){yt(n,n.return,d)}}}function oy(n,s,i){i.props=Es(n.type,n.memoizedProps),i.state=n.memoizedState;try{i.componentWillUnmount()}catch(d){yt(n,s,d)}}function _i(n,s){try{var i=n.ref;if(i!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof i=="function"?n.refCleanup=i(d):i.current=d}}catch(g){yt(n,s,g)}}function Hr(n,s){var i=n.ref,d=n.refCleanup;if(i!==null)if(typeof d=="function")try{d()}catch(g){yt(n,s,g)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(g){yt(n,s,g)}else i.current=null}function iy(n){var s=n.type,i=n.memoizedProps,d=n.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":i.autoFocus&&d.focus();break e;case"img":i.src?d.src=i.src:i.srcSet&&(d.srcset=i.srcSet)}}catch(g){yt(n,n.return,g)}}function Hf(n,s,i){try{var d=n.stateNode;gj(d,n.type,i,s),d[ke]=s}catch(g){yt(n,n.return,g)}}function ly(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Wa(n.type)||n.tag===4}function Ff(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||ly(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Wa(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function qf(n,s,i){var d=n.tag;if(d===5||d===6)n=n.stateNode,s?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(n,s):(s=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,s.appendChild(n),i=i._reactRootContainer,i!=null||s.onclick!==null||(s.onclick=la));else if(d!==4&&(d===27&&Wa(n.type)&&(i=n.stateNode,s=null),n=n.child,n!==null))for(qf(n,s,i),n=n.sibling;n!==null;)qf(n,s,i),n=n.sibling}function Ac(n,s,i){var d=n.tag;if(d===5||d===6)n=n.stateNode,s?i.insertBefore(n,s):i.appendChild(n);else if(d!==4&&(d===27&&Wa(n.type)&&(i=n.stateNode),n=n.child,n!==null))for(Ac(n,s,i),n=n.sibling;n!==null;)Ac(n,s,i),n=n.sibling}function cy(n){var s=n.stateNode,i=n.memoizedProps;try{for(var d=n.type,g=s.attributes;g.length;)s.removeAttributeNode(g[0]);vn(s,d,i),s[je]=n,s[ke]=i}catch(y){yt(n,n.return,y)}}var ya=!1,nn=!1,Gf=!1,uy=typeof WeakSet=="function"?WeakSet:Set,fn=null;function XS(n,s){if(n=n.containerInfo,fp=Qc,n=wg(n),$d(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var d=i.getSelection&&i.getSelection();if(d&&d.rangeCount!==0){i=d.anchorNode;var g=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{i.nodeType,y.nodeType}catch{i=null;break e}var j=0,C=-1,U=-1,X=0,ie=0,pe=n,Q=null;t:for(;;){for(var te;pe!==i||g!==0&&pe.nodeType!==3||(C=j+g),pe!==y||d!==0&&pe.nodeType!==3||(U=j+d),pe.nodeType===3&&(j+=pe.nodeValue.length),(te=pe.firstChild)!==null;)Q=pe,pe=te;for(;;){if(pe===n)break t;if(Q===i&&++X===g&&(C=j),Q===y&&++ie===d&&(U=j),(te=pe.nextSibling)!==null)break;pe=Q,Q=pe.parentNode}pe=te}i=C===-1||U===-1?null:{start:C,end:U}}else i=null}i=i||{start:0,end:0}}else i=null;for(pp={focusedElem:n,selectionRange:i},Qc=!1,fn=s;fn!==null;)if(s=fn,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,fn=n;else for(;fn!==null;){switch(s=fn,y=s.alternate,n=s.flags,s.tag){case 0:if((n&4)!==0&&(n=s.updateQueue,n=n!==null?n.events:null,n!==null))for(i=0;i<n.length;i++)g=n[i],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&y!==null){n=void 0,i=s,g=y.memoizedProps,y=y.memoizedState,d=i.stateNode;try{var Te=Es(i.type,g);n=d.getSnapshotBeforeUpdate(Te,y),d.__reactInternalSnapshotBeforeUpdate=n}catch(Ye){yt(i,i.return,Ye)}}break;case 3:if((n&1024)!==0){if(n=s.stateNode.containerInfo,i=n.nodeType,i===9)gp(n);else if(i===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":gp(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=s.sibling,n!==null){n.return=s.return,fn=n;break}fn=s.return}}function dy(n,s,i){var d=i.flags;switch(i.tag){case 0:case 11:case 15:va(n,i),d&4&&vi(5,i);break;case 1:if(va(n,i),d&4)if(n=i.stateNode,s===null)try{n.componentDidMount()}catch(j){yt(i,i.return,j)}else{var g=Es(i.type,s.memoizedProps);s=s.memoizedState;try{n.componentDidUpdate(g,s,n.__reactInternalSnapshotBeforeUpdate)}catch(j){yt(i,i.return,j)}}d&64&&sy(i),d&512&&_i(i,i.return);break;case 3:if(va(n,i),d&64&&(n=i.updateQueue,n!==null)){if(s=null,i.child!==null)switch(i.child.tag){case 27:case 5:s=i.child.stateNode;break;case 1:s=i.child.stateNode}try{Xg(n,s)}catch(j){yt(i,i.return,j)}}break;case 27:s===null&&d&4&&cy(i);case 26:case 5:va(n,i),s===null&&d&4&&iy(i),d&512&&_i(i,i.return);break;case 12:va(n,i);break;case 31:va(n,i),d&4&&hy(n,i);break;case 13:va(n,i),d&4&&my(n,i),d&64&&(n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(i=aj.bind(null,i),jj(n,i))));break;case 22:if(d=i.memoizedState!==null||ya,!d){s=s!==null&&s.memoizedState!==null||nn,g=ya;var y=nn;ya=d,(nn=s)&&!y?_a(n,i,(i.subtreeFlags&8772)!==0):va(n,i),ya=g,nn=y}break;case 30:break;default:va(n,i)}}function fy(n){var s=n.alternate;s!==null&&(n.alternate=null,fy(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&&Ee(s)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Ut=null,Un=!1;function ba(n,s,i){for(i=i.child;i!==null;)py(n,s,i),i=i.sibling}function py(n,s,i){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(gn,i)}catch{}switch(i.tag){case 26:nn||Hr(i,s),ba(n,s,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:nn||Hr(i,s);var d=Ut,g=Un;Wa(i.type)&&(Ut=i.stateNode,Un=!1),ba(n,s,i),Ri(i.stateNode),Ut=d,Un=g;break;case 5:nn||Hr(i,s);case 6:if(d=Ut,g=Un,Ut=null,ba(n,s,i),Ut=d,Un=g,Ut!==null)if(Un)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(i.stateNode)}catch(y){yt(i,s,y)}else try{Ut.removeChild(i.stateNode)}catch(y){yt(i,s,y)}break;case 18:Ut!==null&&(Un?(n=Ut,sb(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,i.stateNode),Eo(n)):sb(Ut,i.stateNode));break;case 4:d=Ut,g=Un,Ut=i.stateNode.containerInfo,Un=!0,ba(n,s,i),Ut=d,Un=g;break;case 0:case 11:case 14:case 15:Va(2,i,s),nn||Va(4,i,s),ba(n,s,i);break;case 1:nn||(Hr(i,s),d=i.stateNode,typeof d.componentWillUnmount=="function"&&oy(i,s,d)),ba(n,s,i);break;case 21:ba(n,s,i);break;case 22:nn=(d=nn)||i.memoizedState!==null,ba(n,s,i),nn=d;break;default:ba(n,s,i)}}function hy(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Eo(n)}catch(i){yt(s,s.return,i)}}}function my(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Eo(n)}catch(i){yt(s,s.return,i)}}function QS(n){switch(n.tag){case 31:case 13:case 19:var s=n.stateNode;return s===null&&(s=n.stateNode=new uy),s;case 22:return n=n.stateNode,s=n._retryCache,s===null&&(s=n._retryCache=new uy),s;default:throw Error(a(435,n.tag))}}function Rc(n,s){var i=QS(n);s.forEach(function(d){if(!i.has(d)){i.add(d);var g=sj.bind(null,n,d);d.then(g,g)}})}function Pn(n,s){var i=s.deletions;if(i!==null)for(var d=0;d<i.length;d++){var g=i[d],y=n,j=s,C=j;e:for(;C!==null;){switch(C.tag){case 27:if(Wa(C.type)){Ut=C.stateNode,Un=!1;break e}break;case 5:Ut=C.stateNode,Un=!1;break e;case 3:case 4:Ut=C.stateNode.containerInfo,Un=!0;break e}C=C.return}if(Ut===null)throw Error(a(160));py(y,j,g),Ut=null,Un=!1,y=g.alternate,y!==null&&(y.return=null),g.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)gy(s,n),s=s.sibling}var Ar=null;function gy(n,s){var i=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Pn(s,n),Hn(n),d&4&&(Va(3,n,n.return),vi(3,n),Va(5,n,n.return));break;case 1:Pn(s,n),Hn(n),d&512&&(nn||i===null||Hr(i,i.return)),d&64&&ya&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(i=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=i===null?d:i.concat(d))));break;case 26:var g=Ar;if(Pn(s,n),Hn(n),d&512&&(nn||i===null||Hr(i,i.return)),d&4){var y=i!==null?i.memoizedState:null;if(d=n.memoizedState,i===null)if(d===null)if(n.stateNode===null){e:{d=n.type,i=n.memoizedProps,g=g.ownerDocument||g;t:switch(d){case"title":y=g.getElementsByTagName("title")[0],(!y||y[ue]||y[je]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=g.createElement(d),g.head.insertBefore(y,g.querySelector("head > title"))),vn(y,d,i),y[je]=n,it(y),d=y;break e;case"link":var j=gb("link","href",g).get(d+(i.href||""));if(j){for(var C=0;C<j.length;C++)if(y=j[C],y.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&y.getAttribute("rel")===(i.rel==null?null:i.rel)&&y.getAttribute("title")===(i.title==null?null:i.title)&&y.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){j.splice(C,1);break t}}y=g.createElement(d),vn(y,d,i),g.head.appendChild(y);break;case"meta":if(j=gb("meta","content",g).get(d+(i.content||""))){for(C=0;C<j.length;C++)if(y=j[C],y.getAttribute("content")===(i.content==null?null:""+i.content)&&y.getAttribute("name")===(i.name==null?null:i.name)&&y.getAttribute("property")===(i.property==null?null:i.property)&&y.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&y.getAttribute("charset")===(i.charSet==null?null:i.charSet)){j.splice(C,1);break t}}y=g.createElement(d),vn(y,d,i),g.head.appendChild(y);break;default:throw Error(a(468,d))}y[je]=n,it(y),d=y}n.stateNode=d}else xb(g,n.type,n.stateNode);else n.stateNode=mb(g,d,n.memoizedProps);else y!==d?(y===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):y.count--,d===null?xb(g,n.type,n.stateNode):mb(g,d,n.memoizedProps)):d===null&&n.stateNode!==null&&Hf(n,n.memoizedProps,i.memoizedProps)}break;case 27:Pn(s,n),Hn(n),d&512&&(nn||i===null||Hr(i,i.return)),i!==null&&d&4&&Hf(n,n.memoizedProps,i.memoizedProps);break;case 5:if(Pn(s,n),Hn(n),d&512&&(nn||i===null||Hr(i,i.return)),n.flags&32){g=n.stateNode;try{Xs(g,"")}catch(Te){yt(n,n.return,Te)}}d&4&&n.stateNode!=null&&(g=n.memoizedProps,Hf(n,g,i!==null?i.memoizedProps:g)),d&1024&&(Gf=!0);break;case 6:if(Pn(s,n),Hn(n),d&4){if(n.stateNode===null)throw Error(a(162));d=n.memoizedProps,i=n.stateNode;try{i.nodeValue=d}catch(Te){yt(n,n.return,Te)}}break;case 3:if(Vc=null,g=Ar,Ar=qc(s.containerInfo),Pn(s,n),Ar=g,Hn(n),d&4&&i!==null&&i.memoizedState.isDehydrated)try{Eo(s.containerInfo)}catch(Te){yt(n,n.return,Te)}Gf&&(Gf=!1,xy(n));break;case 4:d=Ar,Ar=qc(n.stateNode.containerInfo),Pn(s,n),Hn(n),Ar=d;break;case 12:Pn(s,n),Hn(n);break;case 31:Pn(s,n),Hn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Rc(n,d)));break;case 13:Pn(s,n),Hn(n),n.child.flags&8192&&n.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Lc=Ht()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Rc(n,d)));break;case 22:g=n.memoizedState!==null;var U=i!==null&&i.memoizedState!==null,X=ya,ie=nn;if(ya=X||g,nn=ie||U,Pn(s,n),nn=ie,ya=X,Hn(n),d&8192)e:for(s=n.stateNode,s._visibility=g?s._visibility&-2:s._visibility|1,g&&(i===null||U||ya||nn||Cs(n)),i=null,s=n;;){if(s.tag===5||s.tag===26){if(i===null){U=i=s;try{if(y=U.stateNode,g)j=y.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{C=U.stateNode;var pe=U.memoizedProps.style,Q=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;C.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(Te){yt(U,U.return,Te)}}}else if(s.tag===6){if(i===null){U=s;try{U.stateNode.nodeValue=g?"":U.memoizedProps}catch(Te){yt(U,U.return,Te)}}}else if(s.tag===18){if(i===null){U=s;try{var te=U.stateNode;g?ob(te,!0):ob(U.stateNode,!1)}catch(Te){yt(U,U.return,Te)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===n)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break e;for(;s.sibling===null;){if(s.return===null||s.return===n)break e;i===s&&(i=null),s=s.return}i===s&&(i=null),s.sibling.return=s.return,s=s.sibling}d&4&&(d=n.updateQueue,d!==null&&(i=d.retryQueue,i!==null&&(d.retryQueue=null,Rc(n,i))));break;case 19:Pn(s,n),Hn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Rc(n,d)));break;case 30:break;case 21:break;default:Pn(s,n),Hn(n)}}function Hn(n){var s=n.flags;if(s&2){try{for(var i,d=n.return;d!==null;){if(ly(d)){i=d;break}d=d.return}if(i==null)throw Error(a(160));switch(i.tag){case 27:var g=i.stateNode,y=Ff(n);Ac(n,y,g);break;case 5:var j=i.stateNode;i.flags&32&&(Xs(j,""),i.flags&=-33);var C=Ff(n);Ac(n,C,j);break;case 3:case 4:var U=i.stateNode.containerInfo,X=Ff(n);qf(n,X,U);break;default:throw Error(a(161))}}catch(ie){yt(n,n.return,ie)}n.flags&=-3}s&4096&&(n.flags&=-4097)}function xy(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var s=n;xy(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),n=n.sibling}}function va(n,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)dy(n,s.alternate,s),s=s.sibling}function Cs(n){for(n=n.child;n!==null;){var s=n;switch(s.tag){case 0:case 11:case 14:case 15:Va(4,s,s.return),Cs(s);break;case 1:Hr(s,s.return);var i=s.stateNode;typeof i.componentWillUnmount=="function"&&oy(s,s.return,i),Cs(s);break;case 27:Ri(s.stateNode);case 26:case 5:Hr(s,s.return),Cs(s);break;case 22:s.memoizedState===null&&Cs(s);break;case 30:Cs(s);break;default:Cs(s)}n=n.sibling}}function _a(n,s,i){for(i=i&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var d=s.alternate,g=n,y=s,j=y.flags;switch(y.tag){case 0:case 11:case 15:_a(g,y,i),vi(4,y);break;case 1:if(_a(g,y,i),d=y,g=d.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(X){yt(d,d.return,X)}if(d=y,g=d.updateQueue,g!==null){var C=d.stateNode;try{var U=g.shared.hiddenCallbacks;if(U!==null)for(g.shared.hiddenCallbacks=null,g=0;g<U.length;g++)Kg(U[g],C)}catch(X){yt(d,d.return,X)}}i&&j&64&&sy(y),_i(y,y.return);break;case 27:cy(y);case 26:case 5:_a(g,y,i),i&&d===null&&j&4&&iy(y),_i(y,y.return);break;case 12:_a(g,y,i);break;case 31:_a(g,y,i),i&&j&4&&hy(g,y);break;case 13:_a(g,y,i),i&&j&4&&my(g,y);break;case 22:y.memoizedState===null&&_a(g,y,i),_i(y,y.return);break;case 30:break;default:_a(g,y,i)}s=s.sibling}}function Vf(n,s){var i=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==i&&(n!=null&&n.refCount++,i!=null&&ii(i))}function Yf(n,s){n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&ii(n))}function Rr(n,s,i,d){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)yy(n,s,i,d),s=s.sibling}function yy(n,s,i,d){var g=s.flags;switch(s.tag){case 0:case 11:case 15:Rr(n,s,i,d),g&2048&&vi(9,s);break;case 1:Rr(n,s,i,d);break;case 3:Rr(n,s,i,d),g&2048&&(n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&ii(n)));break;case 12:if(g&2048){Rr(n,s,i,d),n=s.stateNode;try{var y=s.memoizedProps,j=y.id,C=y.onPostCommit;typeof C=="function"&&C(j,s.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(U){yt(s,s.return,U)}}else Rr(n,s,i,d);break;case 31:Rr(n,s,i,d);break;case 13:Rr(n,s,i,d);break;case 23:break;case 22:y=s.stateNode,j=s.alternate,s.memoizedState!==null?y._visibility&2?Rr(n,s,i,d):wi(n,s):y._visibility&2?Rr(n,s,i,d):(y._visibility|=2,go(n,s,i,d,(s.subtreeFlags&10256)!==0||!1)),g&2048&&Vf(j,s);break;case 24:Rr(n,s,i,d),g&2048&&Yf(s.alternate,s);break;default:Rr(n,s,i,d)}}function go(n,s,i,d,g){for(g=g&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var y=n,j=s,C=i,U=d,X=j.flags;switch(j.tag){case 0:case 11:case 15:go(y,j,C,U,g),vi(8,j);break;case 23:break;case 22:var ie=j.stateNode;j.memoizedState!==null?ie._visibility&2?go(y,j,C,U,g):wi(y,j):(ie._visibility|=2,go(y,j,C,U,g)),g&&X&2048&&Vf(j.alternate,j);break;case 24:go(y,j,C,U,g),g&&X&2048&&Yf(j.alternate,j);break;default:go(y,j,C,U,g)}s=s.sibling}}function wi(n,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var i=n,d=s,g=d.flags;switch(d.tag){case 22:wi(i,d),g&2048&&Vf(d.alternate,d);break;case 24:wi(i,d),g&2048&&Yf(d.alternate,d);break;default:wi(i,d)}s=s.sibling}}var Si=8192;function xo(n,s,i){if(n.subtreeFlags&Si)for(n=n.child;n!==null;)by(n,s,i),n=n.sibling}function by(n,s,i){switch(n.tag){case 26:xo(n,s,i),n.flags&Si&&n.memoizedState!==null&&zj(i,Ar,n.memoizedState,n.memoizedProps);break;case 5:xo(n,s,i);break;case 3:case 4:var d=Ar;Ar=qc(n.stateNode.containerInfo),xo(n,s,i),Ar=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=Si,Si=16777216,xo(n,s,i),Si=d):xo(n,s,i));break;default:xo(n,s,i)}}function vy(n){var s=n.alternate;if(s!==null&&(n=s.child,n!==null)){s.child=null;do s=n.sibling,n.sibling=null,n=s;while(n!==null)}}function ji(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var i=0;i<s.length;i++){var d=s[i];fn=d,wy(d,n)}vy(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)_y(n),n=n.sibling}function _y(n){switch(n.tag){case 0:case 11:case 15:ji(n),n.flags&2048&&Va(9,n,n.return);break;case 3:ji(n);break;case 12:ji(n);break;case 22:var s=n.stateNode;n.memoizedState!==null&&s._visibility&2&&(n.return===null||n.return.tag!==13)?(s._visibility&=-3,Tc(n)):ji(n);break;default:ji(n)}}function Tc(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var i=0;i<s.length;i++){var d=s[i];fn=d,wy(d,n)}vy(n)}for(n=n.child;n!==null;){switch(s=n,s.tag){case 0:case 11:case 15:Va(8,s,s.return),Tc(s);break;case 22:i=s.stateNode,i._visibility&2&&(i._visibility&=-3,Tc(s));break;default:Tc(s)}n=n.sibling}}function wy(n,s){for(;fn!==null;){var i=fn;switch(i.tag){case 0:case 11:case 15:Va(8,i,s);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var d=i.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:ii(i.memoizedState.cache)}if(d=i.child,d!==null)d.return=i,fn=d;else e:for(i=n;fn!==null;){d=fn;var g=d.sibling,y=d.return;if(fy(d),d===i){fn=null;break e}if(g!==null){g.return=y,fn=g;break e}fn=y}}}var ZS={getCacheForType:function(n){var s=yn(Wt),i=s.data.get(n);return i===void 0&&(i=n(),s.data.set(n,i)),i},cacheSignal:function(){return yn(Wt).controller.signal}},JS=typeof WeakMap=="function"?WeakMap:Map,mt=0,jt=null,st=null,lt=0,xt=0,er=null,Ya=!1,yo=!1,Kf=!1,wa=0,qt=0,Ka=0,As=0,Xf=0,tr=0,bo=0,ki=null,Fn=null,Qf=!1,Lc=0,Sy=0,Dc=1/0,Oc=null,Xa=null,sn=0,Qa=null,vo=null,Sa=0,Zf=0,Jf=null,jy=null,Ni=0,Wf=null;function nr(){return(mt&2)!==0&<!==0?lt&-lt:T.T!==null?sp():xe()}function ky(){if(tr===0)if((lt&536870912)===0||ut){var n=Ue;Ue<<=1,(Ue&3932160)===0&&(Ue=262144),tr=n}else tr=536870912;return n=Jn.current,n!==null&&(n.flags|=32),tr}function qn(n,s,i){(n===jt&&(xt===2||xt===9)||n.cancelPendingCommit!==null)&&(_o(n,0),Za(n,lt,tr,!1)),Tn(n,i),((mt&2)===0||n!==jt)&&(n===jt&&((mt&2)===0&&(As|=i),qt===4&&Za(n,lt,tr,!1)),Fr(n))}function Ny(n,s,i){if((mt&6)!==0)throw Error(a(327));var d=!i&&(s&127)===0&&(s&n.expiredLanes)===0||Dt(n,s),g=d?tj(n,s):tp(n,s,!0),y=d;do{if(g===0){yo&&!d&&Za(n,s,0,!1);break}else{if(i=n.current.alternate,y&&!WS(i)){g=tp(n,s,!1),y=!1;continue}if(g===2){if(y=s,n.errorRecoveryDisabledLanes&y)var j=0;else j=n.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){s=j;e:{var C=n;g=ki;var U=C.current.memoizedState.isDehydrated;if(U&&(_o(C,j).flags|=256),j=tp(C,j,!1),j!==2){if(Kf&&!U){C.errorRecoveryDisabledLanes|=y,As|=y,g=4;break e}y=Fn,Fn=g,y!==null&&(Fn===null?Fn=y:Fn.push.apply(Fn,y))}g=j}if(y=!1,g!==2)continue}}if(g===1){_o(n,0),Za(n,s,0,!0);break}e:{switch(d=n,y=g,y){case 0:case 1:throw Error(a(345));case 4:if((s&4194048)!==s)break;case 6:Za(d,s,tr,!Ya);break e;case 2:Fn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((s&62914560)===s&&(g=Lc+300-Ht(),10<g)){if(Za(d,s,tr,!Ya),Ct(d,0,!0)!==0)break e;Sa=s,d.timeoutHandle=rb(Ey.bind(null,d,i,Fn,Oc,Qf,s,tr,As,bo,Ya,y,"Throttled",-0,0),g);break e}Ey(d,i,Fn,Oc,Qf,s,tr,As,bo,Ya,y,null,-0,0)}}break}while(!0);Fr(n)}function Ey(n,s,i,d,g,y,j,C,U,X,ie,pe,Q,te){if(n.timeoutHandle=-1,pe=s.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:la},by(s,y,pe);var Te=(y&62914560)===y?Lc-Ht():(y&4194048)===y?Sy-Ht():0;if(Te=$j(pe,Te),Te!==null){Sa=y,n.cancelPendingCommit=Te(My.bind(null,n,s,y,i,d,g,j,C,U,ie,pe,null,Q,te)),Za(n,y,j,!X);return}}My(n,s,y,i,d,g,j,C,U)}function WS(n){for(var s=n;;){var i=s.tag;if((i===0||i===11||i===15)&&s.flags&16384&&(i=s.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var d=0;d<i.length;d++){var g=i[d],y=g.getSnapshot;g=g.value;try{if(!Qn(y(),g))return!1}catch{return!1}}if(i=s.child,s.subtreeFlags&16384&&i!==null)i.return=s,s=i;else{if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Za(n,s,i,d){s&=~Xf,s&=~As,n.suspendedLanes|=s,n.pingedLanes&=~s,d&&(n.warmLanes|=s),d=n.expirationTimes;for(var g=s;0<g;){var y=31-Pt(g),j=1<<y;d[y]=-1,g&=~j}i!==0&&ia(n,i,s)}function Mc(){return(mt&6)===0?(Ei(0),!1):!0}function ep(){if(st!==null){if(xt===0)var n=st.return;else n=st,fa=vs=null,gf(n),uo=null,ci=0,n=st;for(;n!==null;)ay(n.alternate,n),n=n.return;st=null}}function _o(n,s){var i=n.timeoutHandle;i!==-1&&(n.timeoutHandle=-1,bj(i)),i=n.cancelPendingCommit,i!==null&&(n.cancelPendingCommit=null,i()),Sa=0,ep(),jt=n,st=i=ua(n.current,null),lt=s,xt=0,er=null,Ya=!1,yo=Dt(n,s),Kf=!1,bo=tr=Xf=As=Ka=qt=0,Fn=ki=null,Qf=!1,(s&8)!==0&&(s|=s&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=s;0<d;){var g=31-Pt(d),y=1<<g;s|=n[g],d&=~y}return wa=s,nc(),i}function Cy(n,s){Je=null,T.H=xi,s===co||s===uc?(s=qg(),xt=3):s===rf?(s=qg(),xt=4):xt=s===Lf?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,er=s,st===null&&(qt=1,jc(n,pr(s,n.current)))}function Ay(){var n=Jn.current;return n===null?!0:(lt&4194048)===lt?xr===null:(lt&62914560)===lt||(lt&536870912)!==0?n===xr:!1}function Ry(){var n=T.H;return T.H=xi,n===null?xi:n}function Ty(){var n=T.A;return T.A=ZS,n}function zc(){qt=4,Ya||(lt&4194048)!==lt&&Jn.current!==null||(yo=!0),(Ka&134217727)===0&&(As&134217727)===0||jt===null||Za(jt,lt,tr,!1)}function tp(n,s,i){var d=mt;mt|=2;var g=Ry(),y=Ty();(jt!==n||lt!==s)&&(Oc=null,_o(n,s)),s=!1;var j=qt;e:do try{if(xt!==0&&st!==null){var C=st,U=er;switch(xt){case 8:ep(),j=6;break e;case 3:case 2:case 9:case 6:Jn.current===null&&(s=!0);var X=xt;if(xt=0,er=null,wo(n,C,U,X),i&&yo){j=0;break e}break;default:X=xt,xt=0,er=null,wo(n,C,U,X)}}ej(),j=qt;break}catch(ie){Cy(n,ie)}while(!0);return s&&n.shellSuspendCounter++,fa=vs=null,mt=d,T.H=g,T.A=y,st===null&&(jt=null,lt=0,nc()),j}function ej(){for(;st!==null;)Ly(st)}function tj(n,s){var i=mt;mt|=2;var d=Ry(),g=Ty();jt!==n||lt!==s?(Oc=null,Dc=Ht()+500,_o(n,s)):yo=Dt(n,s);e:do try{if(xt!==0&&st!==null){s=st;var y=er;t:switch(xt){case 1:xt=0,er=null,wo(n,s,y,1);break;case 2:case 9:if(Hg(y)){xt=0,er=null,Dy(s);break}s=function(){xt!==2&&xt!==9||jt!==n||(xt=7),Fr(n)},y.then(s,s);break e;case 3:xt=7;break e;case 4:xt=5;break e;case 7:Hg(y)?(xt=0,er=null,Dy(s)):(xt=0,er=null,wo(n,s,y,7));break;case 5:var j=null;switch(st.tag){case 26:j=st.memoizedState;case 5:case 27:var C=st;if(j?yb(j):C.stateNode.complete){xt=0,er=null;var U=C.sibling;if(U!==null)st=U;else{var X=C.return;X!==null?(st=X,$c(X)):st=null}break t}}xt=0,er=null,wo(n,s,y,5);break;case 6:xt=0,er=null,wo(n,s,y,6);break;case 8:ep(),qt=6;break e;default:throw Error(a(462))}}nj();break}catch(ie){Cy(n,ie)}while(!0);return fa=vs=null,T.H=d,T.A=g,mt=i,st!==null?0:(jt=null,lt=0,nc(),qt)}function nj(){for(;st!==null&&!cr();)Ly(st)}function Ly(n){var s=ny(n.alternate,n,wa);n.memoizedProps=n.pendingProps,s===null?$c(n):st=s}function Dy(n){var s=n,i=s.alternate;switch(s.tag){case 15:case 0:s=Qx(i,s,s.pendingProps,s.type,void 0,lt);break;case 11:s=Qx(i,s,s.pendingProps,s.type.render,s.ref,lt);break;case 5:gf(s);default:ay(i,s),s=st=Tg(s,wa),s=ny(i,s,wa)}n.memoizedProps=n.pendingProps,s===null?$c(n):st=s}function wo(n,s,i,d){fa=vs=null,gf(s),uo=null,ci=0;var g=s.return;try{if(qS(n,g,s,i,lt)){qt=1,jc(n,pr(i,n.current)),st=null;return}}catch(y){if(g!==null)throw st=g,y;qt=1,jc(n,pr(i,n.current)),st=null;return}s.flags&32768?(ut||d===1?n=!0:yo||(lt&536870912)!==0?n=!1:(Ya=n=!0,(d===2||d===9||d===3||d===6)&&(d=Jn.current,d!==null&&d.tag===13&&(d.flags|=16384))),Oy(s,n)):$c(s)}function $c(n){var s=n;do{if((s.flags&32768)!==0){Oy(s,Ya);return}n=s.return;var i=YS(s.alternate,s,wa);if(i!==null){st=i;return}if(s=s.sibling,s!==null){st=s;return}st=s=n}while(s!==null);qt===0&&(qt=5)}function Oy(n,s){do{var i=KS(n.alternate,n);if(i!==null){i.flags&=32767,st=i;return}if(i=n.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!s&&(n=n.sibling,n!==null)){st=n;return}st=n=i}while(n!==null);qt=6,st=null}function My(n,s,i,d,g,y,j,C,U){n.cancelPendingCommit=null;do Bc();while(sn!==0);if((mt&6)!==0)throw Error(a(327));if(s!==null){if(s===n.current)throw Error(a(177));if(y=s.lanes|s.childLanes,y|=Hd,$r(n,i,y,j,C,U),n===jt&&(st=jt=null,lt=0),vo=s,Qa=n,Sa=i,Zf=y,Jf=g,jy=d,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,oj(We,function(){return Uy(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||d){d=T.T,T.T=null,g=q.p,q.p=2,j=mt,mt|=4;try{XS(n,s,i)}finally{mt=j,q.p=g,T.T=d}}sn=1,zy(),$y(),By()}}function zy(){if(sn===1){sn=0;var n=Qa,s=vo,i=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||i){i=T.T,T.T=null;var d=q.p;q.p=2;var g=mt;mt|=4;try{gy(s,n);var y=pp,j=wg(n.containerInfo),C=y.focusedElem,U=y.selectionRange;if(j!==C&&C&&C.ownerDocument&&_g(C.ownerDocument.documentElement,C)){if(U!==null&&$d(C)){var X=U.start,ie=U.end;if(ie===void 0&&(ie=X),"selectionStart"in C)C.selectionStart=X,C.selectionEnd=Math.min(ie,C.value.length);else{var pe=C.ownerDocument||document,Q=pe&&pe.defaultView||window;if(Q.getSelection){var te=Q.getSelection(),Te=C.textContent.length,Ye=Math.min(U.start,Te),_t=U.end===void 0?Ye:Math.min(U.end,Te);!te.extend&&Ye>_t&&(j=_t,_t=Ye,Ye=j);var Y=vg(C,Ye),F=vg(C,_t);if(Y&&F&&(te.rangeCount!==1||te.anchorNode!==Y.node||te.anchorOffset!==Y.offset||te.focusNode!==F.node||te.focusOffset!==F.offset)){var K=pe.createRange();K.setStart(Y.node,Y.offset),te.removeAllRanges(),Ye>_t?(te.addRange(K),te.extend(F.node,F.offset)):(K.setEnd(F.node,F.offset),te.addRange(K))}}}}for(pe=[],te=C;te=te.parentNode;)te.nodeType===1&&pe.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<pe.length;C++){var de=pe[C];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}Qc=!!fp,pp=fp=null}finally{mt=g,q.p=d,T.T=i}}n.current=s,sn=2}}function $y(){if(sn===2){sn=0;var n=Qa,s=vo,i=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||i){i=T.T,T.T=null;var d=q.p;q.p=2;var g=mt;mt|=4;try{dy(n,s.alternate,s)}finally{mt=g,q.p=d,T.T=i}}sn=3}}function By(){if(sn===4||sn===3){sn=0,Xn();var n=Qa,s=vo,i=Sa,d=jy;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?sn=5:(sn=0,vo=Qa=null,Iy(n,n.pendingLanes));var g=n.pendingLanes;if(g===0&&(Xa=null),Z(i),s=s.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(gn,s,void 0,(s.current.flags&128)===128)}catch{}if(d!==null){s=T.T,g=q.p,q.p=2,T.T=null;try{for(var y=n.onRecoverableError,j=0;j<d.length;j++){var C=d[j];y(C.value,{componentStack:C.stack})}}finally{T.T=s,q.p=g}}(Sa&3)!==0&&Bc(),Fr(n),g=n.pendingLanes,(i&261930)!==0&&(g&42)!==0?n===Wf?Ni++:(Ni=0,Wf=n):Ni=0,Ei(0)}}function Iy(n,s){(n.pooledCacheLanes&=s)===0&&(s=n.pooledCache,s!=null&&(n.pooledCache=null,ii(s)))}function Bc(){return zy(),$y(),By(),Uy()}function Uy(){if(sn!==5)return!1;var n=Qa,s=Zf;Zf=0;var i=Z(Sa),d=T.T,g=q.p;try{q.p=32>i?32:i,T.T=null,i=Jf,Jf=null;var y=Qa,j=Sa;if(sn=0,vo=Qa=null,Sa=0,(mt&6)!==0)throw Error(a(331));var C=mt;if(mt|=4,_y(y.current),yy(y,y.current,j,i),mt=C,Ei(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(gn,y)}catch{}return!0}finally{q.p=g,T.T=d,Iy(n,s)}}function Py(n,s,i){s=pr(i,s),s=Tf(n.stateNode,s,2),n=Fa(n,s,2),n!==null&&(Tn(n,2),Fr(n))}function yt(n,s,i){if(n.tag===3)Py(n,n,i);else for(;s!==null;){if(s.tag===3){Py(s,n,i);break}else if(s.tag===1){var d=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Xa===null||!Xa.has(d))){n=pr(i,n),i=Hx(2),d=Fa(s,i,2),d!==null&&(Fx(i,d,s,n),Tn(d,2),Fr(d));break}}s=s.return}}function np(n,s,i){var d=n.pingCache;if(d===null){d=n.pingCache=new JS;var g=new Set;d.set(s,g)}else g=d.get(s),g===void 0&&(g=new Set,d.set(s,g));g.has(i)||(Kf=!0,g.add(i),n=rj.bind(null,n,s,i),s.then(n,n))}function rj(n,s,i){var d=n.pingCache;d!==null&&d.delete(s),n.pingedLanes|=n.suspendedLanes&i,n.warmLanes&=~i,jt===n&&(lt&i)===i&&(qt===4||qt===3&&(lt&62914560)===lt&&300>Ht()-Lc?(mt&2)===0&&_o(n,0):Xf|=i,bo===lt&&(bo=0)),Fr(n)}function Hy(n,s){s===0&&(s=oa()),n=xs(n,s),n!==null&&(Tn(n,s),Fr(n))}function aj(n){var s=n.memoizedState,i=0;s!==null&&(i=s.retryLane),Hy(n,i)}function sj(n,s){var i=0;switch(n.tag){case 31:case 13:var d=n.stateNode,g=n.memoizedState;g!==null&&(i=g.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(s),Hy(n,i)}function oj(n,s){return Vt(n,s)}var Ic=null,So=null,rp=!1,Uc=!1,ap=!1,Ja=0;function Fr(n){n!==So&&n.next===null&&(So===null?Ic=So=n:So=So.next=n),Uc=!0,rp||(rp=!0,lj())}function Ei(n,s){if(!ap&&Uc){ap=!0;do for(var i=!1,d=Ic;d!==null;){if(n!==0){var g=d.pendingLanes;if(g===0)var y=0;else{var j=d.suspendedLanes,C=d.pingedLanes;y=(1<<31-Pt(42|n)+1)-1,y&=g&~(j&~C),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(i=!0,Vy(d,y))}else y=lt,y=Ct(d,d===jt?y:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(y&3)===0||Dt(d,y)||(i=!0,Vy(d,y));d=d.next}while(i);ap=!1}}function ij(){Fy()}function Fy(){Uc=rp=!1;var n=0;Ja!==0&&yj()&&(n=Ja);for(var s=Ht(),i=null,d=Ic;d!==null;){var g=d.next,y=qy(d,s);y===0?(d.next=null,i===null?Ic=g:i.next=g,g===null&&(So=i)):(i=d,(n!==0||(y&3)!==0)&&(Uc=!0)),d=g}sn!==0&&sn!==5||Ei(n),Ja!==0&&(Ja=0)}function qy(n,s){for(var i=n.suspendedLanes,d=n.pingedLanes,g=n.expirationTimes,y=n.pendingLanes&-62914561;0<y;){var j=31-Pt(y),C=1<<j,U=g[j];U===-1?((C&i)===0||(C&d)!==0)&&(g[j]=Oa(C,s)):U<=s&&(n.expiredLanes|=C),y&=~C}if(s=jt,i=lt,i=Ct(n,n===s?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,i===0||n===s&&(xt===2||xt===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&Bn(d),n.callbackNode=null,n.callbackPriority=0;if((i&3)===0||Dt(n,i)){if(s=i&-i,s===n.callbackPriority)return s;switch(d!==null&&Bn(d),Z(i)){case 2:case 8:i=Ze;break;case 32:i=We;break;case 268435456:i=ft;break;default:i=We}return d=Gy.bind(null,n),i=Vt(i,d),n.callbackPriority=s,n.callbackNode=i,s}return d!==null&&d!==null&&Bn(d),n.callbackPriority=2,n.callbackNode=null,2}function Gy(n,s){if(sn!==0&&sn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var i=n.callbackNode;if(Bc()&&n.callbackNode!==i)return null;var d=lt;return d=Ct(n,n===jt?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(Ny(n,d,s),qy(n,Ht()),n.callbackNode!=null&&n.callbackNode===i?Gy.bind(null,n):null)}function Vy(n,s){if(Bc())return null;Ny(n,s,!0)}function lj(){vj(function(){(mt&6)!==0?Vt(Le,ij):Fy()})}function sp(){if(Ja===0){var n=io;n===0&&(n=me,me<<=1,(me&261888)===0&&(me=256)),Ja=n}return Ja}function Yy(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Kl(""+n)}function Ky(n,s){var i=s.ownerDocument.createElement("input");return i.name=s.name,i.value=s.value,n.id&&i.setAttribute("form",n.id),s.parentNode.insertBefore(i,s),n=new FormData(n),i.parentNode.removeChild(i),n}function cj(n,s,i,d,g){if(s==="submit"&&i&&i.stateNode===g){var y=Yy((g[ke]||null).action),j=d.submitter;j&&(s=(s=j[ke]||null)?Yy(s.formAction):j.getAttribute("formAction"),s!==null&&(y=s,j=null));var C=new Jl("action","action",null,d,g);n.push({event:C,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Ja!==0){var U=j?Ky(g,j):new FormData(g);kf(i,{pending:!0,data:U,method:g.method,action:y},null,U)}}else typeof y=="function"&&(C.preventDefault(),U=j?Ky(g,j):new FormData(g),kf(i,{pending:!0,data:U,method:g.method,action:y},y,U))},currentTarget:g}]})}}for(var op=0;op<Pd.length;op++){var ip=Pd[op],uj=ip.toLowerCase(),dj=ip[0].toUpperCase()+ip.slice(1);Cr(uj,"on"+dj)}Cr(kg,"onAnimationEnd"),Cr(Ng,"onAnimationIteration"),Cr(Eg,"onAnimationStart"),Cr("dblclick","onDoubleClick"),Cr("focusin","onFocus"),Cr("focusout","onBlur"),Cr(ES,"onTransitionRun"),Cr(CS,"onTransitionStart"),Cr(AS,"onTransitionCancel"),Cr(Cg,"onTransitionEnd"),Br("onMouseEnter",["mouseout","mouseover"]),Br("onMouseLeave",["mouseout","mouseover"]),Br("onPointerEnter",["pointerout","pointerover"]),Br("onPointerLeave",["pointerout","pointerover"]),dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),dn("onBeforeInput",["compositionend","keypress","textInput","paste"]),dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ci="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),fj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ci));function Xy(n,s){s=(s&4)!==0;for(var i=0;i<n.length;i++){var d=n[i],g=d.event;d=d.listeners;e:{var y=void 0;if(s)for(var j=d.length-1;0<=j;j--){var C=d[j],U=C.instance,X=C.currentTarget;if(C=C.listener,U!==y&&g.isPropagationStopped())break e;y=C,g.currentTarget=X;try{y(g)}catch(ie){tc(ie)}g.currentTarget=null,y=U}else for(j=0;j<d.length;j++){if(C=d[j],U=C.instance,X=C.currentTarget,C=C.listener,U!==y&&g.isPropagationStopped())break e;y=C,g.currentTarget=X;try{y(g)}catch(ie){tc(ie)}g.currentTarget=null,y=U}}}}function ot(n,s){var i=s[Ie];i===void 0&&(i=s[Ie]=new Set);var d=n+"__bubble";i.has(d)||(Qy(s,n,2,!1),i.add(d))}function lp(n,s,i){var d=0;s&&(d|=4),Qy(i,n,d,s)}var Pc="_reactListening"+Math.random().toString(36).slice(2);function cp(n){if(!n[Pc]){n[Pc]=!0,an.forEach(function(i){i!=="selectionchange"&&(fj.has(i)||lp(i,!1,n),lp(i,!0,n))});var s=n.nodeType===9?n:n.ownerDocument;s===null||s[Pc]||(s[Pc]=!0,lp("selectionchange",!1,s))}}function Qy(n,s,i,d){switch(kb(s)){case 2:var g=Uj;break;case 8:g=Pj;break;default:g=jp}i=g.bind(null,s,i,n),g=void 0,!Cd||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(g=!0),d?g!==void 0?n.addEventListener(s,i,{capture:!0,passive:g}):n.addEventListener(s,i,!0):g!==void 0?n.addEventListener(s,i,{passive:g}):n.addEventListener(s,i,!1)}function up(n,s,i,d,g){var y=d;if((s&1)===0&&(s&2)===0&&d!==null)e:for(;;){if(d===null)return;var j=d.tag;if(j===3||j===4){var C=d.stateNode.containerInfo;if(C===g)break;if(j===4)for(j=d.return;j!==null;){var U=j.tag;if((U===3||U===4)&&j.stateNode.containerInfo===g)return;j=j.return}for(;C!==null;){if(j=Re(C),j===null)return;if(U=j.tag,U===5||U===6||U===26||U===27){d=y=j;continue e}C=C.parentNode}}d=d.return}tg(function(){var X=y,ie=Nd(i),pe=[];e:{var Q=Ag.get(n);if(Q!==void 0){var te=Jl,Te=n;switch(n){case"keypress":if(Ql(i)===0)break e;case"keydown":case"keyup":te=sS;break;case"focusin":Te="focus",te=Ld;break;case"focusout":Te="blur",te=Ld;break;case"beforeblur":case"afterblur":te=Ld;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=ag;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=Yw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=lS;break;case kg:case Ng:case Eg:te=Qw;break;case Cg:te=uS;break;case"scroll":case"scrollend":te=Gw;break;case"wheel":te=fS;break;case"copy":case"cut":case"paste":te=Jw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=og;break;case"toggle":case"beforetoggle":te=hS}var Ye=(s&4)!==0,_t=!Ye&&(n==="scroll"||n==="scrollend"),Y=Ye?Q!==null?Q+"Capture":null:Q;Ye=[];for(var F=X,K;F!==null;){var de=F;if(K=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||K===null||Y===null||(de=Qo(F,Y),de!=null&&Ye.push(Ai(F,de,K))),_t)break;F=F.return}0<Ye.length&&(Q=new te(Q,Te,null,i,ie),pe.push({event:Q,listeners:Ye}))}}if((s&7)===0){e:{if(Q=n==="mouseover"||n==="pointerover",te=n==="mouseout"||n==="pointerout",Q&&i!==kd&&(Te=i.relatedTarget||i.fromElement)&&(Re(Te)||Te[Ce]))break e;if((te||Q)&&(Q=ie.window===ie?ie:(Q=ie.ownerDocument)?Q.defaultView||Q.parentWindow:window,te?(Te=i.relatedTarget||i.toElement,te=X,Te=Te?Re(Te):null,Te!==null&&(_t=l(Te),Ye=Te.tag,Te!==_t||Ye!==5&&Ye!==27&&Ye!==6)&&(Te=null)):(te=null,Te=X),te!==Te)){if(Ye=ag,de="onMouseLeave",Y="onMouseEnter",F="mouse",(n==="pointerout"||n==="pointerover")&&(Ye=og,de="onPointerLeave",Y="onPointerEnter",F="pointer"),_t=te==null?Q:Oe(te),K=Te==null?Q:Oe(Te),Q=new Ye(de,F+"leave",te,i,ie),Q.target=_t,Q.relatedTarget=K,de=null,Re(ie)===X&&(Ye=new Ye(Y,F+"enter",Te,i,ie),Ye.target=K,Ye.relatedTarget=_t,de=Ye),_t=de,te&&Te)t:{for(Ye=pj,Y=te,F=Te,K=0,de=Y;de;de=Ye(de))K++;de=0;for(var He=F;He;He=Ye(He))de++;for(;0<K-de;)Y=Ye(Y),K--;for(;0<de-K;)F=Ye(F),de--;for(;K--;){if(Y===F||F!==null&&Y===F.alternate){Ye=Y;break t}Y=Ye(Y),F=Ye(F)}Ye=null}else Ye=null;te!==null&&Zy(pe,Q,te,Ye,!1),Te!==null&&_t!==null&&Zy(pe,_t,Te,Ye,!0)}}e:{if(Q=X?Oe(X):window,te=Q.nodeName&&Q.nodeName.toLowerCase(),te==="select"||te==="input"&&Q.type==="file")var pt=hg;else if(fg(Q))if(mg)pt=jS;else{pt=wS;var Me=_S}else te=Q.nodeName,!te||te.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?X&&jd(X.elementType)&&(pt=hg):pt=SS;if(pt&&(pt=pt(n,X))){pg(pe,pt,i,ie);break e}Me&&Me(n,Q,X),n==="focusout"&&X&&Q.type==="number"&&X.memoizedProps.value!=null&&Sd(Q,"number",Q.value)}switch(Me=X?Oe(X):window,n){case"focusin":(fg(Me)||Me.contentEditable==="true")&&(Ws=Me,Bd=X,ai=null);break;case"focusout":ai=Bd=Ws=null;break;case"mousedown":Id=!0;break;case"contextmenu":case"mouseup":case"dragend":Id=!1,Sg(pe,i,ie);break;case"selectionchange":if(NS)break;case"keydown":case"keyup":Sg(pe,i,ie)}var et;if(Od)e:{switch(n){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else Js?ug(n,i)&&(ct="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(ct="onCompositionStart");ct&&(ig&&i.locale!=="ko"&&(Js||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&Js&&(et=ng()):(za=ie,Ad="value"in za?za.value:za.textContent,Js=!0)),Me=Hc(X,ct),0<Me.length&&(ct=new sg(ct,n,null,i,ie),pe.push({event:ct,listeners:Me}),et?ct.data=et:(et=dg(i),et!==null&&(ct.data=et)))),(et=gS?xS(n,i):yS(n,i))&&(ct=Hc(X,"onBeforeInput"),0<ct.length&&(Me=new sg("onBeforeInput","beforeinput",null,i,ie),pe.push({event:Me,listeners:ct}),Me.data=et)),cj(pe,n,X,i,ie)}Xy(pe,s)})}function Ai(n,s,i){return{instance:n,listener:s,currentTarget:i}}function Hc(n,s){for(var i=s+"Capture",d=[];n!==null;){var g=n,y=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||y===null||(g=Qo(n,i),g!=null&&d.unshift(Ai(n,g,y)),g=Qo(n,s),g!=null&&d.push(Ai(n,g,y))),n.tag===3)return d;n=n.return}return[]}function pj(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Zy(n,s,i,d,g){for(var y=s._reactName,j=[];i!==null&&i!==d;){var C=i,U=C.alternate,X=C.stateNode;if(C=C.tag,U!==null&&U===d)break;C!==5&&C!==26&&C!==27||X===null||(U=X,g?(X=Qo(i,y),X!=null&&j.unshift(Ai(i,X,U))):g||(X=Qo(i,y),X!=null&&j.push(Ai(i,X,U)))),i=i.return}j.length!==0&&n.push({event:s,listeners:j})}var hj=/\r\n?/g,mj=/\u0000|\uFFFD/g;function Jy(n){return(typeof n=="string"?n:""+n).replace(hj,`
|
|
10
|
+
`).replace(mj,"")}function Wy(n,s){return s=Jy(s),Jy(n)===s}function vt(n,s,i,d,g,y){switch(i){case"children":typeof d=="string"?s==="body"||s==="textarea"&&d===""||Xs(n,d):(typeof d=="number"||typeof d=="bigint")&&s!=="body"&&Xs(n,""+d);break;case"className":Yt(n,"class",d);break;case"tabIndex":Yt(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Yt(n,i,d);break;case"style":Wm(n,d,y);break;case"data":if(s!=="object"){Yt(n,"data",d);break}case"src":case"href":if(d===""&&(s!=="a"||i!=="href")){n.removeAttribute(i);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(i);break}d=Kl(""+d),n.setAttribute(i,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(i==="formAction"?(s!=="input"&&vt(n,s,"name",g.name,g,null),vt(n,s,"formEncType",g.formEncType,g,null),vt(n,s,"formMethod",g.formMethod,g,null),vt(n,s,"formTarget",g.formTarget,g,null)):(vt(n,s,"encType",g.encType,g,null),vt(n,s,"method",g.method,g,null),vt(n,s,"target",g.target,g,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(i);break}d=Kl(""+d),n.setAttribute(i,d);break;case"onClick":d!=null&&(n.onclick=la);break;case"onScroll":d!=null&&ot("scroll",n);break;case"onScrollEnd":d!=null&&ot("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(i=d.__html,i!=null){if(g.children!=null)throw Error(a(60));n.innerHTML=i}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}i=Kl(""+d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(i,""+d):n.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(i,""):n.removeAttribute(i);break;case"capture":case"download":d===!0?n.setAttribute(i,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(i,d):n.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(i,d):n.removeAttribute(i);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(i):n.setAttribute(i,d);break;case"popover":ot("beforetoggle",n),ot("toggle",n),at(n,"popover",d);break;case"xlinkActuate":wn(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":wn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":wn(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":wn(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":wn(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":wn(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":wn(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":wn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":wn(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":at(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Fw.get(i)||i,at(n,i,d))}}function dp(n,s,i,d,g,y){switch(i){case"style":Wm(n,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(i=d.__html,i!=null){if(g.children!=null)throw Error(a(60));n.innerHTML=i}}break;case"children":typeof d=="string"?Xs(n,d):(typeof d=="number"||typeof d=="bigint")&&Xs(n,""+d);break;case"onScroll":d!=null&&ot("scroll",n);break;case"onScrollEnd":d!=null&&ot("scrollend",n);break;case"onClick":d!=null&&(n.onclick=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_n.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(g=i.endsWith("Capture"),s=i.slice(2,g?i.length-7:void 0),y=n[ke]||null,y=y!=null?y[i]:null,typeof y=="function"&&n.removeEventListener(s,y,g),typeof d=="function")){typeof y!="function"&&y!==null&&(i in n?n[i]=null:n.hasAttribute(i)&&n.removeAttribute(i)),n.addEventListener(s,d,g);break e}i in n?n[i]=d:d===!0?n.setAttribute(i,""):at(n,i,d)}}}function vn(n,s,i){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",n),ot("load",n);var d=!1,g=!1,y;for(y in i)if(i.hasOwnProperty(y)){var j=i[y];if(j!=null)switch(y){case"src":d=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,s));default:vt(n,s,y,j,i,null)}}g&&vt(n,s,"srcSet",i.srcSet,i,null),d&&vt(n,s,"src",i.src,i,null);return;case"input":ot("invalid",n);var C=y=j=g=null,U=null,X=null;for(d in i)if(i.hasOwnProperty(d)){var ie=i[d];if(ie!=null)switch(d){case"name":g=ie;break;case"type":j=ie;break;case"checked":U=ie;break;case"defaultChecked":X=ie;break;case"value":y=ie;break;case"defaultValue":C=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(a(137,s));break;default:vt(n,s,d,ie,i,null)}}Xm(n,y,C,U,X,j,g,!1);return;case"select":ot("invalid",n),d=j=y=null;for(g in i)if(i.hasOwnProperty(g)&&(C=i[g],C!=null))switch(g){case"value":y=C;break;case"defaultValue":j=C;break;case"multiple":d=C;default:vt(n,s,g,C,i,null)}s=y,i=j,n.multiple=!!d,s!=null?Ks(n,!!d,s,!1):i!=null&&Ks(n,!!d,i,!0);return;case"textarea":ot("invalid",n),y=g=d=null;for(j in i)if(i.hasOwnProperty(j)&&(C=i[j],C!=null))switch(j){case"value":d=C;break;case"defaultValue":g=C;break;case"children":y=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(a(91));break;default:vt(n,s,j,C,i,null)}Zm(n,d,g,y);return;case"option":for(U in i)i.hasOwnProperty(U)&&(d=i[U],d!=null)&&(U==="selected"?n.selected=d&&typeof d!="function"&&typeof d!="symbol":vt(n,s,U,d,i,null));return;case"dialog":ot("beforetoggle",n),ot("toggle",n),ot("cancel",n),ot("close",n);break;case"iframe":case"object":ot("load",n);break;case"video":case"audio":for(d=0;d<Ci.length;d++)ot(Ci[d],n);break;case"image":ot("error",n),ot("load",n);break;case"details":ot("toggle",n);break;case"embed":case"source":case"link":ot("error",n),ot("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in i)if(i.hasOwnProperty(X)&&(d=i[X],d!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,s));default:vt(n,s,X,d,i,null)}return;default:if(jd(s)){for(ie in i)i.hasOwnProperty(ie)&&(d=i[ie],d!==void 0&&dp(n,s,ie,d,i,void 0));return}}for(C in i)i.hasOwnProperty(C)&&(d=i[C],d!=null&&vt(n,s,C,d,i,null))}function gj(n,s,i,d){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,y=null,j=null,C=null,U=null,X=null,ie=null;for(te in i){var pe=i[te];if(i.hasOwnProperty(te)&&pe!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":U=pe;default:d.hasOwnProperty(te)||vt(n,s,te,null,d,pe)}}for(var Q in d){var te=d[Q];if(pe=i[Q],d.hasOwnProperty(Q)&&(te!=null||pe!=null))switch(Q){case"type":y=te;break;case"name":g=te;break;case"checked":X=te;break;case"defaultChecked":ie=te;break;case"value":j=te;break;case"defaultValue":C=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,s));break;default:te!==pe&&vt(n,s,Q,te,d,pe)}}wd(n,j,C,U,X,ie,y,g);return;case"select":te=j=C=Q=null;for(y in i)if(U=i[y],i.hasOwnProperty(y)&&U!=null)switch(y){case"value":break;case"multiple":te=U;default:d.hasOwnProperty(y)||vt(n,s,y,null,d,U)}for(g in d)if(y=d[g],U=i[g],d.hasOwnProperty(g)&&(y!=null||U!=null))switch(g){case"value":Q=y;break;case"defaultValue":C=y;break;case"multiple":j=y;default:y!==U&&vt(n,s,g,y,d,U)}s=C,i=j,d=te,Q!=null?Ks(n,!!i,Q,!1):!!d!=!!i&&(s!=null?Ks(n,!!i,s,!0):Ks(n,!!i,i?[]:"",!1));return;case"textarea":te=Q=null;for(C in i)if(g=i[C],i.hasOwnProperty(C)&&g!=null&&!d.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:vt(n,s,C,null,d,g)}for(j in d)if(g=d[j],y=i[j],d.hasOwnProperty(j)&&(g!=null||y!=null))switch(j){case"value":Q=g;break;case"defaultValue":te=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(a(91));break;default:g!==y&&vt(n,s,j,g,d,y)}Qm(n,Q,te);return;case"option":for(var Te in i)Q=i[Te],i.hasOwnProperty(Te)&&Q!=null&&!d.hasOwnProperty(Te)&&(Te==="selected"?n.selected=!1:vt(n,s,Te,null,d,Q));for(U in d)Q=d[U],te=i[U],d.hasOwnProperty(U)&&Q!==te&&(Q!=null||te!=null)&&(U==="selected"?n.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":vt(n,s,U,Q,d,te));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ye in i)Q=i[Ye],i.hasOwnProperty(Ye)&&Q!=null&&!d.hasOwnProperty(Ye)&&vt(n,s,Ye,null,d,Q);for(X in d)if(Q=d[X],te=i[X],d.hasOwnProperty(X)&&Q!==te&&(Q!=null||te!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,s));break;default:vt(n,s,X,Q,d,te)}return;default:if(jd(s)){for(var _t in i)Q=i[_t],i.hasOwnProperty(_t)&&Q!==void 0&&!d.hasOwnProperty(_t)&&dp(n,s,_t,void 0,d,Q);for(ie in d)Q=d[ie],te=i[ie],!d.hasOwnProperty(ie)||Q===te||Q===void 0&&te===void 0||dp(n,s,ie,Q,d,te);return}}for(var Y in i)Q=i[Y],i.hasOwnProperty(Y)&&Q!=null&&!d.hasOwnProperty(Y)&&vt(n,s,Y,null,d,Q);for(pe in d)Q=d[pe],te=i[pe],!d.hasOwnProperty(pe)||Q===te||Q==null&&te==null||vt(n,s,pe,Q,d,te)}function eb(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xj(){if(typeof performance.getEntriesByType=="function"){for(var n=0,s=0,i=performance.getEntriesByType("resource"),d=0;d<i.length;d++){var g=i[d],y=g.transferSize,j=g.initiatorType,C=g.duration;if(y&&C&&eb(j)){for(j=0,C=g.responseEnd,d+=1;d<i.length;d++){var U=i[d],X=U.startTime;if(X>C)break;var ie=U.transferSize,pe=U.initiatorType;ie&&eb(pe)&&(U=U.responseEnd,j+=ie*(U<C?1:(C-X)/(U-X)))}if(--d,s+=8*(y+j)/(g.duration/1e3),n++,10<n)break}}if(0<n)return s/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var fp=null,pp=null;function Fc(n){return n.nodeType===9?n:n.ownerDocument}function tb(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nb(n,s){if(n===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&s==="foreignObject"?0:n}function hp(n,s){return n==="textarea"||n==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var mp=null;function yj(){var n=window.event;return n&&n.type==="popstate"?n===mp?!1:(mp=n,!0):(mp=null,!1)}var rb=typeof setTimeout=="function"?setTimeout:void 0,bj=typeof clearTimeout=="function"?clearTimeout:void 0,ab=typeof Promise=="function"?Promise:void 0,vj=typeof queueMicrotask=="function"?queueMicrotask:typeof ab<"u"?function(n){return ab.resolve(null).then(n).catch(_j)}:rb;function _j(n){setTimeout(function(){throw n})}function Wa(n){return n==="head"}function sb(n,s){var i=s,d=0;do{var g=i.nextSibling;if(n.removeChild(i),g&&g.nodeType===8)if(i=g.data,i==="/$"||i==="/&"){if(d===0){n.removeChild(g),Eo(s);return}d--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")d++;else if(i==="html")Ri(n.ownerDocument.documentElement);else if(i==="head"){i=n.ownerDocument.head,Ri(i);for(var y=i.firstChild;y;){var j=y.nextSibling,C=y.nodeName;y[ue]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&y.rel.toLowerCase()==="stylesheet"||i.removeChild(y),y=j}}else i==="body"&&Ri(n.ownerDocument.body);i=g}while(i);Eo(s)}function ob(n,s){var i=n;n=0;do{var d=i.nextSibling;if(i.nodeType===1?s?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(s?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(n===0)break;n--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||n++;i=d}while(i)}function gp(n){var s=n.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var i=s;switch(s=s.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":gp(i),Ee(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}n.removeChild(i)}}function wj(n,s,i,d){for(;n.nodeType===1;){var g=i;if(n.nodeName.toLowerCase()!==s.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[ue])switch(s){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(y=n.getAttribute("rel"),y==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(y!==g.rel||n.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||n.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||n.getAttribute("title")!==(g.title==null?null:g.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(y=n.getAttribute("src"),(y!==(g.src==null?null:g.src)||n.getAttribute("type")!==(g.type==null?null:g.type)||n.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&y&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(s==="input"&&n.type==="hidden"){var y=g.name==null?null:""+g.name;if(g.type==="hidden"&&n.getAttribute("name")===y)return n}else return n;if(n=yr(n.nextSibling),n===null)break}return null}function Sj(n,s,i){if(s==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=yr(n.nextSibling),n===null))return null;return n}function ib(n,s){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=yr(n.nextSibling),n===null))return null;return n}function xp(n){return n.data==="$?"||n.data==="$~"}function yp(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function jj(n,s){var i=n.ownerDocument;if(n.data==="$~")n._reactRetry=s;else if(n.data!=="$?"||i.readyState!=="loading")s();else{var d=function(){s(),i.removeEventListener("DOMContentLoaded",d)};i.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function yr(n){for(;n!=null;n=n.nextSibling){var s=n.nodeType;if(s===1||s===3)break;if(s===8){if(s=n.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return n}var bp=null;function lb(n){n=n.nextSibling;for(var s=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"||i==="/&"){if(s===0)return yr(n.nextSibling);s--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||s++}n=n.nextSibling}return null}function cb(n){n=n.previousSibling;for(var s=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(s===0)return n;s--}else i!=="/$"&&i!=="/&"||s++}n=n.previousSibling}return null}function ub(n,s,i){switch(s=Fc(i),n){case"html":if(n=s.documentElement,!n)throw Error(a(452));return n;case"head":if(n=s.head,!n)throw Error(a(453));return n;case"body":if(n=s.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function Ri(n){for(var s=n.attributes;s.length;)n.removeAttributeNode(s[0]);Ee(n)}var br=new Map,db=new Set;function qc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var ja=q.d;q.d={f:kj,r:Nj,D:Ej,C:Cj,L:Aj,m:Rj,X:Lj,S:Tj,M:Dj};function kj(){var n=ja.f(),s=Mc();return n||s}function Nj(n){var s=Ge(n);s!==null&&s.tag===5&&s.type==="form"?Cx(s):ja.r(n)}var jo=typeof document>"u"?null:document;function fb(n,s,i){var d=jo;if(d&&typeof s=="string"&&s){var g=dr(s);g='link[rel="'+n+'"][href="'+g+'"]',typeof i=="string"&&(g+='[crossorigin="'+i+'"]'),db.has(g)||(db.add(g),n={rel:n,crossOrigin:i,href:s},d.querySelector(g)===null&&(s=d.createElement("link"),vn(s,"link",n),it(s),d.head.appendChild(s)))}}function Ej(n){ja.D(n),fb("dns-prefetch",n,null)}function Cj(n,s){ja.C(n,s),fb("preconnect",n,s)}function Aj(n,s,i){ja.L(n,s,i);var d=jo;if(d&&n&&s){var g='link[rel="preload"][as="'+dr(s)+'"]';s==="image"&&i&&i.imageSrcSet?(g+='[imagesrcset="'+dr(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(g+='[imagesizes="'+dr(i.imageSizes)+'"]')):g+='[href="'+dr(n)+'"]';var y=g;switch(s){case"style":y=ko(n);break;case"script":y=No(n)}br.has(y)||(n=x({rel:"preload",href:s==="image"&&i&&i.imageSrcSet?void 0:n,as:s},i),br.set(y,n),d.querySelector(g)!==null||s==="style"&&d.querySelector(Ti(y))||s==="script"&&d.querySelector(Li(y))||(s=d.createElement("link"),vn(s,"link",n),it(s),d.head.appendChild(s)))}}function Rj(n,s){ja.m(n,s);var i=jo;if(i&&n){var d=s&&typeof s.as=="string"?s.as:"script",g='link[rel="modulepreload"][as="'+dr(d)+'"][href="'+dr(n)+'"]',y=g;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=No(n)}if(!br.has(y)&&(n=x({rel:"modulepreload",href:n},s),br.set(y,n),i.querySelector(g)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Li(y)))return}d=i.createElement("link"),vn(d,"link",n),it(d),i.head.appendChild(d)}}}function Tj(n,s,i){ja.S(n,s,i);var d=jo;if(d&&n){var g=gt(d).hoistableStyles,y=ko(n);s=s||"default";var j=g.get(y);if(!j){var C={loading:0,preload:null};if(j=d.querySelector(Ti(y)))C.loading=5;else{n=x({rel:"stylesheet",href:n,"data-precedence":s},i),(i=br.get(y))&&vp(n,i);var U=j=d.createElement("link");it(U),vn(U,"link",n),U._p=new Promise(function(X,ie){U.onload=X,U.onerror=ie}),U.addEventListener("load",function(){C.loading|=1}),U.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Gc(j,s,d)}j={type:"stylesheet",instance:j,count:1,state:C},g.set(y,j)}}}function Lj(n,s){ja.X(n,s);var i=jo;if(i&&n){var d=gt(i).hoistableScripts,g=No(n),y=d.get(g);y||(y=i.querySelector(Li(g)),y||(n=x({src:n,async:!0},s),(s=br.get(g))&&_p(n,s),y=i.createElement("script"),it(y),vn(y,"link",n),i.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(g,y))}}function Dj(n,s){ja.M(n,s);var i=jo;if(i&&n){var d=gt(i).hoistableScripts,g=No(n),y=d.get(g);y||(y=i.querySelector(Li(g)),y||(n=x({src:n,async:!0,type:"module"},s),(s=br.get(g))&&_p(n,s),y=i.createElement("script"),it(y),vn(y,"link",n),i.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(g,y))}}function pb(n,s,i,d){var g=(g=ge.current)?qc(g):null;if(!g)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(s=ko(i.href),i=gt(g).hoistableStyles,d=i.get(s),d||(d={type:"style",instance:null,count:0,state:null},i.set(s,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){n=ko(i.href);var y=gt(g).hoistableStyles,j=y.get(n);if(j||(g=g.ownerDocument||g,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(n,j),(y=g.querySelector(Ti(n)))&&!y._p&&(j.instance=y,j.state.loading=5),br.has(n)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},br.set(n,i),y||Oj(g,n,i,j.state))),s&&d===null)throw Error(a(528,""));return j}if(s&&d!==null)throw Error(a(529,""));return null;case"script":return s=i.async,i=i.src,typeof i=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=No(i),i=gt(g).hoistableScripts,d=i.get(s),d||(d={type:"script",instance:null,count:0,state:null},i.set(s,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function ko(n){return'href="'+dr(n)+'"'}function Ti(n){return'link[rel="stylesheet"]['+n+"]"}function hb(n){return x({},n,{"data-precedence":n.precedence,precedence:null})}function Oj(n,s,i,d){n.querySelector('link[rel="preload"][as="style"]['+s+"]")?d.loading=1:(s=n.createElement("link"),d.preload=s,s.addEventListener("load",function(){return d.loading|=1}),s.addEventListener("error",function(){return d.loading|=2}),vn(s,"link",i),it(s),n.head.appendChild(s))}function No(n){return'[src="'+dr(n)+'"]'}function Li(n){return"script[async]"+n}function mb(n,s,i){if(s.count++,s.instance===null)switch(s.type){case"style":var d=n.querySelector('style[data-href~="'+dr(i.href)+'"]');if(d)return s.instance=d,it(d),d;var g=x({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),it(d),vn(d,"style",g),Gc(d,i.precedence,n),s.instance=d;case"stylesheet":g=ko(i.href);var y=n.querySelector(Ti(g));if(y)return s.state.loading|=4,s.instance=y,it(y),y;d=hb(i),(g=br.get(g))&&vp(d,g),y=(n.ownerDocument||n).createElement("link"),it(y);var j=y;return j._p=new Promise(function(C,U){j.onload=C,j.onerror=U}),vn(y,"link",d),s.state.loading|=4,Gc(y,i.precedence,n),s.instance=y;case"script":return y=No(i.src),(g=n.querySelector(Li(y)))?(s.instance=g,it(g),g):(d=i,(g=br.get(y))&&(d=x({},i),_p(d,g)),n=n.ownerDocument||n,g=n.createElement("script"),it(g),vn(g,"link",d),n.head.appendChild(g),s.instance=g);case"void":return null;default:throw Error(a(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(d=s.instance,s.state.loading|=4,Gc(d,i.precedence,n));return s.instance}function Gc(n,s,i){for(var d=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=d.length?d[d.length-1]:null,y=g,j=0;j<d.length;j++){var C=d[j];if(C.dataset.precedence===s)y=C;else if(y!==g)break}y?y.parentNode.insertBefore(n,y.nextSibling):(s=i.nodeType===9?i.head:i,s.insertBefore(n,s.firstChild))}function vp(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.title==null&&(n.title=s.title)}function _p(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.integrity==null&&(n.integrity=s.integrity)}var Vc=null;function gb(n,s,i){if(Vc===null){var d=new Map,g=Vc=new Map;g.set(i,d)}else g=Vc,d=g.get(i),d||(d=new Map,g.set(i,d));if(d.has(n))return d;for(d.set(n,null),i=i.getElementsByTagName(n),g=0;g<i.length;g++){var y=i[g];if(!(y[ue]||y[je]||n==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var j=y.getAttribute(s)||"";j=n+j;var C=d.get(j);C?C.push(y):d.set(j,[y])}}return d}function xb(n,s,i){n=n.ownerDocument||n,n.head.insertBefore(i,s==="title"?n.querySelector("head > title"):null)}function Mj(n,s,i){if(i===1||s.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(n=s.disabled,typeof s.precedence=="string"&&n==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function yb(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function zj(n,s,i,d){if(i.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var g=ko(d.href),y=s.querySelector(Ti(g));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(n.count++,n=Yc.bind(n),s.then(n,n)),i.state.loading|=4,i.instance=y,it(y);return}y=s.ownerDocument||s,d=hb(d),(g=br.get(g))&&vp(d,g),y=y.createElement("link"),it(y);var j=y;j._p=new Promise(function(C,U){j.onload=C,j.onerror=U}),vn(y,"link",d),i.instance=y}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(i,s),(s=i.state.preload)&&(i.state.loading&3)===0&&(n.count++,i=Yc.bind(n),s.addEventListener("load",i),s.addEventListener("error",i))}}var wp=0;function $j(n,s){return n.stylesheets&&n.count===0&&Xc(n,n.stylesheets),0<n.count||0<n.imgCount?function(i){var d=setTimeout(function(){if(n.stylesheets&&Xc(n,n.stylesheets),n.unsuspend){var y=n.unsuspend;n.unsuspend=null,y()}},6e4+s);0<n.imgBytes&&wp===0&&(wp=62500*xj());var g=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Xc(n,n.stylesheets),n.unsuspend)){var y=n.unsuspend;n.unsuspend=null,y()}},(n.imgBytes>wp?50:800)+s);return n.unsuspend=i,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(g)}}:null}function Yc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Kc=null;function Xc(n,s){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Kc=new Map,s.forEach(Bj,n),Kc=null,Yc.call(n))}function Bj(n,s){if(!(s.state.loading&4)){var i=Kc.get(n);if(i)var d=i.get(null);else{i=new Map,Kc.set(n,i);for(var g=n.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<g.length;y++){var j=g[y];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(i.set(j.dataset.precedence,j),d=j)}d&&i.set(null,d)}g=s.instance,j=g.getAttribute("data-precedence"),y=i.get(j)||d,y===d&&i.set(null,g),i.set(j,g),this.count++,d=Yc.bind(this),g.addEventListener("load",d),g.addEventListener("error",d),y?y.parentNode.insertBefore(g,y.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(g,n.firstChild)),s.state.loading|=4}}var Di={$$typeof:E,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function Ij(n,s,i,d,g,y,j,C,U){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ur(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ur(0),this.hiddenUpdates=ur(null),this.identifierPrefix=d,this.onUncaughtError=g,this.onCaughtError=y,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function bb(n,s,i,d,g,y,j,C,U,X,ie,pe){return n=new Ij(n,s,i,j,U,X,ie,pe,C),s=1,y===!0&&(s|=24),y=Zn(3,null,null,s),n.current=y,y.stateNode=n,s=ef(),s.refCount++,n.pooledCache=s,s.refCount++,y.memoizedState={element:d,isDehydrated:i,cache:s},af(y),n}function vb(n){return n?(n=no,n):no}function _b(n,s,i,d,g,y){g=vb(g),d.context===null?d.context=g:d.pendingContext=g,d=Ha(s),d.payload={element:i},y=y===void 0?null:y,y!==null&&(d.callback=y),i=Fa(n,d,s),i!==null&&(qn(i,n,s),di(i,n,s))}function wb(n,s){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<s?i:s}}function Sp(n,s){wb(n,s),(n=n.alternate)&&wb(n,s)}function Sb(n){if(n.tag===13||n.tag===31){var s=xs(n,67108864);s!==null&&qn(s,n,67108864),Sp(n,67108864)}}function jb(n){if(n.tag===13||n.tag===31){var s=nr();s=G(s);var i=xs(n,s);i!==null&&qn(i,n,s),Sp(n,s)}}var Qc=!0;function Uj(n,s,i,d){var g=T.T;T.T=null;var y=q.p;try{q.p=2,jp(n,s,i,d)}finally{q.p=y,T.T=g}}function Pj(n,s,i,d){var g=T.T;T.T=null;var y=q.p;try{q.p=8,jp(n,s,i,d)}finally{q.p=y,T.T=g}}function jp(n,s,i,d){if(Qc){var g=kp(d);if(g===null)up(n,s,d,Zc,i),Nb(n,d);else if(Fj(g,n,s,i,d))d.stopPropagation();else if(Nb(n,d),s&4&&-1<Hj.indexOf(n)){for(;g!==null;){var y=Ge(g);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var j=nt(y.pendingLanes);if(j!==0){var C=y;for(C.pendingLanes|=2,C.entangledLanes|=2;j;){var U=1<<31-Pt(j);C.entanglements[1]|=U,j&=~U}Fr(y),(mt&6)===0&&(Dc=Ht()+500,Ei(0))}}break;case 31:case 13:C=xs(y,2),C!==null&&qn(C,y,2),Mc(),Sp(y,2)}if(y=kp(d),y===null&&up(n,s,d,Zc,i),y===g)break;g=y}g!==null&&d.stopPropagation()}else up(n,s,d,null,i)}}function kp(n){return n=Nd(n),Np(n)}var Zc=null;function Np(n){if(Zc=null,n=Re(n),n!==null){var s=l(n);if(s===null)n=null;else{var i=s.tag;if(i===13){if(n=u(s),n!==null)return n;n=null}else if(i===31){if(n=f(s),n!==null)return n;n=null}else if(i===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;n=null}else s!==n&&(n=null)}}return Zc=n,null}function kb(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(An()){case Le:return 2;case Ze:return 8;case We:case Nt:return 32;case ft:return 268435456;default:return 32}default:return 32}}var Ep=!1,es=null,ts=null,ns=null,Oi=new Map,Mi=new Map,rs=[],Hj="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Nb(n,s){switch(n){case"focusin":case"focusout":es=null;break;case"dragenter":case"dragleave":ts=null;break;case"mouseover":case"mouseout":ns=null;break;case"pointerover":case"pointerout":Oi.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mi.delete(s.pointerId)}}function zi(n,s,i,d,g,y){return n===null||n.nativeEvent!==y?(n={blockedOn:s,domEventName:i,eventSystemFlags:d,nativeEvent:y,targetContainers:[g]},s!==null&&(s=Ge(s),s!==null&&Sb(s)),n):(n.eventSystemFlags|=d,s=n.targetContainers,g!==null&&s.indexOf(g)===-1&&s.push(g),n)}function Fj(n,s,i,d,g){switch(s){case"focusin":return es=zi(es,n,s,i,d,g),!0;case"dragenter":return ts=zi(ts,n,s,i,d,g),!0;case"mouseover":return ns=zi(ns,n,s,i,d,g),!0;case"pointerover":var y=g.pointerId;return Oi.set(y,zi(Oi.get(y)||null,n,s,i,d,g)),!0;case"gotpointercapture":return y=g.pointerId,Mi.set(y,zi(Mi.get(y)||null,n,s,i,d,g)),!0}return!1}function Eb(n){var s=Re(n.target);if(s!==null){var i=l(s);if(i!==null){if(s=i.tag,s===13){if(s=u(i),s!==null){n.blockedOn=s,we(n.priority,function(){jb(i)});return}}else if(s===31){if(s=f(i),s!==null){n.blockedOn=s,we(n.priority,function(){jb(i)});return}}else if(s===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Jc(n){if(n.blockedOn!==null)return!1;for(var s=n.targetContainers;0<s.length;){var i=kp(n.nativeEvent);if(i===null){i=n.nativeEvent;var d=new i.constructor(i.type,i);kd=d,i.target.dispatchEvent(d),kd=null}else return s=Ge(i),s!==null&&Sb(s),n.blockedOn=i,!1;s.shift()}return!0}function Cb(n,s,i){Jc(n)&&i.delete(s)}function qj(){Ep=!1,es!==null&&Jc(es)&&(es=null),ts!==null&&Jc(ts)&&(ts=null),ns!==null&&Jc(ns)&&(ns=null),Oi.forEach(Cb),Mi.forEach(Cb)}function Wc(n,s){n.blockedOn===s&&(n.blockedOn=null,Ep||(Ep=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,qj)))}var eu=null;function Ab(n){eu!==n&&(eu=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){eu===n&&(eu=null);for(var s=0;s<n.length;s+=3){var i=n[s],d=n[s+1],g=n[s+2];if(typeof d!="function"){if(Np(d||i)===null)continue;break}var y=Ge(i);y!==null&&(n.splice(s,3),s-=3,kf(y,{pending:!0,data:g,method:i.method,action:d},d,g))}}))}function Eo(n){function s(U){return Wc(U,n)}es!==null&&Wc(es,n),ts!==null&&Wc(ts,n),ns!==null&&Wc(ns,n),Oi.forEach(s),Mi.forEach(s);for(var i=0;i<rs.length;i++){var d=rs[i];d.blockedOn===n&&(d.blockedOn=null)}for(;0<rs.length&&(i=rs[0],i.blockedOn===null);)Eb(i),i.blockedOn===null&&rs.shift();if(i=(n.ownerDocument||n).$$reactFormReplay,i!=null)for(d=0;d<i.length;d+=3){var g=i[d],y=i[d+1],j=g[ke]||null;if(typeof y=="function")j||Ab(i);else if(j){var C=null;if(y&&y.hasAttribute("formAction")){if(g=y,j=y[ke]||null)C=j.formAction;else if(Np(g)!==null)continue}else C=j.action;typeof C=="function"?i[d+1]=C:(i.splice(d,3),d-=3),Ab(i)}}}function Rb(){function n(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(j){return g=j})},focusReset:"manual",scroll:"manual"})}function s(){g!==null&&(g(),g=null),d||setTimeout(i,20)}function i(){if(!d&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,g=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(i,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),g!==null&&(g(),g=null)}}}function Cp(n){this._internalRoot=n}tu.prototype.render=Cp.prototype.render=function(n){var s=this._internalRoot;if(s===null)throw Error(a(409));var i=s.current,d=nr();_b(i,d,n,s,null,null)},tu.prototype.unmount=Cp.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var s=n.containerInfo;_b(n.current,2,null,n,null,null),Mc(),s[Ce]=null}};function tu(n){this._internalRoot=n}tu.prototype.unstable_scheduleHydration=function(n){if(n){var s=xe();n={blockedOn:null,target:n,priority:s};for(var i=0;i<rs.length&&s!==0&&s<rs[i].priority;i++);rs.splice(i,0,n),i===0&&Eb(n)}};var Tb=t.version;if(Tb!=="19.2.4")throw Error(a(527,Tb,"19.2.4"));q.findDOMNode=function(n){var s=n._reactInternals;if(s===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=p(s),n=n!==null?m(n):null,n=n===null?null:n.stateNode,n};var Gj={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nu.isDisabled&&nu.supportsFiber)try{gn=nu.inject(Gj),Lt=nu}catch{}}return Ii.createRoot=function(n,s){if(!o(n))throw Error(a(299));var i=!1,d="",g=Bx,y=Ix,j=Ux;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(g=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError)),s=bb(n,1,!1,null,null,i,d,null,g,y,j,Rb),n[Ce]=s.current,cp(n),new Cp(s)},Ii.hydrateRoot=function(n,s,i){if(!o(n))throw Error(a(299));var d=!1,g="",y=Bx,j=Ix,C=Ux,U=null;return i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(g=i.identifierPrefix),i.onUncaughtError!==void 0&&(y=i.onUncaughtError),i.onCaughtError!==void 0&&(j=i.onCaughtError),i.onRecoverableError!==void 0&&(C=i.onRecoverableError),i.formState!==void 0&&(U=i.formState)),s=bb(n,1,!0,s,i??null,d,g,U,y,j,C,Rb),s.context=vb(null),i=s.current,d=nr(),d=G(d),g=Ha(d),g.callback=null,Fa(i,g,d),i=d,s.current.lanes=i,Tn(s,i),Fr(s),n[Ce]=s.current,cp(n),new tu(s)},Ii.version="19.2.4",Ii}var l0;function lk(){if(l0)return zp.exports;l0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),zp.exports=ik(),zp.exports}var ck=lk();var K_=e=>{throw TypeError(e)},uk=(e,t,r)=>t.has(e)||K_("Cannot "+r),Up=(e,t,r)=>(uk(e,t,"read from private field"),r?r.call(e):t.get(e)),dk=(e,t,r)=>t.has(e)?K_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),c0="popstate";function u0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function fk(e={}){function t(a,o){let l=o.state?.masked,{pathname:u,search:f,hash:h}=l||a.location;return hl("",{pathname:u,search:f,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default",l?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,o){return typeof o=="string"?o:Jr(o)}return hk(t,r,null,e)}function rt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Gt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function pk(){return Math.random().toString(36).substring(2,10)}function d0(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function hl(e,t,r=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Da(t):t,state:r,key:t&&t.key||a||pk(),unstable_mask:o}}function Jr({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Da(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function hk(e,t,r,a={}){let{window:o=document.defaultView,v5Compat:l=!1}=a,u=o.history,f="POP",h=null,p=m();p==null&&(p=0,u.replaceState({...u.state,idx:p},""));function m(){return(u.state||{idx:null}).idx}function x(){f="POP";let k=m(),N=k==null?null:k-p;p=k,h&&h({action:f,location:S.location,delta:N})}function v(k,N){f="PUSH";let A=u0(k)?k:hl(S.location,k,N);p=m()+1;let E=d0(A,p),D=S.createHref(A.unstable_mask||A);try{u.pushState(E,"",D)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;o.location.assign(D)}l&&h&&h({action:f,location:S.location,delta:1})}function _(k,N){f="REPLACE";let A=u0(k)?k:hl(S.location,k,N);p=m();let E=d0(A,p),D=S.createHref(A.unstable_mask||A);u.replaceState(E,"",D),l&&h&&h({action:f,location:S.location,delta:0})}function w(k){return X_(k)}let S={get action(){return f},get location(){return e(o,u)},listen(k){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(c0,x),h=k,()=>{o.removeEventListener(c0,x),h=null}},createHref(k){return t(o,k)},createURL:w,encodeLocation(k){let N=w(k);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:v,replace:_,go(k){return u.go(k)}};return S}function X_(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),rt(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Jr(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}var nl,f0=class{constructor(e){if(dk(this,nl,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Up(this,nl).has(e))return Up(this,nl).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Up(this,nl).set(e,t)}};nl=new WeakMap;var mk=new Set(["lazy","caseSensitive","path","id","index","children"]);function gk(e){return mk.has(e)}var xk=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function yk(e){return xk.has(e)}function bk(e){return e.index===!0}function ml(e,t,r=[],a={},o=!1){return e.map((l,u)=>{let f=[...r,String(u)],h=typeof l.id=="string"?l.id:f.join("-");if(rt(l.index!==!0||!l.children,"Cannot specify children on an index route"),rt(o||!a[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),bk(l)){let p={...l,id:h};return a[h]=p0(p,t(p)),p}else{let p={...l,id:h,children:void 0};return a[h]=p0(p,t(p)),l.children&&(p.children=ml(l.children,t,f,a,o)),p}})}function p0(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function os(e,t,r="/"){return rl(e,t,r,!1)}function rl(e,t,r,a){let o=typeof t=="string"?Da(t):t,l=Sr(o.pathname||"/",r);if(l==null)return null;let u=Q_(e);_k(u);let f=null;for(let h=0;f==null&&h<u.length;++h){let p=Lk(l);f=Rk(u[h],p,a)}return f}function vk(e,t){let{route:r,pathname:a,params:o}=e;return{id:r.id,pathname:a,params:o,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function Q_(e,t=[],r=[],a="",o=!1){let l=(u,f,h=o,p)=>{let m={relativePath:p===void 0?u.path||"":p,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(a)&&h)return;rt(m.relativePath.startsWith(a),`Absolute route path "${m.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(a.length)}let x=Lr([a,m.relativePath]),v=r.concat(m);u.children&&u.children.length>0&&(rt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Q_(u.children,t,v,x,h)),!(u.path==null&&!u.index)&&t.push({path:x,score:Ck(x,u.index),routesMeta:v})};return e.forEach((u,f)=>{if(u.path===""||!u.path?.includes("?"))l(u,f);else for(let h of Z_(u.path))l(u,f,!0,h)}),t}function Z_(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,o=r.endsWith("?"),l=r.replace(/\?$/,"");if(a.length===0)return o?[l,""]:[l];let u=Z_(a.join("/")),f=[];return f.push(...u.map(h=>h===""?l:[l,h].join("/"))),o&&f.push(...u),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function _k(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Ak(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var wk=/^:[\w-]+$/,Sk=3,jk=2,kk=1,Nk=10,Ek=-2,h0=e=>e==="*";function Ck(e,t){let r=e.split("/"),a=r.length;return r.some(h0)&&(a+=Ek),t&&(a+=jk),r.filter(o=>!h0(o)).reduce((o,l)=>o+(wk.test(l)?Sk:l===""?kk:Nk),a)}function Ak(e,t){return e.length===t.length&&e.slice(0,-1).every((a,o)=>a===t[o])?e[e.length-1]-t[t.length-1]:0}function Rk(e,t,r=!1){let{routesMeta:a}=e,o={},l="/",u=[];for(let f=0;f<a.length;++f){let h=a[f],p=f===a.length-1,m=l==="/"?t:t.slice(l.length)||"/",x=Bu({path:h.relativePath,caseSensitive:h.caseSensitive,end:p},m),v=h.route;if(!x&&p&&r&&!a[a.length-1].route.index&&(x=Bu({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!x)return null;Object.assign(o,x.params),u.push({params:o,pathname:Lr([l,x.pathname]),pathnameBase:Mk(Lr([l,x.pathnameBase])),route:v}),x.pathnameBase!=="/"&&(l=Lr([l,x.pathnameBase]))}return u}function Bu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Tk(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let l=o[0],u=l.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:a.reduce((p,{paramName:m,isOptional:x},v)=>{if(m==="*"){let w=f[v]||"";u=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const _=f[v];return x&&!_?p[m]=void 0:p[m]=(_||"").replace(/%2F/g,"/"),p},{}),pathname:l,pathnameBase:u,pattern:e}}function Tk(e,t=!1,r=!0){Gt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,h,p,m)=>{if(a.push({paramName:f,isOptional:h!=null}),h){let x=m.charAt(p+u.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),a]}function Lk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Gt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Sr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Dk({basename:e,pathname:t}){return t==="/"?e:Lr([e,t])}var J_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cm=e=>J_.test(e);function Ok(e,t="/"){let{pathname:r,search:a="",hash:o=""}=typeof e=="string"?Da(e):e,l;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?l=m0(r.substring(1),"/"):l=m0(r,t)):l=t,{pathname:l,search:zk(a),hash:$k(o)}}function m0(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Pp(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function W_(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function sd(e){let t=W_(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Al(e,t,r,a=!1){let o;typeof e=="string"?o=Da(e):(o={...e},rt(!o.pathname||!o.pathname.includes("?"),Pp("?","pathname","search",o)),rt(!o.pathname||!o.pathname.includes("#"),Pp("#","pathname","hash",o)),rt(!o.search||!o.search.includes("#"),Pp("#","search","hash",o)));let l=e===""||o.pathname==="",u=l?"/":o.pathname,f;if(u==null)f=r;else{let x=t.length-1;if(!a&&u.startsWith("..")){let v=u.split("/");for(;v[0]==="..";)v.shift(),x-=1;o.pathname=v.join("/")}f=x>=0?t[x]:"/"}let h=Ok(o,f),p=u&&u!=="/"&&u.endsWith("/"),m=(l||u===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(p||m)&&(h.pathname+="/"),h}var Lr=e=>e.join("/").replace(/\/\/+/g,"/"),Mk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),zk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,$k=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Rl=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Uo(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Tl(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var e1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function t1(e,t){let r=e;if(typeof r!="string"||!J_.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,o=!1;if(e1)try{let l=new URL(window.location.href),u=r.startsWith("//")?new URL(l.protocol+r):new URL(r),f=Sr(u.pathname,t);u.origin===l.origin&&f!=null?r=f+u.search+u.hash:o=!0}catch{Gt(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:o,to:r}}var ls=Symbol("Uninstrumented");function Bk(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(l){let u=Object.keys(r);for(let f of u)l[f]&&r[f].push(l[f])}}));let a={};if(typeof t.lazy=="function"&&r.lazy.length>0){let o=Oo(r.lazy,t.lazy,()=>{});o&&(a.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(l=>{let u=o[l],f=r[`lazy.${l}`];if(typeof u=="function"&&f.length>0){let h=Oo(f,u,()=>{});h&&(a.lazy=Object.assign(a.lazy||{},{[l]:h}))}})}return["loader","action"].forEach(o=>{let l=t[o];if(typeof l=="function"&&r[o].length>0){let u=l[ls]??l,f=Oo(r[o],u,(...h)=>g0(h[0]));f&&(o==="loader"&&u.hydrate===!0&&(f.hydrate=!0),f[ls]=u,a[o]=f)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(o=>{let l=o[ls]??o,u=Oo(r.middleware,l,(...f)=>g0(f[0]));return u?(u[ls]=l,u):o})),a}function Ik(e,t){let r={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(o){let l=Object.keys(o);for(let u of l)o[u]&&r[u].push(o[u])}})),r.navigate.length>0){let a=e.navigate[ls]??e.navigate,o=Oo(r.navigate,a,(...l)=>{let[u,f]=l;return{to:typeof u=="number"||typeof u=="string"?u:u?Jr(u):".",...x0(e,f??{})}});o&&(o[ls]=a,e.navigate=o)}if(r.fetch.length>0){let a=e.fetch[ls]??e.fetch,o=Oo(r.fetch,a,(...l)=>{let[u,,f,h]=l;return{href:f??".",fetcherKey:u,...x0(e,h??{})}});o&&(o[ls]=a,e.fetch=o)}return e}function Oo(e,t,r){return e.length===0?null:async(...a)=>{let o=await n1(e,r(...a),()=>t(...a),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function n1(e,t,r,a){let o=e[a],l;if(o){let u,f=async()=>(u?console.error("You cannot call instrumented handlers more than once"):u=n1(e,t,r,a-1),l=await u,rt(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await o(f,t)}catch(h){console.error("An instrumentation function threw an error:",h)}u||await f(),await u}else try{l={type:"success",value:await r()}}catch(u){l={type:"error",value:u}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function g0(e){let{request:t,context:r,params:a,unstable_pattern:o}=e;return{request:Uk(t),params:{...a},unstable_pattern:o,context:Pk(r)}}function x0(e,t){return{currentUrl:Jr(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function Uk(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Pk(e){if(Fk(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Hk=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Fk(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Hk}var r1=["POST","PUT","PATCH","DELETE"],qk=new Set(r1),Gk=["GET",...r1],Vk=new Set(Gk),a1=new Set([301,302,303,307,308]),Yk=new Set([307,308]),Hp={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Kk={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ui={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Xk=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),s1="remix-router-transitions",o1=Symbol("ResetLoaderData");function Qk(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";rt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],o=e.mapRouteProperties||Xk,l=o;if(e.unstable_instrumentations){let I=e.unstable_instrumentations;l=G=>({...o(G),...Bk(I.map(Z=>Z.route).filter(Boolean),G)})}let u={},f=ml(e.routes,l,void 0,u),h,p=e.basename||"/";p.startsWith("/")||(p=`/${p}`);let m=e.dataStrategy||tN,x={...e.future},v=null,_=new Set,w=null,S=null,k=null,N=e.hydrationData!=null,A=os(f,e.history.location,p),E=!1,D=null,L,$;if(A==null&&!e.patchRoutesOnNavigation){let I=_r(404,{pathname:e.history.location.pathname}),{matches:G,route:Z}=au(f);L=!0,$=!L,A=G,D={[Z.id]:I}}else if(A&&!e.hydrationData&&ur(A,f,e.history.location.pathname).active&&(A=null),A)if(A.some(I=>I.route.lazy))L=!1,$=!L;else if(!A.some(I=>um(I.route)))L=!0,$=!L;else{let I=e.hydrationData?e.hydrationData.loaderData:null,G=e.hydrationData?e.hydrationData.errors:null,Z=A;if(G){let xe=A.findIndex(we=>G[we.route.id]!==void 0);Z=Z.slice(0,xe+1)}$=!1,L=Z.every(xe=>{let we=i1(xe.route,I,G);return $=$||we.renderFallback,!we.shouldLoad})}else{L=!1,$=!L,A=[];let I=ur(null,f,e.history.location.pathname);I.active&&I.matches&&(E=!0,A=I.matches)}let z,R={historyAction:e.history.action,location:e.history.location,matches:A,initialized:L,renderFallback:$,navigation:Hp,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||D,fetchers:new Map,blockers:new Map},B="POP",H=null,J=!1,oe,ce=!1,M=new Map,P=null,T=!1,q=!1,ee=new Set,ae=new Map,W=0,O=-1,V=new Map,re=new Set,se=new Map,ne=new Map,ge=new Set,Ne=new Map,qe,Fe=null;function be(){if(v=e.history.listen(({action:I,location:G,delta:Z})=>{if(qe){qe(),qe=void 0;return}Gt(Ne.size===0||Z!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let xe=St({currentLocation:R.location,nextLocation:G,historyAction:I});if(xe&&Z!=null){let we=new Promise(Ae=>{qe=Ae});e.history.go(Z*-1),Ue(xe,{state:"blocked",location:G,proceed(){Ue(xe,{state:"proceeding",proceed:void 0,reset:void 0,location:G}),we.then(()=>e.history.go(Z))},reset(){let Ae=new Map(R.blockers);Ae.set(xe,Ui),he({blockers:Ae})}}),H?.resolve(),H=null;return}return Xe(I,G)}),r){bN(t,M);let I=()=>vN(t,M);t.addEventListener("pagehide",I),P=()=>t.removeEventListener("pagehide",I)}return R.initialized||Xe("POP",R.location,{initialHydration:!0}),z}function fe(){v&&v(),P&&P(),_.clear(),oe&&oe.abort(),R.fetchers.forEach((I,G)=>gn(G)),R.blockers.forEach((I,G)=>me(G))}function _e(I){return _.add(I),()=>_.delete(I)}function he(I,G={}){I.matches&&(I.matches=I.matches.map(we=>{let Ae=u[we.route.id],je=we.route;return je.element!==Ae.element||je.errorElement!==Ae.errorElement||je.hydrateFallbackElement!==Ae.hydrateFallbackElement?{...we,route:Ae}:we})),R={...R,...I};let Z=[],xe=[];R.fetchers.forEach((we,Ae)=>{we.state==="idle"&&(ge.has(Ae)?Z.push(Ae):xe.push(Ae))}),ge.forEach(we=>{!R.fetchers.has(we)&&!ae.has(we)&&Z.push(we)}),[..._].forEach(we=>we(R,{deletedFetchers:Z,newErrors:I.errors??null,viewTransitionOpts:G.viewTransitionOpts,flushSync:G.flushSync===!0})),Z.forEach(we=>gn(we)),xe.forEach(we=>R.fetchers.delete(we))}function ve(I,G,{flushSync:Z}={}){let xe=R.actionData!=null&&R.navigation.formMethod!=null&&kn(R.navigation.formMethod)&&R.navigation.state==="loading"&&I.state?._isRedirect!==!0,we;G.actionData?Object.keys(G.actionData).length>0?we=G.actionData:we=null:xe?we=R.actionData:we=null;let Ae=G.loaderData?E0(R.loaderData,G.loaderData,G.matches||[],G.errors):R.loaderData,je=R.blockers;je.size>0&&(je=new Map(je),je.forEach((Pe,Be)=>je.set(Be,Ui)));let ke=T?!1:oa(I,G.matches||R.matches),Ce=J===!0||R.navigation.formMethod!=null&&kn(R.navigation.formMethod)&&I.state?._isRedirect!==!0;h&&(f=h,h=void 0),T||B==="POP"||(B==="PUSH"?e.history.push(I,I.state):B==="REPLACE"&&e.history.replace(I,I.state));let Ie;if(B==="POP"){let Pe=M.get(R.location.pathname);Pe&&Pe.has(I.pathname)?Ie={currentLocation:R.location,nextLocation:I}:M.has(I.pathname)&&(Ie={currentLocation:I,nextLocation:R.location})}else if(ce){let Pe=M.get(R.location.pathname);Pe?Pe.add(I.pathname):(Pe=new Set([I.pathname]),M.set(R.location.pathname,Pe)),Ie={currentLocation:R.location,nextLocation:I}}he({...G,actionData:we,loaderData:Ae,historyAction:B,location:I,initialized:!0,renderFallback:!1,navigation:Hp,revalidation:"idle",restoreScrollPosition:ke,preventScrollReset:Ce,blockers:je},{viewTransitionOpts:Ie,flushSync:Z===!0}),B="POP",J=!1,ce=!1,T=!1,q=!1,H?.resolve(),H=null,Fe?.resolve(),Fe=null}async function Ve(I,G){if(H?.resolve(),H=null,typeof I=="number"){H||(H=T0());let Ee=H.promise;return e.history.go(I),Ee}let Z=vh(R.location,R.matches,p,I,G?.fromRouteId,G?.relative),{path:xe,submission:we,error:Ae}=y0(!1,Z,G),je;G?.unstable_mask&&(je={pathname:"",search:"",hash:"",...typeof G.unstable_mask=="string"?Da(G.unstable_mask):{...R.location.unstable_mask,...G.unstable_mask}});let ke=R.location,Ce=hl(ke,xe,G&&G.state,void 0,je);Ce={...Ce,...e.history.encodeLocation(Ce)};let Ie=G&&G.replace!=null?G.replace:void 0,Pe="PUSH";Ie===!0?Pe="REPLACE":Ie===!1||we!=null&&kn(we.formMethod)&&we.formAction===R.location.pathname+R.location.search&&(Pe="REPLACE");let Be=G&&"preventScrollReset"in G?G.preventScrollReset===!0:void 0,dt=(G&&G.flushSync)===!0,ue=St({currentLocation:ke,nextLocation:Ce,historyAction:Pe});if(ue){Ue(ue,{state:"blocked",location:Ce,proceed(){Ue(ue,{state:"proceeding",proceed:void 0,reset:void 0,location:Ce}),Ve(I,G)},reset(){let Ee=new Map(R.blockers);Ee.set(ue,Ui),he({blockers:Ee})}});return}await Xe(Pe,Ce,{submission:we,pendingError:Ae,preventScrollReset:Be,replace:G&&G.replace,enableViewTransition:G&&G.viewTransition,flushSync:dt,callSiteDefaultShouldRevalidate:G&&G.unstable_defaultShouldRevalidate})}function De(){Fe||(Fe=T0()),We(),he({revalidation:"loading"});let I=Fe.promise;return R.navigation.state==="submitting"?I:R.navigation.state==="idle"?(Xe(R.historyAction,R.location,{startUninterruptedRevalidation:!0}),I):(Xe(B||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:ce===!0}),I)}async function Xe(I,G,Z){oe&&oe.abort(),oe=null,B=I,T=(Z&&Z.startUninterruptedRevalidation)===!0,Oa(R.location,R.matches),J=(Z&&Z.preventScrollReset)===!0,ce=(Z&&Z.enableViewTransition)===!0;let xe=h||f,we=Z&&Z.overrideNavigation,Ae=Z?.initialHydration&&R.matches&&R.matches.length>0&&!E?R.matches:os(xe,G,p),je=(Z&&Z.flushSync)===!0;if(Ae&&R.initialized&&!q&&cN(R.location,G)&&!(Z&&Z.submission&&kn(Z.submission.formMethod))){ve(G,{matches:Ae},{flushSync:je});return}let ke=ur(Ae,xe,G.pathname);if(ke.active&&ke.matches&&(Ae=ke.matches),!Ae){let{error:Re,notFoundMatches:Ge,route:Oe}=nt(G.pathname);ve(G,{matches:Ge,loaderData:{},errors:{[Oe.id]:Re}},{flushSync:je});return}oe=new AbortController;let Ce=Lo(e.history,G,oe.signal,Z&&Z.submission),Ie=e.getContext?await e.getContext():new f0,Pe;if(Z&&Z.pendingError)Pe=[is(Ae).route.id,{type:"error",error:Z.pendingError}];else if(Z&&Z.submission&&kn(Z.submission.formMethod)){let Re=await It(Ce,G,Z.submission,Ae,Ie,ke.active,Z&&Z.initialHydration===!0,{replace:Z.replace,flushSync:je});if(Re.shortCircuited)return;if(Re.pendingActionResult){let[Ge,Oe]=Re.pendingActionResult;if(ar(Oe)&&Uo(Oe.error)&&Oe.error.status===404){oe=null,ve(G,{matches:Re.matches,loaderData:{},errors:{[Ge]:Oe.error}});return}}Ae=Re.matches||Ae,Pe=Re.pendingActionResult,we=Fp(G,Z.submission),je=!1,ke.active=!1,Ce=Lo(e.history,Ce.url,Ce.signal)}let{shortCircuited:Be,matches:dt,loaderData:ue,errors:Ee}=await un(Ce,G,Ae,Ie,ke.active,we,Z&&Z.submission,Z&&Z.fetcherSubmission,Z&&Z.replace,Z&&Z.initialHydration===!0,je,Pe,Z&&Z.callSiteDefaultShouldRevalidate);Be||(oe=null,ve(G,{matches:dt||Ae,...C0(Pe),loaderData:ue,errors:Ee}))}async function It(I,G,Z,xe,we,Ae,je,ke={}){We();let Ce=xN(G,Z);if(he({navigation:Ce},{flushSync:ke.flushSync===!0}),Ae){let Be=await Tn(xe,G.pathname,I.signal);if(Be.type==="aborted")return{shortCircuited:!0};if(Be.type==="error"){if(Be.partialMatches.length===0){let{matches:ue,route:Ee}=au(f);return{matches:ue,pendingActionResult:[Ee.id,{type:"error",error:Be.error}]}}let dt=is(Be.partialMatches).route.id;return{matches:Be.partialMatches,pendingActionResult:[dt,{type:"error",error:Be.error}]}}else if(Be.matches)xe=Be.matches;else{let{notFoundMatches:dt,error:ue,route:Ee}=nt(G.pathname);return{matches:dt,pendingActionResult:[Ee.id,{type:"error",error:ue}]}}}let Ie,Pe=ku(xe,G);if(!Pe.route.action&&!Pe.route.lazy)Ie={type:"error",error:_r(405,{method:I.method,pathname:G.pathname,routeId:Pe.route.id})};else{let Be=Mo(l,u,I,xe,Pe,je?[]:a,we),dt=await Le(I,Be,we,null);if(Ie=dt[Pe.route.id],!Ie){for(let ue of xe)if(dt[ue.route.id]){Ie=dt[ue.route.id];break}}if(I.signal.aborted)return{shortCircuited:!0}}if(Ds(Ie)){let Be;return ke&&ke.replace!=null?Be=ke.replace:Be=j0(Ie.response.headers.get("Location"),new URL(I.url),p,e.history)===R.location.pathname+R.location.search,await An(I,Ie,!0,{submission:Z,replace:Be}),{shortCircuited:!0}}if(ar(Ie)){let Be=is(xe,Pe.route.id);return(ke&&ke.replace)!==!0&&(B="PUSH"),{matches:xe,pendingActionResult:[Be.route.id,Ie,Pe.route.id]}}return{matches:xe,pendingActionResult:[Pe.route.id,Ie]}}async function un(I,G,Z,xe,we,Ae,je,ke,Ce,Ie,Pe,Be,dt){let ue=Ae||Fp(G,je),Ee=je||ke||R0(ue),Re=!T&&!Ie;if(we){if(Re){let Yt=Vt(Be);he({navigation:ue,...Yt!==void 0?{actionData:Yt}:{}},{flushSync:Pe})}let at=await Tn(Z,G.pathname,I.signal);if(at.type==="aborted")return{shortCircuited:!0};if(at.type==="error"){if(at.partialMatches.length===0){let{matches:wn,route:Jt}=au(f);return{matches:wn,loaderData:{},errors:{[Jt.id]:at.error}}}let Yt=is(at.partialMatches).route.id;return{matches:at.partialMatches,loaderData:{},errors:{[Yt]:at.error}}}else if(at.matches)Z=at.matches;else{let{error:Yt,notFoundMatches:wn,route:Jt}=nt(G.pathname);return{matches:wn,loaderData:{},errors:{[Jt.id]:Yt}}}}let Ge=h||f,{dsMatches:Oe,revalidatingFetchers:gt}=b0(I,xe,l,u,e.history,R,Z,Ee,G,Ie?[]:a,Ie===!0,q,ee,ge,se,re,Ge,p,e.patchRoutesOnNavigation!=null,Be,dt);if(O=++W,!e.dataStrategy&&!Oe.some(at=>at.shouldLoad)&&!Oe.some(at=>at.route.middleware&&at.route.middleware.length>0)&>.length===0){let at=Er();return ve(G,{matches:Z,loaderData:{},errors:Be&&ar(Be[1])?{[Be[0]]:Be[1].error}:null,...C0(Be),...at?{fetchers:new Map(R.fetchers)}:{}},{flushSync:Pe}),{shortCircuited:!0}}if(Re){let at={};if(!we){at.navigation=ue;let Yt=Vt(Be);Yt!==void 0&&(at.actionData=Yt)}gt.length>0&&(at.fetchers=Bn(gt)),he(at,{flushSync:Pe})}gt.forEach(at=>{Et(at.key),at.controller&&ae.set(at.key,at.controller)});let it=()=>gt.forEach(at=>Et(at.key));oe&&oe.signal.addEventListener("abort",it);let{loaderResults:an,fetcherResults:_n}=await Ze(Oe,gt,I,xe);if(I.signal.aborted)return{shortCircuited:!0};oe&&oe.signal.removeEventListener("abort",it),gt.forEach(at=>ae.delete(at.key));let dn=su(an);if(dn)return await An(I,dn.result,!0,{replace:Ce}),{shortCircuited:!0};if(dn=su(_n),dn)return re.add(dn.key),await An(I,dn.result,!0,{replace:Ce}),{shortCircuited:!0};let{loaderData:Br,errors:fs}=N0(R,Z,an,Be,gt,_n);Ie&&R.errors&&(fs={...R.errors,...fs});let Ir=Er(),ps=zr(O),Gs=Ir||ps||gt.length>0;return{matches:Z,loaderData:Br,errors:fs,...Gs?{fetchers:new Map(R.fetchers)}:{}}}function Vt(I){if(I&&!ar(I[1]))return{[I[0]]:I[1].data};if(R.actionData)return Object.keys(R.actionData).length===0?null:R.actionData}function Bn(I){return I.forEach(G=>{let Z=R.fetchers.get(G.key),xe=Pi(void 0,Z?Z.data:void 0);R.fetchers.set(G.key,xe)}),new Map(R.fetchers)}async function cr(I,G,Z,xe){Et(I);let we=(xe&&xe.flushSync)===!0,Ae=h||f,je=vh(R.location,R.matches,p,Z,G,xe?.relative),ke=os(Ae,je,p),Ce=ur(ke,Ae,je);if(Ce.active&&Ce.matches&&(ke=Ce.matches),!ke){ft(I,G,_r(404,{pathname:je}),{flushSync:we});return}let{path:Ie,submission:Pe,error:Be}=y0(!0,je,xe);if(Be){ft(I,G,Be,{flushSync:we});return}let dt=e.getContext?await e.getContext():new f0,ue=(xe&&xe.preventScrollReset)===!0;if(Pe&&kn(Pe.formMethod)){await Xn(I,G,Ie,ke,dt,Ce.active,we,ue,Pe,xe&&xe.unstable_defaultShouldRevalidate);return}se.set(I,{routeId:G,path:Ie}),await Ht(I,G,Ie,ke,dt,Ce.active,we,ue,Pe)}async function Xn(I,G,Z,xe,we,Ae,je,ke,Ce,Ie){We(),se.delete(I);let Pe=R.fetchers.get(I);Nt(I,yN(Ce,Pe),{flushSync:je});let Be=new AbortController,dt=Lo(e.history,Z,Be.signal,Ce);if(Ae){let Ot=await Tn(xe,new URL(dt.url).pathname,dt.signal,I);if(Ot.type==="aborted")return;if(Ot.type==="error"){ft(I,G,Ot.error,{flushSync:je});return}else if(Ot.matches)xe=Ot.matches;else{ft(I,G,_r(404,{pathname:Z}),{flushSync:je});return}}let ue=ku(xe,Z);if(!ue.route.action&&!ue.route.lazy){let Ot=_r(405,{method:Ce.formMethod,pathname:Z,routeId:G});ft(I,G,Ot,{flushSync:je});return}ae.set(I,Be);let Ee=W,Re=Mo(l,u,dt,xe,ue,a,we),Ge=await Le(dt,Re,we,I),Oe=Ge[ue.route.id];if(!Oe){for(let Ot of Re)if(Ge[Ot.route.id]){Oe=Ge[Ot.route.id];break}}if(dt.signal.aborted){ae.get(I)===Be&&ae.delete(I);return}if(ge.has(I)){if(Ds(Oe)||ar(Oe)){Nt(I,Ea(void 0));return}}else{if(Ds(Oe))if(ae.delete(I),O>Ee){Nt(I,Ea(void 0));return}else return re.add(I),Nt(I,Pi(Ce)),An(dt,Oe,!1,{fetcherSubmission:Ce,preventScrollReset:ke});if(ar(Oe)){ft(I,G,Oe.error);return}}let gt=R.navigation.location||R.location,it=Lo(e.history,gt,Be.signal),an=h||f,_n=R.navigation.state!=="idle"?os(an,R.navigation.location,p):R.matches;rt(_n,"Didn't find any matches after fetcher action");let dn=++W;V.set(I,dn);let Br=Pi(Ce,Oe.data);R.fetchers.set(I,Br);let{dsMatches:fs,revalidatingFetchers:Ir}=b0(it,we,l,u,e.history,R,_n,Ce,gt,a,!1,q,ee,ge,se,re,an,p,e.patchRoutesOnNavigation!=null,[ue.route.id,Oe],Ie);Ir.filter(Ot=>Ot.key!==I).forEach(Ot=>{let Vs=Ot.key,Ys=R.fetchers.get(Vs),Vl=Pi(void 0,Ys?Ys.data:void 0);R.fetchers.set(Vs,Vl),Et(Vs),Ot.controller&&ae.set(Vs,Ot.controller)}),he({fetchers:new Map(R.fetchers)});let ps=()=>Ir.forEach(Ot=>Et(Ot.key));Be.signal.addEventListener("abort",ps);let{loaderResults:Gs,fetcherResults:at}=await Ze(fs,Ir,it,we);if(Be.signal.aborted)return;if(Be.signal.removeEventListener("abort",ps),V.delete(I),ae.delete(I),Ir.forEach(Ot=>ae.delete(Ot.key)),R.fetchers.has(I)){let Ot=Ea(Oe.data);R.fetchers.set(I,Ot)}let Yt=su(Gs);if(Yt)return An(it,Yt.result,!1,{preventScrollReset:ke});if(Yt=su(at),Yt)return re.add(Yt.key),An(it,Yt.result,!1,{preventScrollReset:ke});let{loaderData:wn,errors:Jt}=N0(R,_n,Gs,void 0,Ir,at);zr(dn),R.navigation.state==="loading"&&dn>O?(rt(B,"Expected pending action"),oe&&oe.abort(),ve(R.navigation.location,{matches:_n,loaderData:wn,errors:Jt,fetchers:new Map(R.fetchers)})):(he({errors:Jt,loaderData:E0(R.loaderData,wn,_n,Jt),fetchers:new Map(R.fetchers)}),q=!1)}async function Ht(I,G,Z,xe,we,Ae,je,ke,Ce){let Ie=R.fetchers.get(I);Nt(I,Pi(Ce,Ie?Ie.data:void 0),{flushSync:je});let Pe=new AbortController,Be=Lo(e.history,Z,Pe.signal);if(Ae){let Oe=await Tn(xe,new URL(Be.url).pathname,Be.signal,I);if(Oe.type==="aborted")return;if(Oe.type==="error"){ft(I,G,Oe.error,{flushSync:je});return}else if(Oe.matches)xe=Oe.matches;else{ft(I,G,_r(404,{pathname:Z}),{flushSync:je});return}}let dt=ku(xe,Z);ae.set(I,Pe);let ue=W,Ee=Mo(l,u,Be,xe,dt,a,we),Ge=(await Le(Be,Ee,we,I))[dt.route.id];if(ae.get(I)===Pe&&ae.delete(I),!Be.signal.aborted){if(ge.has(I)){Nt(I,Ea(void 0));return}if(Ds(Ge))if(O>ue){Nt(I,Ea(void 0));return}else{re.add(I),await An(Be,Ge,!1,{preventScrollReset:ke});return}if(ar(Ge)){ft(I,G,Ge.error);return}Nt(I,Ea(Ge.data))}}async function An(I,G,Z,{submission:xe,fetcherSubmission:we,preventScrollReset:Ae,replace:je}={}){Z||(H?.resolve(),H=null),G.response.headers.has("X-Remix-Revalidate")&&(q=!0);let ke=G.response.headers.get("Location");rt(ke,"Expected a Location header on the redirect Response"),ke=j0(ke,new URL(I.url),p,e.history);let Ce=hl(R.location,ke,{_isRedirect:!0});if(r){let Ee=!1;if(G.response.headers.has("X-Remix-Reload-Document"))Ee=!0;else if(cm(ke)){const Re=X_(ke,!0);Ee=Re.origin!==t.location.origin||Sr(Re.pathname,p)==null}if(Ee){je?t.location.replace(ke):t.location.assign(ke);return}}oe=null;let Ie=je===!0||G.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Pe,formAction:Be,formEncType:dt}=R.navigation;!xe&&!we&&Pe&&Be&&dt&&(xe=R0(R.navigation));let ue=xe||we;if(Yk.has(G.response.status)&&ue&&kn(ue.formMethod))await Xe(Ie,Ce,{submission:{...ue,formAction:ke},preventScrollReset:Ae||J,enableViewTransition:Z?ce:void 0});else{let Ee=Fp(Ce,xe);await Xe(Ie,Ce,{overrideNavigation:Ee,fetcherSubmission:we,preventScrollReset:Ae||J,enableViewTransition:Z?ce:void 0})}}async function Le(I,G,Z,xe){let we,Ae={};try{we=await rN(m,I,G,xe,Z,!1)}catch(je){return G.filter(ke=>ke.shouldLoad).forEach(ke=>{Ae[ke.route.id]={type:"error",error:je}}),Ae}if(I.signal.aborted)return Ae;if(!kn(I.method))for(let je of G){if(we[je.route.id]?.type==="error")break;!we.hasOwnProperty(je.route.id)&&!R.loaderData.hasOwnProperty(je.route.id)&&(!R.errors||!R.errors.hasOwnProperty(je.route.id))&&je.shouldCallHandler()&&(we[je.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${je.route.id}`)})}for(let[je,ke]of Object.entries(we))if(pN(ke)){let Ce=ke.result;Ae[je]={type:"redirect",response:iN(Ce,I,je,G,p)}}else Ae[je]=await oN(ke);return Ae}async function Ze(I,G,Z,xe){let we=Le(Z,I,xe,null),Ae=Promise.all(G.map(async Ce=>{if(Ce.matches&&Ce.match&&Ce.request&&Ce.controller){let Pe=(await Le(Ce.request,Ce.matches,xe,Ce.key))[Ce.match.route.id];return{[Ce.key]:Pe}}else return Promise.resolve({[Ce.key]:{type:"error",error:_r(404,{pathname:Ce.path})}})})),je=await we,ke=(await Ae).reduce((Ce,Ie)=>Object.assign(Ce,Ie),{});return{loaderResults:je,fetcherResults:ke}}function We(){q=!0,se.forEach((I,G)=>{ae.has(G)&&ee.add(G),Et(G)})}function Nt(I,G,Z={}){R.fetchers.set(I,G),he({fetchers:new Map(R.fetchers)},{flushSync:(Z&&Z.flushSync)===!0})}function ft(I,G,Z,xe={}){let we=is(R.matches,G);gn(I),he({errors:{[we.route.id]:Z},fetchers:new Map(R.fetchers)},{flushSync:(xe&&xe.flushSync)===!0})}function Rn(I){return ne.set(I,(ne.get(I)||0)+1),ge.has(I)&&ge.delete(I),R.fetchers.get(I)||Kk}function mn(I,G){Et(I,G?.reason),Nt(I,Ea(null))}function gn(I){let G=R.fetchers.get(I);ae.has(I)&&!(G&&G.state==="loading"&&V.has(I))&&Et(I),se.delete(I),V.delete(I),re.delete(I),ge.delete(I),ee.delete(I),R.fetchers.delete(I)}function Lt(I){let G=(ne.get(I)||0)-1;G<=0?(ne.delete(I),ge.add(I)):ne.set(I,G),he({fetchers:new Map(R.fetchers)})}function Et(I,G){let Z=ae.get(I);Z&&(Z.abort(G),ae.delete(I))}function Pt(I){for(let G of I){let Z=Rn(G),xe=Ea(Z.data);R.fetchers.set(G,xe)}}function Er(){let I=[],G=!1;for(let Z of re){let xe=R.fetchers.get(Z);rt(xe,`Expected fetcher: ${Z}`),xe.state==="loading"&&(re.delete(Z),I.push(Z),G=!0)}return Pt(I),G}function zr(I){let G=[];for(let[Z,xe]of V)if(xe<I){let we=R.fetchers.get(Z);rt(we,`Expected fetcher: ${Z}`),we.state==="loading"&&(Et(Z),V.delete(Z),G.push(Z))}return Pt(G),G.length>0}function sa(I,G){let Z=R.blockers.get(I)||Ui;return Ne.get(I)!==G&&Ne.set(I,G),Z}function me(I){R.blockers.delete(I),Ne.delete(I)}function Ue(I,G){let Z=R.blockers.get(I)||Ui;rt(Z.state==="unblocked"&&G.state==="blocked"||Z.state==="blocked"&&G.state==="blocked"||Z.state==="blocked"&&G.state==="proceeding"||Z.state==="blocked"&&G.state==="unblocked"||Z.state==="proceeding"&&G.state==="unblocked",`Invalid blocker state transition: ${Z.state} -> ${G.state}`);let xe=new Map(R.blockers);xe.set(I,G),he({blockers:xe})}function St({currentLocation:I,nextLocation:G,historyAction:Z}){if(Ne.size===0)return;Ne.size>1&&Gt(!1,"A router only supports one blocker at a time");let xe=Array.from(Ne.entries()),[we,Ae]=xe[xe.length-1],je=R.blockers.get(we);if(!(je&&je.state==="proceeding")&&Ae({currentLocation:I,nextLocation:G,historyAction:Z}))return we}function nt(I){let G=_r(404,{pathname:I}),Z=h||f,{matches:xe,route:we}=au(Z);return{notFoundMatches:xe,route:we,error:G}}function Ct(I,G,Z){if(w=I,k=G,S=Z||null,!N&&R.navigation===Hp){N=!0;let xe=oa(R.location,R.matches);xe!=null&&he({restoreScrollPosition:xe})}return()=>{w=null,k=null,S=null}}function Dt(I,G){return S&&S(I,G.map(xe=>vk(xe,R.loaderData)))||I.key}function Oa(I,G){if(w&&k){let Z=Dt(I,G);w[Z]=k()}}function oa(I,G){if(w){let Z=Dt(I,G),xe=w[Z];if(typeof xe=="number")return xe}return null}function ur(I,G,Z){if(e.patchRoutesOnNavigation)if(I){if(Object.keys(I[0].params).length>0)return{active:!0,matches:rl(G,Z,p,!0)}}else return{active:!0,matches:rl(G,Z,p,!0)||[]};return{active:!1,matches:null}}async function Tn(I,G,Z,xe){if(!e.patchRoutesOnNavigation)return{type:"success",matches:I};let we=I;for(;;){let Ae=h==null,je=h||f,ke=u;try{await e.patchRoutesOnNavigation({signal:Z,path:G,matches:we,fetcherKey:xe,patch:(Pe,Be)=>{Z.aborted||v0(Pe,Be,je,ke,l,!1)}})}catch(Pe){return{type:"error",error:Pe,partialMatches:we}}finally{Ae&&!Z.aborted&&(f=[...f])}if(Z.aborted)return{type:"aborted"};let Ce=os(je,G,p),Ie=null;if(Ce){if(Object.keys(Ce[0].params).length===0)return{type:"success",matches:Ce};if(Ie=rl(je,G,p,!0),!(Ie&&we.length<Ie.length&&$r(we,Ie.slice(0,we.length))))return{type:"success",matches:Ce}}if(Ie||(Ie=rl(je,G,p,!0)),!Ie||$r(we,Ie))return{type:"success",matches:null};we=Ie}}function $r(I,G){return I.length===G.length&&I.every((Z,xe)=>Z.route.id===G[xe].route.id)}function ia(I){u={},h=ml(I,l,void 0,u)}function Ma(I,G,Z=!1){let xe=h==null;v0(I,G,h||f,u,l,Z),xe&&(f=[...f],he({}))}return z={get basename(){return p},get future(){return x},get state(){return R},get routes(){return f},get window(){return t},initialize:be,subscribe:_e,enableScrollRestoration:Ct,navigate:Ve,fetch:cr,revalidate:De,createHref:I=>e.history.createHref(I),encodeLocation:I=>e.history.encodeLocation(I),getFetcher:Rn,resetFetcher:mn,deleteFetcher:Lt,dispose:fe,getBlocker:sa,deleteBlocker:me,patchRoutes:Ma,_internalFetchControllers:ae,_internalSetRoutes:ia,_internalSetStateDoNotUseOrYouWillBreakYourApp(I){he(I)}},e.unstable_instrumentations&&(z=Ik(z,e.unstable_instrumentations.map(I=>I.router).filter(Boolean))),z}function Zk(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function vh(e,t,r,a,o,l){let u,f;if(o){u=[];for(let p of t)if(u.push(p),p.route.id===o){f=p;break}}else u=t,f=t[t.length-1];let h=Al(a||".",sd(u),Sr(e.pathname,r)||e.pathname,l==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&f){let p=fm(h.search);if(f.route.index&&!p)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&p){let m=new URLSearchParams(h.search),x=m.getAll("index");m.delete("index"),x.filter(_=>_).forEach(_=>m.append("index",_));let v=m.toString();h.search=v?`?${v}`:""}}return r!=="/"&&(h.pathname=Dk({basename:r,pathname:h.pathname})),Jr(h)}function y0(e,t,r){if(!r||!Zk(r))return{path:t};if(r.formMethod&&!gN(r.formMethod))return{path:t,error:_r(405,{method:r.formMethod})};let a=()=>({path:t,error:_r(400,{type:"invalid-body"})}),l=(r.formMethod||"get").toUpperCase(),u=p1(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!kn(l))return a();let x=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((v,[_,w])=>`${v}${_}=${w}
|
|
11
|
+
`,""):String(r.body);return{path:t,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:x}}}else if(r.formEncType==="application/json"){if(!kn(l))return a();try{let x=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:x,text:void 0}}}catch{return a()}}}rt(typeof FormData=="function","FormData is not available in this environment");let f,h;if(r.formData)f=wh(r.formData),h=r.formData;else if(r.body instanceof FormData)f=wh(r.body),h=r.body;else if(r.body instanceof URLSearchParams)f=r.body,h=k0(f);else if(r.body==null)f=new URLSearchParams,h=new FormData;else try{f=new URLSearchParams(r.body),h=k0(f)}catch{return a()}let p={formMethod:l,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(kn(p.formMethod))return{path:t,submission:p};let m=Da(t);return e&&m.search&&fm(m.search)&&f.append("index",""),m.search=`?${f}`,{path:Jr(m),submission:p}}function b0(e,t,r,a,o,l,u,f,h,p,m,x,v,_,w,S,k,N,A,E,D){let L=E?ar(E[1])?E[1].error:E[1].data:void 0,$=o.createURL(l.location),z=o.createURL(h),R;if(m&&l.errors){let P=Object.keys(l.errors)[0];R=u.findIndex(T=>T.route.id===P)}else if(E&&ar(E[1])){let P=E[0];R=u.findIndex(T=>T.route.id===P)-1}let B=E?E[1].statusCode:void 0,H=B&&B>=400,J={currentUrl:$,currentParams:l.matches[0]?.params||{},nextUrl:z,nextParams:u[0].params,...f,actionResult:L,actionStatus:B},oe=Tl(u),ce=u.map((P,T)=>{let{route:q}=P,ee=null;if(R!=null&&T>R)ee=!1;else if(q.lazy)ee=!0;else if(!um(q))ee=!1;else if(m){let{shouldLoad:V}=i1(q,l.loaderData,l.errors);ee=V}else Jk(l.loaderData,l.matches[T],P)&&(ee=!0);if(ee!==null)return _h(r,a,e,oe,P,p,t,ee);let ae=!1;typeof D=="boolean"?ae=D:H?ae=!1:(x||$.pathname+$.search===z.pathname+z.search||$.search!==z.search||Wk(l.matches[T],P))&&(ae=!0);let W={...J,defaultShouldRevalidate:ae},O=ul(P,W);return _h(r,a,e,oe,P,p,t,O,W,D)}),M=[];return w.forEach((P,T)=>{if(m||!u.some(se=>se.route.id===P.routeId)||_.has(T))return;let q=l.fetchers.get(T),ee=q&&q.state!=="idle"&&q.data===void 0,ae=os(k,P.path,N);if(!ae){if(A&&ee)return;M.push({key:T,routeId:P.routeId,path:P.path,matches:null,match:null,request:null,controller:null});return}if(S.has(T))return;let W=ku(ae,P.path),O=new AbortController,V=Lo(o,P.path,O.signal),re=null;if(v.has(T))v.delete(T),re=Mo(r,a,V,ae,W,p,t);else if(ee)x&&(re=Mo(r,a,V,ae,W,p,t));else{let se;typeof D=="boolean"?se=D:H?se=!1:se=x;let ne={...J,defaultShouldRevalidate:se};ul(W,ne)&&(re=Mo(r,a,V,ae,W,p,t,ne))}re&&M.push({key:T,routeId:P.routeId,path:P.path,matches:re,match:W,request:V,controller:O})}),{dsMatches:ce,revalidatingFetchers:M}}function um(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function i1(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!um(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,o=r!=null&&r[e.id]!==void 0;if(!a&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let l=!a&&!o;return{shouldLoad:l,renderFallback:l}}function Jk(e,t,r){let a=!t||r.route.id!==t.route.id,o=!e.hasOwnProperty(r.route.id);return a||o}function Wk(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ul(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function v0(e,t,r,a,o,l){let u;if(e){let p=a[e];rt(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),u=p.children}else u=r;let f=[],h=[];if(t.forEach(p=>{let m=u.find(x=>l1(p,x));m?h.push({existingRoute:m,newRoute:p}):f.push(p)}),f.length>0){let p=ml(f,o,[e||"_","patch",String(u?.length||"0")],a);u.push(...p)}if(l&&h.length>0)for(let p=0;p<h.length;p++){let{existingRoute:m,newRoute:x}=h[p],v=m,[_]=ml([x],o,[],{},!0);Object.assign(v,{element:_.element?_.element:v.element,errorElement:_.errorElement?_.errorElement:v.errorElement,hydrateFallbackElement:_.hydrateFallbackElement?_.hydrateFallbackElement:v.hydrateFallbackElement})}}function l1(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((r,a)=>t.children?.some(o=>l1(r,o)))??!1:!1}var _0=new WeakMap,c1=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let o=r[t.id];if(rt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let l=o.lazy[e];if(!l)return;let u=_0.get(o);u||(u={},_0.set(o,u));let f=u[e];if(f)return f;let h=(async()=>{let p=gk(e),x=o[e]!==void 0&&e!=="hasErrorBoundary";if(p)Gt(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(x)Gt(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await l();v!=null&&(Object.assign(o,{[e]:v}),Object.assign(o,a(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(v=>v===void 0)&&(o.lazy=void 0))})();return u[e]=h,h},w0=new WeakMap;function eN(e,t,r,a,o){let l=r[e.id];if(rt(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=w0.get(l);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let x=(async()=>{rt(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),_={};for(let w in v){let S=v[w];if(S===void 0)continue;let k=yk(w),A=l[w]!==void 0&&w!=="hasErrorBoundary";k?Gt(!k,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):A?Gt(!A,`Route "${l.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):_[w]=S}Object.assign(l,_),Object.assign(l,{...a(l),lazy:void 0})})();return w0.set(l,x),x.catch(()=>{}),{lazyRoutePromise:x,lazyHandlerPromise:x}}let u=Object.keys(e.lazy),f=[],h;for(let m of u){if(o&&o.includes(m))continue;let x=c1({key:m,route:e,manifest:r,mapRouteProperties:a});x&&(f.push(x),m===t&&(h=x))}let p=f.length>0?Promise.all(f).then(()=>{}):void 0;return p?.catch(()=>{}),h?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:h}}async function S0(e){let t=e.matches.filter(o=>o.shouldLoad),r={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,l)=>{r[t[l].route.id]=o}),r}async function tN(e){return e.matches.some(t=>t.route.middleware)?u1(e,()=>S0(e)):S0(e)}function u1(e,t){return nN(e,t,a=>{if(mN(a))throw a;return a},dN,r);function r(a,o,l){if(l)return Promise.resolve(Object.assign(l.value,{[o]:{type:"error",result:a}}));{let{matches:u}=e,f=Math.min(Math.max(u.findIndex(p=>p.route.id===o),0),Math.max(u.findIndex(p=>p.shouldCallHandler()),0)),h=is(u,u[f].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:a}})}}}async function nN(e,t,r,a,o){let{matches:l,request:u,params:f,context:h,unstable_pattern:p}=e,m=l.flatMap(v=>v.route.middleware?v.route.middleware.map(_=>[v.route.id,_]):[]);return await d1({request:u,params:f,context:h,unstable_pattern:p},m,t,r,a,o)}async function d1(e,t,r,a,o,l,u=0){let{request:f}=e;if(f.signal.aborted)throw f.signal.reason??new Error(`Request aborted: ${f.method} ${f.url}`);let h=t[u];if(!h)return await r();let[p,m]=h,x,v=async()=>{if(x)throw new Error("You may only call `next()` once per middleware");try{return x={value:await d1(e,t,r,a,o,l,u+1)},x.value}catch(_){return x={value:await l(_,p,x)},x.value}};try{let _=await m(e,v),w=_!=null?a(_):void 0;return o(w)?w:x?w??x.value:(x={value:await v()},x.value)}catch(_){return await l(_,p,x)}}function f1(e,t,r,a,o){let l=c1({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),u=eN(a.route,kn(r.method)?"action":"loader",t,e,o);return{middleware:l,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function _h(e,t,r,a,o,l,u,f,h=null,p){let m=!1,x=f1(e,t,r,o,l);return{...o,_lazyPromises:x,shouldLoad:f,shouldRevalidateArgs:h,shouldCallHandler(v){return m=!0,h?typeof p=="boolean"?ul(o,{...h,defaultShouldRevalidate:p}):typeof v=="boolean"?ul(o,{...h,defaultShouldRevalidate:v}):ul(o,h):f},resolve(v){let{lazy:_,loader:w,middleware:S}=o.route,k=m||f||v&&!kn(r.method)&&(_||w),N=S&&S.length>0&&!w&&!_;return k&&(kn(r.method)||!N)?aN({request:r,unstable_pattern:a,match:o,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:v,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function Mo(e,t,r,a,o,l,u,f=null){return a.map(h=>h.route.id!==o.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:f,shouldCallHandler:()=>!1,_lazyPromises:f1(e,t,r,h,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:_h(e,t,r,Tl(a),h,l,u,!0,f))}async function rN(e,t,r,a,o,l){r.some(p=>p._lazyPromises?.middleware)&&await Promise.all(r.map(p=>p._lazyPromises?.middleware));let u={request:t,unstable_pattern:Tl(r),params:r[0].params,context:o,matches:r},h=await e({...u,fetcherKey:a,runClientMiddleware:p=>{let m=u;return u1(m,()=>p({...m,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return h}async function aN({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:a,lazyRoutePromise:o,handlerOverride:l,scopedContext:u}){let f,h,p=kn(e.method),m=p?"action":"loader",x=v=>{let _,w=new Promise((N,A)=>_=A);h=()=>_(),e.signal.addEventListener("abort",h);let S=N=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${r.route.id}]`)):v({request:e,unstable_pattern:t,params:r.params,context:u},...N!==void 0?[N]:[]),k=(async()=>{try{return{type:"data",result:await(l?l(A=>S(A)):S())}}catch(N){return{type:"error",result:N}}})();return Promise.race([k,w])};try{let v=p?r.route.action:r.route.loader;if(a||o)if(v){let _,[w]=await Promise.all([x(v).catch(S=>{_=S}),a,o]);if(_!==void 0)throw _;f=w}else{await a;let _=p?r.route.action:r.route.loader;if(_)[f]=await Promise.all([x(_),o]);else if(m==="action"){let w=new URL(e.url),S=w.pathname+w.search;throw _r(405,{method:e.method,pathname:S,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(v)f=await x(v);else{let _=new URL(e.url),w=_.pathname+_.search;throw _r(404,{pathname:w})}}catch(v){return{type:"error",result:v}}finally{h&&e.signal.removeEventListener("abort",h)}return f}async function sN(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function oN(e){let{result:t,type:r}=e;if(dm(t)){let a;try{a=await sN(t)}catch(o){return{type:"error",error:o}}return r==="error"?{type:"error",error:new Rl(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return r==="error"?A0(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:uN(t),statusCode:Uo(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Uo(t)?t.status:void 0}:A0(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function iN(e,t,r,a,o){let l=e.headers.get("Location");if(rt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!cm(l)){let u=a.slice(0,a.findIndex(f=>f.route.id===r)+1);l=vh(new URL(t.url),u,o,l),e.headers.set("Location",l)}return e}function j0(e,t,r,a){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(cm(e)){let l=e,u=l.startsWith("//")?new URL(t.protocol+l):new URL(l);if(o.includes(u.protocol))throw new Error("Invalid redirect location");let f=Sr(u.pathname,r)!=null;if(u.origin===t.origin&&f)return u.pathname+u.search+u.hash}try{let l=a.createURL(e);if(o.includes(l.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Lo(e,t,r,a){let o=e.createURL(p1(t)).toString(),l={signal:r};if(a&&kn(a.formMethod)){let{formMethod:u,formEncType:f}=a;l.method=u.toUpperCase(),f==="application/json"?(l.headers=new Headers({"Content-Type":f}),l.body=JSON.stringify(a.json)):f==="text/plain"?l.body=a.text:f==="application/x-www-form-urlencoded"&&a.formData?l.body=wh(a.formData):l.body=a.formData}return new Request(o,l)}function wh(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function k0(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function lN(e,t,r,a=!1,o=!1){let l={},u=null,f,h=!1,p={},m=r&&ar(r[1])?r[1].error:void 0;return e.forEach(x=>{if(!(x.route.id in t))return;let v=x.route.id,_=t[v];if(rt(!Ds(_),"Cannot handle redirect results in processLoaderData"),ar(_)){let w=_.error;if(m!==void 0&&(w=m,m=void 0),u=u||{},o)u[v]=w;else{let S=is(e,v);u[S.route.id]==null&&(u[S.route.id]=w)}a||(l[v]=o1),h||(h=!0,f=Uo(_.error)?_.error.status:500),_.headers&&(p[v]=_.headers)}else l[v]=_.data,_.statusCode&&_.statusCode!==200&&!h&&(f=_.statusCode),_.headers&&(p[v]=_.headers)}),m!==void 0&&r&&(u={[r[0]]:m},r[2]&&(l[r[2]]=void 0)),{loaderData:l,errors:u,statusCode:f||200,loaderHeaders:p}}function N0(e,t,r,a,o,l){let{loaderData:u,errors:f}=lN(t,r,a);return o.filter(h=>!h.matches||h.matches.some(p=>p.shouldLoad)).forEach(h=>{let{key:p,match:m,controller:x}=h;if(x&&x.signal.aborted)return;let v=l[p];if(rt(v,"Did not find corresponding fetcher result"),ar(v)){let _=is(e.matches,m?.route.id);f&&f[_.route.id]||(f={...f,[_.route.id]:v.error}),e.fetchers.delete(p)}else if(Ds(v))rt(!1,"Unhandled fetcher revalidation redirect");else{let _=Ea(v.data);e.fetchers.set(p,_)}}),{loaderData:u,errors:f}}function E0(e,t,r,a){let o=Object.entries(t).filter(([,l])=>l!==o1).reduce((l,[u,f])=>(l[u]=f,l),{});for(let l of r){let u=l.route.id;if(!t.hasOwnProperty(u)&&e.hasOwnProperty(u)&&l.route.loader&&(o[u]=e[u]),a&&a.hasOwnProperty(u))break}return o}function C0(e){return e?ar(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function is(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function au(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function _r(e,{pathname:t,routeId:r,method:a,type:o,message:l}={}){let u="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(u="Bad Request",a&&t&&r?f=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:o==="invalid-body"&&(f="Unable to encode submission body")):e===403?(u="Forbidden",f=`Route "${r}" does not match URL "${t}"`):e===404?(u="Not Found",f=`No route matches URL "${t}"`):e===405&&(u="Method Not Allowed",a&&t&&r?f=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:a&&(f=`Invalid request method "${a.toUpperCase()}"`)),new Rl(e||500,u,new Error(f),!0)}function su(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,o]=t[r];if(Ds(o))return{key:a,result:o}}}function p1(e){let t=typeof e=="string"?Da(e):e;return Jr({...t,hash:""})}function cN(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function uN(e){return new Rl(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function dN(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&fN(r))}function fN(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function pN(e){return dm(e.result)&&a1.has(e.result.status)}function ar(e){return e.type==="error"}function Ds(e){return(e&&e.type)==="redirect"}function A0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function dm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function hN(e){return a1.has(e)}function mN(e){return dm(e)&&hN(e.status)&&e.headers.has("Location")}function gN(e){return Vk.has(e.toUpperCase())}function kn(e){return qk.has(e.toUpperCase())}function fm(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ku(e,t){let r=typeof t=="string"?Da(t).search:t.search;if(e[e.length-1].route.index&&fm(r||""))return e[e.length-1];let a=W_(e);return a[a.length-1]}function R0(e){let{formMethod:t,formAction:r,formEncType:a,text:o,formData:l,json:u}=e;if(!(!t||!r||!a)){if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:o};if(l!=null)return{formMethod:t,formAction:r,formEncType:a,formData:l,json:void 0,text:void 0};if(u!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:u,text:void 0}}}function Fp(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function xN(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Pi(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function yN(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ea(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function bN(e,t){try{let r=e.sessionStorage.getItem(s1);if(r){let a=JSON.parse(r);for(let[o,l]of Object.entries(a||{}))l&&Array.isArray(l)&&t.set(o,new Set(l||[]))}}catch{}}function vN(e,t){if(t.size>0){let r={};for(let[a,o]of t)r[a]=[...o];try{e.sessionStorage.setItem(s1,JSON.stringify(r))}catch(a){Gt(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function T0(){let e,t,r=new Promise((a,o)=>{e=async l=>{a(l);try{await r}catch{}},t=async l=>{o(l);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Hs=b.createContext(null);Hs.displayName="DataRouter";var Ll=b.createContext(null);Ll.displayName="DataRouterState";var h1=b.createContext(!1);function _N(){return b.useContext(h1)}var pm=b.createContext({isTransitioning:!1});pm.displayName="ViewTransition";var m1=b.createContext(new Map);m1.displayName="Fetchers";var wN=b.createContext(null);wN.displayName="Await";var ir=b.createContext(null);ir.displayName="Navigation";var od=b.createContext(null);od.displayName="Location";var kr=b.createContext({outlet:null,matches:[],isDataRoute:!1});kr.displayName="Route";var hm=b.createContext(null);hm.displayName="RouteError";var g1="REACT_ROUTER_ERROR",SN="REDIRECT",jN="ROUTE_ERROR_RESPONSE";function kN(e){if(e.startsWith(`${g1}:${SN}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function NN(e){if(e.startsWith(`${g1}:${jN}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Rl(t.status,t.statusText,t.data)}catch{}}function EN(e,{relative:t}={}){rt(Go(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=b.useContext(ir),{hash:o,pathname:l,search:u}=Dl(e,{relative:t}),f=l;return r!=="/"&&(f=l==="/"?r:Lr([r,l])),a.createHref({pathname:f,search:u,hash:o})}function Go(){return b.useContext(od)!=null}function Nr(){return rt(Go(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(od).location}var x1="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function y1(e){b.useContext(ir).static||b.useLayoutEffect(e)}function Tt(){let{isDataRoute:e}=b.useContext(kr);return e?PN():CN()}function CN(){rt(Go(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Hs),{basename:t,navigator:r}=b.useContext(ir),{matches:a}=b.useContext(kr),{pathname:o}=Nr(),l=JSON.stringify(sd(a)),u=b.useRef(!1);return y1(()=>{u.current=!0}),b.useCallback((h,p={})=>{if(Gt(u.current,x1),!u.current)return;if(typeof h=="number"){r.go(h);return}let m=Al(h,JSON.parse(l),o,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Lr([t,m.pathname])),(p.replace?r.replace:r.push)(m,p.state,p)},[t,r,l,o,e])}var AN=b.createContext(null);function RN(e){let t=b.useContext(kr).outlet;return b.useMemo(()=>t&&b.createElement(AN.Provider,{value:e},t),[t,e])}function Vo(){let{matches:e}=b.useContext(kr),t=e[e.length-1];return t?t.params:{}}function Dl(e,{relative:t}={}){let{matches:r}=b.useContext(kr),{pathname:a}=Nr(),o=JSON.stringify(sd(r));return b.useMemo(()=>Al(e,JSON.parse(o),a,t==="path"),[e,o,a,t])}function TN(e,t,r){rt(Go(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=b.useContext(ir),{matches:o}=b.useContext(kr),l=o[o.length-1],u=l?l.params:{},f=l?l.pathname:"/",h=l?l.pathnameBase:"/",p=l&&l.route;{let k=p&&p.path||"";_1(f,!p||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
12
|
+
|
|
13
|
+
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let m=Nr(),x;x=m;let v=x.pathname||"/",_=v;if(h!=="/"){let k=h.replace(/^\//,"").split("/");_="/"+v.replace(/^\//,"").split("/").slice(k.length).join("/")}let w=os(e,{pathname:_});return Gt(p||w!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Gt(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),zN(w&&w.map(k=>Object.assign({},k,{params:Object.assign({},u,k.params),pathname:Lr([h,a.encodeLocation?a.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?h:Lr([h,a.encodeLocation?a.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),o,r)}function LN(){let e=v1(),t=Uo(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},l={padding:"2px 4px",backgroundColor:a},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:l},"ErrorBoundary")," or"," ",b.createElement("code",{style:l},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),r?b.createElement("pre",{style:o},r):null,u)}var DN=b.createElement(LN,null),b1=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=NN(e.digest);r&&(e=r)}let t=e!==void 0?b.createElement(kr.Provider,{value:this.props.routeContext},b.createElement(hm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(ON,{error:e},t):t}};b1.contextType=h1;var qp=new WeakMap;function ON({children:e,error:t}){let{basename:r}=b.useContext(ir);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=kN(t.digest);if(a){let o=qp.get(t);if(o)throw o;let l=t1(a.location,r);if(e1&&!qp.get(t))if(l.isExternal||a.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:a.replace}));throw qp.set(t,u),u}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function MN({routeContext:e,match:t,children:r}){let a=b.useContext(Hs);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(kr.Provider,{value:e},r)}function zN(e,t=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let o=e,l=a?.errors;if(l!=null){let m=o.findIndex(x=>x.route.id&&l?.[x.route.id]!==void 0);rt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let u=!1,f=-1;if(r&&a){u=a.renderFallback;for(let m=0;m<o.length;m++){let x=o[m];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(f=m),x.route.id){let{loaderData:v,errors:_}=a,w=x.route.loader&&!v.hasOwnProperty(x.route.id)&&(!_||_[x.route.id]===void 0);if(x.route.lazy||w){r.isStatic&&(u=!0),f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}}let h=r?.onError,p=a&&h?(m,x)=>{h(m,{location:a.location,params:a.matches?.[0]?.params??{},unstable_pattern:Tl(a.matches),errorInfo:x})}:void 0;return o.reduceRight((m,x,v)=>{let _,w=!1,S=null,k=null;a&&(_=l&&x.route.id?l[x.route.id]:void 0,S=x.route.errorElement||DN,u&&(f<0&&v===0?(_1("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,k=null):f===v&&(w=!0,k=x.route.hydrateFallbackElement||null)));let N=t.concat(o.slice(0,v+1)),A=()=>{let E;return _?E=S:w?E=k:x.route.Component?E=b.createElement(x.route.Component,null):x.route.element?E=x.route.element:E=m,b.createElement(MN,{match:x,routeContext:{outlet:m,matches:N,isDataRoute:a!=null},children:E})};return a&&(x.route.ErrorBoundary||x.route.errorElement||v===0)?b.createElement(b1,{location:a.location,revalidation:a.revalidation,component:S,error:_,children:A(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:p}):A()},null)}function mm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $N(e){let t=b.useContext(Hs);return rt(t,mm(e)),t}function BN(e){let t=b.useContext(Ll);return rt(t,mm(e)),t}function IN(e){let t=b.useContext(kr);return rt(t,mm(e)),t}function gm(e){let t=IN(e),r=t.matches[t.matches.length-1];return rt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function UN(){return gm("useRouteId")}function v1(){let e=b.useContext(hm),t=BN("useRouteError"),r=gm("useRouteError");return e!==void 0?e:t.errors?.[r]}function PN(){let{router:e}=$N("useNavigate"),t=gm("useNavigate"),r=b.useRef(!1);return y1(()=>{r.current=!0}),b.useCallback(async(o,l={})=>{Gt(r.current,x1),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...l}))},[e,t])}var L0={};function _1(e,t,r){!t&&!L0[e]&&(L0[e]=!0,Gt(!1,r))}var D0={};function O0(e,t){!e&&!D0[t]&&(D0[t]=!0,console.warn(t))}var HN="useOptimistic",M0=b2[HN],FN=()=>{};function qN(e){return M0?M0(e):[e,FN]}function GN(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Gt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:b.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Gt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:b.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Gt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:b.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var VN=["HydrateFallback","hydrateFallbackElement"],YN=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function KN({router:e,flushSync:t,onError:r,unstable_useTransitions:a}){a=_N()||a;let[l,u]=b.useState(e.state),[f,h]=qN(l),[p,m]=b.useState(),[x,v]=b.useState({isTransitioning:!1}),[_,w]=b.useState(),[S,k]=b.useState(),[N,A]=b.useState(),E=b.useRef(new Map),D=b.useCallback((R,{deletedFetchers:B,newErrors:H,flushSync:J,viewTransitionOpts:oe})=>{H&&r&&Object.values(H).forEach(M=>r(M,{location:R.location,params:R.matches[0]?.params??{},unstable_pattern:Tl(R.matches)})),R.fetchers.forEach((M,P)=>{M.data!==void 0&&E.current.set(P,M.data)}),B.forEach(M=>E.current.delete(M)),O0(J===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let ce=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(O0(oe==null||ce,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!oe||!ce){t&&J?t(()=>u(R)):a===!1?u(R):b.startTransition(()=>{a===!0&&h(M=>z0(M,R)),u(R)});return}if(t&&J){t(()=>{S&&(_?.resolve(),S.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})});let M=e.window.document.startViewTransition(()=>{t(()=>u(R))});M.finished.finally(()=>{t(()=>{w(void 0),k(void 0),m(void 0),v({isTransitioning:!1})})}),t(()=>k(M));return}S?(_?.resolve(),S.skipTransition(),A({state:R,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})):(m(R),v({isTransitioning:!0,flushSync:!1,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation}))},[e.window,t,S,_,a,h,r]);b.useLayoutEffect(()=>e.subscribe(D),[e,D]),b.useEffect(()=>{x.isTransitioning&&!x.flushSync&&w(new YN)},[x]),b.useEffect(()=>{if(_&&p&&e.window){let R=p,B=_.promise,H=e.window.document.startViewTransition(async()=>{a===!1?u(R):b.startTransition(()=>{a===!0&&h(J=>z0(J,R)),u(R)}),await B});H.finished.finally(()=>{w(void 0),k(void 0),m(void 0),v({isTransitioning:!1})}),k(H)}},[p,_,e.window,a,h]),b.useEffect(()=>{_&&p&&f.location.key===p.location.key&&_.resolve()},[_,S,f.location,p]),b.useEffect(()=>{!x.isTransitioning&&N&&(m(N.state),v({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}),A(void 0))},[x.isTransitioning,N]);let L=b.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:R=>e.navigate(R),push:(R,B,H)=>e.navigate(R,{state:B,preventScrollReset:H?.preventScrollReset}),replace:(R,B,H)=>e.navigate(R,{replace:!0,state:B,preventScrollReset:H?.preventScrollReset})}),[e]),$=e.basename||"/",z=b.useMemo(()=>({router:e,navigator:L,static:!1,basename:$,onError:r}),[e,L,$,r]);return b.createElement(b.Fragment,null,b.createElement(Hs.Provider,{value:z},b.createElement(Ll.Provider,{value:f},b.createElement(m1.Provider,{value:E.current},b.createElement(pm.Provider,{value:x},b.createElement(JN,{basename:$,location:f.location,navigationType:f.historyAction,navigator:L,unstable_useTransitions:a},b.createElement(XN,{routes:e.routes,future:e.future,state:f,isStatic:!1,onError:r})))))),null)}function z0(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var XN=b.memo(QN);function QN({routes:e,future:t,state:r,isStatic:a,onError:o}){return TN(e,void 0,{state:r,isStatic:a,onError:o})}function ZN({to:e,replace:t,state:r,relative:a}){rt(Go(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=b.useContext(ir);Gt(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=b.useContext(kr),{pathname:u}=Nr(),f=Tt(),h=Al(e,sd(l),u,a==="path"),p=JSON.stringify(h);return b.useEffect(()=>{f(JSON.parse(p),{replace:t,state:r,relative:a})},[f,p,a,t,r]),null}function w1(e){return RN(e.context)}function JN({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:o,static:l=!1,unstable_useTransitions:u}){rt(!Go(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=b.useMemo(()=>({basename:f,navigator:o,static:l,unstable_useTransitions:u,future:{}}),[f,o,l,u]);typeof r=="string"&&(r=Da(r));let{pathname:p="/",search:m="",hash:x="",state:v=null,key:_="default",unstable_mask:w}=r,S=b.useMemo(()=>{let k=Sr(p,f);return k==null?null:{location:{pathname:k,search:m,hash:x,state:v,key:_,unstable_mask:w},navigationType:a}},[f,p,m,x,v,_,a,w]);return Gt(S!=null,`<Router basename="${f}"> is not able to match the URL "${p}${m}${x}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:b.createElement(ir.Provider,{value:h},b.createElement(od.Provider,{children:t,value:S}))}var Nu="get",Eu="application/x-www-form-urlencoded";function id(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function WN(e){return id(e)&&e.tagName.toLowerCase()==="button"}function eE(e){return id(e)&&e.tagName.toLowerCase()==="form"}function tE(e){return id(e)&&e.tagName.toLowerCase()==="input"}function nE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function rE(e,t){return e.button===0&&(!t||t==="_self")&&!nE(e)}function Sh(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(o=>[r,o]):[[r,a]])},[]))}function aE(e,t){let r=Sh(e);return t&&t.forEach((a,o)=>{r.has(o)||t.getAll(o).forEach(l=>{r.append(o,l)})}),r}var ou=null;function sE(){if(ou===null)try{new FormData(document.createElement("form"),0),ou=!1}catch{ou=!0}return ou}var oE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gp(e){return e!=null&&!oE.has(e)?(Gt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Eu}"`),null):e}function iE(e,t){let r,a,o,l,u;if(eE(e)){let f=e.getAttribute("action");a=f?Sr(f,t):null,r=e.getAttribute("method")||Nu,o=Gp(e.getAttribute("enctype"))||Eu,l=new FormData(e)}else if(WN(e)||tE(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||f.getAttribute("action");if(a=h?Sr(h,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||Nu,o=Gp(e.getAttribute("formenctype"))||Gp(f.getAttribute("enctype"))||Eu,l=new FormData(f,e),!sE()){let{name:p,type:m,value:x}=e;if(m==="image"){let v=p?`${p}.`:"";l.append(`${v}x`,"0"),l.append(`${v}y`,"0")}else p&&l.append(p,x)}}else{if(id(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Nu,a=null,o=Eu,u=e}return l&&o==="text/plain"&&(u=l,l=void 0),{action:a,method:r.toLowerCase(),encType:o,formData:l,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function xm(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function lE(e,t,r,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:t&&Sr(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${a}`,o}async function cE(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function uE(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function dE(e,t,r){let a=await Promise.all(e.map(async o=>{let l=t.routes[o.route.id];if(l){let u=await cE(l,r);return u.links?u.links():[]}return[]}));return mE(a.flat(1).filter(uE).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function $0(e,t,r,a,o,l){let u=(h,p)=>r[p]?h.route.id!==r[p].route.id:!0,f=(h,p)=>r[p].pathname!==h.pathname||r[p].route.path?.endsWith("*")&&r[p].params["*"]!==h.params["*"];return l==="assets"?t.filter((h,p)=>u(h,p)||f(h,p)):l==="data"?t.filter((h,p)=>{let m=a.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(u(h,p)||f(h,p))return!0;if(h.route.shouldRevalidate){let x=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function fE(e,t,{includeHydrateFallback:r}={}){return pE(e.map(a=>{let o=t.routes[a.route.id];if(!o)return[];let l=[o.module];return o.clientActionModule&&(l=l.concat(o.clientActionModule)),o.clientLoaderModule&&(l=l.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(l=l.concat(o.hydrateFallbackModule)),o.imports&&(l=l.concat(o.imports)),l}).flat(1))}function pE(e){return[...new Set(e)]}function hE(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function mE(e,t){let r=new Set;return new Set(t),e.reduce((a,o)=>{let l=JSON.stringify(hE(o));return r.has(l)||(r.add(l),a.push({key:l,link:o})),a},[])}function S1(){let e=b.useContext(Hs);return xm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function gE(){let e=b.useContext(Ll);return xm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ym=b.createContext(void 0);ym.displayName="FrameworkContext";function j1(){let e=b.useContext(ym);return xm(e,"You must render this element inside a <HydratedRouter> element"),e}function xE(e,t){let r=b.useContext(ym),[a,o]=b.useState(!1),[l,u]=b.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:p,onMouseLeave:m,onTouchStart:x}=t,v=b.useRef(null);b.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let S=N=>{N.forEach(A=>{u(A.isIntersecting)})},k=new IntersectionObserver(S,{threshold:.5});return v.current&&k.observe(v.current),()=>{k.disconnect()}}},[e]),b.useEffect(()=>{if(a){let S=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(S)}}},[a]);let _=()=>{o(!0)},w=()=>{o(!1),u(!1)};return r?e!=="intent"?[l,v,{}]:[l,v,{onFocus:Hi(f,_),onBlur:Hi(h,w),onMouseEnter:Hi(p,_),onMouseLeave:Hi(m,w),onTouchStart:Hi(x,_)}]:[!1,v,{}]}function Hi(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function yE({page:e,...t}){let{router:r}=S1(),a=b.useMemo(()=>os(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?b.createElement(vE,{page:e,matches:a,...t}):null}function bE(e){let{manifest:t,routeModules:r}=j1(),[a,o]=b.useState([]);return b.useEffect(()=>{let l=!1;return dE(e,t,r).then(u=>{l||o(u)}),()=>{l=!0}},[e,t,r]),a}function vE({page:e,matches:t,...r}){let a=Nr(),{future:o,manifest:l,routeModules:u}=j1(),{basename:f}=S1(),{loaderData:h,matches:p}=gE(),m=b.useMemo(()=>$0(e,t,p,l,a,"data"),[e,t,p,l,a]),x=b.useMemo(()=>$0(e,t,p,l,a,"assets"),[e,t,p,l,a]),v=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let S=new Set,k=!1;if(t.forEach(A=>{let E=l.routes[A.route.id];!E||!E.hasLoader||(!m.some(D=>D.route.id===A.route.id)&&A.route.id in h&&u[A.route.id]?.shouldRevalidate||E.hasClientLoader?k=!0:S.add(A.route.id))}),S.size===0)return[];let N=lE(e,f,o.unstable_trailingSlashAwareDataRequests,"data");return k&&S.size>0&&N.searchParams.set("_routes",t.filter(A=>S.has(A.route.id)).map(A=>A.route.id).join(",")),[N.pathname+N.search]},[f,o.unstable_trailingSlashAwareDataRequests,h,a,l,m,t,e,u]),_=b.useMemo(()=>fE(x,l),[x,l]),w=bE(x);return b.createElement(b.Fragment,null,v.map(S=>b.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...r})),_.map(S=>b.createElement("link",{key:S,rel:"modulepreload",href:S,...r})),w.map(({key:S,link:k})=>b.createElement("link",{key:S,nonce:r.nonce,...k,crossOrigin:k.crossOrigin??r.crossOrigin})))}function _E(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var wE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{wE&&(window.__reactRouterVersion="7.13.1")}catch{}function SE(e,t){return Qk({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:fk({window:t?.window}),hydrationData:jE(),routes:e,mapRouteProperties:GN,hydrationRouteProperties:VN,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function jE(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:kE(e.errors)}),e}function kE(e){if(!e)return null;let t=Object.entries(e),r={};for(let[a,o]of t)if(o&&o.__type==="RouteErrorResponse")r[a]=new Rl(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let l=window[o.__subType];if(typeof l=="function")try{let u=new l(o.message);u.stack="",r[a]=u}catch{}}if(r[a]==null){let l=new Error(o.message);l.stack="",r[a]=l}}else r[a]=o;return r}var k1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jr=b.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:o,reloadDocument:l,replace:u,unstable_mask:f,state:h,target:p,to:m,preventScrollReset:x,viewTransition:v,unstable_defaultShouldRevalidate:_,...w},S){let{basename:k,navigator:N,unstable_useTransitions:A}=b.useContext(ir),E=typeof m=="string"&&k1.test(m),D=t1(m,k);m=D.to;let L=EN(m,{relative:o}),$=Nr(),z=null;if(f){let P=Al(f,[],$.unstable_mask?$.unstable_mask.pathname:"/",!0);k!=="/"&&(P.pathname=P.pathname==="/"?k:Lr([k,P.pathname])),z=N.createHref(P)}let[R,B,H]=xE(a,w),J=CE(m,{replace:u,unstable_mask:f,state:h,target:p,preventScrollReset:x,relative:o,viewTransition:v,unstable_defaultShouldRevalidate:_,unstable_useTransitions:A});function oe(P){t&&t(P),P.defaultPrevented||J(P)}let ce=!(D.isExternal||l),M=b.createElement("a",{...w,...H,href:(ce?z:void 0)||D.absoluteURL||L,onClick:ce?oe:t,ref:_E(S,B),target:p,"data-discover":!E&&r==="render"?"true":void 0});return R&&!E?b.createElement(b.Fragment,null,M,b.createElement(yE,{page:L})):M});jr.displayName="Link";var Po=b.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:o=!1,style:l,to:u,viewTransition:f,children:h,...p},m){let x=Dl(u,{relative:p.relative}),v=Nr(),_=b.useContext(Ll),{navigator:w,basename:S}=b.useContext(ir),k=_!=null&&DE(x)&&f===!0,N=w.encodeLocation?w.encodeLocation(x).pathname:x.pathname,A=v.pathname,E=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;r||(A=A.toLowerCase(),E=E?E.toLowerCase():null,N=N.toLowerCase()),E&&S&&(E=Sr(E,S)||E);const D=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let L=A===N||!o&&A.startsWith(N)&&A.charAt(D)==="/",$=E!=null&&(E===N||!o&&E.startsWith(N)&&E.charAt(N.length)==="/"),z={isActive:L,isPending:$,isTransitioning:k},R=L?t:void 0,B;typeof a=="function"?B=a(z):B=[a,L?"active":null,$?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let H=typeof l=="function"?l(z):l;return b.createElement(jr,{...p,"aria-current":R,className:B,ref:m,style:H,to:u,viewTransition:f},typeof h=="function"?h(z):h)});Po.displayName="NavLink";var NE=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:o,state:l,method:u=Nu,action:f,onSubmit:h,relative:p,preventScrollReset:m,viewTransition:x,unstable_defaultShouldRevalidate:v,..._},w)=>{let{unstable_useTransitions:S}=b.useContext(ir),k=TE(),N=LE(f,{relative:p}),A=u.toLowerCase()==="get"?"get":"post",E=typeof f=="string"&&k1.test(f),D=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let $=L.nativeEvent.submitter,z=$?.getAttribute("formmethod")||u,R=()=>k($||L.currentTarget,{fetcherKey:t,method:z,navigate:r,replace:o,state:l,relative:p,preventScrollReset:m,viewTransition:x,unstable_defaultShouldRevalidate:v});S&&r!==!1?b.startTransition(()=>R()):R()};return b.createElement("form",{ref:w,method:A,action:N,onSubmit:a?h:D,..._,"data-discover":!E&&e==="render"?"true":void 0})});NE.displayName="Form";function EE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function N1(e){let t=b.useContext(Hs);return rt(t,EE(e)),t}function CE(e,{target:t,replace:r,unstable_mask:a,state:o,preventScrollReset:l,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:h,unstable_useTransitions:p}={}){let m=Tt(),x=Nr(),v=Dl(e,{relative:u});return b.useCallback(_=>{if(rE(_,t)){_.preventDefault();let w=r!==void 0?r:Jr(x)===Jr(v),S=()=>m(e,{replace:w,unstable_mask:a,state:o,preventScrollReset:l,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:h});p?b.startTransition(()=>S()):S()}},[x,m,v,r,a,o,t,e,l,u,f,h,p])}function Ol(e){Gt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=b.useRef(Sh(e)),r=b.useRef(!1),a=Nr(),o=b.useMemo(()=>aE(a.search,r.current?null:t.current),[a.search]),l=Tt(),u=b.useCallback((f,h)=>{const p=Sh(typeof f=="function"?f(new URLSearchParams(o)):f);r.current=!0,l("?"+p,h)},[l,o]);return[o,u]}var AE=0,RE=()=>`__${String(++AE)}__`;function TE(){let{router:e}=N1("useSubmit"),{basename:t}=b.useContext(ir),r=UN(),a=e.fetch,o=e.navigate;return b.useCallback(async(l,u={})=>{let{action:f,method:h,encType:p,formData:m,body:x}=iE(l,t);if(u.navigate===!1){let v=u.fetcherKey||RE();await a(v,r,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:m,body:x,formMethod:u.method||h,formEncType:u.encType||p,flushSync:u.flushSync})}else await o(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:m,body:x,formMethod:u.method||h,formEncType:u.encType||p,replace:u.replace,state:u.state,fromRouteId:r,flushSync:u.flushSync,viewTransition:u.viewTransition})},[a,o,t,r])}function LE(e,{relative:t}={}){let{basename:r}=b.useContext(ir),a=b.useContext(kr);rt(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),l={...Dl(e||".",{relative:t})},u=Nr();if(e==null){l.search=u.search;let f=new URLSearchParams(l.search),h=f.getAll("index");if(h.some(m=>m==="")){f.delete("index"),h.filter(x=>x).forEach(x=>f.append("index",x));let m=f.toString();l.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(l.pathname=l.pathname==="/"?r:Lr([r,l.pathname])),Jr(l)}function DE(e,{relative:t}={}){let r=b.useContext(pm);rt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=N1("useViewTransitionState"),o=Dl(e,{relative:t});if(!r.isTransitioning)return!1;let l=Sr(r.currentLocation.pathname,a)||r.currentLocation.pathname,u=Sr(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Bu(o.pathname,u)!=null||Bu(o.pathname,l)!=null}const OE="modulepreload",ME=function(e){return"/"+e},B0={},le=function(t,r,a){let o=Promise.resolve();if(r&&r.length>0){let h=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=u?.nonce||u?.getAttribute("nonce");o=h(r.map(p=>{if(p=ME(p),p in B0)return;B0[p]=!0;const m=p.endsWith(".css"),x=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${x}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":OE,m||(v.as="script"),v.crossOrigin="",v.href=p,f&&v.setAttribute("nonce",f),document.head.appendChild(v),m)return new Promise((_,w)=>{v.addEventListener("load",_),v.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${p}`)))})}))}function l(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return o.then(u=>{for(const f of u||[])f.status==="rejected"&&l(f.reason);return t().catch(l)})};const E1=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim();const zE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const $E=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase());const I0=e=>{const t=$E(e);return t.charAt(0).toUpperCase()+t.slice(1)};var BE={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 IE=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const UE=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:o="",children:l,iconNode:u,...f},h)=>b.createElement("svg",{ref:h,...BE,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:E1("lucide",o),...!l&&!IE(f)&&{"aria-hidden":"true"},...f},[...u.map(([p,m])=>b.createElement(p,m)),...Array.isArray(l)?l:[l]]));const $e=(e,t)=>{const r=b.forwardRef(({className:a,...o},l)=>b.createElement(UE,{ref:l,iconNode:t,className:E1(`lucide-${zE(I0(e))}`,`lucide-${e}`,a),...o}));return r.displayName=I0(e),r};const PE=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],HE=$e("arrow-right-left",PE);const FE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],C1=$e("arrow-right",FE);const qE=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],U0=$e("arrow-up-right",qE);const GE=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],A1=$e("boxes",GE);const VE=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],YE=$e("brain",VE);const KE=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],XE=$e("chart-column",KE);const QE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Wr=$e("check",QE);const ZE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],$t=$e("chevron-right",ZE);const JE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],R1=$e("circle-alert",JE);const WE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],eC=$e("circle",WE);const tC=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],nC=$e("cloud",tC);const rC=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Iu=$e("copy",rC);const aC=[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]],bm=$e("corner-left-up",aC);const sC=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 15 21.84",key:"14ibmq"}],["path",{d:"M21 5V8",key:"1marbg"}],["path",{d:"M21 12L18 17H22L19 22",key:"zafso"}],["path",{d:"M3 12A9 3 0 0 0 14.59 14.87",key:"1y4wr8"}]],oC=$e("database-zap",sC);const iC=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],T1=$e("database",iC);const lC=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],vm=$e("file-code",lC);const cC=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],uC=$e("file-spreadsheet",cC);const dC=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],On=$e("file-text",dC);const fC=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],_m=$e("file",fC);const pC=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]],hC=$e("files",pC);const mC=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],Ml=$e("folder-git-2",mC);const gC=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],xC=$e("folder-input",gC);const yC=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],bC=$e("folder-open",yC);const vC=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],L1=$e("folder-plus",vC);const _C=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Gn=$e("folder",_C);const wC=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Uu=$e("git-branch",wC);const SC=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],jC=$e("git-commit-horizontal",SC);const kC=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]],NC=$e("git-fork",kC);const EC=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],P0=$e("github",EC);const CC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],AC=$e("globe",CC);const RC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],TC=$e("grid-3x3",RC);const LC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],DC=$e("info",LC);const OC=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],MC=$e("key",OC);const zC=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],$C=$e("laptop",zC);const BC=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],IC=$e("layers",BC);const UC=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],PC=$e("link-2",UC);const HC=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],FC=$e("list-filter",HC);const qC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Zt=$e("loader-circle",qC);const GC=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],VC=$e("log-out",GC);const YC=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],KC=$e("menu",YC);const XC=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],QC=$e("monitor",XC);const ZC=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],JC=$e("moon",ZC);const WC=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],eA=$e("network",WC);const tA=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Dr=$e("package",tA);const nA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],rA=$e("panel-left",nA);const aA=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],jh=$e("pencil",aA);const sA=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],oA=$e("phone",sA);const iA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],wm=$e("plus",iA);const lA=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],cA=$e("refresh-cw",lA);const uA=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],dA=$e("rotate-cw",uA);const fA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],gl=$e("search",fA);const pA=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],hA=$e("settings",pA);const mA=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],gA=$e("share-2",mA);const xA=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],yA=$e("sparkles",xA);const bA=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],vA=$e("sun",bA);const _A=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ld=$e("trash-2",_A);const wA=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],SA=$e("triangle-alert",wA);const jA=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],kh=$e("upload",jA);const kA=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],NA=$e("users",kA);const EA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Or=$e("x",EA);const CA=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],AA=$e("zap",CA),H0=e=>Symbol.iterator in e,F0=e=>"entries"in e,q0=(e,t)=>{const r=e instanceof Map?e:new Map(e.entries()),a=t instanceof Map?t:new Map(t.entries());if(r.size!==a.size)return!1;for(const[o,l]of r)if(!a.has(o)||!Object.is(l,a.get(o)))return!1;return!0},RA=(e,t)=>{const r=e[Symbol.iterator](),a=t[Symbol.iterator]();let o=r.next(),l=a.next();for(;!o.done&&!l.done;){if(!Object.is(o.value,l.value))return!1;o=r.next(),l=a.next()}return!!o.done&&!!l.done};function TA(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:H0(e)&&H0(t)?F0(e)&&F0(t)?q0(e,t):RA(e,t):q0({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function ds(e){const t=Do.useRef(void 0);return r=>{const a=e(r);return TA(t.current,a)?t.current:t.current=a}}const G0=e=>{let t;const r=new Set,a=(p,m)=>{const x=typeof p=="function"?p(t):p;if(!Object.is(x,t)){const v=t;t=m??(typeof x!="object"||x===null)?x:Object.assign({},t,x),r.forEach(_=>_(t,v))}},o=()=>t,f={setState:a,getState:o,getInitialState:()=>h,subscribe:p=>(r.add(p),()=>r.delete(p))},h=t=e(a,o,f);return f},LA=(e=>e?G0(e):G0),DA=e=>e;function OA(e,t=DA){const r=Do.useSyncExternalStore(e.subscribe,Do.useCallback(()=>t(e.getState()),[e,t]),Do.useCallback(()=>t(e.getInitialState()),[e,t]));return Do.useDebugValue(r),r}const V0=e=>{const t=LA(e),r=a=>OA(t,a);return Object.assign(r,t),r},ea=(e=>e?V0(e):V0),Fi="c4a_token";function Y0(e){try{const t=e.split(".");if(t.length!==3)return null;const r=t[1].replace(/-/g,"+").replace(/_/g,"/"),a=atob(r),o=Uint8Array.from(a,u=>u.charCodeAt(0));return JSON.parse(new TextDecoder().decode(o))}catch{return null}}function K0(e){const t=e.userId,r=e.name,a=e.email,o=e.avatar_url,l=e.workspaceId;if(!t||!a||!l)return null;const u={id:t,name:r??a,email:a,personal_workspace_id:l};return o&&(u.avatar_url=o),u}function X0(e){const t=e.exp;return t?Date.now()>=t*1e3:!1}const Yn=ea(e=>({token:null,user:null,isAuthenticated:!1,init:()=>{const t=localStorage.getItem(Fi);if(!t){e({token:null,user:null,isAuthenticated:!1});return}const r=Y0(t);if(!r||X0(r)){localStorage.removeItem(Fi),e({token:null,user:null,isAuthenticated:!1});return}const a=K0(r);if(!a){localStorage.removeItem(Fi),e({token:null,user:null,isAuthenticated:!1});return}e({token:t,user:a,isAuthenticated:!0})},login:t=>{const r=Y0(t);if(!r||X0(r))return;const a=K0(r);a&&(localStorage.setItem(Fi,t),e({token:t,user:a,isAuthenticated:!0}))},logout:()=>{localStorage.removeItem(Fi),e({token:null,user:null,isAuthenticated:!1})}})),xl=ea(e=>({activeWorkspaceId:null,init:()=>{const t=Yn.getState().user;t?.personal_workspace_id&&e({activeWorkspaceId:t.personal_workspace_id})},setActiveWorkspace:t=>{e({activeWorkspaceId:t})}}));Yn.subscribe((e,t)=>{e.user!==t.user&&(e.user?.personal_workspace_id?xl.getState().setActiveWorkspace(e.user.personal_workspace_id):xl.getState().setActiveWorkspace(null))});const D1="/api/v1";class hn extends Error{constructor(t,r,a){super(a),this.status=t,this.code=r,this.name="ApiError"}}async function qi(e,t,r,a,o){let l=`${D1}${t}`;if(a){const x=new URLSearchParams(a).toString();x&&(l+=`?${x}`)}const u={"Content-Type":"application/json"},f=Yn.getState().token;f&&(u.Authorization=`Bearer ${f}`);const h=xl.getState().activeWorkspaceId;h&&(u["X-Workspace-Id"]=h);const p={method:e,headers:u};r!==void 0&&(p.body=JSON.stringify(r)),o?.signal&&(p.signal=o.signal);const m=await fetch(l,p);if(!m.ok){let x="UNKNOWN",v=m.statusText;try{const _=await m.json();_.code&&(x=_.code),_.message&&(v=_.message)}catch{}throw m.status===401&&Yn.getState().logout(),new hn(m.status,x,v)}return m.json()}const Vp=new Map;function MA(e,t){let r=`${D1}${e}`;if(t){const a=new URLSearchParams(t).toString();a&&(r+=`?${a}`)}return r}const ze={get(e,t,r){if(r?.skipDedup)return qi("GET",e,void 0,t,r);const o=`${xl.getState().activeWorkspaceId??""}::${MA(e,t)}`,l=Vp.get(o);if(l)return l;const u=qi("GET",e,void 0,t,r).finally(()=>{Vp.delete(o)});return Vp.set(o,u),u},post(e,t,r){return qi("POST",e,t,void 0,r)},put(e,t){return qi("PUT",e,t)},delete(e){return qi("DELETE",e)}},zA=3e4,$A=1e3,BA=3e4;class IA{ws=null;url="";handlers=new Map;statusHandlers=new Set;heartbeatTimer=null;reconnectTimer=null;reconnectAttempt=0;intentionalClose=!1;disconnectTimer=null;_status="disconnected";get status(){return this._status}setStatus(t){this._status=t;for(const r of this.statusHandlers)r(t)}onStatusChange(t){return this.statusHandlers.add(t),()=>{this.statusHandlers.delete(t)}}connect(t){this.disconnectTimer&&(clearTimeout(this.disconnectTimer),this.disconnectTimer=null),!(this.url===t&&this.ws&&this.ws.readyState<=WebSocket.OPEN)&&(this.url=t,this.intentionalClose=!1,this.reconnectAttempt=0,this.open())}disconnect(){this.disconnectTimer||(this.disconnectTimer=setTimeout(()=>{this.disconnectTimer=null,this.intentionalClose=!0,this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")},50))}on(t,r){let a=this.handlers.get(t);return a||(a=new Set,this.handlers.set(t,a)),a.add(r),()=>{a.delete(r),a.size===0&&this.handlers.delete(t)}}send(t,r){if(this.ws?.readyState!==WebSocket.OPEN)return;const a={event:t,payload:r,timestamp:Date.now()};this.ws.send(JSON.stringify(a))}open(){this.setStatus("connecting");const t=new WebSocket(this.url);t.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},t.onmessage=r=>{try{const a=JSON.parse(String(r.data));if(a.event==="pong")return;const o=this.handlers.get(a.event);if(o)for(const l of o)l(a.payload)}catch{}},t.onclose=()=>{this.stopHeartbeat(),this.intentionalClose||(this.setStatus("reconnecting"),this.scheduleReconnect())},t.onerror=()=>{},this.ws=t}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({event:"ping",payload:null,timestamp:Date.now()}))},zA)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const t=Math.min($A*2**this.reconnectAttempt,BA);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},t)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.disconnectTimer&&(clearTimeout(this.disconnectTimer),this.disconnectTimer=null)}}const En=new IA,Qt=ea((e,t)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{e({loading:!0,error:null});try{const r=await ze.get("/libraries");e({libraries:r,loading:!1})}catch(r){e({error:r instanceof Error?r.message:"Failed to load libraries",loading:!1})}},createLibrary:async r=>{const a=await ze.post("/libraries",r);return e(o=>({libraries:[...o.libraries,a]})),a},deleteLibrary:async r=>{await ze.delete(`/libraries/${r}`),e(a=>({libraries:a.libraries.filter(o=>o.id!==r)}))},updateLibraryName:async(r,a)=>{const o=await ze.put(`/libraries/${r}`,{name:a});e(l=>({libraries:l.libraries.map(u=>u.id===r?o:u)}))},_updateLibraryOnline:(r,a)=>{e(o=>({libraries:o.libraries.map(l=>l.id===r?{...l,is_online:a}:l)}))},_refreshLibrary:async r=>{try{const a=await ze.get(`/libraries/${r}`);e(o=>({libraries:o.libraries.map(l=>l.id===r?a:l)}))}catch{t().fetchLibraries()}}})),Fs=e=>{const t=e.libraries.filter(a=>a.type==="cloud").sort((a,o)=>a.created_at.localeCompare(o.created_at)),r=e.libraries.filter(a=>a.type==="daemon").sort((a,o)=>a.name.localeCompare(o.name));return[...t,...r]},UA=e=>e.libraries.filter(t=>t.type==="daemon");En.on("ws:daemon:status",e=>{const t=e;t.lib_id&&Qt.getState()._updateLibraryOnline(t.lib_id,t.is_online),Qt.getState().fetchLibraries()});En.on("ws:daemon:connected",e=>{const t=e;t.lib_id&&Qt.getState()._updateLibraryOnline(t.lib_id,!0),Qt.getState().fetchLibraries()});En.on("ws:library:updated",e=>{const t=e;Qt.getState()._refreshLibrary(t.library_id)});function PA({name:e,avatarUrl:t,size:r=24}){const[a,o]=b.useState(!1),l=e.charAt(0).toUpperCase();return t&&!a?c.jsx("img",{src:t,alt:"",className:"rounded-full object-cover",style:{width:r,height:r},onError:()=>o(!0)}):c.jsx("span",{className:"inline-flex items-center justify-center rounded-full bg-c4a-accent font-mono font-bold text-white",style:{width:r,height:r,fontSize:r*.48},children:l})}function HA(){const{t:e}=ye(),t=Tt(),r=Yn(v=>v.user),a=Yn(v=>v.logout),[o,l]=b.useState(!1),u=b.useRef(null),f=Qt(ds(UA)),h=f.some(v=>v.is_online),p=b.useCallback(()=>{a(),l(!1),t("/login",{replace:!0})},[a,t]),m=()=>{u.current&&clearTimeout(u.current),l(!0)},x=()=>{u.current=setTimeout(()=>l(!1),150)};return r?c.jsxs("div",{className:"relative",onMouseEnter:m,onMouseLeave:x,children:[c.jsxs("button",{className:"relative flex cursor-pointer items-center gap-1",children:[c.jsx(PA,{name:r.name,avatarUrl:r.avatar_url,size:30}),c.jsx("span",{className:`absolute right-0 top-0 h-2 w-2 rounded-full ${h?"bg-c4a-success":"bg-c4a-text-muted"}`})]}),o&&c.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 min-w-[180px] rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-c4a-md",children:[c.jsxs("div",{className:"px-4 py-3",children:[c.jsx("p",{className:"text-sm text-c4a-text-primary",children:r.name}),c.jsx("p",{className:"text-xs text-c4a-text-muted",children:r.email})]}),c.jsx("div",{className:"border-t border-c4a-border-subtle",children:f.length===0?c.jsxs("button",{onClick:()=>{l(!1),t("/studio/sources/add-client")},className:"flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-left text-xs font-medium text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx("span",{className:"flex h-3 w-3 shrink-0 items-center justify-center",children:c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-c4a-text-muted"})}),e("user.menu.connect_source")]}):f.map(v=>c.jsxs("button",{onClick:()=>{l(!1),t(`/studio/sources/${v.id}`)},className:"flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-left text-xs font-medium text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx("span",{className:"flex h-3 w-3 shrink-0 items-center justify-center",children:c.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${v.is_online?"bg-c4a-success":"bg-c4a-error"}`})}),v.name]},v.id))}),c.jsx("div",{className:"border-t border-c4a-border-subtle",children:c.jsxs("button",{onClick:p,className:"flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-left text-xs font-medium text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx(VC,{size:12,className:"shrink-0"}),e("user.menu.sign_out")]})})]})]}):null}function Nh({onLoginClick:e}){const{t}=ye();return Yn(a=>a.isAuthenticated)?c.jsx(HA,{}):c.jsx(jr,{to:"/login",onClick:e,className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:t("nav.login")})}const Q0=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function FA(){const{t:e}=ye(),[t,r]=b.useState(!1);return c.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[c.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[c.jsxs(jr,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[c.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),c.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),c.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[c.jsx("nav",{className:"flex items-center gap-4",children:Q0.map(({to:a,labelKey:o})=>c.jsx(Po,{to:a,end:a==="/",className:({isActive:l})=>`font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${l?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:e(o)},a))}),c.jsx(Nh,{})]}),c.jsx("button",{onClick:()=>r(!t),className:"text-c4a-text-secondary md:hidden",children:t?c.jsx(Or,{size:20}):c.jsx(KC,{size:20})})]}),t&&c.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[c.jsx("nav",{className:"flex flex-col gap-2",children:Q0.map(({to:a,labelKey:o})=>c.jsx(Po,{to:a,end:a==="/",onClick:()=>r(!1),className:({isActive:l})=>`block py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${l?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:e(o)},a))}),c.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:c.jsx(Nh,{onLoginClick:()=>r(!1)})})]})]})}function qA(e){return e==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e==="system"?"dark":e}function O1(e){if(typeof window>"u")return;const t=qA(e);document.documentElement.setAttribute("data-theme",t),localStorage.setItem("theme",e)}function GA(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const Sm=ea(e=>({theme:GA(),setTheme:t=>{O1(t),e({theme:t})}}));let Z0=!1;function VA(){if(Z0||typeof window>"u")return;Z0=!0;const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{const{theme:r}=Sm.getState();r==="system"&&O1("system")};e.addEventListener("change",t)}VA();const YA=[{mode:"light",icon:vA,labelKey:"footer.theme.light"},{mode:"dark",icon:JC,labelKey:"footer.theme.dark"},{mode:"system",icon:QC,labelKey:"footer.theme.system"}];function M1(){const{t:e}=ye(),{theme:t,setTheme:r}=Sm();return c.jsx("div",{className:"flex items-center gap-1",children:YA.map(({mode:a,icon:o,labelKey:l})=>c.jsx("button",{onClick:()=>r(a),title:e(l),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${t===a?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:c.jsx(o,{size:14})},a))})}function z1(){const{i18n:e}=ye(),t=()=>{const r=e.language==="en"?"zh":"en";e.changeLanguage(r)};return c.jsx("button",{onClick:t,className:"cursor-pointer rounded px-2 py-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-secondary hover:bg-c4a-bg-hover",children:e.language==="en"?"CN":"EN"})}function $1({compact:e}){const{t}=ye(),r=new Date().getFullYear(),a=e?"footer.copyright_compact":"footer.copyright";return c.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:t(a,{year:r})})}const KA="_brandIcon_1c7st_1",XA="_iconPulse_1c7st_35",J0={brandIcon:KA,iconPulse:XA};function QA({variant:e}){const{t}=ye(),r=e==="studio"?"bg-c4a-bg-surface":"bg-c4a-bg-base";return c.jsx("footer",{className:`border-t border-c4a-border-subtle ${r} px-4 py-4`,children:c.jsxs("div",{className:"flex items-end justify-between gap-4",children:[c.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[c.jsx("div",{className:J0.brandIcon,children:c.jsx("span",{className:J0.iconPulse,children:"C4A"})}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),c.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:t("footer.tagline")})]})]}),c.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(M1,{}),c.jsx(z1,{})]}),c.jsx($1,{})]})]})})}let ZA=1;const Eh=ea(e=>({items:[],show:(t,r=6e3)=>{const a=ZA++;e(o=>({items:[...o.items,{id:a,message:t,duration:r}]})),setTimeout(()=>{e(o=>({items:o.items.filter(l=>l.id!==a)}))},r)},dismiss:t=>{e(r=>({items:r.items.filter(a=>a.id!==t)}))}})),Qr=(e,t)=>Eh.getState().show(e,t);function B1(){const e=Eh(r=>r.items),t=Eh(r=>r.dismiss);return e.length===0?null:c.jsx("div",{className:"fixed top-4 left-1/2 z-50 flex -translate-x-1/2 flex-col items-center gap-2",children:e.map(r=>c.jsx("div",{role:"status",onClick:()=>t(r.id),className:"flex cursor-pointer items-center gap-2 rounded border border-c4a-accent/30 bg-c4a-bg-elevated px-5 py-3 font-mono text-xs uppercase tracking-tight text-c4a-accent shadow-c4a-lg transition-opacity",children:r.message},r.id))})}function JA(){return c.jsxs("div",{className:"flex min-h-screen flex-col",children:[c.jsx(FA,{}),c.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:c.jsx(w1,{})}),c.jsx(QA,{}),c.jsx(B1,{})]})}function WA({onToggleSidebar:e}){return c.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-surface/95 backdrop-blur-sm",children:c.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[e&&c.jsx("button",{onClick:e,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:c.jsx(rA,{size:20})}),c.jsxs(jr,{to:"/",className:"hidden items-center gap-2 text-c4a-text-primary md:flex",children:[c.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),c.jsx("span",{className:"font-mono text-sm font-semibold uppercase tracking-tight",children:"Context4AI"})]})]}),c.jsx(jr,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:c.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),c.jsx(Nh,{})]})})}const eR=e=>`flex items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${e?"c4a-sidebar-active text-c4a-accent":"c4a-sidebar-item text-c4a-text-secondary hover:text-c4a-text-primary"}`,tR=[{to:"/studio/modeling",icon:A1,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:YE,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:gl,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:gA,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:NA,i18nKey:"studio.sidebar.collaboration"}],nR=[{to:"/studio/settings/api-keys",i18nKey:"settings.tab.api_keys",icon:MC}],rR=["My Drive","个人云","我的云盘"];function aR({onNavigate:e}){const{t}=ye(),a=Nr().pathname.startsWith("/studio/settings"),[o,l]=b.useState(a);return b.useEffect(()=>{a&&l(!0)},[a]),c.jsxs("div",{children:[c.jsxs("button",{onClick:()=>l(u=>!u),className:`flex w-full cursor-pointer items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${a?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[c.jsx(hA,{size:14}),t("studio.sidebar.settings"),c.jsx($t,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${o?"rotate-90":""}`})]}),o&&c.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:nR.map(({to:u,i18nKey:f,icon:h})=>c.jsxs(Po,{to:u,onClick:e,className:({isActive:p})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${p?"c4a-sidebar-active text-c4a-accent":"c4a-sidebar-item text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[c.jsx(h,{size:13,className:"shrink-0 opacity-60"}),t(f)]},u))})]})}function W0({onNavigate:e}){const{t}=ye(),r=Nr(),a=Tt(),o=Qt(ds(Fs)),l=r.pathname.startsWith("/studio/sources")||r.pathname.startsWith("/studio/source/"),[u,f]=b.useState(l);b.useEffect(()=>{l&&f(!0)},[l]);const h=p=>p.is_default&&rR.includes(p.name)?t("sources.library.default_cloud_name"):p.name;return c.jsxs("aside",{className:"flex h-full w-[220px] shrink-0 flex-col border-r border-c4a-border-subtle bg-c4a-bg-base p-4",children:[c.jsxs("nav",{className:"flex flex-col gap-1",children:[c.jsxs("div",{className:"group/sources",children:[c.jsxs("button",{onClick:()=>f(p=>!p),className:`flex w-full cursor-pointer items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${l?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[c.jsx(T1,{size:14}),t("studio.sidebar.sources"),c.jsx("span",{role:"button",tabIndex:0,onClick:p=>{p.stopPropagation(),a("/studio/sources/add-client"),e?.()},onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.stopPropagation(),a("/studio/sources/add-client"),e?.())},className:"rounded p-0.5 text-c4a-text-muted opacity-0 transition-all hover:bg-c4a-bg-hover max-md:opacity-100 group-hover/sources:opacity-100 group-hover/sources:text-c4a-accent",title:t("sources.menu.add_client"),children:c.jsx(wm,{size:12})}),c.jsx($t,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${u?"rotate-90":""}`})]}),u&&c.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:o.map(p=>{const m=h(p);return c.jsxs(Po,{to:`/studio/sources/${p.id}`,onClick:e,className:({isActive:x})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${x?"c4a-sidebar-active text-c4a-accent":"c4a-sidebar-item text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[p.type==="cloud"?c.jsx(nC,{size:13,className:"shrink-0 opacity-60"}):c.jsx($C,{size:13,className:"shrink-0 opacity-60"}),c.jsx("span",{className:"truncate",children:m}),p.type==="daemon"&&(()=>{const x=p.config?.machine_id;return c.jsxs("span",{role:"button",tabIndex:0,onClick:v=>{v.preventDefault(),v.stopPropagation(),a("/studio/sources/add-client"),e?.()},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),a("/studio/sources/add-client"),e?.())},className:"group/dot relative ml-auto shrink-0 cursor-pointer rounded-full p-1",children:[c.jsx("span",{className:`block h-[7px] w-[7px] rounded-full ${p.is_online?"bg-c4a-success":"bg-c4a-error"}`}),c.jsx("span",{className:"pointer-events-none absolute left-full top-1/2 z-50 ml-2 hidden -translate-y-1/2 whitespace-nowrap rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/dot:block",children:p.is_online?t("sources.menu.status_online",{machine:x??""}):t("sources.menu.status_offline",{machine:x??""})})]})})()]},p.id)})})]}),tR.map(({to:p,icon:m,i18nKey:x})=>c.jsxs(Po,{to:p,onClick:e,className:({isActive:v})=>eR(v),children:[c.jsx(m,{size:14}),t(x)]},p)),c.jsx(aR,{...e?{onNavigate:e}:{}})]}),c.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(M1,{}),c.jsx(z1,{})]}),c.jsx($1,{compact:!0})]})]})}const yl=ea(e=>({status:"disconnected",onlineCount:0,connections:[],setStatus:t=>e({status:t}),fetchDaemonStatus:async()=>{try{const t=await ze.get("/daemons/status");e({onlineCount:t.online_count,connections:t.connections})}catch{}}})),sR=e=>e==="connecting"?"disconnected":e;En.onStatusChange(e=>{yl.getState().setStatus(sR(e))});En.on("ws:daemon:connected",e=>{const t=e;yl.setState(r=>{if(r.connections.some(u=>u.machine_id===t.machine_id))return r;const o={machine_id:t.machine_id};t.lib_id&&(o.lib_id=t.lib_id);const l=[...r.connections,o];return{connections:l,onlineCount:l.length}})});En.on("ws:daemon:status",e=>{const t=e;yl.setState(r=>{if(t.is_online){if(r.connections.some(f=>f.machine_id===t.machine_id))return r;const l={machine_id:t.machine_id};t.lib_id&&(l.lib_id=t.lib_id);const u=[...r.connections,l];return{connections:u,onlineCount:u.length}}const a=r.connections.filter(o=>o.machine_id!==t.machine_id);return{connections:a,onlineCount:a.length}})});function oR(){const e=Tt(),[t,r]=b.useState(!1),a=Yn(u=>u.isAuthenticated),[o,l]=b.useState(!1);return b.useEffect(()=>{const u=Yn.getState();u.isAuthenticated||u.init(),l(!0)},[]),b.useEffect(()=>{o&&!a&&e("/login",{replace:!0})},[o,a,e]),b.useEffect(()=>{!o||!a||(Qt.getState().fetchLibraries(),yl.getState().fetchDaemonStatus())},[o,a]),b.useEffect(()=>{if(!(!o||!a))return En.onStatusChange(u=>{u==="connected"&&(Qt.getState().fetchLibraries(),yl.getState().fetchDaemonStatus())})},[o,a]),!o||!a?null:c.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[c.jsx(WA,{onToggleSidebar:()=>r(!t)}),c.jsxs("div",{className:"flex min-h-0 flex-1",children:[c.jsx("div",{className:"hidden md:block",children:c.jsx(W0,{})}),t&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>r(!1)}),c.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:c.jsx(W0,{onNavigate:()=>r(!1)})})]}),c.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:c.jsx(w1,{})})]}),c.jsx(B1,{})]})}function iR(){const{t:e}=ye();return c.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[c.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:e("home.hero.title")}),c.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:e("home.hero.description")}),c.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[c.jsxs(jr,{to:"/studio",className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[e("home.hero.cta.studio"),c.jsx(C1,{size:14})]}),c.jsx("a",{href:"https://github.com/context4ai/c4a",target:"_blank",rel:"noopener noreferrer",className:"rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:e("home.hero.cta.github")})]})]})}const lR=new Set(["github","google","feishu"]),cR=new Set(["oidc","oauth2"]);function uR(){const{t:e}=ye(),t=Tt(),r=Yn(D=>D.login),a=Yn(D=>D.isAuthenticated),[o,l]=b.useState([]),[u,f]=b.useState(!0),[h,p]=b.useState(null),[m,x]=b.useState(!1);b.useEffect(()=>{a&&t("/studio",{replace:!0})},[a,t]);const v=b.useCallback(async()=>{f(!0),p(null);try{const D=await ze.get("/auth/providers");l(D)}catch{p(e("login.error"))}finally{f(!1)}},[e]);b.useEffect(()=>{v()},[v]);const _=D=>{x(!0),window.location.href=`/api/v1/auth/${D}/login`},w=async()=>{x(!0);try{const D=await ze.post("/auth/test-account/login");r(D.token),t("/studio",{replace:!0})}catch{x(!1),p(e("login.error"))}},S=o.filter(D=>lR.has(D.type)),k=o.filter(D=>cR.has(D.type)),N=o.find(D=>D.type==="test_account"),A=S.length>0||k.length>0,E=(S.length>0?1:0)+(k.length>0?1:0)+(N?1:0)>1;return c.jsx("div",{className:"flex flex-1 items-center justify-center px-4 py-12",children:c.jsxs("div",{className:`relative w-full max-w-sm bg-c4a-bg-surface px-8 pt-8 pb-10 transition-all duration-300 border-t-2 border-x border-b ${m?"border-transparent":"border-c4a-border-subtle border-t-c4a-accent"}`,children:[m&&c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
|
|
14
|
+
.login-animated-border {
|
|
15
|
+
stroke-dasharray: 92 8;
|
|
16
|
+
animation:
|
|
17
|
+
border-accel 2s cubic-bezier(0.33, 0, 0.67, 0.33) forwards,
|
|
18
|
+
border-fast 0.75s linear 2s infinite,
|
|
19
|
+
border-grow 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
|
|
20
|
+
}
|
|
21
|
+
@keyframes border-accel {
|
|
22
|
+
0% { stroke-dashoffset: 0; }
|
|
23
|
+
100% { stroke-dashoffset: -200; }
|
|
24
|
+
}
|
|
25
|
+
@keyframes border-fast {
|
|
26
|
+
0% { stroke-dashoffset: 0; }
|
|
27
|
+
100% { stroke-dashoffset: -100; }
|
|
28
|
+
}
|
|
29
|
+
@keyframes border-grow {
|
|
30
|
+
0% { stroke-dasharray: 25 75; }
|
|
31
|
+
100% { stroke-dasharray: 92 8; }
|
|
32
|
+
}
|
|
33
|
+
`}),c.jsx("svg",{className:"pointer-events-none absolute -inset-x-[1px] -bottom-[1px] -top-[2px] h-[calc(100%+3px)] w-[calc(100%+2px)] overflow-visible",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("rect",{x:"1",y:"1",width:"calc(100% - 2px)",height:"calc(100% - 2px)",fill:"none",stroke:"var(--c4a-accent)",strokeWidth:"2",pathLength:"100",className:"login-animated-border"})})]}),u&&!m&&c.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:c.jsx(Zt,{size:24,className:"animate-spin text-c4a-text-muted"})}),!u&&!m&&h&&c.jsxs("div",{className:"flex min-h-[160px] flex-col items-center justify-center gap-4",children:[c.jsx("p",{className:"text-center font-mono text-xs text-c4a-text-muted",children:h}),c.jsx("button",{onClick:v,className:"border border-c4a-border-default bg-transparent px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:text-c4a-text-primary",children:e("login.retry")})]}),!u&&!h&&c.jsxs("div",{className:"flex flex-col gap-6",children:[c.jsx("h2",{className:"text-center font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:e("login.title")}),c.jsxs("div",{className:"flex flex-col gap-2",children:[S.map(D=>c.jsx(ev,{provider:D,onClick:()=>_(D.id),label:e("login.provider_cta",{name:D.display_name}),disabled:m},D.id)),S.length>0&&k.length>0&&c.jsx(tv,{label:e("login.or")}),k.map(D=>c.jsx(ev,{provider:D,onClick:()=>_(D.id),label:e("login.provider_cta",{name:D.display_name}),disabled:m},D.id)),A&&N&&E&&c.jsx(tv,{label:e("login.or")}),N&&c.jsxs("button",{disabled:m,onClick:w,className:"c4a-flash-accent flex h-11 w-full cursor-pointer items-center justify-center gap-3 bg-c4a-accent font-mono text-xs font-bold uppercase tracking-widest text-white transition-all duration-300 disabled:cursor-not-allowed",children:[N.icon&&c.jsx("img",{src:N.icon,alt:"",className:"relative z-10 h-5 w-5 shrink-0 opacity-90"}),c.jsx("span",{className:`relative z-10 ${m?"opacity-50":""}`,children:e("login.provider_cta",{name:e("login.test_account")})})]})]})]})]})})}function ev({provider:e,onClick:t,label:r,disabled:a}){return c.jsxs("button",{onClick:t,disabled:a,className:"group c4a-flash-outline flex h-11 w-full cursor-pointer items-center justify-center gap-3 border border-c4a-border-default bg-transparent font-mono text-xs font-bold uppercase tracking-tight text-c4a-text-primary transition-opacity duration-150 ease-out disabled:cursor-not-allowed",children:[e.icon&&c.jsx("img",{src:e.icon,alt:"",className:"login-provider-btn-icon relative z-10 h-5 w-5 shrink-0 opacity-70 grayscale transition-all duration-[250ms] ease-out group-hover:opacity-100 group-hover:grayscale-0 group-disabled:opacity-100 group-disabled:grayscale-0"}),c.jsx("span",{className:`relative z-10 ${a?"opacity-50":""}`,children:r})]})}function tv({label:e}){return c.jsxs("div",{className:"flex items-center gap-3 py-1",children:[c.jsx("div",{className:"h-px flex-1 border-t border-dashed border-c4a-border-default"}),c.jsx("span",{className:"font-mono text-xs uppercase text-c4a-text-muted",children:e}),c.jsx("div",{className:"h-px flex-1 border-t border-dashed border-c4a-border-default"})]})}const dR="animate-pulse font-mono text-xs uppercase tracking-tight text-c4a-text-muted";function ta({labelKey:e="login.loading",className:t}){const{t:r}=ye();return c.jsx("span",{className:t??dR,children:r(e)})}function fR(){const e=Tt(),t=Yn(r=>r.login);return b.useEffect(()=>{const a=new URLSearchParams(window.location.search).get("token");if(a){t(a);const o=Yn.getState().isAuthenticated;e(o?"/studio":"/login",{replace:!0})}else e("/login",{replace:!0})},[t,e]),c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(ta,{labelKey:"login.authenticating",className:"animate-pulse font-mono text-sm uppercase tracking-tight text-c4a-text-muted"})})}function wt({icon:e,title:t,description:r,action:a,fullPage:o}){const l=c.jsxs("div",{className:o?"w-full max-w-[800px] text-center":"flex flex-col items-center text-center",children:[e&&c.jsx("div",{className:"mb-3 text-c4a-text-muted",children:e}),o?c.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:t}):c.jsx("p",{className:"font-mono text-sm text-c4a-text-secondary",children:t}),c.jsx("p",{className:`mt-2 ${o?"mt-3 text-sm text-c4a-text-secondary":"max-w-md text-xs text-c4a-text-muted"}`,children:r}),a&&c.jsx("div",{className:o?"mt-6 flex justify-center":"mt-4",children:a})]});return c.jsx("div",{className:`flex flex-1 items-center justify-center ${o?"p-8 pb-24":"p-8 pb-23"}`,children:l})}function na({title:e,version:t,description:r}){const{t:a}=ye();return c.jsx(wt,{fullPage:!0,title:e,description:r,action:t?c.jsx("span",{className:"inline-block rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1 font-mono text-xs uppercase text-c4a-accent",children:a("placeholder.coming",{version:t})}):void 0})}function pR(){const{t:e}=ye();return c.jsx(na,{title:e("page.docs.title"),version:"0.4.13",description:e("page.docs.description")})}function hR(){const{t:e}=ye();return c.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[c.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:e("notfound.title")}),c.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:e("notfound.description")}),c.jsx(jr,{to:"/",className:"mt-8 rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:e("notfound.back")})]})}function nv(){const{t:e}=ye(),t=v1();let r="500",a=e("error.description");return Uo(t)?(r=String(t.status),t.status===404?a=e("notfound.description"):t.statusText&&(a=t.statusText)):t instanceof Error&&(a=t.message),console.error(`[ErrorPage] ${r}:`,t),c.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[c.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:r}),c.jsx("p",{className:"mt-4 max-w-md text-base text-c4a-text-secondary",children:a}),c.jsxs("div",{className:"mt-8 flex items-center gap-3",children:[c.jsxs("button",{onClick:()=>window.location.reload(),className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[c.jsx(dA,{size:14}),e("error.reload")]}),c.jsx(jr,{to:"/",className:"rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:e("notfound.back")})]})]})}function mR(){const{t:e}=ye();return c.jsx(na,{title:e("page.modeling.title"),version:"0.4.16",description:e("page.modeling.description")})}function gR(){const{t:e}=ye();return c.jsx(na,{title:e("page.brain.title"),version:"0.4.18",description:e("page.brain.description")})}function xR(){const{t:e}=ye();return c.jsx(na,{title:e("page.discovery.title"),version:"0.6.x",description:e("page.discovery.description")})}function yR(){const{t:e}=ye();return c.jsx(na,{title:e("page.sharing.title"),version:"0.4.39",description:e("page.sharing.description")})}function bR(){const{t:e}=ye();return c.jsx(na,{title:e("page.collaboration.title"),version:"0.5.x",description:e("page.collaboration.description")})}function lr({children:e,onClose:t,className:r="",overlayClass:a="bg-black/50",closeOnOverlay:o=!0,closeOnEsc:l=!0,disableClose:u=!1}){const f=b.useRef(null);b.useEffect(()=>{if(!l)return;const p=m=>{m.key==="Escape"&&!u&&t()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t,l,u]);const h=b.useCallback(p=>{o&&!u&&f.current&&!f.current.contains(p.target)&&t()},[t,o,u]);return c.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center ${a}`,onClick:h,children:c.jsx("div",{ref:f,className:r,children:e})})}function vR(){const{t:e}=ye(),[t,r]=b.useState([]),[a,o]=b.useState(!0),[l,u]=b.useState(!1),[f,h]=b.useState(null),p=[{label:e("page.settings.title")},{label:e("settings.tab.api_keys")}],m=b.useCallback(async()=>{o(!0);try{const _=await ze.get("/auth/api-keys");r(_)}catch{}finally{o(!1)}},[]);b.useEffect(()=>{m()},[m]);const x=_=>{u(!1),h(_),m()},v=async _=>{if(confirm(e("api_keys.delete.confirm")))try{await ze.delete(`/auth/api-keys/${_}`),m()}catch{}};return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[c.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:p.map((_,w)=>{const S=w===p.length-1;return c.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[w>0&&c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:S?"text-c4a-text-primary":"",children:_.label})]},w)})}),a&&c.jsx("div",{className:"flex flex-1 items-center justify-center pb-24",children:c.jsx(ta,{})}),!a&&t.length===0&&c.jsx(wt,{fullPage:!0,title:e("api_keys.empty.title"),description:e("api_keys.empty.description"),action:c.jsx("button",{onClick:()=>u(!0),className:"cursor-pointer rounded bg-c4a-accent/75 px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent",children:e("api_keys.create")})}),!a&&t.length>0&&c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between gap-4",children:[c.jsx("p",{className:"text-xs text-c4a-text-muted",children:e("api_keys.description")}),c.jsxs("button",{onClick:()=>u(!0),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[c.jsx(wm,{size:14}),e("api_keys.create")]})]}),c.jsx("div",{className:"flex flex-col gap-3",children:t.map(_=>c.jsx(_R,{apiKey:_,onDelete:()=>v(_.id)},_.id))})]}),l&&c.jsx(wR,{onClose:()=>u(!1),onCreated:x}),f&&c.jsx(SR,{apiKey:f,onClose:()=>h(null)})]})}function _R({apiKey:e,onDelete:t}){const{t:r}=ye(),a=e.last_used_at?new Date(e.last_used_at).toLocaleDateString():r("api_keys.never_used"),o=new Date(e.created_at).toLocaleDateString();return c.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-mono text-sm text-c4a-text-primary",children:e.name}),c.jsxs("p",{className:"mt-1 text-xs text-c4a-text-muted",children:[c.jsxs("span",{className:"font-mono",children:[e.key_prefix,"****"]}),c.jsx("span",{className:"mx-2",children:"·"}),a]}),c.jsx("p",{className:"mt-0.5 text-xs text-c4a-text-muted",children:r("api_keys.created_at",{date:o})})]}),c.jsx("button",{onClick:t,className:"cursor-pointer p-1 text-c4a-text-muted transition-colors hover:text-c4a-error",title:"Delete",children:c.jsx(ld,{size:14})})]})})}function wR({onClose:e,onCreated:t}){const{t:r}=ye(),[a,o]=b.useState(""),[l,u]=b.useState("never"),[f,h]=b.useState(!1),p=b.useRef(null),[m,x]=b.useState(!1),v=[{value:"never",label:r("api_keys.expires.never")},{value:"30d",label:r("api_keys.expires.30d")},{value:"90d",label:r("api_keys.expires.90d")},{value:"1y",label:r("api_keys.expires.1y")}],_=v.find(S=>S.value===l);b.useEffect(()=>{if(!f)return;const S=k=>{p.current&&!p.current.contains(k.target)&&h(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[f]);const w=async()=>{if(a.trim()){x(!0);try{const S=jR(l),k=await ze.post("/auth/api-keys",{name:a.trim(),scope:["read"],expires_at:S});t(k)}catch{x(!1)}}};return c.jsxs(lr,{onClose:e,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-8 shadow-c4a-lg",children:[c.jsx("h2",{className:"mb-6 font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:r("api_keys.create")}),c.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:r("api_keys.form.name")}),c.jsx("input",{value:a,onChange:S=>o(S.target.value),placeholder:r("api_keys.form.name_placeholder"),className:"mb-4 w-full rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none"}),c.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:r("api_keys.form.expiry")}),c.jsxs("div",{ref:p,className:"relative mb-6",children:[c.jsxs("button",{type:"button",onClick:()=>h(S=>!S),className:"flex w-full cursor-pointer items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 text-sm text-c4a-text-primary transition-colors hover:border-c4a-border-strong",children:[c.jsx("span",{children:_?.label}),c.jsx($t,{size:14,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${f?"rotate-90":""}`})]}),f&&c.jsx("div",{className:"absolute left-0 top-full z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg",children:v.map(S=>c.jsxs("button",{type:"button",onClick:()=>{u(S.value),h(!1)},className:`flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors hover:bg-c4a-bg-hover ${S.value===l?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[c.jsx(Wr,{size:12,className:`shrink-0 ${S.value===l?"opacity-100":"opacity-0"}`}),S.label]},S.value))})]}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx("button",{onClick:e,disabled:m,className:"cursor-pointer rounded border border-c4a-border-default px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:text-c4a-text-primary",children:r("common.cancel")}),c.jsx("button",{onClick:w,disabled:!a.trim()||m,className:"cursor-pointer rounded bg-c4a-accent/75 px-4 py-2 font-mono text-xs uppercase tracking-tight text-white transition-colors hover:bg-c4a-accent disabled:opacity-50",children:r("api_keys.create")})]})]})}function SR({apiKey:e,onClose:t}){const{t:r}=ye(),[a,o]=b.useState(!1),l=async()=>{try{await navigator.clipboard.writeText(e.key),o(!0),setTimeout(()=>o(!1),2e3)}catch{const u=document.querySelector("[data-api-key-value]");if(u){const f=document.createRange();f.selectNodeContents(u);const h=window.getSelection();h?.removeAllRanges(),h?.addRange(f)}}};return c.jsxs(lr,{onClose:t,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-8 shadow-c4a-lg",closeOnOverlay:!1,closeOnEsc:!1,children:[c.jsx("h2",{className:"mb-4 font-mono text-sm uppercase tracking-tight text-c4a-accent",children:r("api_keys.created")}),c.jsx("p",{className:"mb-4 text-sm text-c4a-text-secondary",children:r("api_keys.copy_warning")}),c.jsxs("div",{className:"mb-6 flex items-center gap-2 rounded border border-c4a-accent/30 bg-c4a-bg-base px-3 py-2",children:[c.jsx("code",{"data-api-key-value":!0,className:"flex-1 truncate font-mono text-xs text-c4a-text-primary",children:e.key}),c.jsx("button",{onClick:l,className:"cursor-pointer shrink-0 font-mono text-xs uppercase text-c4a-accent transition-colors hover:text-c4a-accent/80",children:r(a?"api_keys.copied":"api_keys.copy")})]}),c.jsx("div",{className:"flex justify-end",children:c.jsx("button",{onClick:t,className:"cursor-pointer rounded bg-c4a-accent/75 px-4 py-2 font-mono text-xs uppercase tracking-tight text-white transition-colors hover:bg-c4a-accent",children:r("api_keys.done")})})]})}function jR(e){if(e==="never")return null;const t=new Date;switch(e){case"30d":t.setDate(t.getDate()+30);break;case"90d":t.setDate(t.getDate()+90);break;case"1y":t.setFullYear(t.getFullYear()+1);break;default:return null}return t.toISOString()}function kR(){const{t:e}=ye();return c.jsx(na,{title:e("page.code_setup.title"),version:"0.4.13",description:e("page.code_setup.description")})}function NR(){const{t:e}=ye();return c.jsx(na,{title:e("page.code_compile.title"),version:"0.4.13",description:e("page.code_compile.description")})}function ER(){const{t:e}=ye();return c.jsx(na,{title:e("page.code_review.title"),version:"0.4.14",description:e("page.code_review.description")})}function CR(){const{t:e}=ye();return c.jsx(na,{title:e("page.code_result.title"),version:"0.4.14",description:e("page.code_result.description")})}const zo=new Map;let Ca=null;const Ch=()=>{if(Ca=null,zo.size===0)return;const e=[...zo.entries()];zo.clear();const t=kt.getState(),r=new Map(t.indexingTasks);let a=!1;for(const[o,l]of e){const u=r.get(o);u?.terminalState||(r.set(o,{...u,...l,pendingSkips:u?.pendingSkips,unchangedCount:u?.unchangedCount,modules:l.modules??u?.modules}),a=!0)}a&&kt.setState({indexingTasks:r})},AR=e=>{const t=zo.get(e.sourceId);t&&t.stage!==e.stage&&(Ca!==null&&(cancelAnimationFrame(Ca),Ca=null),Ch()),zo.set(e.sourceId,e),Ca===null&&(Ca=requestAnimationFrame(Ch))},zl=(e,t)=>{for(const r of e){if(r.path===t)return r;if(r.children){const a=zl(r.children,t);if(a)return a}}return null},RR=(e,t)=>t===""?e:zl(e,t)?.children??[],al=(e,t)=>{if(!t)return[];const r=t.split("/"),a=[];let o="";for(const l of r){o=o?`${o}/${l}`:l;const u=zl(e,o);u&&a.push(u)}return a},kt=ea((e,t)=>({rootSources:[],currentRoot:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",indexingTasks:new Map,fetchRootSources:async({library_id:r,limit:a,offset:o})=>{e({loading:!0,error:null});try{const l={library_id:r};a!==void 0&&(l.limit=String(a)),o!==void 0&&(l.offset=String(o));const u=await ze.get("/sources",l);e({rootSources:u.items,total:u.total,limit:u.limit,offset:u.offset,loading:!1})}catch(l){e({error:l instanceof Error?l.message:"Failed to load sources",loading:!1})}},fetchRootSource:async r=>{e({loading:!0,error:null,currentRoot:null});try{const a=await ze.get(`/sources/${r}`);return e({currentRoot:a,loading:!1}),a}catch(a){throw e({currentRoot:null,loading:!1,error:a instanceof Error?a.message:"Source not found"}),a}},createSource:async r=>await ze.post("/sources",r),addTreeNode:async(r,a)=>{const o=await ze.post(`/sources/${r}/tree`,a);return e(l=>({rootSources:l.rootSources.map(u=>u.id===r?o:u),currentRoot:l.currentRoot?.id===r?o:l.currentRoot})),o},updateSource:async(r,a)=>{const o=await ze.put(`/sources/${r}`,a);e(l=>({rootSources:l.rootSources.map(u=>u.id===r?o:u),currentRoot:l.currentRoot?.id===r?o:l.currentRoot}))},deleteSource:async r=>{await ze.delete(`/sources/${r}`),e(a=>({rootSources:a.rootSources.filter(o=>o.id!==r),currentRoot:a.currentRoot?.id===r?null:a.currentRoot}))},deleteTreeNode:async(r,a)=>{const o=await ze.delete(`/sources/${r}/tree?path=${encodeURIComponent(a)}`);return e(l=>({rootSources:l.rootSources.map(u=>u.id===r?o:u),currentRoot:l.currentRoot?.id===r?o:l.currentRoot})),o},uploadDoc:async r=>await ze.post("/sources/upload",r),triggerIndex:async(r,a)=>{const o=new Map(t().indexingTasks);o.set(r,{sourceId:r,stage:"pending",progress:0,modules:a?.map(u=>u.path)}),e({indexingTasks:o});const l={};a&&(l.modules=a);try{const u=await ze.post(`/sources/${r}/index`,l);if(u.status!=="started")t().clearIndexTask(r);else if(u.dirty_skipped&&u.dirty_skipped.length>0){const f=new Map(t().indexingTasks),h=f.get(r);h&&(f.set(r,{...h,unchangedCount:u.dirty_skipped.length}),e({indexingTasks:f}))}return u}catch(u){throw t().clearIndexTask(r),u}},updateIndexProgress:r=>{if(!t().indexingTasks.get(r.sourceId)?.terminalState){if(r.stage==="skipping"&&r.message){const o=new Map(t().indexingTasks),l=o.get(r.sourceId),u=typeof r.message=="string"?r.message:JSON.stringify(r.message),f=[...l?.pendingSkips??[],u];o.set(r.sourceId,{...l??r,pendingSkips:f}),e({indexingTasks:o});return}AR(r)}},markIndexTerminal:(r,a,o)=>{zo.has(r)&&Ca!==null&&(cancelAnimationFrame(Ca),Ca=null,Ch());const l=new Map(t().indexingTasks),u=l.get(r);u&&l.set(r,{...u,terminalState:a,errorMessage:o}),e({indexingTasks:l})},clearIndexTask:r=>{const a=new Map(t().indexingTasks);a.delete(r),e({indexingTasks:a})},deleteIndex:async(r,a)=>{const o=a?`?modules=${a.map(u=>encodeURIComponent(u.path)).join(",")}`:"";return{deleted:(await ze.delete(`/sources/${r}/index${o}`)).deleted}},setFilter:r=>e({filter:r}),clearSources:()=>e({rootSources:[],currentRoot:null,total:0,offset:0})})),Ah="__c4a_indexWsSubs",Rh=globalThis;if(Rh[Ah])for(const e of Rh[Ah])e();const $l=[];Rh[Ah]=$l;$l.push(En.on("index/progress",e=>{const t=e;kt.getState().updateIndexProgress({sourceId:t.source_id,stage:t.stage,progress:t.progress,moduleName:t.module_name,currentFile:t.current_file,totalFiles:t.total_files,processedFiles:t.processed_files,message:t.message,modules:t.modules})}));$l.push(En.on("index/done",e=>{const t=e;kt.getState().markIndexTerminal(t.source_id,"done")}));$l.push(En.on("index/error",e=>{const t=e;if(kt.getState().markIndexTerminal(t.source_id,"error",t.error),t.errorCode){const a={DOC_INDEX_LLM_UNAVAILABLE:"index.doc.error.llm_unavailable",DOC_INDEX_EMBEDDING_UNAVAILABLE:"index.doc.error.embedding_unavailable",DOC_INDEX_CONTENT_MISSING:"index.doc.error.content_missing",DOC_INDEX_PARSE_FAILED:"index.doc.error.parse_failed",DOC_INDEX_LLM_EXHAUSTED:"index.doc.error.llm_exhausted"}[t.errorCode];a?Qr(Cn.t(a,{message:t.error??""}),5e3):t.error&&Qr(t.error,5e3)}else t.error&&Qr(t.error,5e3)}));$l.push(En.on("index/timeout",e=>{const t=e;kt.getState().markIndexTerminal(t.source_id,"timeout")}));function Ta({segments:e}){const{t}=ye(),r=b.useRef(null),a=b.useRef(null),[o,l]=b.useState(0),u=[{label:t("sources.breadcrumb.sources")},...e],f=Math.max(0,u.length-3);b.useEffect(()=>{const p=r.current,m=a.current;if(!p||!m)return;const x=()=>{const _=p.clientWidth,w=Array.from(m.children);if(w.length===0)return;const S=w.map(z=>z.offsetWidth),k=4;if(S.reduce((z,R)=>z+R,0)+k*(S.length-1)<=_){l(0);return}const A=20,E=(S[0]??0)+(S[1]??0)+k,D=S[S.length-1]??0,L=E+k+A+k+D;let $=f;for(let z=1;z<=f;z++){let R=0;for(let B=2+z;B<S.length-1;B++)R+=S[B]+k;if(L+R<=_){$=z;break}}l($)};x();const v=new ResizeObserver(x);return v.observe(p),()=>v.disconnect()},[f,e,t]);const h=(()=>{if(o===0||u.length<=3)return u;const p=u.slice(0,2),m=u[u.length-1],x=u.slice(2+o,u.length-1);return[...p,{label:"…"},...x,m]})();return c.jsxs("div",{ref:r,className:"relative min-w-0 overflow-hidden",children:[c.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs tracking-tight text-c4a-text-muted",children:h.map((p,m)=>{const x=m===h.length-1;return c.jsxs("span",{className:`flex shrink-0 items-center gap-1 ${m===0?"uppercase":""}`,children:[m>0&&c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"}),p.to&&!x?c.jsx(jr,{to:p.to,className:"cursor-pointer whitespace-nowrap transition-colors hover:text-c4a-text-primary",children:p.label}):c.jsx("span",{className:`whitespace-nowrap ${x?"text-c4a-text-primary":""}`,children:p.label})]},m)})}),c.jsx("div",{ref:a,"aria-hidden":!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 items-center gap-1 overflow-visible whitespace-nowrap font-mono text-xs tracking-tight",children:u.map((p,m)=>c.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[m>0&&c.jsx($t,{size:12}),c.jsx("span",{className:"whitespace-nowrap",children:p.label})]},m))})]})}const TR=["all","indexed","not_indexed"];function LR({value:e,onChange:t}){const{t:r}=ye(),[a,o]=b.useState(!1),l=b.useRef(null),u=b.useRef(null),f={all:r("sources.filter.all"),indexed:r("sources.filter.indexed"),not_indexed:r("sources.filter.not_indexed")},h=b.useCallback(x=>{l.current&&!l.current.contains(x.target)&&o(!1)},[]);b.useEffect(()=>{if(a)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[a,h]);const p=b.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),o(!0)},[]),m=b.useCallback(()=>{u.current=setTimeout(()=>o(!1),150)},[]);return c.jsxs("div",{ref:l,className:"relative",onMouseEnter:p,onMouseLeave:m,children:[c.jsxs("button",{className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[c.jsx(FC,{size:12}),c.jsx("span",{className:"hidden sm:inline",children:f[e]}),c.jsx($t,{size:12,className:`hidden transition-transform duration-200 sm:block ${a?"rotate-90":""}`})]}),a&&c.jsx("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[120px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg",children:TR.map(x=>c.jsxs("button",{onClick:()=>{t(x),o(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${x===e?"text-c4a-accent":"text-c4a-text-secondary"}`,children:[c.jsx(Wr,{size:12,className:x===e?"opacity-100":"opacity-0"}),f[x]]},x))})]})}function rv({target:e,onConfirm:t,onCancel:r}){const{t:a}=ye();return c.jsxs(lr,{onClose:r,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:a("sources.delete.confirm_title")}),c.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[e.type==="resource"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:a("sources.delete.resource",{name:e.name})}),c.jsx("p",{children:a("sources.delete.resource_impact")}),c.jsx("p",{className:"text-c4a-warning",children:a("sources.delete.session_warning")}),c.jsx("p",{children:a("sources.delete.entity_safe")})]}),e.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:a("sources.delete.folder",{name:e.name})}),e.folderCount!==void 0&&e.sourceCount!==void 0?c.jsxs(c.Fragment,{children:[c.jsx("p",{children:a("sources.delete.folder_contents",{folders:e.folderCount,sources:e.sourceCount})}),e.indexedCount!==void 0&&e.indexedCount>0&&c.jsx("p",{children:a("sources.delete.indexed_hint",{indexed:e.indexedCount,total:e.sourceCount})})]}):c.jsx("p",{children:a("sources.delete.folder_impact_generic")}),c.jsx("p",{className:"text-c4a-warning",children:a("sources.delete.irreversible")})]}),e.type==="repo"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:a("sources.delete.repo",{name:e.name,library:e.libraryName})}),e.packageCount!==void 0&&e.docCount!==void 0?c.jsxs(c.Fragment,{children:[c.jsx("p",{children:a("sources.delete.repo_contents",{packages:e.packageCount,docs:e.docCount})}),e.indexedCount!==void 0&&e.indexedCount>0&&c.jsx("p",{children:a("sources.delete.indexed_hint",{indexed:e.indexedCount,total:e.packageCount+e.docCount})})]}):c.jsx("p",{children:a("sources.delete.repo_impact_generic")}),c.jsx("p",{children:a("sources.delete.local_safe")}),c.jsx("p",{children:a("sources.delete.entity_safe")})]}),e.type==="client"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:a("sources.delete.client",{name:e.name})}),c.jsx("p",{children:a("sources.delete.client_impact")}),c.jsx("p",{children:a("sources.delete.local_safe")}),c.jsx("p",{children:a("sources.delete.entity_safe")}),c.jsx("p",{className:"text-c4a-warning",children:a("sources.delete.irreversible")}),c.jsx("p",{className:"text-c4a-text-muted",children:a("sources.delete.client_reregister")})]})]}),c.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[c.jsx("button",{onClick:r,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:a("common.cancel")}),c.jsx("button",{onClick:t,className:"rounded bg-c4a-error px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-error/80",children:a("common.confirm")})]})]})}function DR({onConfirm:e,onCancel:t,error:r}){const{t:a}=ye(),[o,l]=b.useState(""),u=b.useRef(null);b.useEffect(()=>{u.current?.focus()},[]);const f=b.useCallback(()=>{const p=o.trim();p&&e(p)},[o,e]),h=b.useCallback(p=>{p.key==="Enter"&&(p.preventDefault(),f())},[f]);return c.jsxs(lr,{onClose:t,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(L1,{size:16,className:"shrink-0 text-c4a-accent"}),c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:a("sources.actions.new_folder")})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("input",{ref:u,value:o,onChange:p=>l(p.target.value),onKeyDown:h,placeholder:a("sources.folder.name_placeholder"),className:"w-full rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 text-sm text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent",autoFocus:!0}),r&&c.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:r})]}),c.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[c.jsx("button",{onClick:t,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:a("common.cancel")}),c.jsx("button",{onClick:f,disabled:!o.trim(),className:"rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:a("common.confirm")})]})]})}function Yp({label:e,icon:t,items:r,alignRight:a}){const[o,l]=b.useState(!1),u=b.useRef(null),f=b.useRef(null),h=b.useCallback(x=>{u.current&&!u.current.contains(x.target)&&l(!1)},[]);b.useEffect(()=>{if(o)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[o,h]);const p=b.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null),l(!0)},[]),m=b.useCallback(()=>{f.current=setTimeout(()=>l(!1),150)},[]);return c.jsxs("div",{ref:u,className:"relative",onMouseEnter:p,onMouseLeave:m,children:[c.jsxs("button",{className:`flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${e?"p-1 sm:px-2 sm:py-1":"p-1"}`,children:[t,e&&c.jsx("span",{className:"hidden sm:inline",children:e}),e&&c.jsx($t,{size:12,className:`hidden transition-transform duration-200 sm:block ${o?"rotate-90":""}`})]}),o&&c.jsx("div",{className:`absolute top-full z-20 mt-1 min-w-[160px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg ${a?"right-0":"left-0"}`,children:r.map(x=>c.jsxs("button",{onClick:()=>{x.onClick(),l(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[x.icon,x.label]},x.label))})]})}function OR({onClose:e}){const{t}=ye();return c.jsxs(lr,{onClose:e,closeOnEsc:!1,className:"w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(yA,{size:18,className:"text-c4a-accent"}),c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:t("sources.upgrade.title")})]}),c.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:t("sources.upgrade.description")}),c.jsx("div",{className:"mt-6 flex justify-end",children:c.jsx("button",{onClick:e,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:t("common.confirm")})})]})}const MR=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),zR=new Set([".ts",".tsx",".md"]),$R=new Set([".md",".txt",".ts",".tsx",".doc",".docx",".pdf",".ppt",".pptx"]),BR=new Set([".md",".txt"]),IR=5*1024*1024,UR=10;function Th(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}function PR(e){const t=e.includes("/")?e.split("/").pop():e;if(MR.has(t.toLowerCase()))return!0;const r=Th(t);return zR.has(r)}function HR(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function FR({onConfirm:e,onCancel:t,error:r,uploading:a}){const{t:o}=ye(),[l,u]=b.useState([]),[f,h]=b.useState(null),[p,m]=b.useState(!1),[x,v]=b.useState(!1),_=b.useRef(null),w=b.useCallback($=>{h(null);for(const z of $){const R=Th(z.name);if(!$R.has(R)){h(o("sources.upload.unsupported_type",{name:z.name}));return}if(z.size>IR){h(o("sources.upload.file_too_large",{name:z.name}));return}}u(z=>{const R=new Map(z.map(H=>[H.name,H]));for(const H of $)R.set(H.name,{name:H.name,size:H.size,file:H});const B=Array.from(R.values());return B.length>UR?(h(o("sources.upload.too_many_files")),z):B})},[o]),S=b.useCallback($=>{const z=$.target.files;!z||z.length===0||(w(Array.from(z)),$.target.value="")},[w]),k=b.useCallback($=>{u(z=>z.filter((R,B)=>B!==$)),h(null)},[]),N=b.useCallback($=>{$.preventDefault(),m(!1);const z=$.dataTransfer?.files;!z||z.length===0||w(Array.from(z))},[w]),A=b.useCallback($=>{$.preventDefault(),m(!0)},[]),E=b.useCallback($=>{$.preventDefault(),m(!1)},[]),D=b.useCallback(async()=>{if(!(l.length===0||x)){v(!0);try{const $=await Promise.all(l.map(z=>new Promise((R,B)=>{const H=Th(z.name),J=BR.has(H),oe=new FileReader;oe.onerror=()=>B(oe.error),J?(oe.onload=()=>R({name:z.name,content:oe.result,encoding:"utf-8"}),oe.readAsText(z.file)):(oe.onload=()=>{const ce=oe.result,M=ce.slice(ce.indexOf(",")+1);R({name:z.name,content:M,encoding:"base64"})},oe.readAsDataURL(z.file))})));e($)}catch{v(!1)}}},[l,x,e]),L=r||f;return c.jsxs(lr,{onClose:t,disableClose:x||(a??!1),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(kh,{size:16,className:"shrink-0 text-c4a-accent"}),c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:o("sources.upload.title")})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("input",{ref:_,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:S,className:"hidden"}),c.jsxs("button",{type:"button",onClick:()=>_.current?.click(),onDrop:N,onDragOver:A,onDragLeave:E,disabled:x||a,className:`flex w-full flex-col items-center justify-center rounded border-2 border-dashed px-4 py-8 transition-colors ${p?"border-c4a-accent bg-c4a-accent/5":"border-c4a-border-default hover:border-c4a-accent/50"} ${x||a?"cursor-not-allowed opacity-40":"cursor-pointer"}`,children:[c.jsx(kh,{size:24,className:"text-c4a-text-muted"}),c.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:o("sources.upload.drop_hint")}),c.jsx("p",{className:"mt-1 text-[10px] text-c4a-text-muted",children:o("sources.upload.supported_formats")})]})]}),l.length>0&&c.jsxs("div",{className:"mt-3",children:[c.jsx("p",{className:"text-xs text-c4a-text-muted",children:o("sources.upload.selected",{count:l.length})}),c.jsx("div",{className:"mt-1 max-h-40 space-y-1 overflow-y-auto c4a-scrollbar",children:l.map(($,z)=>c.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[c.jsx(On,{size:12,className:"shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-primary",children:$.name}),c.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:HR($.size)}),!x&&!a&&c.jsx("button",{type:"button",onClick:()=>k(z),className:"shrink-0 text-c4a-text-muted transition-colors hover:text-c4a-text-primary",title:o("sources.upload.remove"),children:c.jsx(Or,{size:12})})]},`${$.name}-${z}`))})]}),L&&c.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:L}),c.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[c.jsx("button",{onClick:t,disabled:x||a,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:o("common.cancel")}),c.jsxs("button",{onClick:D,disabled:l.length===0||x||a,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[(x||a)&&c.jsx(Zt,{size:12,className:"animate-spin"}),o(x||a?"sources.upload.uploading":"common.confirm")]})]})]})}const qR=/^v\d+\.\d+\.\d+$/;function Lh(e){const t=/^v(\d+)\.(\d+)\.(\d+)$/.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function GR(e,t){const r=Lh(e),a=Lh(t);return!r||!a?!1:r[0]!==a[0]?r[0]>a[0]:r[1]!==a[1]?r[1]>a[1]:r[2]>a[2]}function VR(e){const t=Lh(e);return t?`v${t[0]}.${t[1]}.${t[2]+1}`:"v0.0.1"}function YR({currentVersion:e,onConfirm:t,onCancel:r,uploading:a,serverError:o}){const{t:l}=ye(),[u,f]=b.useState(()=>VR(e)),h=b.useMemo(()=>qR.test(u)?GR(u,e)?null:l("upload.version_must_increase",{version:e}):l("upload.version_must_increase",{version:e}),[u,e,l]),p=b.useCallback(()=>{h||a||t(u)},[h,a,t,u]);return c.jsxs(lr,{onClose:r,disableClose:a??!1,className:"mx-4 w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:l("upload.new_version_title")}),c.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:l("upload.new_version_desc")}),c.jsxs("div",{className:"mt-4",children:[c.jsx("label",{className:"block text-xs text-c4a-text-muted uppercase",children:l("upload.version_label")}),c.jsx("input",{type:"text",value:u,onChange:m=>f(m.target.value),disabled:a,className:"mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-1.5 font-mono text-sm text-c4a-text-primary focus:border-c4a-accent focus:outline-none disabled:opacity-40"}),c.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:l("upload.current_version",{version:e})}),h&&c.jsx("p",{className:"mt-1 text-xs text-c4a-error",children:h}),o&&!h&&c.jsx("p",{className:"mt-1 text-xs text-c4a-error",children:o})]}),c.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:r,disabled:a,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:l("common.cancel")}),c.jsxs("button",{type:"button",onClick:p,disabled:!!h||a,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[a&&c.jsx(Zt,{size:12,className:"animate-spin"}),l("upload.confirm")]})]})]})}function KR({pathLabel:e,loading:t,badge:r,onNavigateUp:a,children:o}){return c.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2.5",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[c.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:e}),r]}),c.jsx("hr",{className:"my-2 border-c4a-border-subtle"}),c.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:t?c.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:c.jsx(Zt,{size:14,className:"animate-spin text-c4a-text-muted"})}):c.jsxs(c.Fragment,{children:[a&&c.jsxs("button",{onClick:a,className:"flex w-full cursor-pointer items-center gap-3 rounded pl-3 pr-5 py-2 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx(bm,{size:14,className:"shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:"leading-none pb-1",children:".."})]}),o]})})]})}function XR(e){const t=e.match(/^[\w.-]+@([\w.-]+):([\w./-]+?)(?:\.git)?$/);if(t){const r=t[1],a=t[2];return{slug:a,repoUrl:`https://${r}/${a}`,host:r}}try{const r=new URL(e),a=r.hostname,o=r.pathname.replace(/^\//,"").replace(/\.git$/,"");return o?{slug:o,repoUrl:`https://${a}/${o}`,host:a}:null}catch{return null}}function QR(e,t){return`${e}/tree/${encodeURIComponent(t)}`}function ZR(e,t){return`${e}/commit/${t}`}function I1({remoteUrl:e,fallbackName:t,branch:r,commit:a}){const o=e?XR(e):null,l=a.slice(0,7);return c.jsxs("div",{className:"flex min-w-0 shrink flex-wrap items-center gap-1.5 font-mono text-xs leading-none text-c4a-accent",children:[o?c.jsxs("a",{href:o.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:o.repoUrl,children:[c.jsx(P0,{size:12,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:o.slug})]}):c.jsxs("span",{className:"flex items-center gap-1 truncate",children:[c.jsx(P0,{size:12,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:t||"repo"})]}),c.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?c.jsxs("a",{href:QR(o.repoUrl,r),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[c.jsx(Uu,{size:10,className:"shrink-0"}),c.jsx("span",{children:r})]}):c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(Uu,{size:10,className:"shrink-0"}),c.jsx("span",{children:r})]}),c.jsx("span",{className:"text-c4a-text-muted",children:"/"}),o?c.jsx("a",{href:ZR(o.repoUrl,a),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:l}):c.jsx("span",{children:l})]})}function U1({currentName:e,onConfirm:t,onCancel:r,error:a}){const[o,l]=b.useState(e),u=b.useRef(null);b.useEffect(()=>{u.current?.select()},[]);const f=b.useCallback(()=>{const p=o.trim();p&&p!==e?t(p):r()},[o,e,t,r]),h=b.useCallback(p=>{p.key==="Enter"?(p.preventDefault(),f()):p.key==="Escape"&&r()},[f,r]);return c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("input",{ref:u,value:o,onChange:p=>l(p.target.value),onKeyDown:h,onBlur:f,className:"min-w-0 flex-1 rounded border border-c4a-accent bg-c4a-bg-surface px-2 py-1 text-sm text-c4a-text-primary outline-none",autoFocus:!0}),c.jsx("button",{onClick:p=>{p.stopPropagation(),f()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:c.jsx(Wr,{size:14})}),c.jsx("button",{onClick:p=>{p.stopPropagation(),r()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:c.jsx(Or,{size:14})}),a&&c.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:a})]})}const JR=e=>{const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const r=o=>String(o).padStart(2,"0"),a=`${r(t.getMonth()+1)}-${r(t.getDate())} ${r(t.getHours())}:${r(t.getMinutes())}`;return t.getFullYear()===new Date().getFullYear()?a:`${t.getFullYear()}-${a}`},av={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function WR({source:e,isDaemonLibrary:t,isRepoRoot:r}){const{t:a}=ye(),o=e.kind==="source",l=o&&(e.source_type==="code"||PR(e.name)),f=l&&e.index_status!=="none"?"text-c4a-accent":"text-c4a-text-secondary",h=e.metadata?.origin==="remote";let p;if(e.kind==="folder"?p=r||h?c.jsx(Ml,{size:14,className:`shrink-0 ${f}`}):t?c.jsx(bC,{size:14,className:`shrink-0 ${f}`}):c.jsx(Gn,{size:14,className:`shrink-0 ${f}`}):e.source_type==="code"?p=c.jsx(Dr,{size:14,className:`shrink-0 ${f}`}):p=c.jsx(On,{size:14,className:`shrink-0 ${f}`}),!o||!l)return c.jsx(c.Fragment,{children:p});const m=av[e.index_status]??av.none,x=a(`sources.status.${e.index_status}`);return c.jsxs("span",{className:"group/dot relative shrink-0",children:[p,c.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${m}`}),c.jsx("span",{className:"pointer-events-none absolute bottom-full left-1/2 z-50 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-[10px] text-c4a-text-secondary opacity-0 shadow-lg transition-opacity group-hover/dot:opacity-100",children:x})]})}function sv({source:e,displayName:t,childCount:r,isDaemonLibrary:a,isRepoRoot:o,onClick:l,onRename:u,onDelete:f}){const{t:h}=ye(),[p,m]=b.useState(!1),[x,v]=b.useState(null),_=b.useCallback(async A=>{if(!u)return;const E=await u(A);E?v(E):(m(!1),v(null))},[u]),w=b.useCallback(()=>{m(!1),v(null)},[]),S=!o&&u,k=f,N=e.updated_at||e.created_at;return c.jsxs("div",{className:"group flex cursor-pointer items-center gap-3 rounded py-2 pl-3 pr-5 transition-colors hover:bg-c4a-bg-hover",onClick:p?void 0:l,children:[c.jsx(WR,{source:e,isDaemonLibrary:a??!1,isRepoRoot:o??!1}),p?c.jsx("div",{className:"min-w-0 flex-1",onClick:A=>A.stopPropagation(),children:c.jsx(U1,{currentName:e.name,onConfirm:_,onCancel:w,error:x})}):c.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-secondary",children:t??e.name}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.kind==="folder"&&r!==void 0&&c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:h("common.items",{count:r})}),N&&c.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:JR(N)})]}),(S||k)&&c.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[S?c.jsx("button",{title:h("sources.actions.rename"),onClick:A=>{A.stopPropagation(),m(!0)},className:"-my-0.5 rounded p-0.5 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:c.jsx(jh,{size:14})}):k?c.jsx("span",{className:"inline-block h-[14px] w-[14px]"}):null,k&&c.jsx("button",{title:h("sources.actions.delete"),onClick:A=>{A.stopPropagation(),f()},className:"-my-0.5 rounded p-0.5 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:c.jsx(ld,{size:14})})]})]})}function eT({library:e,onNewFolder:t,onUploadDoc:r,onImportRepo:a,onImportDir:o,onUpgrade:l}){const{t:u}=ye(),f=e.type==="daemon",h="rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",p=f?c.jsxs("div",{className:"flex gap-3",children:[o&&c.jsx("button",{onClick:o,disabled:!e.is_online,className:h,children:u("sources.actions.import_dir")}),a&&c.jsx("button",{onClick:a,disabled:!e.is_online,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:u("sources.actions.import_repo")})]}):c.jsxs("div",{className:"flex gap-3",children:[c.jsx("button",{onClick:t,className:h,children:u("sources.actions.new_folder")}),r&&c.jsx("button",{onClick:r,className:h,children:u("sources.actions.upload_document")}),l&&c.jsx("button",{onClick:l,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:u("sources.actions.import_repo_url")})]});return c.jsx(wt,{fullPage:!0,title:u(f?"sources.empty.daemon.title":"sources.empty.cloud.title"),description:u(f?"sources.empty.daemon.description":"sources.empty.cloud.description"),action:p})}function tT(){const{t:e}=ye();return c.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[c.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:e("sources.empty.indexed.title")}),c.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:e("sources.empty.indexed.description")})]})}const Dh=e=>{let t=0,r=0,a=0,o=0,l=0;const u=f=>{for(const h of f.children??[])h.kind==="folder"?(t++,u(h)):h.kind==="source"&&(r++,h.source_type==="code"?a++:o++,(h.index_status==="indexed"||h.index_status==="stale")&&l++)};return u(e),{folders:t,sources:r,codeSources:a,docSources:o,indexedSources:l}};function nT({items:e,isDaemon:t,isCloud:r,onItemClick:a,onRename:o,onDelete:l}){return c.jsx("div",{className:"flex flex-col gap-0.5",children:e.map(u=>{if(u.type==="root"){const m=u.root,x=t,v=x?m.metadata?.local_path:void 0,_=m.tree.length>0?Dh({children:m.tree}):void 0,w=_?_.folders+_.sources:0,S=m.metadata,k=S?.origin==="remote",N=S?.import_type==="directory",A=k||x&&!N;return c.jsx(sv,{source:{id:m.id,library_id:m.library_id,owner_id:m.owner_id,path:"",kind:m.kind,source_type:m.source_type,name:m.name,content_hash:m.content_hash,metadata:m.metadata,index_status:m.index_status,created_at:m.created_at,updated_at:m.updated_at},...typeof v=="string"?{displayName:v}:{},...m.kind==="folder"?{childCount:w}:{},isDaemonLibrary:t??!1,isRepoRoot:A,onClick:()=>a(u),...k?{}:{onRename:E=>o(m.id,E)},onDelete:()=>l(u)},m.id)}const f=u.node,h=`${u.root.id}:${f.path}`,p=f.kind==="folder"?f.children?.length??0:void 0;return c.jsx(sv,{source:{id:u.root.id,library_id:u.root.library_id,owner_id:u.root.owner_id,path:f.path,kind:f.kind,source_type:f.source_type??null,name:f.name,content_hash:null,metadata:f.metadata??null,index_status:f.index_status??"none",created_at:u.root.created_at,updated_at:u.root.updated_at},...p!==void 0?{childCount:p}:{},isDaemonLibrary:t??!1,onClick:()=>a(u),...r&&u.root.metadata?.origin!=="remote"?{onDelete:()=>l(u)}:{}},h)})})}function rT({libId:e,isBrowsingTree:t,rootSourceId:r,treePath:a}){const{t:o}=ye(),{uploadDoc:l,fetchRootSources:u,fetchRootSource:f}=kt(),[h,p]=b.useState(!1),[m,x]=b.useState(null),[v,_]=b.useState(!1),[w,S]=b.useState(null),k=b.useCallback(async(A,E)=>{if(e){_(!0),x(null);try{const D={library_id:e,files:A.map(H=>{const J={file_name:H.name,content:H.content};return H.encoding&&(J.encoding=H.encoding),E&&(J.version_label=E),J})};t&&r&&(D.root_source_id=r,D.parent_path=a);const L=await l(D),$=L.results??[],z=$.some(H=>H.status==="created")||(L.created?.length??0)>0,R=$.some(H=>H.status==="hash_changed"),B=$.filter(H=>H.status==="no_change").length;if(R&&!E){const H=$.find(J=>J.status==="hash_changed");S({files:A,currentVersion:H?.current_version_label??"v0.0.0"}),p(!1)}else if(z&&(t&&r?f(r):u({library_id:e})),p(!1),S(null),B>0){const H=B===$.length?o("upload.no_change"):o("upload.partial_no_change",{count:B});Qr(H,4e3)}}catch(D){D instanceof hn&&D.status===409?x(o("sources.error.name_conflict",{name:A[0]?.name??""})):D instanceof hn&&x(D.message)}finally{_(!1)}}},[e,t,r,a,l,u,f,o]),N=b.useCallback(async A=>{w&&await k(w.files,A)},[w,k]);return{showUploadDoc:h,setShowUploadDoc:p,uploadError:m,setUploadError:x,uploading:v,versionDialogData:w,setVersionDialogData:S,handleUploadDoc:k,handleVersionConfirm:N}}function aT(e){const t=Tt(),r=Qt(w=>w.updateLibraryName),a=Qt(w=>w.deleteLibrary),[o,l]=b.useState(!1),[u,f]=b.useState(null),[h,p]=b.useState(!1),m=b.useCallback(async w=>{if(e)try{await r(e,w),l(!1),f(null)}catch(S){const k=S instanceof Error?S.message:String(S);f(k)}},[e,r]),x=b.useCallback(()=>{l(!1),f(null)},[]),v=b.useCallback(async()=>{if(e){try{await a(e),t("/studio/sources/add-client")}catch{}p(!1)}},[e,a,t]),_=b.useCallback(()=>{p(!1)},[]);return{renamingLib:o,setRenamingLib:l,renameLibError:u,deletingLib:h,setDeletingLib:p,handleLibRenameConfirm:m,handleLibRenameCancel:x,handleLibDeleteConfirm:v,handleLibDeleteCancel:_}}function sT(){const{t:e}=ye(),t=Tt(),{libId:r}=Vo(),[a,o]=Ol(),l=a.get("rootId")||null,u=a.get("path")||"",h=Qt(ds(Fs)).find(me=>me.id===r),{rootSources:p,currentRoot:m,loading:x,filter:v,fetchRootSources:_,fetchRootSource:w,createSource:S,addTreeNode:k,updateSource:N,deleteSource:A,deleteTreeNode:E,setFilter:D}=kt(),L=l!==null,{showUploadDoc:$,setShowUploadDoc:z,uploadError:R,setUploadError:B,uploading:H,versionDialogData:J,setVersionDialogData:oe,handleUploadDoc:ce,handleVersionConfirm:M}=rT({libId:r,isBrowsingTree:L,rootSourceId:l,treePath:u}),[P,T]=b.useState(!1),[q,ee]=b.useState(null),[ae,W]=b.useState(null),[O,V]=b.useState(null),[re,se]=b.useState(null),[ne,ge]=b.useState(!1),{renamingLib:Ne,setRenamingLib:qe,renameLibError:Fe,deletingLib:be,setDeletingLib:fe,handleLibRenameConfirm:_e,handleLibRenameCancel:he,handleLibDeleteConfirm:ve,handleLibDeleteCancel:Ve}=aT(r);b.useEffect(()=>{r&&_({library_id:r})},[r,_]),b.useEffect(()=>{l&&w(l)},[l,w]),b.useEffect(()=>{const me=sessionStorage.getItem("c4a_batch_toast");me&&(sessionStorage.removeItem("c4a_batch_toast"),Qr(me,4e3))},[a]);const De=b.useMemo(()=>L?m?[...RR(m.tree,u)].sort((St,nt)=>St.kind!==nt.kind?St.kind==="folder"?-1:1:St.name.localeCompare(nt.name)).map(St=>({type:"node",root:m,node:St})):[]:[...p].sort((nt,Ct)=>nt.kind!==Ct.kind?nt.kind==="folder"?-1:1:new Date(Ct.created_at).getTime()-new Date(nt.created_at).getTime()).map(nt=>({type:"root",root:nt,node:null})),[L,p,m,u]),Xe=b.useMemo(()=>v==="all"?De:De.filter(me=>me.type==="root"||!me.node||me.node.kind==="folder"?!0:v==="indexed"?me.node.index_status==="indexed":me.node.index_status==="none"||!me.node.index_status),[De,v]),It=h?.type==="daemon",un=h?.type==="cloud",Vt=It&&!L,Bn=h?.type==="cloud"?!0:h?.is_online??!1,cr=kt(me=>me.indexingTasks),Xn=b.useMemo(()=>{if(L&&l){const me=cr.get(l);return!!me&&!me.terminalState}return p.some(me=>{const Ue=cr.get(me.id);return!!Ue&&!Ue.terminalState})},[L,l,cr,p]),Ht=b.useMemo(()=>{if(!h)return[];const me=[{label:h.is_default?e("sources.library.default_cloud_name"):h.name,to:`/studio/sources/${h.id}`}];return L&&m&&(me.push({label:m.name,to:`/studio/sources/${h.id}?rootId=${m.id}`}),u&&al(m.tree,u).forEach(St=>{me.push({label:St.name,to:`/studio/sources/${h.id}?rootId=${m.id}&path=${encodeURIComponent(St.path)}`})})),me},[h,L,m,u,e]),An=b.useCallback(async me=>{if(r)try{L&&l?await k(l,{parent_path:u,kind:"folder",name:me}):(await S({library_id:r,kind:"folder",name:me}),_({library_id:r})),T(!1),ee(null)}catch(Ue){Ue instanceof hn&&Ue.status===409&&ee(e("sources.error.name_conflict",{name:me}))}},[r,L,l,u,S,k,_,e]),Le=b.useCallback(me=>{r&&(me.type==="root"?me.root.kind==="source"?t(`/studio/source/${me.root.id}`):o({rootId:me.root.id}):me.node&&(me.node.kind==="folder"?o({rootId:me.root.id,path:me.node.path}):t(`/studio/source/${me.root.id}?path=${encodeURIComponent(me.node.path)}`)))},[r,t,o]),Ze=b.useCallback(()=>{if(!(!l||!r))if(u){const me=u.split("/");me.pop();const Ue=me.join("/");o(Ue?{rootId:l,path:Ue}:{rootId:l})}else o({})},[l,r,u,o]),We=b.useCallback(async(me,Ue)=>{try{return await N(me,{name:Ue}),_({library_id:r}),null}catch(St){return St instanceof hn&&St.status===409?e("sources.error.name_conflict",{name:Ue}):null}},[r,N,_,e]),Nt=b.useCallback(me=>{if(me.type==="root"){V(me.root.id),se(null);const Ue=me.root.tree.length>0?Dh({children:me.root.tree}):void 0;W(It?{type:"repo",name:me.root.name,libraryName:h.name,...Ue?{packageCount:Ue.codeSources,docCount:Ue.docSources,indexedCount:Ue.indexedSources}:{}}:{type:me.root.kind==="folder"?"folder":"resource",name:me.root.name,...me.root.kind==="folder"&&Ue?{folderCount:Ue.folders,sourceCount:Ue.sources,indexedCount:Ue.indexedSources}:{}})}else if(me.node)if(V(me.root.id),se(me.node.path),me.node.kind==="folder"){const Ue=Dh(me.node);W({type:"folder",name:me.node.name,folderCount:Ue.folders,sourceCount:Ue.sources,indexedCount:Ue.indexedSources})}else W({type:"resource",name:me.node.name})},[It,h]),ft=b.useCallback(async()=>{if(!(!O||!r)){try{re?await E(O,re):(await A(O),_({library_id:r}))}catch{}W(null),V(null),se(null)}},[O,re,r,A,E,_]),Rn=b.useCallback(()=>{if(!r)return;const me=new URLSearchParams;l&&(me.set("parentId",l),m&&me.set("parentName",m.name)),u&&me.set("parentPath",u);const Ue=me.toString();t(`/studio/sources/import/${r}${Ue?`?${Ue}`:""}`)},[r,t,l,u,m]),mn=b.useCallback(()=>{r&&t(`/studio/sources/import-dir/${r}`)},[r,t]),gn=h?.is_default===!0;if(!h)return c.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Lt=p.length===0&&v==="all"&&!x&&!L,Et=Xe.filter(me=>me.type==="node"&&me.node?.kind==="source").length===0&&v==="indexed"&&!x,Pt=!L||!m?!1:m.metadata?.origin==="remote"?!0:u?al(m.tree,u).some(Ue=>Ue.metadata?.origin==="remote"):!1,Er=!Vt,zr=un&&!Pt,sa=Vt;return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("div",{className:"min-w-0 flex-1",children:Ne?c.jsx(U1,{currentName:h.name,onConfirm:_e,onCancel:he,error:Fe}):c.jsx(Ta,{segments:Ht})}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[zr&&c.jsxs(c.Fragment,{children:[c.jsx(Yp,{label:e("sources.actions.upload"),icon:c.jsx(kh,{size:14}),items:[{label:e("sources.actions.upload_doc"),icon:c.jsx(On,{size:14}),onClick:()=>z(!0)}]}),c.jsx(Yp,{label:e("sources.actions.add"),icon:c.jsx(wm,{size:14}),items:[{label:e("sources.actions.add_folder"),icon:c.jsx(L1,{size:14}),onClick:()=>T(!0)},{label:e("sources.actions.add_web"),icon:c.jsx(AC,{size:14}),onClick:()=>ge(!0)},{label:e("sources.actions.add_feishu"),icon:c.jsx(uC,{size:14}),onClick:()=>ge(!0)}]}),c.jsxs("button",{onClick:()=>{const me=new URLSearchParams;l&&(me.set("parentId",l),m&&me.set("parentName",m.name)),u&&me.set("parentPath",u);const Ue=me.toString();t(`/studio/sources/import-remote/${r}${Ue?`?${Ue}`:""}`)},className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[c.jsx(U0,{size:14}),c.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_repo_url")})]})]}),sa&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:mn,disabled:!h.is_online,title:h.is_online?void 0:e("sources.import.daemon_offline",{name:h.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[c.jsx(xC,{size:14}),c.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_dir")})]}),c.jsxs("button",{onClick:Rn,disabled:!h.is_online,title:h.is_online?void 0:e("sources.import.daemon_offline",{name:h.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[c.jsx(U0,{size:14}),c.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_repo")})]}),c.jsx(Yp,{label:"",icon:c.jsx(jh,{size:14}),alignRight:!0,items:[{label:e("sources.library.rename"),icon:c.jsx(jh,{size:14}),onClick:()=>qe(!0)},...gn?[]:[{label:e("sources.actions.delete"),icon:c.jsx(ld,{size:14}),onClick:()=>fe(!0)}]]})]}),(L||un)&&c.jsxs("button",{onClick:()=>{const me=new URLSearchParams;l&&me.set("rootId",l),u&&me.set("path",u),t(`/studio/sources/${r}/batch-index?${me.toString()}`)},disabled:!Bn||Xn,title:e(Bn?Xn?"index.batch.tooltip_indexing":"index.batch.tooltip":"daemon.offline_tooltip"),className:`flex items-center gap-1.5 rounded border p-1 font-mono text-xs uppercase transition-colors sm:px-2 sm:py-1 ${Xn?"border-c4a-accent/30 bg-c4a-bg-surface text-c4a-accent":Bn?"border-c4a-border-default bg-c4a-bg-surface text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary":"border-c4a-border-default bg-c4a-bg-surface text-c4a-text-secondary opacity-40"}`,children:[Xn?c.jsx(Zt,{size:14,className:"animate-spin"}):c.jsx(oC,{size:14}),c.jsx("span",{className:"hidden sm:inline",children:e("index.batch.tooltip")})]}),Er&&c.jsx(LR,{value:v,onChange:D})]})]}),Lt?c.jsx(eT,{library:h,onNewFolder:()=>T(!0),...It?{onImportRepo:Rn,onImportDir:mn}:{},...un?{onUploadDoc:()=>z(!0),onUpgrade:()=>{const me=new URLSearchParams;l&&(me.set("parentId",l),m&&me.set("parentName",m.name)),u&&me.set("parentPath",u);const Ue=me.toString();t(`/studio/sources/import-remote/${r}${Ue?`?${Ue}`:""}`)}}:{}}):c.jsx(KR,{pathLabel:(()=>{if(!L||!m)return"/";const me=m.metadata,Ue=It?typeof me?.local_path=="string"?me.local_path:m.name:"/"+m.name;if(!u)return Ue;const St=al(m.tree,u);return Ue+"/"+St.map(nt=>nt.name).join("/")})(),loading:x,badge:(()=>{if(!L||!m)return;let me=m.metadata,Ue=m.name;if(!me?.origin&&u){const Ct=al(m.tree,u);for(const Dt of Ct){const Oa=Dt.metadata;if(Oa?.origin==="remote"){me=Oa,Ue=Dt.name;break}}}const St=me?.pinned_branch??me?.remote_ref,nt=me?.pinned_hash??me?.remote_commit;if(!(!St||!nt))return c.jsx(I1,{remoteUrl:me?.remote_url,fallbackName:Ue,branch:St,commit:nt})})(),onNavigateUp:L?Ze:void 0,children:Xe.length===0?Et?c.jsx(tT,{}):L?null:c.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:e("common.items",{count:0})}):c.jsx(nT,{items:Xe,isDaemon:It??!1,isCloud:un??!1,onItemClick:Le,onRename:We,onDelete:Nt})}),P&&c.jsx(DR,{onConfirm:An,onCancel:()=>{T(!1),ee(null)},error:q}),$&&c.jsx(FR,{onConfirm:ce,onCancel:()=>{z(!1),B(null)},error:R,uploading:H}),J&&c.jsx(YR,{currentVersion:J.currentVersion,onConfirm:M,onCancel:()=>{oe(null),B(null)},uploading:H,serverError:R}),ne&&c.jsx(OR,{onClose:()=>ge(!1)}),ae&&c.jsx(rv,{target:ae,onConfirm:ft,onCancel:()=>{W(null),V(null),se(null)}}),be&&h&&c.jsx(rv,{target:{type:"client",name:h.name},onConfirm:ve,onCancel:Ve})]})}function oT(){const{t:e}=ye(),t=Tt(),r=Qt(u=>u.libraries),a=Qt(u=>u.loading),[o,l]=b.useState(!1);return b.useEffect(()=>{if(a)return;if(r.length===0&&!o){l(!0),Qt.getState().fetchLibraries();return}const u=r.find(f=>f.is_default);u?t(`/studio/sources/${u.id}`,{replace:!0}):r.length>0&&t(`/studio/sources/${r[0].id}`,{replace:!0})},[r,a,t,o]),o&&!a&&r.length===0?c.jsx(wt,{fullPage:!0,icon:c.jsx(T1,{size:32}),title:e("sources.empty.cloud.title"),description:e("sources.empty.cloud.description")}):c.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:c.jsx(ta,{})})}function Xr({active:e,current:t}){return c.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full border-2 ${t?"border-c4a-accent bg-c4a-accent":e?"border-c4a-accent bg-transparent":"border-c4a-border-default bg-transparent"}`})}function $s(){return c.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function P1({libraryName:e}){const{t}=ye();return c.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[c.jsx("p",{className:"text-sm text-c4a-warning",children:t("sources.import.daemon_offline",{name:e})}),c.jsx(jr,{to:"/studio/sources/add-client",className:"mt-4 inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:t("sources.import.view_guide")})]})}function jm({step:e,totalSteps:t,importing:r,stepBusy:a,canProceed:o,safetyNoticeKey:l,confirmLabelKey:u,onPrev:f,onNext:h,onImport:p}){const{t:m}=ye();return c.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-4 sm:mt-6",children:[c.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-c4a-text-muted line-clamp-1 sm:line-clamp-none",title:m(l),onClick:x=>x.currentTarget.classList.toggle("line-clamp-1"),children:m(l)}),c.jsxs("div",{className:"flex shrink-0 gap-2",children:[e>1&&c.jsx("button",{onClick:f,disabled:r||a,className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover disabled:opacity-40",children:m("common.previous")}),e<t?c.jsx("button",{onClick:h,disabled:!o||a,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:m("common.next")}):c.jsxs("button",{onClick:p,disabled:r||a||!o,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[r&&c.jsx(Zt,{size:12,className:"animate-spin"}),m(r?"sources.import.importing":u)]})]})]})}function H1(e,t){const r=b.useCallback(async(u,f)=>{if(!e)throw new Error("No library");const h=await ze.post(`/libraries/${e}/rpc`,{method:u,params:f});if(h.error){const p=h.error;throw new Error(p.message??JSON.stringify(h.error))}return h.result??h},[e]),[a,o]=b.useState([]);b.useEffect(()=>{if(!e)return;let u=!1;return(async()=>{try{const f=await ze.get("/sources",{library_id:e,limit:"500"});if(u)return;const h=f.items.map(p=>{const m=p.metadata;return typeof m?.local_path=="string"?m.local_path:null}).filter(p=>p!==null);o(h)}catch{}})(),()=>{u=!0}},[e]);const l=b.useMemo(()=>{const u=t?.config;return!u||!Array.isArray(u.allowed_paths)?[]:u.allowed_paths},[t]);return{rpc:r,importedPaths:a,allowedPaths:l}}function iT(e,t){const r=e.toLowerCase();try{if(r.endsWith("package.json")){const a=JSON.parse(t);if(typeof a.name=="string"&&a.name.trim())return a.name.trim()}if(r.endsWith("pyproject.toml"))return t.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(r.endsWith("go.mod"))return t.match(/^\s*module\s+([^\s]+)\s*$/m)?.[1]??null;if(r.endsWith("cargo.toml"))return t.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(r.endsWith("pom.xml"))return t.match(/<artifactId>([^<]+)<\/artifactId>/)?.[1]?.trim()??null;if(r.endsWith("build.gradle"))return t.match(/rootProject\.name\s*=\s*["']([^"']+)["']/)?.[1]??null}catch{return null}return null}function Oh(e,t,r="repo"){const a=[];for(const l of e){const u=l.path.split("/"),f=u.slice(0,-1).join("/")||".",h=u.length===1||l.path==="package.json",p=f==="."?r:u[u.length-2]||f,m=iT(l.path,l.content);a.push({name:m||p,path:f,isRoot:h})}const o=t.filter(l=>/\.md$/i.test(l.path)).map(l=>l.path);return{packages:a,mdFiles:o}}const ov=new Set(["tree","blob","commit","commits","raw","src"]),lT=new Set(["commit","commits"]);function cT(e){let t;try{t=new URL(e.trim())}catch{return{repoUrl:e.trim()}}const r=t.pathname.split("/").filter(Boolean);let a=-1;for(let p=2;p<r.length;p++){const m=r[p];if(m==="-"&&p+1<r.length&&ov.has(r[p+1])){a=p;break}if(ov.has(m)){a=p;break}}if(a===-1)return{repoUrl:`${t.protocol}//${t.host}${t.pathname}`.replace(/\/+$/,"")};const o=r.slice(0,a).join("/"),l=`${t.protocol}//${t.host}/${o}`;let u,f;if(r[a]==="-"?(u=r[a+1],f=a+2):(u=r[a],f=a+1),f>=r.length)return{repoUrl:l};const h=r[f];return lT.has(u)?{repoUrl:l,commit:h}:{repoUrl:l,ref:h}}function Os(e){try{return(new URL(e).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return e.split("/").pop()||e}}function Mh(){const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`}const uT=1500;async function F1(e){const t=uT-(Date.now()-e);t>0&&await new Promise(r=>setTimeout(r,t))}function q1(){const{t:e}=ye(),[t,r]=b.useState(!1),[a,o]=b.useState(null),l=b.useRef(),u=b.useRef(),f=window.location.host,h=`c4a-daemon --server ${f} --allow <dir1> <dir2>`,p=`c4a-daemon --server ${f}`,m=b.useCallback((_,w)=>{navigator.clipboard.writeText(_),o(w),clearTimeout(l.current),l.current=setTimeout(()=>o(null),1500)},[]),x=b.useCallback(()=>{clearTimeout(u.current),r(!0)},[]),v=b.useCallback(()=>{u.current=setTimeout(()=>r(!1),150)},[]);return c.jsxs("span",{className:"relative",onMouseEnter:x,onMouseLeave:v,children:[c.jsx(R1,{size:12,className:"text-c4a-warning"}),t&&c.jsxs("span",{className:"absolute left-full top-1/2 z-10 ml-2 -translate-y-1/2 rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-2 shadow-lg",onMouseEnter:x,onMouseLeave:v,children:[c.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:e("sources.import.allowed_dirs_tooltip_restrict")}),c.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[c.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:h}),c.jsx("button",{onClick:()=>m(h,0),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:a===0?c.jsx(Wr,{size:10}):c.jsx(Iu,{size:10})})]}),c.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:e("sources.import.allowed_dirs_tooltip_all")}),c.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[c.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:p}),c.jsx("button",{onClick:()=>m(p,1),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:a===1?c.jsx(Wr,{size:10}):c.jsx(Iu,{size:10})})]})]})]})}function G1({open:e,onClose:t,rpc:r,onNavigate:a,defaultPath:o}){const{t:l}=ye(),[u,f]=b.useState(o??""),[h,p]=b.useState(null),[m,x]=b.useState(!1),v=b.useRef(null);b.useEffect(()=>{o&&!u&&f(o)},[o]);const _=b.useCallback(async()=>{const S=u.trim();if(S){x(!0),p(null);try{(await r("fs/exists",{path:S})).exists?(a(S),f(o??""),p(null),t()):p(l("sources.import.wildcard_path_not_found"))}catch(k){p(k instanceof Error?k.message:String(k))}finally{x(!1)}}},[u,r,l,a,t]),w=b.useCallback(()=>{f(o??""),p(null),t()},[t,o]);return e?c.jsxs(lr,{onClose:w,closeOnOverlay:!1,closeOnEsc:!1,overlayClass:"bg-black/40",className:"w-full max-w-md rounded-lg border border-c4a-border-default bg-c4a-bg-surface p-5 shadow-xl",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:l("sources.import.wildcard_go_title")}),c.jsx("button",{onClick:w,className:"rounded p-1 text-c4a-text-muted transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-secondary",children:c.jsx(Or,{size:14})})]}),c.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[c.jsx("input",{ref:v,type:"text",value:u,onChange:S=>{f(S.target.value),p(null)},onKeyDown:S=>{S.key==="Enter"&&_()},placeholder:l("sources.import.wildcard_path_placeholder"),autoFocus:!0,className:"flex-1 rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent"}),c.jsxs("button",{onClick:_,disabled:m||!u.trim(),className:"flex shrink-0 items-center gap-1.5 rounded bg-c4a-accent px-3 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[m?c.jsx(Zt,{size:12,className:"animate-spin"}):c.jsx(C1,{size:12}),l("sources.import.wildcard_go")]})]}),h&&c.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:h})]}):null}function V1({rpc:e,allowedPaths:t,importedPaths:r,onNavigateUpExtra:a}){const o=!!t&&t.length>0,l=o&&t.length===1&&t[0]==="*",[u,f]=b.useState(o),[h,p]=b.useState(o&&!l?"":"/"),[m,x]=b.useState([]),[v,_]=b.useState(!1),[w,S]=b.useState(null),[k,N]=b.useState(null);b.useEffect(()=>{if(o&&!l)return;let B=!1;return(async()=>{try{const H=await e("fs/homeDir",{});B||N(H.home_dir)}catch{B||N("/")}})(),()=>{B=!0}},[o,l,e]);const[A,E]=b.useState(!1),D=b.useCallback(async B=>{_(!0),S(null);try{const H=await e("fs/listTree",{path:B,depth:1});x(H.entries||[]),p(B),f(!1)}catch(H){const J=H instanceof Error?H.message:String(H);S(J)}finally{_(!1)}},[e]);b.useEffect(()=>{o&&!l||k!==null&&D(k)},[k,o,l,D]);const L=b.useMemo(()=>new Set(r??[]),[r]),$=b.useCallback(()=>{if(o&&!l&&t.some(J=>J===h)){f(!0),p(""),x([]),S(null),a?.();return}const B=h.split("/").slice(0,-1).join("/")||"/";a?.(),D(B)},[o,l,t,h,D,a]),z=b.useMemo(()=>m.filter(B=>B.type==="directory"),[m]),R=b.useMemo(()=>m.filter(B=>B.type==="file"),[m]);return{atRoot:u,currentPath:h,entries:m,loading:v,error:w,homeDir:k,goToOpen:A,hasAllowedPaths:o,isWildcard:l,importedSet:L,dirs:z,files:R,loadTree:D,handleNavigateUp:$,setGoToOpen:E}}function dT({rpc:e,selectedPath:t,onSelect:r,allowedPaths:a,importedPaths:o}){const{t:l}=ye(),[u,f]=b.useState(null),{atRoot:h,currentPath:p,entries:m,loading:x,error:v,homeDir:_,goToOpen:w,isWildcard:S,importedSet:k,dirs:N,files:A,loadTree:E,handleNavigateUp:D,setGoToOpen:L}=V1({rpc:e,allowedPaths:a??[],importedPaths:o??[],onNavigateUpExtra:()=>f(null)}),[$,z]=b.useState(null),[R,B]=b.useState(!1);b.useEffect(()=>{if(!t){z(null),B(!1);return}z(null),B(!0);let ce=!1;return(async()=>{try{const M=await e("fs/repoStatus",{path:t});ce||(z({branch:M.branch,hash:M.head_hash,remoteUrl:M.remote_url}),B(!1))}catch{ce||(z(null),B(!1))}})(),()=>{ce=!0}},[t,e]);const H=b.useCallback(ce=>{if(ce.type==="directory")if(ce.is_git_repo){if(k.has(ce.path))return;f(null),r(ce.path,ce.name)}else f(ce.path),E(ce.path)},[r,E,k]),J=b.useMemo(()=>N.sort((ce,M)=>ce.is_git_repo&&!M.is_git_repo?-1:!ce.is_git_repo&&M.is_git_repo?1:ce.name.localeCompare(M.name)),[N]),oe=b.useMemo(()=>A.sort((ce,M)=>ce.name.localeCompare(M.name)),[A]);return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2.5",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[h?c.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[c.jsx("span",{children:l("sources.import.allowed_dirs")}),c.jsx(q1,{})]}):c.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:p}),t&&R?c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[c.jsx(Zt,{size:12,className:"animate-spin"}),c.jsx("span",{children:l("common.loading")})]}):t&&$?c.jsx(I1,{remoteUrl:$.remoteUrl,fallbackName:t.split("/").pop()||t,branch:$.branch,commit:$.hash}):!t&&S&&h?c.jsx("button",{onClick:()=>L(!0),className:"flex shrink-0 items-center gap-1.5 rounded border border-c4a-accent/40 bg-c4a-accent/10 px-2.5 py-1 text-xs text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:l("sources.import.wildcard_goto")}):null]}),c.jsx("hr",{className:"my-2 border-c4a-border-subtle"}),h?S?c.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:_&&c.jsxs("button",{onClick:()=>E(_),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx(Gn,{size:14,className:"shrink-0"}),c.jsxs("span",{className:"truncate",children:[_,c.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",l("sources.import.wildcard_home"),")"]})]}),c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):c.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:a.map(ce=>c.jsxs("button",{onClick:()=>E(ce),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx(Gn,{size:14,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:ce}),c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"})]},ce))}):v&&!x?c.jsx("p",{className:"py-4 text-xs text-c4a-error",children:v}):c.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[x&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:c.jsx(Zt,{size:14,className:"animate-spin text-c4a-text-muted"})}),p!=="/"&&c.jsxs("button",{onClick:D,disabled:x,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[c.jsx(bm,{size:14,className:"text-c4a-text-muted"}),c.jsx("span",{className:"leading-none pb-1",children:".."})]}),J.map(ce=>{const M=ce.is_git_repo&&k.has(ce.path),P=ce.is_git_repo?Ml:Gn;return c.jsxs("div",{className:`flex w-full items-center rounded pl-2 pr-4 text-left text-xs transition-colors ${M?"cursor-not-allowed text-c4a-accent/60":t===ce.path?"bg-c4a-bg-hover":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[c.jsxs("button",{onClick:()=>H(ce),disabled:M||x,className:"flex flex-1 items-center gap-2 py-1.5",children:[c.jsx(P,{size:14,className:"shrink-0"}),c.jsx("span",{className:"flex-1 truncate text-left",children:ce.name}),M&&c.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:l("sources.import.already_imported")})]}),!M&&c.jsx("button",{onClick:T=>{T.stopPropagation(),E(ce.path)},disabled:x,className:"shrink-0 rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent disabled:pointer-events-none",title:ce.path,children:c.jsx($t,{size:12})})]},ce.path)}),oe.map(ce=>c.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-xs text-c4a-text-muted",children:[c.jsx(_m,{size:14,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:ce.name})]},ce.path)),m.length===0&&!x&&c.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:l("sources.import.no_entries")})]}),u&&!t&&c.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:l("sources.import.not_git")}),c.jsx(G1,{open:w,onClose:()=>L(!1),rpc:e,onNavigate:E,defaultPath:_??void 0})]})}const Ro=50,Kp=["main","master"];function fT(e){const t=[],r=[];for(const a of e)Kp.includes(a.name)?t.push(a):r.push(a);return t.sort((a,o)=>Kp.indexOf(a.name)-Kp.indexOf(o.name)),[...t,...r]}function iv(e,t,r){b.useEffect(()=>{if(!r)return;const a=o=>{e.current&&!e.current.contains(o.target)&&t()};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e,t,r])}function Y1({refs:e,loading:t,error:r,selectedRef:a,commit:o,onRefChange:l,onCommitChange:u,onValidChange:f,onBranchSwitch:h}){const{t:p}=ye(),[m,x]=b.useState(!1),[v,_]=b.useState(""),[w,S]=b.useState(!0),[k,N]=b.useState(!0),A=b.useRef(null),E=b.useRef(null),[D,L]=b.useState(!1),[$,z]=b.useState(""),R=b.useRef(null),B=b.useRef(null);iv(A,()=>{x(!1),_("")},m),iv(R,()=>{L(!1),z("")},D),b.useEffect(()=>{m&&setTimeout(()=>E.current?.focus(),0)},[m]),b.useEffect(()=>{D&&setTimeout(()=>B.current?.focus(),0)},[D]),b.useEffect(()=>{f(!!a)},[a,f]);const H=b.useCallback(W=>{l(W.name),u(W.commit),x(!1),_(""),h?.(W.name)},[l,u,h]),J=b.useCallback((W,O)=>{u(W),l(O),L(!1),z("")},[u,l]),oe=b.useMemo(()=>e?fT(e.branches):[],[e]),ce=b.useMemo(()=>{const W=v.toLowerCase();return(W?oe.filter(V=>V.name.toLowerCase().includes(W)):oe).slice(0,Ro)},[oe,v]),M=b.useMemo(()=>{if(!e)return[];const W=v.toLowerCase();return(W?e.tags.filter(V=>V.name.toLowerCase().includes(W)):e.tags).slice(0,Ro)},[e,v]),P=b.useMemo(()=>{if(!e)return[];if(e.commits&&e.commits.length>0){const se=$.toLowerCase(),ne=e.commits.map(ge=>({hash:ge.hash,refName:a||"",label:`${ge.hash.slice(0,8)} ${ge.message?`— ${ge.message.slice(0,50)}`:""}`.trim()}));return se?ne.filter(ge=>ge.hash.toLowerCase().includes(se)||ge.label.toLowerCase().includes(se)).slice(0,Ro):ne.slice(0,Ro)}const W=new Set,O=[],V=[...e.branches??[],...e.tags??[]];for(const se of V){const ne=se.commit.slice(0,8);W.has(se.commit)||(W.add(se.commit),O.push({hash:se.commit,refName:se.name,label:`${ne} (${se.name})`}))}if(!$)return O.slice(0,Ro);const re=$.toLowerCase();return O.filter(se=>se.hash.toLowerCase().includes(re)||se.label.toLowerCase().includes(re)).slice(0,Ro)},[e,$,a]),[T,q]=b.useState(!1);if(b.useEffect(()=>{if(!t){q(!1);return}const W=setTimeout(()=>q(!0),5e3);return()=>clearTimeout(W)},[t]),t)return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsx(Zt,{size:20,className:"animate-spin text-c4a-accent"}),c.jsx("span",{className:"mt-2 text-sm text-c4a-accent",children:p("sources.import_remote.loading_refs")}),T&&c.jsx("span",{className:"mt-1.5 text-xs text-c4a-text-muted",children:p("sources.import_remote.loading_refs_slow")})]});if(r)return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-sm font-medium text-red-400",children:[c.jsx(Or,{size:14,className:"shrink-0"}),p("sources.import.error_title")]}),c.jsx("p",{className:"mt-2 max-h-40 overflow-y-auto break-all font-mono text-xs leading-relaxed text-red-400/70",children:r})]});if(!e)return null;const ee=e.branches.find(W=>W.name===a)?.name??e.tags.find(W=>W.name===a)?.name??a,ae=o?o.slice(0,8):"";return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col space-y-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:p("sources.import_remote.ref_label")}),c.jsxs("div",{ref:A,className:"relative mt-2",children:[c.jsxs("button",{onClick:()=>x(!m),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[c.jsx("span",{children:ee||"—"}),c.jsx($t,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${m?"rotate-90":""}`})]}),m&&c.jsxs("div",{className:"absolute z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[c.jsx("div",{className:"border-b border-c4a-border-default px-3 py-2.5",children:c.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1.5",children:[c.jsx(gl,{size:14,className:"shrink-0 text-c4a-text-muted"}),c.jsx("input",{ref:E,type:"text",value:v,onChange:W=>_(W.target.value),placeholder:p("sources.import_remote.ref_search"),className:"w-full bg-transparent font-mono text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),c.jsxs("div",{className:"flex max-h-80 flex-col md:flex-row",children:[ce.length>0&&c.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto md:border-r md:border-c4a-border-default",children:[c.jsxs("button",{onClick:()=>S(!w),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[c.jsx($t,{size:12,className:`transition-transform duration-200 ${w?"rotate-90":""}`}),p("sources.import_remote.ref_branches")," (",e.branches.length,")"]}),w&&ce.map(W=>c.jsxs("button",{onClick:()=>H(W),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${W.name===a?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[c.jsx("span",{className:"truncate",children:W.name}),W.name===a&&c.jsx("span",{children:"✓"})]},`b-${W.name}`))]}),M.length>0&&c.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto border-t border-c4a-border-default md:border-t-0",children:[c.jsxs("button",{onClick:()=>N(!k),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[c.jsx($t,{size:12,className:`transition-transform duration-200 ${k?"rotate-90":""}`}),p("sources.import_remote.ref_tags")," (",e.tags.length,")"]}),k&&M.map(W=>c.jsxs("button",{onClick:()=>H(W),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${W.name===a?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[c.jsx("span",{className:"truncate",children:W.name}),W.name===a&&c.jsx("span",{children:"✓"})]},`t-${W.name}`))]})]}),ce.length===0&&M.length===0&&c.jsx("div",{className:"px-3 py-4 text-center font-mono text-sm text-c4a-text-muted",children:"No matches"})]})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:p("sources.import_remote.commit_label")}),c.jsxs("div",{ref:R,className:"relative mt-2",children:[c.jsxs("button",{onClick:()=>L(!D),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[c.jsx("span",{className:o?"":"font-normal text-c4a-text-muted",children:ae||"—"}),c.jsx($t,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${D?"rotate-90":""}`})]}),D&&c.jsxs("div",{className:"c4a-scrollbar absolute z-20 mt-1 max-h-64 w-full overflow-y-auto rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[c.jsx("div",{className:"sticky top-0 z-10 border-b border-c4a-border-default bg-c4a-bg-elevated px-3 py-2",children:c.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1",children:[c.jsx(gl,{size:12,className:"shrink-0 text-c4a-text-muted"}),c.jsx("input",{ref:B,type:"text",value:$,onChange:W=>z(W.target.value),placeholder:p("sources.import_remote.commit_search"),className:"w-full bg-transparent font-mono text-xs text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),P.map(W=>c.jsxs("button",{onClick:()=>J(W.hash,W.refName),className:"flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx("span",{className:"truncate",children:W.label}),W.hash===o&&c.jsx("span",{className:"text-c4a-accent",children:"✓"})]},W.hash)),P.length===0&&c.jsx("div",{className:"px-3 py-4 text-center font-mono text-xs text-c4a-text-muted",children:"No matches"})]})]}),c.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[c.jsx(DC,{size:12,className:"shrink-0"}),p("sources.import_remote.commit_hint")]})]})]})}const pT="_progressTrack_1cl9k_1",hT="_progressFill_1cl9k_9",mT="_progressFillComplete_1cl9k_45",gT="_progressFillFailed_1cl9k_49",iu={progressTrack:pT,progressFill:hT,progressFillComplete:mT,progressFillFailed:gT};function xT(e){const t={},r=100/e.length;return e.forEach((a,o)=>{t[a.key]=Math.round(r*(o+1))}),t}function yT(e,t,r,a,o,l){const u=m=>m>0?t[e[m-1].key]??0:0;if(o){const m=e.findIndex(_=>_.key===o),x=u(m),v=t[o]??100;return x+l/100*(v-x)}if(!r)return a.length===e.length?100:0;const f=e.findIndex(m=>m.key===r);if(f<0)return 0;const h=u(f),p=t[r]??100;return l>=0?h+l/100*(p-h):h}function K1({stages:e,currentStage:t,completedStages:r,failedStage:a,progress:o,breakpoints:l,headerRight:u}){const f=l??xT(e),h=o?.percent??-1,p=b.useRef(0),[m,x]=b.useState(0),v=b.useRef(null),_=yT(e,f,t,r,a,h>=0?h:-1);p.current=_,b.useEffect(()=>{_>m&&x(_)},[_]),b.useEffect(()=>{if(!t||a){v.current&&(clearInterval(v.current),v.current=null);return}const E=e.findIndex(R=>R.key===t),D=f[t]??100,L=E===e.length-1?D-1:D-2,$=500,z=.025;return v.current=setInterval(()=>{x(R=>{const B=p.current;if(R>=B&&R<L){const H=Math.max(.1,(L-R)*z);return Math.min(R+H,L)}return R})},$),()=>{v.current&&(clearInterval(v.current),v.current=null)}},[t,a,e,f]);const w=b.useRef(null);b.useEffect(()=>{if(r.length===e.length&&!a)return v.current&&(clearInterval(v.current),v.current=null),w.current=setInterval(()=>{x(E=>E>=100?(w.current&&clearInterval(w.current),w.current=null,100):Math.min(100,E+4))},32),()=>{w.current&&(clearInterval(w.current),w.current=null)}},[r.length,e.length,a]);const S=Math.min(100,Math.max(0,m)),k=!!t&&!a,N=!!a,A=r.length===e.length&&!a;return c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2 flex-wrap",children:e.map(E=>{const D=r.includes(E.key),L=a===E.key,$=t===E.key;let z="inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-mono text-[11px] uppercase tracking-tight transition-colors";return L?z+=" bg-red-500/10 text-red-400":D?z+=" bg-c4a-accent/10 text-c4a-accent":$?z+=" bg-c4a-accent/15 text-c4a-accent":z+=" bg-c4a-bg-elevated text-c4a-text-muted",c.jsxs("span",{className:z,children:[L?c.jsx(Or,{size:10,className:"shrink-0"}):D?c.jsx(Wr,{size:10,className:"shrink-0"}):$?c.jsx(Zt,{size:10,className:"shrink-0 animate-spin"}):c.jsx(eC,{size:8,className:"shrink-0 opacity-40"}),E.label]},E.key)})}),u&&c.jsx("div",{className:"shrink-0",children:u})]}),c.jsx("div",{className:iu.progressTrack,children:S>0?c.jsx("div",{className:`${iu.progressFill} ${N?iu.progressFillFailed:A?iu.progressFillComplete:""}`,style:{width:`${S}%`}},"fill"):null}),c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"font-mono text-[11px] text-c4a-text-muted tabular-nums",children:A?"100%":k||N?`${Math.round(S)}%`:""}),o?.label&&k&&c.jsx("span",{className:"hidden truncate font-mono text-[11px] text-c4a-text-muted sm:block",children:o.label})]})]})}function X1({stages:e,currentStage:t,completedStages:r,failedStage:a,progress:o,breakpoints:l,failedError:u,logs:f}){const h=b.useRef(null);return b.useEffect(()=>{h.current?.scrollIntoView({behavior:"smooth"})},[f.length]),c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsx(K1,{stages:e,currentStage:t,completedStages:r,failedStage:a,progress:o,...l?{breakpoints:l}:{}}),c.jsxs("div",{className:"mt-4 min-h-0 flex-1 rounded bg-c4a-bg-base p-3 c4a-scrollbar overflow-y-auto",children:[f.map((p,m)=>c.jsx("p",{className:"font-mono text-xs text-c4a-text-muted leading-relaxed",children:p},m)),c.jsx("div",{ref:h})]}),a&&u&&c.jsx("div",{className:"mt-3 max-h-32 overflow-y-auto rounded-sm bg-red-500/5 px-4 py-3",children:c.jsx("p",{className:"break-all font-mono text-xs leading-relaxed text-red-400/80",children:u})})]})}function ln({icon:e,label:t,value:r,tooltip:a,size:o="sm"}){const l=o==="sm";return c.jsxs("div",{className:"group/stat relative rounded-lg border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted [&>svg]:size-4",children:[e,c.jsx("span",{className:"font-mono text-xs uppercase",children:t})]}),c.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-secondary ${l?"text-sm truncate":"text-lg"}`,title:l?String(r):void 0,children:r}),a&&c.jsx("div",{className:"pointer-events-none absolute bottom-full left-0 z-30 mb-1.5 hidden w-max max-w-[260px] rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/stat:block",children:a})]})}const Xp=100;function Q1({repoName:e,repoIdentifier:t,branch:r,commit:a,packages:o,mdFiles:l,importing:u,completed:f,importMethod:h}){const{t:p}=ye(),m=a?a.slice(0,7):"",[x,v]=b.useState("packages"),[_,w]=b.useState(Xp),S=b.useRef(null),k=b.useRef(null);b.useEffect(()=>{w(Xp),k.current?.scrollTo(0,0)},[x]),b.useEffect(()=>{const L=S.current;if(!L)return;const $=x==="packages"?o.length:l.length;if(_>=$)return;const z=new IntersectionObserver(R=>{R[0]?.isIntersecting&&w(B=>Math.min(B+Xp,$))},{root:k.current,threshold:.1});return z.observe(L),()=>z.disconnect()},[x,_,o.length,l.length]);const N=x==="packages"?o:l,A=N.slice(0,_),E=_<N.length,D=b.useMemo(()=>f?p("sources.import_remote.complete"):u?p("sources.import.importing"):p("sources.import.confirm_heading",{name:e}),[f,u,e,p]);return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[c.jsx("p",{className:"text-sm text-c4a-text-secondary",children:D}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[c.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:e}),c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:t})]}),c.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[c.jsx(ln,{icon:c.jsx(Uu,{size:14}),label:p("sources.import.branch"),value:r}),c.jsx(ln,{icon:c.jsx(jC,{size:14}),label:p("sources.import.commit"),value:m}),c.jsx(ln,{icon:c.jsx(Dr,{size:14}),label:p("sources.import.packages"),value:String(o.length),tooltip:p("sources.import.dir_code_packages_tip")}),c.jsx(ln,{icon:c.jsx(On,{size:14}),label:p("sources.import.documents"),value:String(l.length),tooltip:p("sources.import.dir_doc_files_tip")})]}),h&&c.jsxs("p",{className:"mt-3 font-mono text-xs text-c4a-text-muted",children:[p("sources.import_remote.api.method"),":"," ",c.jsx("span",{className:"text-c4a-accent",children:p(h==="api"?"sources.import_remote.api.method_api":"sources.import_remote.api.method_clone")})]}),u&&c.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[c.jsx(Zt,{size:14,className:"animate-spin text-c4a-accent"}),c.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:p("sources.import.importing")})]}),(o.length>0||l.length>0)&&c.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-base",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[c.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-secondary sm:block",children:p("sources.import.recognized",{packages:o.length,docs:l.length})}),c.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[c.jsxs("button",{onClick:()=>v("packages"),className:`flex items-center gap-1 px-2.5 py-1 text-xs transition-colors ${x==="packages"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[c.jsx(Dr,{size:13}),c.jsx("span",{className:"font-mono",children:o.length})]}),c.jsxs("button",{onClick:()=>v("docs"),className:`flex items-center gap-1 border-l border-c4a-border-subtle px-2.5 py-1 text-xs transition-colors ${x==="docs"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[c.jsx(On,{size:13}),c.jsx("span",{className:"font-mono",children:l.length})]})]})]}),c.jsx("hr",{className:"border-c4a-border-subtle"}),c.jsx("div",{ref:k,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:N.length===0?c.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:x==="packages"?p("sources.import.no_packages"):"—"}):c.jsxs(c.Fragment,{children:[x==="packages"?A.map(L=>c.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[c.jsx(Dr,{size:14,className:"shrink-0 text-c4a-accent"}),c.jsx("span",{className:"text-c4a-text-secondary",children:L.name}),c.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:L.path}),L.isRoot&&c.jsx("span",{className:"rounded bg-c4a-bg-active px-1 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:"root"})]},L.path)):A.map(L=>c.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[c.jsx(On,{size:14,className:"shrink-0 text-c4a-text-secondary"}),c.jsx("span",{className:"truncate text-c4a-text-secondary",children:L})]},L)),E&&c.jsx("div",{ref:S,className:"h-4"})]})})]})]})}const bT=["scan","save"],lu={scan:"sources.import.stage.scan",save:"sources.import.stage.save"},vT={scan:20,save:90};function _T(){const{t:e}=ye(),t=Tt(),{libId:r}=Vo(),[a]=Ol(),l=Qt(ds(Fs)).find(Le=>Le.id===r),u=kt(Le=>Le.createSource),f=a.get("parentId")||"",h=a.get("parentName")||"",p=a.get("parentPath")||"",[m,x]=b.useState(1),[v,_]=b.useState(null),[w,S]=b.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),[k,N]=b.useState(null),[A,E]=b.useState(!1),[D,L]=b.useState(null),[$,z]=b.useState(""),[R,B]=b.useState(""),[H,J]=b.useState(!1),[oe,ce]=b.useState(!1),[M,P]=b.useState(!1),[T,q]=b.useState(null),[ee,ae]=b.useState([]),[W,O]=b.useState(null),[V,re]=b.useState(null),[se,ne]=b.useState([]),ge=b.useRef(null),Ne=l?.is_online??!1,{rpc:qe,importedPaths:Fe,allowedPaths:be}=H1(r,l),fe=b.useMemo(()=>bT.map(Le=>({key:Le,label:lu[Le]?e(lu[Le]):Le})),[e]),_e=b.useCallback(Le=>{ne(Ze=>[...Ze,`[${Mh()}] ${Le}`])},[]),he=b.useRef(null),ve=b.useCallback(Le=>{const Ze=he.current;Ze&&Ze!==Le&&(ae(We=>We.includes(Ze)?We:[...We,Ze]),_e(`${e(lu[Ze]??Ze)} ${e("sources.import.stage.done_suffix")}`)),_e(`${e(lu[Le]??Le)}...`),he.current=Le,q(Le),re(null)},[_e,e]),Ve=b.useCallback((Le,Ze)=>{S(We=>({...We,repoPath:Le,repoName:Ze}))},[]),De=b.useCallback(async()=>{E(!0),L(null);try{const Le=await qe("fs/repoStatus",{path:w.repoPath}),Ze={branches:Le.branches??[{name:Le.branch,commit:Le.head_hash}],tags:Le.tags??[],default:Le.branch,commits:Le.commits??[{hash:Le.head_hash,message:"HEAD"}]};N(Ze),S(We=>({...We,isDirty:Le.is_dirty})),z(We=>{if(We)return We;const Nt=Ze.branches.find(mn=>mn.name===Ze.default),ft=Ze.branches[0],Rn=Nt??ft;return Rn?(B(Rn.commit),Rn.name):We})}catch(Le){const Ze=Le instanceof Error?Le.message:"Failed to load repository info";L(Ze)}finally{E(!1)}},[qe,w.repoPath]);b.useEffect(()=>{m===2&&w.repoPath&&!k&&De()},[m,w.repoPath,k,De]);const Xe=b.useCallback(async Le=>{try{const Ze=await qe("fs/repoStatus",{path:w.repoPath,branch:Le});N(We=>We&&{...We,commits:Ze.commits??[]})}catch{}},[qe,w.repoPath]),It=b.useCallback(async()=>{if(!r)return;const Le=Date.now();ce(!0),P(!1),_(null),O(null),ae([]),he.current=null,q(null),re(null),ne([]),x(3);try{ve("scan");const Ze=await qe("fs/repoScan",{path:w.repoPath,hash:R}),We=Ze.files||[],Nt=Ze.manifests||[],ft=Os(w.repoPath),{packages:Rn,mdFiles:mn}=Oh(Nt,We,ft);S(Et=>({...Et,branch:$,commit:R,repoFiles:We,packages:Rn,mdFiles:mn,repoFileContents:Nt})),ve("save");const gn=await u({library_id:r,repo_name:w.repoName||ft,repo_root_path:w.repoPath,repo_branch:$,repo_commit:R,repo_files:We.map(Et=>Et.path),repo_file_contents:Nt,...f?{parent_source_id:f,parent_path:p}:{}});ae(["scan","save"]),he.current=null,q(null),_e(`${e("sources.import.stage.save")} ${e("sources.import.stage.done_suffix")}`),_e(e("sources.import.stage.complete"));const Lt=Array.isArray(gn)?gn[0]:gn;ge.current=Lt?.id??null,await F1(Le),P(!0),ce(!1),x(4)}catch(Ze){const We=he.current??"scan";O(We),he.current=null,q(null);const Nt=Ze instanceof Error?Ze.message:String(Ze);_e(`ERROR: ${Nt}`),_(Nt),ce(!1)}},[r,w,$,R,f,p,qe,u,ve,_e]),un=b.useCallback(()=>{O(null),_(null),It()},[It]),Vt=b.useCallback(()=>{if(r)if(f){const Le=w.repoName||Os(w.repoPath),Ze=p?`${p}/${Le}`:Le;t(`/studio/sources/${r}?rootId=${f}&path=${encodeURIComponent(Ze)}`)}else ge.current?t(`/studio/sources/${r}?rootId=${ge.current}`):t(`/studio/sources/${r}`)},[r,t,f,p,w.repoPath,w.repoName]),Bn=b.useMemo(()=>m===1?!!w.repoPath:m===2?H:m===3?M:!1,[m,w.repoPath,H,M]),cr=b.useMemo(()=>{if(!l)return[];const Le=[{label:l.is_default?e("sources.library.default_cloud_name"):l.name,to:`/studio/sources/${l.id}`}];if(f&&(Le.push({label:h||f,to:`/studio/sources/${l.id}?rootId=${f}`}),p)){const Ze=p.split("/").filter(Boolean);for(const[We,Nt]of Ze.entries()){const ft=Ze.slice(0,We+1).join("/");Le.push({label:Nt,to:`/studio/sources/${l.id}?rootId=${f}&path=${encodeURIComponent(ft)}`})}}return Le.push({label:e("sources.import.title")}),Le},[l,f,h,p,e]);if(!l)return c.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Xn=m===4,Ht=m===3&&!!W&&!oe,An=m<=2;return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[c.jsx("div",{className:"shrink-0",children:c.jsx(Ta,{segments:cr})}),c.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[c.jsx(Xr,{active:m>=1,current:m===1}),c.jsx("span",{className:m===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.select")}),c.jsx($s,{}),c.jsx(Xr,{active:m>=2,current:m===2}),c.jsx("span",{className:m===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.version")}),c.jsx($s,{}),c.jsx(Xr,{active:m>=3,current:m===3}),c.jsx("span",{className:m===3?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.loading")}),c.jsx($s,{}),c.jsx(Xr,{active:m>=4,current:m===4}),c.jsx("span",{className:m===4?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.confirm")})]}),c.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:Ne?c.jsxs(c.Fragment,{children:[m===1&&c.jsx(dT,{rpc:qe,selectedPath:w.repoPath,onSelect:Ve,allowedPaths:be,importedPaths:Fe}),m===2&&c.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:c.jsx(Y1,{refs:k,loading:A,error:D,selectedRef:$,commit:R,onRefChange:z,onCommitChange:B,onValidChange:J,onRetry:De,onBranchSwitch:Xe})}),m===3&&c.jsx(X1,{stages:fe,currentStage:T,completedStages:ee,failedStage:W,progress:V,breakpoints:vT,failedError:v,logs:se}),m===4&&c.jsx(Q1,{repoName:w.repoName||Os(w.repoPath),repoIdentifier:w.repoPath,branch:$,commit:R,packages:w.packages,mdFiles:w.mdFiles,importing:!1,completed:M})]}):c.jsx(P1,{libraryName:l.name})}),Ne&&c.jsx(c.Fragment,{children:Xn?c.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:c.jsx("button",{onClick:Vt,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.done")})}):Ht?c.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[c.jsx("button",{onClick:()=>{x(2),O(null),_(null),ae([]),he.current=null,q(null),ne([])},className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:e("sources.import.back")}),c.jsx("button",{onClick:un,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.retry")})]}):An?c.jsx(jm,{step:m,totalSteps:4,importing:oe,stepBusy:A||m===3&&oe,canProceed:Bn,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>x(Le=>Le-1),onNext:()=>{m===2?It():x(Le=>Le+1)},onImport:It}):null}),v&&m!==3&&c.jsxs(lr,{onClose:()=>_(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:e("sources.import.error_title")}),c.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:v}),c.jsx("div",{className:"mt-6 flex justify-end",children:c.jsx("button",{onClick:()=>_(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("common.confirm")})})]})]})}const lv=(e,t)=>{let r=0,a=0,o=0;const l=[],u=f=>{for(const h of f)if(h.type==="directory")a++,h.is_git_repo&&o++,h.children&&u(h.children);else if(r++,/\.md$/i.test(h.name)){const p=h.path.startsWith(t)?h.path.slice(t.length).replace(/^\//,""):h.name;l.push(p)}};return u(e),{files:r,dirs:a,gitRepos:o,mdFiles:l}};function wT({rpc:e,selectedPath:t,onSelect:r,allowedPaths:a,importedPaths:o}){const{t:l}=ye(),{atRoot:u,currentPath:f,entries:h,loading:p,error:m,homeDir:x,goToOpen:v,isWildcard:_,importedSet:w,dirs:S,files:k,loadTree:N,handleNavigateUp:A,setGoToOpen:E}=V1({rpc:e,allowedPaths:a??[],importedPaths:o??[]}),D=b.useCallback(R=>{if(R.type!=="directory"||w.has(R.path))return;const B=lv(R.children||[],R.path);r(R.path,R.name,B),N(R.path)},[r,N,w]);b.useEffect(()=>{if(f&&!u&&h.length>=0&&!p){const R=f.split("/").pop()||f,B=lv(h,f);r(f,R,B)}},[f,u,h,p,r]);const L=b.useMemo(()=>t?t.split("/").pop()||t:"",[t]),$=b.useMemo(()=>S.sort((R,B)=>R.is_git_repo&&!B.is_git_repo?-1:!R.is_git_repo&&B.is_git_repo?1:R.name.localeCompare(B.name)),[S]),z=b.useMemo(()=>k.sort((R,B)=>R.name.localeCompare(B.name)),[k]);return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2.5",children:[c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u?c.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[c.jsx("span",{children:l("sources.import.allowed_dirs")}),c.jsx(q1,{})]}):c.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:f}),t?c.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[c.jsx(Gn,{size:12}),c.jsx("span",{children:L})]}):_&&u?c.jsx("button",{onClick:()=>E(!0),className:"flex shrink-0 items-center gap-1.5 rounded border border-c4a-accent/40 bg-c4a-accent/10 px-2.5 py-1 text-xs text-c4a-accent transition-colors hover:bg-c4a-accent/20",children:l("sources.import.wildcard_goto")}):null]}),c.jsx("hr",{className:"my-2 border-c4a-border-subtle"}),u?_?c.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:x&&c.jsxs("button",{onClick:()=>N(x),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx(Gn,{size:14,className:"shrink-0"}),c.jsxs("span",{className:"truncate",children:[x,c.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",l("sources.import.wildcard_home"),")"]})]}),c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):c.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:a.map(R=>c.jsxs("button",{onClick:()=>N(R),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx(Gn,{size:14,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:R}),c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"})]},R))}):m&&!p?c.jsx("p",{className:"py-4 text-xs text-c4a-error",children:m}):c.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[p&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:c.jsx(Zt,{size:14,className:"animate-spin text-c4a-text-muted"})}),f!=="/"&&c.jsxs("button",{onClick:A,disabled:p,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[c.jsx(bm,{size:14,className:"text-c4a-text-muted"}),c.jsx("span",{className:"leading-none pb-1",children:".."})]}),$.map(R=>{const B=w.has(R.path),H=R.is_git_repo?Ml:Gn;return c.jsxs("button",{onClick:()=>D(R),disabled:B||p,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs transition-colors ${B?"cursor-not-allowed text-c4a-accent/60":t===R.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[c.jsx(H,{size:14,className:"shrink-0"}),c.jsx("span",{className:"flex-1 truncate",children:R.name}),B&&c.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:l("sources.import.already_imported")}),c.jsx($t,{size:12,className:"shrink-0 text-c4a-text-muted"})]},R.path)}),z.map(R=>c.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-xs text-c4a-text-muted",children:[c.jsx(_m,{size:14,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:R.name})]},R.path)),h.length===0&&!p&&c.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:l("sources.import.no_entries")})]}),c.jsx(G1,{open:v,onClose:()=>E(!1),rpc:e,onNavigate:N,defaultPath:x??void 0})]})}const ST=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),jT=e=>{let t=0,r=0,a=0,o=0,l=0;const u=new Set;for(const f of e)if(f.type==="directory")r++,f.is_git_repo&&l++;else{t++,f.path.toLowerCase().endsWith(".md")&&o++;const p=f.path.split("/").pop();if(p&&ST.has(p.toLowerCase())){const m=f.path.split("/").slice(0,-1).join("/");e.some(v=>v.type==="directory"&&v.is_git_repo&&(m===v.path||m.startsWith(`${v.path}/`)))||u.add(m)}}return a=u.size,{totalFiles:t,totalDirs:r,codePackages:a,docFiles:o,gitRepos:l}};function kT({dirPath:e,rpc:t,importing:r,onScanComplete:a,onBusyChange:o}){const{t:l}=ye(),[u,f]=b.useState(!1),[h,p]=b.useState(null),[m,x]=b.useState(null),v=b.useCallback(async()=>{f(!0),o?.(!0),p(null),x(null);try{const _=await t("fs/dirScan",{path:e}),w=_.entries||[],S=_.manifests||[],k=jT(w);x(k),a(w,k,S)}catch(_){const w=_ instanceof Error?_.message:String(_);p(w)}finally{f(!1),o?.(!1)}},[e,t,a,o]);return b.useEffect(()=>{v()},[v]),c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[c.jsx("p",{className:"shrink-0 font-mono text-xs text-c4a-text-muted",children:e}),c.jsx("div",{className:"mt-3 shrink-0 border-t border-c4a-border-subtle"}),c.jsxs("div",{className:"c4a-scrollbar min-h-0 flex-1 overflow-y-auto",children:[u&&c.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[c.jsx(Zt,{size:14,className:"animate-spin text-c4a-accent"}),c.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:l("sources.import.dir_scanning")})]}),h&&c.jsxs("div",{className:"mt-6",children:[c.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[c.jsx(R1,{size:14,className:"mt-0.5 shrink-0"}),l("sources.import.dir_scan_error")]}),c.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:h}),c.jsxs("button",{onClick:v,className:"mt-3 flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[c.jsx(cA,{size:12}),l("sources.import.dir_scan_retry")]})]}),m&&!u&&!h&&c.jsxs("div",{className:"mt-6 space-y-3",children:[c.jsxs("p",{className:"font-mono text-sm uppercase text-c4a-accent",children:[l("sources.import.dir_scan_complete"),"!"]}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[c.jsx(ln,{icon:c.jsx(On,{size:14}),label:l("sources.import.dir_doc_files"),value:m.docFiles,tooltip:l("sources.import.dir_doc_files_tip"),size:"lg"}),c.jsx(ln,{icon:c.jsx(Dr,{size:14}),label:l("sources.import.dir_code_packages"),value:m.codePackages,tooltip:l("sources.import.dir_code_packages_tip"),size:"lg"}),m.gitRepos>0&&c.jsx(ln,{icon:c.jsx(Ml,{size:14}),label:l("sources.import.dir_git_repos"),value:m.gitRepos,size:"lg"}),c.jsx(ln,{icon:c.jsx(Gn,{size:14}),label:l("sources.import.dir_total_dirs"),value:m.totalDirs,size:"lg"}),c.jsx(ln,{icon:c.jsx(hC,{size:14}),label:l("sources.import.dir_total_files"),value:m.totalFiles,size:"lg"})]}),m.gitRepos>0&&c.jsx("p",{className:"text-xs text-c4a-warning",children:l("sources.import.dir_git_skip_hint",{count:m.gitRepos})})]}),r&&c.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[c.jsx(Zt,{size:14,className:"animate-spin text-c4a-accent"}),c.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:l("sources.import.importing")})]})]})]})}function NT(){const{t:e}=ye(),t=Tt(),{libId:r}=Vo(),o=Qt(ds(Fs)).find(B=>B.id===r),l=kt(B=>B.createSource),[u,f]=b.useState(1),[h,p]=b.useState(!1),[m,x]=b.useState(null),[v,_]=b.useState(!1),[w,S]=b.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),k=o?.is_online??!1,{rpc:N,importedPaths:A,allowedPaths:E}=H1(r,o),D=b.useCallback((B,H,J)=>{S(oe=>({...oe,dirPath:B,dirName:H,fileCount:J.files,subDirCount:J.dirs,gitRepoCount:J.gitRepos,mdFiles:J.mdFiles}))},[]),L=b.useCallback((B,H,J)=>{S(oe=>({...oe,scanEntries:B,scanStats:H,manifests:J}))},[]),$=b.useCallback(async()=>{if(r){p(!0);try{const B=await l({library_id:r,dir_files:w.scanEntries,dir_name:w.dirName,dir_path:w.dirPath,dir_file_contents:w.manifests}),H=Array.isArray(B)?B[0]:B;H?.id?t(`/studio/sources/${r}?rootId=${H.id}`):t(`/studio/sources/${r}`)}catch(B){const H=B instanceof Error?B.message:String(B);x(H),p(!1)}}},[r,w,l,t]),z=b.useMemo(()=>u===1?!!w.dirPath:u===2?w.scanEntries.length>0:!0,[u,w]),R=b.useMemo(()=>o?[{label:o.is_default?e("sources.library.default_cloud_name"):o.name,to:`/studio/sources/${o.id}`},{label:e("sources.import.dir_title")}]:[],[o,e]);return o?c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[c.jsx("div",{className:"shrink-0",children:c.jsx(Ta,{segments:R})}),c.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[c.jsx(Xr,{active:u>=1,current:u===1}),c.jsx("span",{className:u===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.dir_step.select")}),c.jsx($s,{}),c.jsx(Xr,{active:u>=2,current:u===2}),c.jsx("span",{className:u===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.dir_step.confirm")})]}),c.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:k?c.jsxs(c.Fragment,{children:[u===1&&c.jsx(wT,{rpc:N,selectedPath:w.dirPath,onSelect:D,allowedPaths:E,importedPaths:A}),u===2&&c.jsx(kT,{dirPath:w.dirPath,rpc:N,importing:h,onScanComplete:L,onBusyChange:_})]}):c.jsx(P1,{libraryName:o.name})}),k&&c.jsx(jm,{step:u,totalSteps:2,importing:h,stepBusy:v,canProceed:z,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>f(B=>B-1),onNext:()=>f(B=>B+1),onImport:$}),m&&c.jsxs(lr,{onClose:()=>x(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:e("sources.import.error_title")}),c.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:m}),c.jsx("div",{className:"mt-6 flex justify-end",children:c.jsx("button",{onClick:()=>x(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("common.confirm")})})]})]}):c.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})})}function ET(e){return new Promise((t,r)=>{let a=!1,o=null,l=null;const u=()=>{a=!0,o&&(clearInterval(o),o=null),l&&(l(),l=null)},f=(p,m,x)=>{a||(u(),p==="done"&&m?t(m):r(new Error(x??"Clone failed")))};l=En.on("task/complete",p=>{const m=p;m.task_id===e&&f(m.status??"error",m.result,m.error)}),o=setInterval(async()=>{if(!a)try{const p=await ze.get(`/import/remote/tasks/${e}`);p.status!=="running"&&f(p.status,p.result,p.error)}catch{}},5e3)})}async function CT(e){const{task_id:t}=await ze.post("/import/remote/clone",{library_id:e.libraryId,url:e.url,ref:e.ref,...e.commit?{commit:e.commit}:{},repo_name:e.repoName});return ET(t)}async function AT(e,t,r){const{libraryId:a,url:o,ref:l,commitHash:u,scanResult:f,sourceUuid:h,parentSourceId:p,parentPath:m}=e,x={library_id:a,url:o,ref:l,commit:u,repo_files:f.files,repo_file_contents:f.manifests,...h?{source_uuid:h}:{},...p?{parent_source_id:p,parent_path:m}:{}},v=m?`${m}/${t}`:t;if(r.length>0){const k=[],N=[],A=new Set;for(const E of r){const D=E.split("/").pop()??E,L=E.endsWith("/")?E:`${E}/`,$=f.files.filter(J=>J.path.startsWith(L)||J.path===E).map(J=>({...J,path:J.path.startsWith(L)?J.path.slice(L.length):J.path})),z=f.manifests.filter(J=>J.path.startsWith(L)||J.path===E).map(J=>({...J,path:J.path.startsWith(L)?J.path.slice(L.length):J.path})),R=await ze.post("/import/remote/import",{...x,repo_files:$,repo_file_contents:z,repo_name:v,dir_name:D,sub_path:E});k.push(R.id);const{packages:B,mdFiles:H}=Oh(z,$,D);for(const J of B)N.push(J);for(const J of H)A.add(J)}return{importIds:k,packages:N,mdFiles:Array.from(A)}}const _=await ze.post("/import/remote/import",{...x,repo_name:v,dir_name:t}),{packages:w,mdFiles:S}=Oh(f.manifests,f.files,t);return{importIds:[_.id],packages:w,mdFiles:S}}function RT(e,t,r){if(e instanceof hn){const a=e.message.toLowerCase();if(e.status===503)return r("sources.import_remote.error.capacity");if(a.includes("connect")||a.includes("connectionrefused")||a.includes("unavailable")||a.includes("econnrefused"))return r("sources.import_remote.error.network");if(a.includes("authentication")||a.includes("token")||a.includes("credential")||a.includes("401")||a.includes("403"))try{return r("sources.import_remote.error.auth_required",{host:new URL(t).hostname})}catch{return r("sources.import_remote.error.auth_required",{host:t})}return a.includes("not found")||a.includes("404")||a.includes("does not exist")?r("sources.import_remote.error.not_found"):e.message||r("sources.import_remote.error.network")}return e instanceof TypeError&&e.message.includes("fetch")?r("sources.import_remote.error.network"):e instanceof Error?e.message:r("sources.import_remote.error.network")}function TT(e){return e==="cloning"?"clone":e==="detecting"||e==="extracting"?"scan":e==="saving"?"save":e}const cu=/^https:\/\/[^/]+\/.+/,cv=e=>e.toLowerCase().replace(/:\d+$/,""),LT={"github.com":"github"};function Qp(e,t){try{const r=cv(new URL(e.trim()).hostname),a=t.find(o=>cv(o.host)===r&&o.api_import);return a?a.platform:LT[r]??null}catch{}return null}function DT({url:e,onUrlChange:t,onValidChange:r,onRefHint:a,onImportModeChange:o,forceClone:l}){const{t:u}=ye(),[f,h]=b.useState(null),[p,m]=b.useState([]),[x,v]=b.useState(null),[_,w]=b.useState("clone"),S=b.useRef(null);b.useEffect(()=>{ze.get("/import/remote/git-hosts").then(B=>m(B.hosts),()=>{})},[]);const k=l?"clone":x&&_==="api"?"api":"clone",N=b.useRef(k);b.useEffect(()=>{k!==N.current&&(N.current=k,o?.(k))},[k,o]);const A=b.useCallback(B=>{if(!B){h(null),r(!1),v(null);return}cu.test(B.trim())?(h(null),r(!0),v(Qp(B,p))):(h(u("sources.import_remote.url_invalid")),r(!1),v(null))},[r,u,p]),E=b.useCallback(B=>{if(!B){h(null),r(!1),v(null);return}const H=cT(B),J=H.repoUrl!==B.trim(),oe=J?H.repoUrl:B;J&&(t(oe),a?.(H.ref,H.commit)),cu.test(oe)?(h(null),r(!0),v(Qp(oe,p))):(h(u("sources.import_remote.url_invalid")),r(!1),v(null))},[t,r,a,u,p]),D=b.useCallback(B=>{const H=B.target.value;t(H),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>A(H),500)},[t,A]),L=b.useCallback(()=>{S.current&&clearTimeout(S.current),e&&E(e)},[e,E]),$=b.useCallback(B=>{B.preventDefault();const H=B.clipboardData.getData("text").trim();t(H),S.current&&clearTimeout(S.current),E(H)},[t,E]);b.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]),b.useEffect(()=>{e&&E(e)},[]),b.useEffect(()=>{e&&cu.test(e.trim())&&p.length>0&&v(Qp(e,p))},[p]),b.useEffect(()=>{o?.(l?"clone":x&&_==="api"?"api":"clone")},[x,l]);const z=B=>{w(B),o?.(l?"clone":B==="api"&&x?"api":"clone")},R=e&&cu.test(e.trim());return c.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface px-6 py-10",children:c.jsxs("div",{className:"w-full max-w-2xl space-y-5",children:[c.jsx("input",{type:"text",value:e,onChange:D,onBlur:L,onPaste:$,placeholder:u("sources.import_remote.url_placeholder"),className:"w-full rounded-md border border-c4a-border-default bg-c4a-bg-surface px-4 py-3 text-center font-mono text-base font-semibold text-c4a-accent placeholder:font-normal placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none",autoFocus:!0}),c.jsx("div",{className:"min-h-14 text-center text-sm leading-relaxed text-c4a-text-muted",children:f?c.jsx("p",{className:"text-red-400",children:f}):R?c.jsx("div",{className:"flex flex-col items-center gap-2",children:x&&!l?c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[c.jsx("input",{type:"checkbox",className:"c4a-check",checked:_==="clone",onChange:()=>z("clone")}),c.jsx("span",{className:_==="clone"?"text-c4a-accent":"text-c4a-text-muted",children:u("sources.import_remote.api.use_clone")})]}),c.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[c.jsx("input",{type:"checkbox",className:"c4a-check",checked:_==="api",onChange:()=>z("api")}),c.jsx("span",{className:_==="api"?"text-c4a-accent":"text-c4a-text-muted",children:u("sources.import_remote.api.detected",{platform:x})})]})]}):c.jsx("p",{className:"text-c4a-text-muted",children:u("sources.import_remote.api.will_use_clone")})}):c.jsxs(c.Fragment,{children:[c.jsx("p",{children:p.length>0?c.jsxs(c.Fragment,{children:[u("sources.import_remote.url_hint_public"),p.map((B,H)=>c.jsxs("span",{children:[H>0&&"、",c.jsx("span",{className:"font-mono font-medium text-c4a-accent",children:B.host})]},B.host))]}):u("sources.import_remote.url_hint_no_auth")}),c.jsx("p",{className:"mt-1 text-c4a-text-muted/60",children:u("sources.import_remote.url_hint_format")})]})})]})})}function OT({repoUrl:e,ref:t,selected:r,fetchTree:a,onConfirm:o,onCancel:l}){const{t:u}=ye(),[f,h]=b.useState([]),[p,m]=b.useState(!0),[x,v]=b.useState(new Set),[_,w]=b.useState(new Set(r));b.useEffect(()=>{(async()=>{m(!0);try{const L=await a(e,t,"");h(L.map($=>({entry:$,children:null,loading:!1})))}catch{h([])}finally{m(!1)}})()},[]);const S=b.useCallback((L,$,z)=>L.map(R=>R.entry.path===$?z(R):R.children?{...R,children:S(R.children,$,z)}:R),[]),k=b.useCallback(async L=>{const $=L.entry.path;if(x.has($)){v(R=>{const B=new Set(R);return B.delete($),B});return}if(v(R=>new Set(R).add($)),L.children===null&&!L.loading){h(R=>S(R,$,B=>({...B,loading:!0})));try{const B=(await a(e,t,$)).map(H=>({entry:H,children:null,loading:!1}));h(H=>S(H,$,J=>({...J,children:B,loading:!1})))}catch{h(R=>S(R,$,B=>({...B,children:[],loading:!1})))}}},[x,e,t,a,S]),N=b.useCallback(L=>{w($=>{const z=new Set($);return z.has(L)?z.delete(L):z.add(L),z})},[]),A=b.useCallback(L=>{w($=>{const z=new Set($);return z.delete(L),z})},[]),E=b.useCallback(()=>{o(Array.from(_))},[o,_]),D=Array.from(_);return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 lg:flex-row",children:[c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded-lg border border-c4a-border-default lg:w-1/2",children:[c.jsx("div",{className:"border-b border-c4a-border-subtle px-3 py-2",children:c.jsx("span",{className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:u("sources.import_remote.api.sub_path")})}),c.jsx("div",{className:"c4a-scrollbar flex-1 overflow-y-auto",children:p?c.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:c.jsx(ta,{labelKey:"common.loading"})}):c.jsx(Z1,{nodes:f,depth:0,expandedPaths:x,selectedPaths:_,onToggleExpand:k,onToggleSelect:N})})]}),c.jsxs("div",{className:"flex min-h-0 flex-col rounded-lg border border-c4a-border-default lg:w-1/2",children:[c.jsx("div",{className:"border-b border-c4a-border-subtle px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:u("sources.import_remote.api.panel_selected")}),c.jsx("div",{className:"px-3 py-2",children:c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:u("sources.import_remote.api.selected_count",{count:D.length}).split(/(\d+)/).map((L,$)=>/^\d+$/.test(L)?c.jsx("span",{className:"font-extrabold text-c4a-accent",children:L},$):c.jsx("span",{children:L},$))})}),c.jsx("div",{className:"c4a-scrollbar flex-1 overflow-y-auto px-3",children:D.length===0?null:c.jsx("div",{className:"flex flex-col gap-0.5",children:D.map(L=>c.jsxs("div",{className:"flex items-center gap-2 rounded-sm px-2 py-1 text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover",children:[c.jsx(Gn,{size:12,className:"shrink-0"}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:L}),c.jsx("button",{onClick:()=>A(L),className:"shrink-0 text-c4a-text-muted hover:text-c4a-accent",children:c.jsx(Or,{size:12})})]},L))})})]})]}),c.jsxs("div",{className:"mt-4 flex items-center justify-end gap-3",children:[c.jsx("button",{onClick:l,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:u("sources.import.back")}),c.jsx("button",{onClick:E,disabled:D.length===0,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover disabled:cursor-not-allowed disabled:opacity-40",children:D.length>0?`${u("sources.import.step.confirm")} (${D.length})`:u("sources.import.step.confirm")})]})]})}function Z1({nodes:e,depth:t,expandedPaths:r,selectedPaths:a,onToggleExpand:o,onToggleSelect:l}){const u=e.filter(h=>h.entry.type==="tree"),f=e.filter(h=>h.entry.type==="blob");return c.jsxs(c.Fragment,{children:[u.map(h=>{const p=h.entry.path,m=r.has(p);return c.jsxs("div",{children:[c.jsxs("div",{className:"flex h-8 items-center font-mono text-[12px] transition-colors hover:bg-c4a-bg-hover",style:{paddingLeft:`${t*16+8}px`},children:[c.jsx("button",{onClick:()=>o(h),className:"flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center text-c4a-text-muted",children:h.loading?c.jsx(Zt,{size:12,className:"animate-spin"}):c.jsx($t,{size:12,className:`transition-transform duration-200 ${m?"rotate-90":""}`})}),c.jsx("input",{type:"checkbox",checked:a.has(p),onChange:()=>l(p),className:"c4a-check mx-1.5 h-3 w-3 cursor-pointer"}),c.jsx(Gn,{size:14,className:"mr-1.5 shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:"truncate text-c4a-text-secondary",children:h.entry.name})]}),m&&h.children&&c.jsx(Z1,{nodes:h.children,depth:t+1,expandedPaths:r,selectedPaths:a,onToggleExpand:o,onToggleSelect:l})]},p)}),f.map(h=>c.jsxs("div",{className:"flex h-8 items-center font-mono text-[12px]",style:{paddingLeft:`${t*16+8+20+6+12+6}px`},children:[c.jsx(_m,{size:14,className:"mr-1.5 shrink-0 text-c4a-text-muted opacity-50"}),c.jsx("span",{className:"truncate text-c4a-text-muted",children:h.entry.name})]},h.entry.path)),u.length===0&&f.length===0&&c.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",style:{paddingLeft:`${t*16+8}px`},children:"—"})]})}function MT(){const e=b.useRef(new Map),t=b.useCallback(async(l,u)=>{const f=await ze.post("/import/remote/branches",{repo_url:l,...u?{search:u}:{}});if(!f.provider_matched)return{refs:{branches:[],tags:[],default:""},providerMatched:!1,platform:null};const h=f.branches.find(m=>m.isDefault)?.name??"";return{refs:{branches:f.branches.map(m=>({name:m.name,commit:m.commitSha})),tags:[],default:h},providerMatched:!0,platform:f.platform}},[]),r=b.useCallback(async(l,u,f)=>{const h=`${l}::${u}::${f}`,p=e.current.get(h);if(p)return p;const m=await ze.post("/import/remote/tree",{repo_url:l,ref:u,path:f});return e.current.set(h,m.entries),m.entries},[]),a=b.useCallback(async l=>{const u=await ze.post("/import/remote/import",{library_id:l.libraryId,url:l.url,import_method:"api",branch:l.branch,commit_sha:l.commitSha,...l.subPaths&&l.subPaths.length>0?{sub_paths:l.subPaths}:{},...l.forceTruncated?{force_truncated:!0}:{},...l.sourceUuid?{source_uuid:l.sourceUuid}:{},...l.parentSourceId?{parent_source_id:l.parentSourceId,parent_path:l.parentPath}:{}}),f=u.results?.flatMap(p=>p.packages)??[],h=new Set;for(const p of u.results??[])for(const m of p.md_files)h.add(m);return{response:u,packages:f,mdFiles:Array.from(h)}},[]),o=b.useCallback(()=>{e.current.clear()},[]);return{fetchApiBranches:t,fetchRemoteTree:r,importViaApi:a,clearTreeCache:o}}function Bl({error:e,onClose:t}){const{t:r}=ye(),[a,o]=b.useState(!1),l=b.useCallback(async()=>{try{await navigator.clipboard.writeText(e.detail),o(!0),setTimeout(()=>o(!1),2e3)}catch{const u=document.createElement("textarea");u.value=e.detail,u.style.position="fixed",u.style.opacity="0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u),o(!0),setTimeout(()=>o(!1),2e3)}},[e.detail]);return c.jsxs(lr,{onClose:t,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsx("p",{className:"font-mono text-sm font-bold uppercase tracking-tight text-c4a-text-primary",children:e.title}),c.jsx("p",{className:"mt-3 text-xs text-c4a-text-muted",children:r("error.dialog.console_hint")}),c.jsxs("div",{className:"mt-5 flex items-center justify-end gap-3",children:[c.jsxs("button",{onClick:l,className:"flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:text-c4a-text-primary",children:[a?c.jsx(Wr,{size:12}):c.jsx(Iu,{size:12}),r(a?"error.dialog.copied":"error.dialog.copy")]}),c.jsx("button",{onClick:t,className:"rounded bg-c4a-accent px-4 py-1.5 font-mono text-xs uppercase tracking-tight text-white transition-colors hover:bg-c4a-accent-hover",children:r("error.dialog.confirm")})]})]})}const Zp=["prepare","clone","scan","save"],J1={prepare:"sources.import.stage.prepare",clone:"sources.import.stage.clone",scan:"sources.import.stage.scan",save:"sources.import.stage.save"},zT={prepare:5,clone:90,scan:95,save:100},uv=["prepare","fetch_tree","read_packages","save"],W1={prepare:"sources.import.stage.prepare",fetch_tree:"sources.import.stage.fetch_tree",read_packages:"sources.import.stage.read_packages",save:"sources.import.stage.save"},$T={prepare:5,fetch_tree:50,read_packages:90,save:100},dv={...J1,...W1};function BT(){const{t:e}=ye(),t=Tt(),{libId:r}=Vo(),[a]=Ol(),o=a.get("url")||"",l=a.get("ref")||"",u=a.get("sourceUuid")||"",f=a.get("parentId")||"",h=a.get("parentName")||"",p=a.get("parentPath")||"",x=Qt(ds(Fs)).find(ue=>ue.id===r),[v,_]=b.useState(new Set),w=b.useCallback(async()=>{if(r)try{const ue=new Set;if(f){const Re=(await ze.get(`/sources/${f}`)).tree??[];let Ge=p===""?Re:[];if(p){const Oe=(gt,it)=>{for(const an of gt){if(an.path===it)return an.children??[];if(an.children){const _n=Oe(an.children,it);if(_n.length>0)return _n}}return[]};Ge=Oe(Re,p)}for(const Oe of Ge)ue.add(Oe.name.toLowerCase())}else{const Ee=await ze.get("/sources",{library_id:r});for(const Re of Ee.items)ue.add(Re.name.toLowerCase())}_(ue)}catch{}},[r,f,p]);b.useEffect(()=>{w()},[w]);const[S,k]=b.useState(o?2:1),[N,A]=b.useState(o),[E,D]=b.useState(!!o),[L,$]=b.useState(l),[z,R]=b.useState(""),[B,H]=b.useState(!!l),[J,oe]=b.useState(""),ce=b.useRef(void 0),M=b.useRef(void 0),[P,T]=b.useState("clone"),[q,ee]=b.useState([]),[ae,W]=b.useState(!1),[O,V]=b.useState(null),[re,se]=b.useState(null),ne=b.useRef(0),{fetchApiBranches:ge,fetchRemoteTree:Ne,importViaApi:qe,clearTreeCache:Fe}=MT(),be=q.length>0,fe=b.useCallback(ue=>{T(ue)},[]),_e=b.useRef(N);b.useEffect(()=>{N!==_e.current&&(_e.current=N,$(""),R(""),H(!1),ve(null),It(null),ee([]))},[N]);const[he,ve]=b.useState(null),[Ve,De]=b.useState(!1),[Xe,It]=b.useState(null),[un,Vt]=b.useState(!1),[Bn,cr]=b.useState(!1),[Xn,Ht]=b.useState(null),[An,Le]=b.useState(null),[Ze,We]=b.useState(null),[Nt,ft]=b.useState(null),[Rn,mn]=b.useState([]),[gn,Lt]=b.useState(null),[Et,Pt]=b.useState([]),Er=b.useRef(null),zr=b.useRef(""),sa=P==="api"?W1:J1,me=P==="api"?uv:Zp,Ue=P==="api"?$T:zT,St=b.useMemo(()=>me.map(ue=>({key:ue,label:sa[ue]?e(sa[ue]):ue})),[e,me,sa]),nt=b.useCallback(ue=>{Pt(Ee=>[...Ee,`[${Mh()}] ${ue}`])},[]),Ct=b.useRef(null),Dt=b.useCallback(ue=>{const Ee=Ct.current;Ee&&Ee!==ue&&(mn(Re=>Re.includes(Ee)?Re:[...Re,Ee]),nt(`${e(dv[Ee]??Ee)} ${e("sources.import.stage.done_suffix")}`)),nt(`${e(dv[ue]??ue)}...`),Ct.current=ue,ft(ue),Lt(null)},[nt,e]),Oa=b.useCallback((ue,Ee)=>{ce.current=ue,M.current=Ee},[]),oa=b.useCallback((ue,Ee)=>{ue.length!==0&&$(Re=>{if(Re)return Re;const Ge=ce.current,Oe=M.current;if(Ge){const an=ue.find(_n=>_n.name===Ge);if(an)return R(an.commit),an.name}Oe&&R(Oe);const it=ue.find(an=>an.name===Ee)??ue[0];return it?(Oe||R(it.commit),it.name):Re})},[]),ur=b.useCallback(async ue=>{if(!r)return;De(!0),It(null);const Ee=async()=>{const Re=await ze.post("/import/remote/refs",{library_id:r,url:N},ue?{signal:ue}:void 0);ue?.aborted||(ve(Re),oa([...Re.branches??[],...Re.tags??[]],Re.default))};try{if(P==="api"){const{refs:Re,providerMatched:Ge}=await ge(N);if(ue?.aborted)return;if(!Ge){T("clone"),ee([]),await Ee();return}ve(Re),oa(Re.branches,Re.default)}else await Ee()}catch(Re){if(ue?.aborted)return;It(RT(Re,N,e))}finally{ue?.aborted||De(!1)}},[r,N,e,P,ge,oa]);b.useEffect(()=>{if(S!==2||!r)return;const ue=new AbortController;return ur(ue.signal),()=>ue.abort()},[S,r,ur]),b.useEffect(()=>{if(!un||P!=="clone")return;let ue="";return En.on("task/progress",Re=>{const Ge=Re,Oe=TT(Ge.stage??"");Oe&&Zp.includes(Oe)&&(Lt({percent:Ge.percent??-1,label:Ge.detail??Ge.label??""}),Ge.detail&&Ge.detail!==ue&&(ue=Ge.detail,Pt(gt=>[...gt,`[${Mh()}] ${Ge.detail}`])))})},[un,P]);const Tn=b.useCallback(async(ue,Ee)=>{mn([...ue]),Ct.current=null,ft(null),nt(`${e("sources.import.stage.save")} ${e("sources.import.stage.done_suffix")}`),nt(e("sources.import.stage.complete")),await F1(Ee),cr(!0),Vt(!1),k(4)},[nt,e]),$r=b.useCallback(async ue=>{if(!r)return;const Ee=J||Os(N);Dt("clone");const Re=p?`${p}/${Ee}`:Ee,Ge=await CT({libraryId:r,url:N,ref:L,commit:z||void 0,repoName:Re});zr.current=Ge.commit_hash,Dt("scan");const Oe=await ze.post("/import/remote/scan",{library_id:r,path:Ge.path,hash:Ge.commit_hash});Dt("save");const gt=await AT({libraryId:r,url:N,ref:L,commitHash:Ge.commit_hash,scanResult:Oe,sourceUuid:u||void 0,parentSourceId:f||void 0,parentPath:p||void 0},Ee,[]);Er.current=gt.importIds[0]??null,Ht({packages:gt.packages,mdFiles:gt.mdFiles}),await Tn(Zp,ue)},[r,N,L,z,J,u,f,p,Dt,Tn]),ia=b.useCallback(async(ue,Ee=!1)=>{if(!r)return;Dt("fetch_tree");const Re=await qe({libraryId:r,url:N,branch:L,commitSha:z,subPaths:q.length>0?q:void 0,forceTruncated:Ee,sourceUuid:u||void 0,parentSourceId:f||void 0,parentPath:p||void 0});if(Re.response.status==="truncated"){nt(e("sources.import_remote.api.truncated_warning")),V({treeEntries:Re.response.tree_entries??0,message:Re.response.message??""}),Vt(!1);return}Dt("read_packages"),zr.current=z,Dt("save");const Ge=Re.response.results?.[0];Ge&&(Er.current=Ge.source_id),Ht({packages:Re.packages,mdFiles:Re.mdFiles});for(const Oe of Re.response.warnings??[])Qr(Oe.message);await Tn(uv,ue)},[r,N,L,z,q,u,f,p,qe,Dt,nt,e,Tn]),Ma=b.useCallback(async()=>{if(!r)return;const ue=Date.now();ne.current=ue,Vt(!0),cr(!1),Le(null),We(null),mn([]),Ct.current=null,ft(null),Lt(null),Pt([]),k(3);try{Dt("prepare"),await new Promise(Ee=>setTimeout(Ee,300)),P==="api"?await ia(ue):await $r(ue)}catch(Ee){const Re=Ct.current??"prepare";if(Ee instanceof hn&&Ee.code==="GIT_HOST_NOT_CONFIGURED"){Ct.current=null,ft(null),Vt(!1);let Oe=N;try{Oe=new URL(N).hostname}catch{}console.error("GIT_HOST_NOT_CONFIGURED:",Ee.message),se({title:e("sources.import_remote.api.git_host_not_configured",{host:Oe}),detail:Ee.message});return}if(P==="api"){nt(e("sources.import_remote.api.fallback_msg")),T("clone"),ee([]),mn([]),Ct.current=null,ft(null),Lt(null);try{Dt("prepare"),await new Promise(Oe=>setTimeout(Oe,300)),await $r(ue);return}catch(Oe){const gt=Ct.current??"prepare";We(gt),Ct.current=null,ft(null);const it=Oe instanceof Error?Oe.message:String(Oe);nt(`ERROR: ${it}`),Le(it),Vt(!1);return}}We(Re),Ct.current=null,ft(null);const Ge=Ee instanceof Error?Ee.message:String(Ee);nt(`ERROR: ${Ge}`),Le(Ge),Vt(!1)}},[r,N,P,Dt,ia,$r,nt,e]),I=b.useCallback(()=>{We(null),Le(null),Ma()},[Ma]),G=b.useCallback(ue=>{const Ee=ue instanceof Error?ue.message:String(ue);nt(`ERROR: ${Ee}`),Le(Ee),We(Ct.current??"prepare"),Ct.current=null,ft(null),Vt(!1)},[nt]),Z=b.useCallback(async()=>{V(null),Vt(!0);try{await ia(ne.current,!0)}catch(ue){G(ue)}},[ia,G]),xe=b.useCallback(async()=>{V(null),T("clone"),ee([]),Vt(!0),mn([]),Ct.current=null,ft(null),Lt(null);try{Dt("prepare"),await new Promise(ue=>setTimeout(ue,300)),await $r(ne.current)}catch(ue){G(ue)}},[$r,Dt,G]),we=b.useCallback(()=>{if(r)if(f){const ue=`/studio/sources/${r}?rootId=${f}`;t(p?`${ue}&path=${encodeURIComponent(p)}`:ue)}else Er.current&&!be?t(`/studio/sources/${r}?rootId=${Er.current}`):t(`/studio/sources/${r}`)},[r,t,f,p,be]),Ae=b.useCallback(()=>{k(2),We(null),Le(null),mn([]),Ct.current=null,ft(null),Pt([])},[]),je=(J||Os(N)).toLowerCase(),ke=!be&&v.has(je),Ce=b.useMemo(()=>S===1?E:S===2?B&&!ke&&!Ve&&!Xe:!1,[S,E,B,ke,Ve,Xe]),Ie=b.useMemo(()=>{if(!x)return[];const ue=[{label:x.is_default?e("sources.library.default_cloud_name"):x.name,to:`/studio/sources/${x.id}`}];if(f&&(ue.push({label:h||f,to:`/studio/sources/${x.id}?rootId=${f}`}),p)){const Ee=p.split("/").filter(Boolean);for(const[Re,Ge]of Ee.entries()){const Oe=Ee.slice(0,Re+1).join("/");ue.push({label:Ge,to:`/studio/sources/${x.id}?rootId=${f}&path=${encodeURIComponent(Oe)}`})}}return ue.push({label:e("sources.import_remote.title")}),ue},[x,f,h,p,e]);if(!x)return c.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Pe=S===4&&Bn,Be=S===3&&!!Ze&&!un,dt=S<=2&&!ae;return S===2&&ae&&P==="api"?c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[c.jsx("div",{className:"shrink-0",children:c.jsx(Ta,{segments:Ie})}),c.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:c.jsx(OT,{repoUrl:N,ref:L,selected:q,fetchTree:Ne,onConfirm:ue=>{ee(ue),W(!1),Fe()},onCancel:()=>{W(!1),Fe()}})})]}):c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[c.jsx("div",{className:"shrink-0",children:c.jsx(Ta,{segments:Ie})}),c.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[c.jsx(Xr,{active:S>=1,current:S===1}),c.jsx("span",{className:S===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.select")}),c.jsx($s,{}),c.jsx(Xr,{active:S>=2,current:S===2}),c.jsx("span",{className:S===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.version")}),c.jsx($s,{}),c.jsx(Xr,{active:S>=3,current:S===3}),c.jsx("span",{className:S===3?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.loading")}),c.jsx($s,{}),c.jsx(Xr,{active:S>=4,current:S===4}),c.jsx("span",{className:S===4?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.confirm")})]}),c.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[S===1&&c.jsx(DT,{url:N,onUrlChange:A,onValidChange:D,onRefHint:Oa,onImportModeChange:fe,forceClone:!!f}),S===2&&r&&c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[c.jsx(Y1,{refs:he,loading:Ve,error:Xe,selectedRef:L,commit:z,onRefChange:$,onCommitChange:R,onValidChange:H,onRetry:()=>ur()}),!Ve&&he&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:e("sources.import.dir_name")}),c.jsx("input",{type:"text",value:J,onChange:ue=>oe(ue.target.value),placeholder:Os(N),disabled:be,className:`mt-2 w-full rounded border bg-c4a-bg-surface px-3 py-2 font-mono text-sm text-c4a-accent placeholder:text-c4a-text-muted focus:outline-none ${be?"opacity-50":""} ${ke?"border-red-400 focus:border-red-400":"border-c4a-border-default focus:border-c4a-accent"}`}),ke?c.jsx("p",{className:"mt-1.5 text-xs text-red-400",children:e("sources.import.dir_name_duplicate")}):c.jsx("p",{className:"mt-1.5 text-xs text-c4a-text-muted",children:e("sources.import.dir_name_hint")})]}),!f&&P==="api"&&c.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:e("sources.import_remote.api.sub_path")}),c.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:e("sources.import_remote.api.sub_path_hint")}),c.jsx("button",{onClick:()=>W(!0),className:"mt-2 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:e("sources.import_remote.api.select_sub_paths")}),q.length>0&&c.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:q.map(ue=>c.jsxs("span",{className:"inline-flex items-center gap-1 rounded border border-c4a-border-subtle bg-c4a-bg-subtle px-1.5 py-0.5 font-mono text-[11px] text-c4a-text-secondary",children:[ue,c.jsx("button",{onClick:()=>ee(Ee=>Ee.filter(Re=>Re!==ue)),className:"cursor-pointer text-c4a-text-muted hover:text-c4a-text-primary",children:c.jsx(Or,{size:10})})]},ue))})]})]})]}),S===3&&c.jsx(X1,{stages:St,currentStage:Nt,completedStages:Rn,failedStage:Ze,progress:gn,breakpoints:Ue,failedError:An,logs:Et}),S===4&&c.jsx(Q1,{repoName:Os(N),repoIdentifier:N,branch:L,commit:zr.current||z,packages:Xn?.packages??[],mdFiles:Xn?.mdFiles??[],importing:!1,completed:Bn,importMethod:P})]}),Pe?c.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:c.jsx("button",{onClick:we,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.done")})}):Be?c.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[c.jsx("button",{onClick:Ae,className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:e("sources.import.back")}),c.jsx("button",{onClick:I,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.retry")})]}):dt?c.jsx(jm,{step:S,totalSteps:2,importing:!1,stepBusy:Ve,canProceed:Ce,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"common.next",onPrev:()=>k(ue=>ue-1),onNext:()=>k(ue=>ue+1),onImport:Ma}):null,O&&c.jsxs(lr,{onClose:()=>V(null),className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[c.jsxs("p",{className:"font-mono text-sm font-bold uppercase tracking-tight text-c4a-text-primary",children:["⚠ ",e("sources.import_remote.api.truncated_warning")]}),c.jsx("p",{className:"mt-3 text-xs text-c4a-text-muted",children:e("sources.import_remote.api.truncated_suggest")}),c.jsxs("div",{className:"mt-5 flex items-center justify-end gap-3",children:[c.jsx("button",{onClick:Z,className:"rounded border border-c4a-border-default px-4 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:e("sources.import_remote.api.truncated_continue")}),c.jsx("button",{onClick:xe,className:"rounded bg-c4a-accent px-4 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import_remote.api.truncated_use_clone")})]})]}),re&&c.jsx(Bl,{error:re,onClose:()=>{se(null),k(1)}})]})}function IT(){const{t:e}=ye(),t=Tt(),r=Qt(v=>v.createLibrary),[a,o]=b.useState("waiting"),[l,u]=b.useState(null),[f,h]=b.useState(""),[p,m]=b.useState(!1);b.useEffect(()=>En.on("ws:daemon:connected",_=>{const w=_;u(w),h(w.machine_id),o(w.needs_registration?"new_client":"reconnected")}),[]),b.useEffect(()=>{let v=!1;return(async()=>{try{const _=await ze.get("/daemons/pending");if(v||_.pending.length===0)return;const w=_.pending[0];u({machine_id:w.machine_id,needs_registration:!0}),h(w.machine_id),o("new_client")}catch{}})(),()=>{v=!0}},[]);const x=b.useCallback(async()=>{if(l){m(!0);try{const v=await r({type:"daemon",name:f||l.machine_id,config:{machine_id:l.machine_id,os:l.os||"",daemon_version:l.daemon_version||""}});t(`/studio/sources/${v.id}`)}catch{m(!1)}}},[l,f,r,t]);return c.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[c.jsx(Ta,{segments:[{label:e("sources.add_client.title")}]}),c.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:e("sources.add_client.description")}),c.jsx("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:c.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[c.jsxs("li",{children:[c.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",e("sources.add_client.step1")]}),c.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:["npm install -g @c4a/daemon ",c.jsx(Jp,{text:"npm install -g @c4a/daemon"})]})]}),c.jsxs("li",{children:[c.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",e("sources.add_client.step2")]}),c.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:[`c4a-daemon --server ${window.location.host}`," ",c.jsx(Jp,{text:`c4a-daemon --server ${window.location.host}`})]}),c.jsx("p",{className:"mt-2 text-xs text-c4a-text-muted",children:e("sources.add_client.step2_allow")}),c.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:[`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`," ",c.jsx(Jp,{text:`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`})]})]}),c.jsxs("li",{children:[c.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",e("sources.add_client.step3")]}),c.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:e("sources.add_client.step3_desc")})]})]})}),c.jsxs("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:[a==="waiting"&&c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Zt,{size:16,className:"animate-spin text-c4a-warning"}),c.jsx("span",{className:"text-sm text-c4a-warning",children:e("sources.add_client.waiting")})]}),a==="new_client"&&l&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-accent",children:e("sources.add_client.detected")}),c.jsxs("div",{className:"space-y-2 text-sm",children:[c.jsx(Wp,{label:e("sources.add_client.machine_name"),value:l.machine_id}),l.os&&c.jsx(Wp,{label:e("sources.add_client.os"),value:l.os}),l.daemon_version&&c.jsx(Wp,{label:e("sources.add_client.daemon_version"),value:l.daemon_version})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:e("sources.add_client.client_name")}),c.jsx("input",{value:f,onChange:v=>h(v.target.value),className:"min-w-0 flex-1 rounded border border-c4a-border-default bg-c4a-bg-base px-2 py-1 font-mono text-xs text-c4a-text-primary outline-none focus:border-c4a-accent"})]}),c.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[c.jsx("button",{onClick:()=>t("/studio/sources"),className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:e("common.cancel")}),c.jsxs("button",{onClick:x,disabled:p||!f.trim(),className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-50",children:[p&&c.jsx(Zt,{size:12,className:"animate-spin"}),e("sources.add_client.confirm")]})]})]}),a==="reconnected"&&l&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Wr,{size:16,className:"text-c4a-success"}),c.jsx("span",{className:"text-sm text-c4a-text-primary",children:e("sources.add_client.reconnected",{name:l.machine_id})})]}),l.lib_id&&c.jsx(jr,{to:`/studio/sources/${l.lib_id}`,className:"inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.add_client.go_to",{name:l.machine_id})})]})]})]})}function Jp({text:e}){const[t,r]=b.useState(!1),a=b.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[e]);return c.jsx("button",{type:"button",onClick:a,className:"shrink-0 rounded p-0.5 text-c4a-accent opacity-60 transition-opacity hover:opacity-100",title:"Copy",children:t?c.jsx(Wr,{size:13}):c.jsx(Iu,{size:13})})}function Wp({label:e,value:t}){return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:e}),c.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:t})]})}const fv={accent:"bg-c4a-accent/10 text-c4a-accent/60",success:"bg-c4a-success/10 text-c4a-success",warning:"bg-c4a-warning/10 text-c4a-warning",error:"bg-c4a-error/10 text-c4a-error",muted:"bg-c4a-bg-active text-c4a-text-secondary"};function Bt({children:e,variant:t="accent",tooltip:r}){return r?c.jsxs("span",{className:"relative inline-block group cursor-default",children:[c.jsx("span",{className:`inline-block font-mono text-[10px] uppercase px-1.5 py-0.5 rounded-sm ${fv[t]}`,children:e}),c.jsx("span",{className:"pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-1.5 px-2 py-1 rounded bg-c4a-bg-elevated text-c4a-text-primary text-[11px] font-sans normal-case whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity duration-150 shadow-lg border border-c4a-border-subtle z-50",children:r})]}):c.jsx("span",{className:`inline-block font-mono text-[10px] uppercase px-1.5 py-0.5 rounded-sm ${fv[t]}`,children:e})}function Yo(e){return e===void 0?null:e>=.9?{labelKey:"confidence.high",tipKey:"confidence.high.tip",variant:"success",value:e}:e>=.7?{labelKey:"confidence.ai",tipKey:"confidence.ai.tip",variant:"warning",value:e}:{labelKey:"confidence.low",tipKey:"confidence.low.tip",variant:"error",value:e}}const e4="c4a_explorer_mode";function UT(){try{const e=localStorage.getItem(e4);if(e==="append"||e==="replace")return e}catch{}return"append"}const Aa=ea((e,t)=>({tabs:[],activeTabId:null,mode:UT(),openTab:r=>{const{tabs:a,mode:o}=t(),l=a.find(u=>u.id===r.id);if(l){e({activeTabId:l.id});return}if(o==="append")e({tabs:[...a,{...r,isAnchor:!1}],activeTabId:r.id});else{const u=a.find(f=>f.id===t().activeTabId);if(!u||u.isAnchor)e({tabs:[...a,{...r,isAnchor:!1}],activeTabId:r.id});else{const f=a.findIndex(p=>p.id===t().activeTabId),h=[...a];h[f]={...r,isAnchor:!1},e({tabs:h,activeTabId:r.id})}}},closeTab:r=>{const{tabs:a,activeTabId:o}=t(),l=a.find(p=>p.id===r);if(!l||l.isAnchor)return;const u=a.findIndex(p=>p.id===r),f=a.filter(p=>p.id!==r);let h=o;o===r&&(h=f[u-1]?.id??f[0]?.id??null),e({tabs:f,activeTabId:h})},activateTab:r=>{e({activeTabId:r})},closeAll:()=>{const{tabs:r}=t(),a=r.filter(o=>o.isAnchor);e({tabs:a,activeTabId:a[0]?.id??null})},setAnchor:r=>{const a={...r,isAnchor:!0};e({tabs:[a],activeTabId:a.id})},toggleMode:()=>{const r=t().mode==="append"?"replace":"append";try{localStorage.setItem(e4,r)}catch{}e({mode:r})},reset:()=>{e({tabs:[],activeTabId:null})}})),t4=b.createContext(null);function PT({children:e}){const t=Aa(a=>a.openTab),r=b.useCallback((a,o,l,u)=>{t({id:`${a}:${o}`,type:a,resourceId:o,label:l,...u!=null&&{icon:u}})},[t]);return c.jsx(t4.Provider,{value:{active:!0,navigate:r},children:e})}function Ko(){return b.useContext(t4)}const n4=b.createContext(null);function r4(){const e=b.useContext(n4);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}function a4({value:e,onChange:t,children:r}){return c.jsx(n4.Provider,{value:{value:e,onChange:t},children:c.jsx("div",{className:"flex flex-1 flex-col",children:r})})}function s4({children:e}){return c.jsx("div",{className:"flex border-b border-c4a-border-subtle",children:e})}function Vr({value:e,children:t}){const{value:r,onChange:a}=r4(),o=r===e;return c.jsx("button",{onClick:()=>a(e),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${o?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:t})}function Yr({value:e,children:t}){const{value:r}=r4();return r!==e?null:c.jsx("div",{className:"flex flex-1 flex-col",children:t})}function o4(e,t){const r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const HT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,FT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qT={};function pv(e,t){return(qT.jsx?FT:HT).test(e)}const GT=/[ \t\n\f\r]/g;function cd(e){return typeof e=="object"?e.type==="text"?hv(e.value):!1:hv(e)}function hv(e){return e.replace(GT,"")===""}class Il{constructor(t,r,a){this.normal=r,this.property=t,a&&(this.space=a)}}Il.prototype.normal={};Il.prototype.property={};Il.prototype.space=void 0;function i4(e,t){const r={},a={};for(const o of e)Object.assign(r,o.property),Object.assign(a,o.normal);return new Il(r,a,t)}function zh(e){return e.toLowerCase()}class Kn{constructor(t,r){this.attribute=r,this.property=t}}Kn.prototype.attribute="";Kn.prototype.booleanish=!1;Kn.prototype.boolean=!1;Kn.prototype.commaOrSpaceSeparated=!1;Kn.prototype.commaSeparated=!1;Kn.prototype.defined=!1;Kn.prototype.mustUseProperty=!1;Kn.prototype.number=!1;Kn.prototype.overloadedBoolean=!1;Kn.prototype.property="";Kn.prototype.spaceSeparated=!1;Kn.prototype.space=void 0;let VT=0;const tt=qs(),rn=qs(),$h=qs(),Se=qs(),At=qs(),$o=qs(),rr=qs();function qs(){return 2**++VT}const Bh=Object.freeze(Object.defineProperty({__proto__:null,boolean:tt,booleanish:rn,commaOrSpaceSeparated:rr,commaSeparated:$o,number:Se,overloadedBoolean:$h,spaceSeparated:At},Symbol.toStringTag,{value:"Module"})),eh=Object.keys(Bh);class km extends Kn{constructor(t,r,a,o){let l=-1;if(super(t,r),mv(this,"space",o),typeof a=="number")for(;++l<eh.length;){const u=eh[l];mv(this,eh[l],(a&Bh[u])===Bh[u])}}}km.prototype.defined=!0;function mv(e,t,r){r&&(e[t]=r)}function Xo(e){const t={},r={};for(const[a,o]of Object.entries(e.properties)){const l=new km(a,e.transform(e.attributes||{},a),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(l.mustUseProperty=!0),t[a]=l,r[zh(a)]=a,r[zh(l.attribute)]=a}return new Il(t,r,e.space)}const l4=Xo({properties:{ariaActiveDescendant:null,ariaAtomic:rn,ariaAutoComplete:null,ariaBusy:rn,ariaChecked:rn,ariaColCount:Se,ariaColIndex:Se,ariaColSpan:Se,ariaControls:At,ariaCurrent:null,ariaDescribedBy:At,ariaDetails:null,ariaDisabled:rn,ariaDropEffect:At,ariaErrorMessage:null,ariaExpanded:rn,ariaFlowTo:At,ariaGrabbed:rn,ariaHasPopup:null,ariaHidden:rn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:At,ariaLevel:Se,ariaLive:null,ariaModal:rn,ariaMultiLine:rn,ariaMultiSelectable:rn,ariaOrientation:null,ariaOwns:At,ariaPlaceholder:null,ariaPosInSet:Se,ariaPressed:rn,ariaReadOnly:rn,ariaRelevant:null,ariaRequired:rn,ariaRoleDescription:At,ariaRowCount:Se,ariaRowIndex:Se,ariaRowSpan:Se,ariaSelected:rn,ariaSetSize:Se,ariaSort:null,ariaValueMax:Se,ariaValueMin:Se,ariaValueNow:Se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function c4(e,t){return t in e?e[t]:t}function u4(e,t){return c4(e,t.toLowerCase())}const YT=Xo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$o,acceptCharset:At,accessKey:At,action:null,allow:null,allowFullScreen:tt,allowPaymentRequest:tt,allowUserMedia:tt,alt:null,as:null,async:tt,autoCapitalize:null,autoComplete:At,autoFocus:tt,autoPlay:tt,blocking:At,capture:null,charSet:null,checked:tt,cite:null,className:At,cols:Se,colSpan:null,content:null,contentEditable:rn,controls:tt,controlsList:At,coords:Se|$o,crossOrigin:null,data:null,dateTime:null,decoding:null,default:tt,defer:tt,dir:null,dirName:null,disabled:tt,download:$h,draggable:rn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:tt,formTarget:null,headers:At,height:Se,hidden:$h,high:Se,href:null,hrefLang:null,htmlFor:At,httpEquiv:At,id:null,imageSizes:null,imageSrcSet:null,inert:tt,inputMode:null,integrity:null,is:null,isMap:tt,itemId:null,itemProp:At,itemRef:At,itemScope:tt,itemType:At,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:tt,low:Se,manifest:null,max:null,maxLength:Se,media:null,method:null,min:null,minLength:Se,multiple:tt,muted:tt,name:null,nonce:null,noModule:tt,noValidate:tt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:tt,optimum:Se,pattern:null,ping:At,placeholder:null,playsInline:tt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:tt,referrerPolicy:null,rel:At,required:tt,reversed:tt,rows:Se,rowSpan:Se,sandbox:At,scope:null,scoped:tt,seamless:tt,selected:tt,shadowRootClonable:tt,shadowRootDelegatesFocus:tt,shadowRootMode:null,shape:null,size:Se,sizes:null,slot:null,span:Se,spellCheck:rn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Se,step:null,style:null,tabIndex:Se,target:null,title:null,translate:null,type:null,typeMustMatch:tt,useMap:null,value:rn,width:Se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:At,axis:null,background:null,bgColor:null,border:Se,borderColor:null,bottomMargin:Se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:tt,declare:tt,event:null,face:null,frame:null,frameBorder:null,hSpace:Se,leftMargin:Se,link:null,longDesc:null,lowSrc:null,marginHeight:Se,marginWidth:Se,noResize:tt,noHref:tt,noShade:tt,noWrap:tt,object:null,profile:null,prompt:null,rev:null,rightMargin:Se,rules:null,scheme:null,scrolling:rn,standby:null,summary:null,text:null,topMargin:Se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:tt,disableRemotePlayback:tt,prefix:null,property:null,results:Se,security:null,unselectable:null},space:"html",transform:u4}),KT=Xo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:rr,accentHeight:Se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Se,amplitude:Se,arabicForm:null,ascent:Se,attributeName:null,attributeType:null,azimuth:Se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Se,by:null,calcMode:null,capHeight:Se,className:At,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Se,diffuseConstant:Se,direction:null,display:null,dur:null,divisor:Se,dominantBaseline:null,download:tt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Se,enableBackground:null,end:null,event:null,exponent:Se,externalResourcesRequired:null,fill:null,fillOpacity:Se,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$o,g2:$o,glyphName:$o,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Se,horizOriginX:Se,horizOriginY:Se,id:null,ideographic:Se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Se,k:Se,k1:Se,k2:Se,k3:Se,k4:Se,kernelMatrix:rr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Se,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Se,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Se,overlineThickness:Se,paintOrder:null,panose1:null,path:null,pathLength:Se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:At,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Se,pointsAtY:Se,pointsAtZ:Se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rr,rev:rr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rr,requiredFeatures:rr,requiredFonts:rr,requiredFormats:rr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Se,specularExponent:Se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Se,strikethroughThickness:Se,string:null,stroke:null,strokeDashArray:rr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Se,strokeOpacity:Se,strokeWidth:null,style:null,surfaceScale:Se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rr,tabIndex:Se,tableValues:null,target:null,targetX:Se,targetY:Se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Se,underlineThickness:Se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Se,values:null,vAlphabetic:Se,vMathematical:Se,vectorEffect:null,vHanging:Se,vIdeographic:Se,version:null,vertAdvY:Se,vertOriginX:Se,vertOriginY:Se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:c4}),d4=Xo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),f4=Xo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:u4}),p4=Xo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),XT={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},QT=/[A-Z]/g,gv=/-[a-z]/g,ZT=/^data[-\w.:]+$/i;function h4(e,t){const r=zh(t);let a=t,o=Kn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&ZT.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(gv,WT);a="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!gv.test(l)){let u=l.replace(QT,JT);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=km}return new o(a,t)}function JT(e){return"-"+e.toLowerCase()}function WT(e){return e.charAt(1).toUpperCase()}const m4=i4([l4,YT,d4,f4,p4],"html"),Ul=i4([l4,KT,d4,f4,p4],"svg");function g4(e){return e.join(" ").trim()}var To={},th,xv;function e3(){if(xv)return th;xv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
34
|
+
`,p="/",m="*",x="",v="comment",_="declaration";function w(k,N){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];N=N||{};var A=1,E=1;function D(M){var P=M.match(t);P&&(A+=P.length);var T=M.lastIndexOf(h);E=~T?M.length-T:E+M.length}function L(){var M={line:A,column:E};return function(P){return P.position=new $(M),B(),P}}function $(M){this.start=M,this.end={line:A,column:E},this.source=N.source}$.prototype.content=k;function z(M){var P=new Error(N.source+":"+A+":"+E+": "+M);if(P.reason=M,P.filename=N.source,P.line=A,P.column=E,P.source=k,!N.silent)throw P}function R(M){var P=M.exec(k);if(P){var T=P[0];return D(T),k=k.slice(T.length),P}}function B(){R(r)}function H(M){var P;for(M=M||[];P=J();)P!==!1&&M.push(P);return M}function J(){var M=L();if(!(p!=k.charAt(0)||m!=k.charAt(1))){for(var P=2;x!=k.charAt(P)&&(m!=k.charAt(P)||p!=k.charAt(P+1));)++P;if(P+=2,x===k.charAt(P-1))return z("End of comment missing");var T=k.slice(2,P-2);return E+=2,D(T),k=k.slice(P),E+=2,M({type:v,comment:T})}}function oe(){var M=L(),P=R(a);if(P){if(J(),!R(o))return z("property missing ':'");var T=R(l),q=M({type:_,property:S(P[0].replace(e,x)),value:T?S(T[0].replace(e,x)):x});return R(u),q}}function ce(){var M=[];H(M);for(var P;P=oe();)P!==!1&&(M.push(P),H(M));return M}return B(),ce()}function S(k){return k?k.replace(f,x):x}return th=w,th}var yv;function t3(){if(yv)return To;yv=1;var e=To&&To.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(To,"__esModule",{value:!0}),To.default=r;const t=e(e3());function r(a,o){let l=null;if(!a||typeof a!="string")return l;const u=(0,t.default)(a),f=typeof o=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:p,value:m}=h;f?o(p,m,h):m&&(l=l||{},l[p]=m)}),l}return To}var Gi={},bv;function n3(){if(bv)return Gi;bv=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,l=function(p){return!p||r.test(p)||e.test(p)},u=function(p,m){return m.toUpperCase()},f=function(p,m){return"".concat(m,"-")},h=function(p,m){return m===void 0&&(m={}),l(p)?p:(p=p.toLowerCase(),m.reactCompat?p=p.replace(o,f):p=p.replace(a,f),p.replace(t,u))};return Gi.camelCase=h,Gi}var Vi,vv;function r3(){if(vv)return Vi;vv=1;var e=Vi&&Vi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(t3()),r=n3();function a(o,l){var u={};return!o||typeof o!="string"||(0,t.default)(o,function(f,h){f&&h&&(u[(0,r.camelCase)(f,l)]=h)}),u}return a.default=a,Vi=a,Vi}var a3=r3();const s3=$_(a3),o3=i3("start");function i3(e){return t;function t(r){const a=r&&r.position&&r.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function l3(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_v(e.position):"start"in e||"end"in e?_v(e):"line"in e||"column"in e?Ih(e):""}function Ih(e){return wv(e&&e.line)+":"+wv(e&&e.column)}function _v(e){return Ih(e&&e.start)+"-"+Ih(e&&e.end)}function wv(e){return e&&typeof e=="number"?e:1}class zn extends Error{constructor(t,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let o="",l={},u=!1;if(r&&("line"in r&&"column"in r?l={place:r}:"start"in r&&"end"in r?l={place:r}:"type"in r?l={ancestors:[r],place:r.position}:l={...r}),typeof t=="string"?o=t:!l.cause&&t&&(u=!0,o=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?l.ruleId=a:(l.source=a.slice(0,h),l.ruleId=a.slice(h+1))}if(!l.place&&l.ancestors&&l.ancestors){const h=l.ancestors[l.ancestors.length-1];h&&(l.place=h.position)}const f=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=l3(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}zn.prototype.file="";zn.prototype.name="";zn.prototype.reason="";zn.prototype.message="";zn.prototype.stack="";zn.prototype.column=void 0;zn.prototype.line=void 0;zn.prototype.ancestors=void 0;zn.prototype.cause=void 0;zn.prototype.fatal=void 0;zn.prototype.place=void 0;zn.prototype.ruleId=void 0;zn.prototype.source=void 0;const Nm={}.hasOwnProperty,c3=new Map,u3=/[A-Z]/g,d3=new Set(["table","tbody","thead","tfoot","tr"]),f3=new Set(["td","th"]),x4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function p3(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=_3(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=v3(r,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ul:m4,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=y4(o,e,void 0);return l&&typeof l!="string"?l:o.create(e,o.Fragment,{children:l||void 0},void 0)}function y4(e,t,r){if(t.type==="element")return h3(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return m3(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return x3(e,t,r);if(t.type==="mdxjsEsm")return g3(e,t);if(t.type==="root")return y3(e,t,r);if(t.type==="text")return b3(e,t)}function h3(e,t,r){const a=e.schema;let o=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Ul,e.schema=o),e.ancestors.push(t);const l=v4(e,t.tagName,!1),u=w3(e,t);let f=Cm(e,t);return d3.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!cd(h):!0})),b4(e,u,l,t),Em(u,f),e.ancestors.pop(),e.schema=a,e.create(t,l,u,r)}function m3(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}bl(e,t.position)}function g3(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bl(e,t.position)}function x3(e,t,r){const a=e.schema;let o=a;t.name==="svg"&&a.space==="html"&&(o=Ul,e.schema=o),e.ancestors.push(t);const l=t.name===null?e.Fragment:v4(e,t.name,!0),u=S3(e,t),f=Cm(e,t);return b4(e,u,l,t),Em(u,f),e.ancestors.pop(),e.schema=a,e.create(t,l,u,r)}function y3(e,t,r){const a={};return Em(a,Cm(e,t)),e.create(t,e.Fragment,a,r)}function b3(e,t){return t.value}function b4(e,t,r,a){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=a)}function Em(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function v3(e,t,r){return a;function a(o,l,u,f){const p=Array.isArray(u.children)?r:t;return f?p(l,u,f):p(l,u)}}function _3(e,t){return r;function r(a,o,l,u){const f=Array.isArray(l.children),h=o3(a);return t(o,l,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function w3(e,t){const r={};let a,o;for(o in t.properties)if(o!=="children"&&Nm.call(t.properties,o)){const l=j3(e,o,t.properties[o]);if(l){const[u,f]=l;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&f3.has(t.tagName)?a=f:r[u]=f}}if(a){const l=r.style||(r.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function S3(e,t){const r={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const l=a.data.estree.body[0];l.type;const u=l.expression;u.type;const f=u.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else bl(e,t.position);else{const o=a.name;let l;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,l=e.evaluater.evaluateExpression(f.expression)}else bl(e,t.position);else l=a.value===null?!0:a.value;r[o]=l}return r}function Cm(e,t){const r=[];let a=-1;const o=e.passKeys?new Map:c3;for(;++a<t.children.length;){const l=t.children[a];let u;if(e.passKeys){const h=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(h){const p=o.get(h)||0;u=h+"-"+p,o.set(h,p+1)}}const f=y4(e,l,u);f!==void 0&&r.push(f)}return r}function j3(e,t,r){const a=h4(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=a.commaSeparated?o4(r):g4(r)),a.property==="style"){let o=typeof r=="object"?r:k3(e,String(r));return e.stylePropertyNameCase==="css"&&(o=N3(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&a.space?XT[a.property]||a.property:a.attribute,r]}}function k3(e,t){try{return s3(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const a=r,o=new zn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=x4+"#cannot-parse-style-attribute",o}}function v4(e,t,r){let a;if(!r)a={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let l=-1,u;for(;++l<o.length;){const f=pv(o[l])?{type:"Identifier",name:o[l]}:{type:"Literal",value:o[l]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(l&&f.type==="Literal"),optional:!1}:f}a=u}else a=pv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const o=a.value;return Nm.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(a);bl(e)}function bl(e,t){const r=new zn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=x4+"#cannot-handle-mdx-estrees-without-createevaluater",r}function N3(e){const t={};let r;for(r in e)Nm.call(e,r)&&(t[E3(r)]=e[r]);return t}function E3(e){let t=e.replace(u3,C3);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function C3(e){return"-"+e.toLowerCase()}var Uh=Object.defineProperty,A3=Object.getOwnPropertyDescriptor,R3=Object.getOwnPropertyNames,T3=Object.prototype.hasOwnProperty,L3=(e,t)=>{let r={};for(var a in e)Uh(r,a,{get:e[a],enumerable:!0});return Uh(r,Symbol.toStringTag,{value:"Module"}),r},D3=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=R3(t),l=0,u=o.length,f;l<u;l++)f=o[l],!T3.call(e,f)&&f!==r&&Uh(e,f,{get:(h=>t[h]).bind(null,f),enumerable:!(a=A3(t,f))||a.enumerable});return e},O3=(e,t,r)=>(D3(e,t,"default"),r),Rt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function M3(e){return Am(e)}function Am(e){return Array.isArray(e)?z3(e):e instanceof RegExp?e:typeof e=="object"?$3(e):e}function z3(e){let t=[];for(let r=0,a=e.length;r<a;r++)t[r]=Am(e[r]);return t}function $3(e){let t={};for(let r in e)t[r]=Am(e[r]);return t}function _4(e,...t){return t.forEach(r=>{for(let a in r)e[a]=r[a]}),e}function w4(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?w4(e.substring(0,e.length-1)):e.substr(~t+1)}var nh=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,uu=class{static hasCaptures(e){return e===null?!1:(nh.lastIndex=0,nh.test(e))}static replaceCaptures(e,t,r){return e.replace(nh,(a,o,l,u)=>{let f=r[parseInt(o||l,10)];if(f){let h=t.substring(f.start,f.end);for(;h[0]===".";)h=h.substring(1);switch(u){case"downcase":return h.toLowerCase();case"upcase":return h.toUpperCase();default:return h}}else return a})}};function S4(e,t){return e<t?-1:e>t?1:0}function j4(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let r=e.length,a=t.length;if(r===a){for(let o=0;o<r;o++){let l=S4(e[o],t[o]);if(l!==0)return l}return 0}return r-a}function Sv(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function k4(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var N4=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Pu=class{constructor(e,t,r){this._colorMap=e,this._defaults=t,this._root=r}static createFromRawTheme(e,t){return this.createFromParsedTheme(U3(e),t)}static createFromParsedTheme(e,t){return H3(e,t)}_cachedMatchRoot=new N4(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,a=this._cachedMatchRoot.get(t).find(o=>B3(e.parent,o.parentScopes));return a?new E4(a.fontStyle,a.foreground,a.background):null}},rh=class Cu{constructor(t,r){this.parent=t,this.scopeName=r}static push(t,r){for(const a of r)t=new Cu(t,a);return t}static from(...t){let r=null;for(let a=0;a<t.length;a++)r=new Cu(r,t[a]);return r}push(t){return new Cu(this,t)}getSegments(){let t=this;const r=[];for(;t;)r.push(t.scopeName),t=t.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const r=[];let a=this;for(;a&&a!==t;)r.push(a.scopeName),a=a.parent;return a===t?r.reverse():void 0}};function B3(e,t){if(t.length===0)return!0;for(let r=0;r<t.length;r++){let a=t[r],o=!1;if(a===">"){if(r===t.length-1)return!1;a=t[++r],o=!0}for(;e&&!I3(e.scopeName,a);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function I3(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var E4=class{constructor(e,t,r){this.fontStyle=e,this.foregroundId=t,this.backgroundId=r}};function U3(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,r=[],a=0;for(let o=0,l=t.length;o<l;o++){let u=t[o];if(!u.settings)continue;let f;if(typeof u.scope=="string"){let x=u.scope;x=x.replace(/^[,]+/,""),x=x.replace(/[,]+$/,""),f=x.split(",")}else Array.isArray(u.scope)?f=u.scope:f=[""];let h=-1;if(typeof u.settings.fontStyle=="string"){h=0;let x=u.settings.fontStyle.split(" ");for(let v=0,_=x.length;v<_;v++)switch(x[v]){case"italic":h=h|1;break;case"bold":h=h|2;break;case"underline":h=h|4;break;case"strikethrough":h=h|8;break}}let p=null;typeof u.settings.foreground=="string"&&Sv(u.settings.foreground)&&(p=u.settings.foreground);let m=null;typeof u.settings.background=="string"&&Sv(u.settings.background)&&(m=u.settings.background);for(let x=0,v=f.length;x<v;x++){let w=f[x].trim().split(" "),S=w[w.length-1],k=null;w.length>1&&(k=w.slice(0,w.length-1),k.reverse()),r[a++]=new P3(S,k,o,h,p,m)}}return r}var P3=class{constructor(e,t,r,a,o,l){this.scope=e,this.parentScopes=t,this.index=r,this.fontStyle=a,this.foreground=o,this.background=l}},Nn=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Nn||{});function H3(e,t){e.sort((h,p)=>{let m=S4(h.scope,p.scope);return m!==0||(m=j4(h.parentScopes,p.parentScopes),m!==0)?m:h.index-p.index});let r=0,a="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let h=e.shift();h.fontStyle!==-1&&(r=h.fontStyle),h.foreground!==null&&(a=h.foreground),h.background!==null&&(o=h.background)}let l=new F3(t),u=new E4(r,l.getId(a),l.getId(o)),f=new G3(new Ph(0,null,-1,0,0),[]);for(let h=0,p=e.length;h<p;h++){let m=e[h];f.insert(0,m.scope,m.parentScopes,m.fontStyle,l.getId(m.foreground),l.getId(m.background))}return new Pu(l,u,f)}var F3=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,r=e.length;t<r;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},q3=Object.freeze([]),Ph=class C4{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,r,a,o,l){this.scopeDepth=t,this.parentScopes=r||q3,this.fontStyle=a,this.foreground=o,this.background=l}clone(){return new C4(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let r=[];for(let a=0,o=t.length;a<o;a++)r[a]=t[a].clone();return r}acceptOverwrite(t,r,a,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,r!==-1&&(this.fontStyle=r),a!==0&&(this.foreground=a),o!==0&&(this.background=o)}},G3=class Hh{constructor(t,r=[],a={}){this._mainRule=t,this._children=a,this._rulesWithParentScopes=r}_rulesWithParentScopes;static _cmpBySpecificity(t,r){if(t.scopeDepth!==r.scopeDepth)return r.scopeDepth-t.scopeDepth;let a=0,o=0;for(;t.parentScopes[a]===">"&&a++,r.parentScopes[o]===">"&&o++,!(a>=t.parentScopes.length||o>=r.parentScopes.length);){const l=r.parentScopes[o].length-t.parentScopes[a].length;if(l!==0)return l;a++,o++}return r.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let a=t.indexOf("."),o,l;if(a===-1?(o=t,l=""):(o=t.substring(0,a),l=t.substring(a+1)),this._children.hasOwnProperty(o))return this._children[o].match(l)}const r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(Hh._cmpBySpecificity),r}insert(t,r,a,o,l,u){if(r===""){this._doInsertHere(t,a,o,l,u);return}let f=r.indexOf("."),h,p;f===-1?(h=r,p=""):(h=r.substring(0,f),p=r.substring(f+1));let m;this._children.hasOwnProperty(h)?m=this._children[h]:(m=new Hh(this._mainRule.clone(),Ph.cloneArr(this._rulesWithParentScopes)),this._children[h]=m),m.insert(t+1,p,a,o,l,u)}_doInsertHere(t,r,a,o,l){if(r===null){this._mainRule.acceptOverwrite(t,a,o,l);return}for(let u=0,f=this._rulesWithParentScopes.length;u<f;u++){let h=this._rulesWithParentScopes[u];if(j4(h.parentScopes,r)===0){h.acceptOverwrite(t,a,o,l);return}}a===-1&&(a=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),l===0&&(l=this._mainRule.background),this._rulesWithParentScopes.push(new Ph(t,r,a,o,l))}},Ho=class vr{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const r=vr.getLanguageId(t),a=vr.getTokenType(t),o=vr.getFontStyle(t),l=vr.getForeground(t),u=vr.getBackground(t);console.log({languageId:r,tokenType:a,fontStyle:o,foreground:l,background:u})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,r,a,o,l,u,f){let h=vr.getLanguageId(t),p=vr.getTokenType(t),m=vr.containsBalancedBrackets(t)?1:0,x=vr.getFontStyle(t),v=vr.getForeground(t),_=vr.getBackground(t);return r!==0&&(h=r),a!==8&&(p=a),o!==null&&(m=o?1:0),l!==-1&&(x=l),u!==0&&(v=u),f!==0&&(_=f),(h<<0|p<<8|m<<10|x<<11|v<<15|_<<24)>>>0}};function Hu(e,t){const r=[],a=V3(e);let o=a.next();for(;o!==null;){let h=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":h=1;break;case"L":h=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=a.next()}let p=u();if(r.push({matcher:p,priority:h}),o!==",")break;o=a.next()}return r;function l(){if(o==="-"){o=a.next();const h=l();return p=>!!h&&!h(p)}if(o==="("){o=a.next();const h=f();return o===")"&&(o=a.next()),h}if(jv(o)){const h=[];do h.push(o),o=a.next();while(jv(o));return p=>t(h,p)}return null}function u(){const h=[];let p=l();for(;p;)h.push(p),p=l();return m=>h.every(x=>x(m))}function f(){const h=[];let p=u();for(;p&&(h.push(p),o==="|"||o===",");){do o=a.next();while(o==="|"||o===",");p=u()}return m=>h.some(x=>x(m))}}function jv(e){return!!e&&!!e.match(/[\w\.:]+/)}function V3(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=t.exec(e);return{next:()=>{if(!r)return null;const a=r[0];return r=t.exec(e),a}}}function A4(e){typeof e.dispose=="function"&&e.dispose()}var vl=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Y3=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},K3=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},X3=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new vl(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new K3;for(const r of e)Q3(r,this.initialScopeName,this.repo,t);for(const r of t.references)if(r instanceof vl){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function Q3(e,t,r,a){const o=r.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const l=r.lookup(t);e instanceof vl?Au({baseGrammar:l,selfGrammar:o},a):Fh(e.ruleName,{baseGrammar:l,selfGrammar:o,repository:o.repository},a);const u=r.injections(e.scopeName);if(u)for(const f of u)a.add(new vl(f))}function Fh(e,t,r){if(t.repository&&t.repository[e]){const a=t.repository[e];Fu([a],t,r)}}function Au(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Fu(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Fu(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Fu(e,t,r){for(const a of e){if(r.visitedRule.has(a))continue;r.visitedRule.add(a);const o=a.repository?_4({},t.repository,a.repository):t.repository;Array.isArray(a.patterns)&&Fu(a.patterns,{...t,repository:o},r);const l=a.include;if(!l)continue;const u=R4(l);switch(u.kind){case 0:Au({...t,selfGrammar:t.baseGrammar},r);break;case 1:Au(t,r);break;case 2:Fh(u.ruleName,{...t,repository:o},r);break;case 3:case 4:const f=u.scopeName===t.selfGrammar.scopeName?t.selfGrammar:u.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(f){const h={baseGrammar:t.baseGrammar,selfGrammar:f,repository:o};u.kind===4?Fh(u.ruleName,h,r):Au(h,r)}else u.kind===4?r.add(new Y3(u.scopeName,u.ruleName)):r.add(new vl(u.scopeName));break}}}var Z3=class{kind=0},J3=class{kind=1},W3=class{constructor(e){this.ruleName=e}kind=2},e5=class{constructor(e){this.scopeName=e}kind=3},t5=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function R4(e){if(e==="$base")return new Z3;if(e==="$self")return new J3;const t=e.indexOf("#");if(t===-1)return new e5(e);if(t===0)return new W3(e.substring(1));{const r=e.substring(0,t),a=e.substring(t+1);return new t5(r,a)}}var n5=/\\(\d+)/,kv=/\\(\d+)/g,r5=-1,T4=-2;var Pl=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,r,a){this.$location=e,this.id=t,this._name=r||null,this._nameIsCapturing=uu.hasCaptures(this._name),this._contentName=a||null,this._contentNameIsCapturing=uu.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${w4(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:uu.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:uu.replaceCaptures(this._contentName,e,t)}},a5=class extends Pl{retokenizeCapturedWithRuleId;constructor(e,t,r,a,o){super(e,t,r,a),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,r,a){throw new Error("Not supported!")}},s5=class extends Pl{_match;captures;_cachedCompiledPatterns;constructor(e,t,r,a,o){super(e,t,r,null),this._match=new _l(a,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,a){return this._getCachedCompiledPatterns(e).compileAG(e,r,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new wl,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Nv=class extends Pl{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,r,a,o){super(e,t,r,a),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const r of this.patterns)e.getRule(r).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,a){return this._getCachedCompiledPatterns(e).compileAG(e,r,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new wl,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},qh=class extends Pl{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,r,a,o,l,u,f,h,p){super(e,t,r,a),this._begin=new _l(o,this.id),this.beginCaptures=l,this._end=new _l(u||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=f,this.applyEndPatternLast=h||!1,this.patterns=p.patterns,this.hasMissingPatterns=p.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,r,a){return this._getCachedCompiledPatterns(e,t).compileAG(e,r,a)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new wl;for(const r of this.patterns)e.getRule(r).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},qu=class extends Pl{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,r,a,o,l,u,f,h){super(e,t,r,a),this._begin=new _l(o,this.id),this.beginCaptures=l,this.whileCaptures=f,this._while=new _l(u,T4),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,a){return this._getCachedCompiledPatterns(e).compileAG(e,r,a)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new wl;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,r,a){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,r,a)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new wl,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},L4=class jn{static createCaptureRule(t,r,a,o,l){return t.registerRule(u=>new a5(r,u,a,o,l))}static getCompiledRuleId(t,r,a){return t.id||r.registerRule(o=>{if(t.id=o,t.match)return new s5(t.$vscodeTextmateLocation,t.id,t.name,t.match,jn._compileCaptures(t.captures,r,a));if(typeof t.begin>"u"){t.repository&&(a=_4({},a,t.repository));let l=t.patterns;return typeof l>"u"&&t.include&&(l=[{include:t.include}]),new Nv(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,jn._compilePatterns(l,r,a))}return t.while?new qu(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,jn._compileCaptures(t.beginCaptures||t.captures,r,a),t.while,jn._compileCaptures(t.whileCaptures||t.captures,r,a),jn._compilePatterns(t.patterns,r,a)):new qh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,jn._compileCaptures(t.beginCaptures||t.captures,r,a),t.end,jn._compileCaptures(t.endCaptures||t.captures,r,a),t.applyEndPatternLast,jn._compilePatterns(t.patterns,r,a))}),t.id}static _compileCaptures(t,r,a){let o=[];if(t){let l=0;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const f=parseInt(u,10);f>l&&(l=f)}for(let u=0;u<=l;u++)o[u]=null;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const f=parseInt(u,10);let h=0;t[u].patterns&&(h=jn.getCompiledRuleId(t[u],r,a)),o[f]=jn.createCaptureRule(r,t[u].$vscodeTextmateLocation,t[u].name,t[u].contentName,h)}}return o}static _compilePatterns(t,r,a){let o=[];if(t)for(let l=0,u=t.length;l<u;l++){const f=t[l];let h=-1;if(f.include){const p=R4(f.include);switch(p.kind){case 0:case 1:h=jn.getCompiledRuleId(a[f.include],r,a);break;case 2:let m=a[p.ruleName];m&&(h=jn.getCompiledRuleId(m,r,a));break;case 3:case 4:const x=p.scopeName,v=p.kind===4?p.ruleName:null,_=r.getExternalGrammar(x,a);if(_)if(v){let w=_.repository[v];w&&(h=jn.getCompiledRuleId(w,r,_.repository))}else h=jn.getCompiledRuleId(_.repository.$self,r,_.repository);break}}else h=jn.getCompiledRuleId(f,r,a);if(h!==-1){const p=r.getRule(h);let m=!1;if((p instanceof Nv||p instanceof qh||p instanceof qu)&&p.hasMissingPatterns&&p.patterns.length===0&&(m=!0),m)continue;o.push(h)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},_l=class D4{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,r){if(t&&typeof t=="string"){const a=t.length;let o=0,l=[],u=!1;for(let f=0;f<a;f++)if(t.charAt(f)==="\\"&&f+1<a){const p=t.charAt(f+1);p==="z"?(l.push(t.substring(o,f)),l.push("$(?!\\n)(?<!\\n)"),o=f+2):(p==="A"||p==="G")&&(u=!0),f++}this.hasAnchor=u,o===0?this.source=t:(l.push(t.substring(o,a)),this.source=l.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=n5.test(this.source):this.hasBackReferences=!1}clone(){return new D4(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,r){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let a=r.map(o=>t.substring(o.start,o.end));return kv.lastIndex=0,this.source.replace(kv,(o,l)=>k4(a[parseInt(l,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],r=[],a=[],o=[],l,u,f,h;for(l=0,u=this.source.length;l<u;l++)f=this.source.charAt(l),t[l]=f,r[l]=f,a[l]=f,o[l]=f,f==="\\"&&l+1<u&&(h=this.source.charAt(l+1),h==="A"?(t[l+1]="",r[l+1]="",a[l+1]="A",o[l+1]="A"):h==="G"?(t[l+1]="",r[l+1]="G",a[l+1]="",o[l+1]="G"):(t[l+1]=h,r[l+1]=h,a[l+1]=h,o[l+1]=h),l++);return{A0_G0:t.join(""),A0_G1:r.join(""),A1_G0:a.join(""),A1_G1:o.join("")}}resolveAnchors(t,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},wl=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(r=>r.source);this._cached=new Ev(e,t,this._items.map(r=>r.ruleId))}return this._cached}compileAG(e,t,r){return this._hasAnchors?t?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,r){let a=this._items.map(o=>o.resolveAnchors(t,r));return new Ev(e,a,this._items.map(o=>o.ruleId))}},Ev=class{constructor(e,t,r){this.regExps=t,this.rules=r,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,r=this.rules.length;t<r;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
35
|
+
`)}findNextMatchSync(e,t,r){const a=this.scanner.findNextMatchSync(e,t,r);return a?{ruleId:this.rules[a.index],captureIndices:a.captureIndices}:null}},ah=class{constructor(e,t){this.languageId=e,this.tokenType=t}},o5=class Gh{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,r){this._defaultAttributes=new ah(t,8),this._embeddedLanguagesMatcher=new i5(Object.entries(r||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Gh._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new ah(0,0);_getBasicScopeAttributes=new N4(t=>{const r=this._scopeToLanguage(t),a=this._toStandardTokenType(t);return new ah(r,a)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const r=t.match(Gh.STANDARD_TOKEN_TYPE_REGEXP);if(!r)return 8;switch(r[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},i5=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([r,a])=>k4(r));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Cv=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function O4(e,t,r,a,o,l,u,f){const h=t.content.length;let p=!1,m=-1;if(u){const _=l5(e,t,r,a,o,l);o=_.stack,a=_.linePos,r=_.isFirstLine,m=_.anchorPosition}const x=Date.now();for(;!p;){if(f!==0&&Date.now()-x>f)return new Cv(o,!0);v()}return new Cv(o,!1);function v(){const _=c5(e,t,r,a,o,m);if(!_){l.produce(o,h),p=!0;return}const w=_.captureIndices,S=_.matchedRuleId,k=w&&w.length>0?w[0].end>a:!1;if(S===r5){const N=o.getRule(e);l.produce(o,w[0].start),o=o.withContentNameScopesList(o.nameScopesList),sl(e,t,r,o,l,N.endCaptures,w),l.produce(o,w[0].end);const A=o;if(o=o.parent,m=A.getAnchorPos(),!k&&A.getEnterPos()===a){o=A,l.produce(o,h),p=!0;return}}else{const N=e.getRule(S);l.produce(o,w[0].start);const A=o,E=N.getName(t.content,w),D=o.contentNameScopesList.pushAttributed(E,e);if(o=o.push(S,a,m,w[0].end===h,null,D,D),N instanceof qh){const L=N;sl(e,t,r,o,l,L.beginCaptures,w),l.produce(o,w[0].end),m=w[0].end;const $=L.getContentName(t.content,w),z=D.pushAttributed($,e);if(o=o.withContentNameScopesList(z),L.endHasBackReferences&&(o=o.withEndRule(L.getEndWithResolvedBackReferences(t.content,w))),!k&&A.hasSameRuleAs(o)){o=o.pop(),l.produce(o,h),p=!0;return}}else if(N instanceof qu){const L=N;sl(e,t,r,o,l,L.beginCaptures,w),l.produce(o,w[0].end),m=w[0].end;const $=L.getContentName(t.content,w),z=D.pushAttributed($,e);if(o=o.withContentNameScopesList(z),L.whileHasBackReferences&&(o=o.withEndRule(L.getWhileWithResolvedBackReferences(t.content,w))),!k&&A.hasSameRuleAs(o)){o=o.pop(),l.produce(o,h),p=!0;return}}else if(sl(e,t,r,o,l,N.captures,w),l.produce(o,w[0].end),o=o.pop(),!k){o=o.safePop(),l.produce(o,h),p=!0;return}}w[0].end>a&&(a=w[0].end,r=!1)}}function l5(e,t,r,a,o,l){let u=o.beginRuleCapturedEOL?0:-1;const f=[];for(let h=o;h;h=h.pop()){const p=h.getRule(e);p instanceof qu&&f.push({rule:p,stack:h})}for(let h=f.pop();h;h=f.pop()){const{ruleScanner:p,findOptions:m}=f5(h.rule,e,h.stack.endRule,r,a===u),x=p.findNextMatchSync(t,a,m);if(x){if(x.ruleId!==T4){o=h.stack.pop();break}x.captureIndices&&x.captureIndices.length&&(l.produce(h.stack,x.captureIndices[0].start),sl(e,t,r,h.stack,l,h.rule.whileCaptures,x.captureIndices),l.produce(h.stack,x.captureIndices[0].end),u=x.captureIndices[0].end,x.captureIndices[0].end>a&&(a=x.captureIndices[0].end,r=!1))}else{o=h.stack.pop();break}}return{stack:o,linePos:a,anchorPosition:u,isFirstLine:r}}function c5(e,t,r,a,o,l){const u=u5(e,t,r,a,o,l),f=e.getInjections();if(f.length===0)return u;const h=d5(f,e,t,r,a,o,l);if(!h)return u;if(!u)return h;const p=u.captureIndices[0].start,m=h.captureIndices[0].start;return m<p||h.priorityMatch&&m===p?h:u}function u5(e,t,r,a,o,l){const u=o.getRule(e),{ruleScanner:f,findOptions:h}=M4(u,e,o.endRule,r,a===l),p=f.findNextMatchSync(t,a,h);return p?{captureIndices:p.captureIndices,matchedRuleId:p.ruleId}:null}function d5(e,t,r,a,o,l,u){let f=Number.MAX_VALUE,h=null,p,m=0;const x=l.contentNameScopesList.getScopeNames();for(let v=0,_=e.length;v<_;v++){const w=e[v];if(!w.matcher(x))continue;const S=t.getRule(w.ruleId),{ruleScanner:k,findOptions:N}=M4(S,t,null,a,o===u),A=k.findNextMatchSync(r,o,N);if(!A)continue;const E=A.captureIndices[0].start;if(!(E>=f)&&(f=E,h=A.captureIndices,p=A.ruleId,m=w.priority,f===o))break}return h?{priorityMatch:m===-1,captureIndices:h,matchedRuleId:p}:null}function M4(e,t,r,a,o){return{ruleScanner:e.compileAG(t,r,a,o),findOptions:0}}function f5(e,t,r,a,o){return{ruleScanner:e.compileWhileAG(t,r,a,o),findOptions:0}}function sl(e,t,r,a,o,l,u){if(l.length===0)return;const f=t.content,h=Math.min(l.length,u.length),p=[],m=u[0].end;for(let x=0;x<h;x++){const v=l[x];if(v===null)continue;const _=u[x];if(_.length===0)continue;if(_.start>m)break;for(;p.length>0&&p[p.length-1].endPos<=_.start;)o.produceFromScopes(p[p.length-1].scopes,p[p.length-1].endPos),p.pop();if(p.length>0?o.produceFromScopes(p[p.length-1].scopes,_.start):o.produce(a,_.start),v.retokenizeCapturedWithRuleId){const S=v.getName(f,u),k=a.contentNameScopesList.pushAttributed(S,e),N=v.getContentName(f,u),A=k.pushAttributed(N,e),E=a.push(v.retokenizeCapturedWithRuleId,_.start,-1,!1,null,k,A),D=e.createOnigString(f.substring(0,_.end));O4(e,D,r&&_.start===0,_.start,E,o,!1,0),A4(D);continue}const w=v.getName(f,u);if(w!==null){const k=(p.length>0?p[p.length-1].scopes:a.contentNameScopesList).pushAttributed(w,e);p.push(new p5(k,_.end))}}for(;p.length>0;)o.produceFromScopes(p[p.length-1].scopes,p[p.length-1].endPos),p.pop()}var p5=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function h5(e,t,r,a,o,l,u,f){return new g5(e,t,r,a,o,l,u,f)}function Av(e,t,r,a,o){const l=Hu(t,Gu),u=L4.getCompiledRuleId(r,a,o.repository);for(const f of l)e.push({debugSelector:t,matcher:f.matcher,ruleId:u,grammar:o,priority:f.priority})}function Gu(e,t){if(t.length<e.length)return!1;let r=0;return e.every(a=>{for(let o=r;o<t.length;o++)if(m5(t[o],a))return r=o+1,!0;return!1})}function m5(e,t){if(!e)return!1;if(e===t)return!0;const r=t.length;return e.length>r&&e.substr(0,r)===t&&e[r]==="."}var g5=class{constructor(e,t,r,a,o,l,u,f){if(this._rootScopeName=e,this.balancedBracketSelectors=l,this._onigLib=f,this._basicScopeAttributesProvider=new o5(r,a),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=u,this._grammar=Rv(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const h of Object.keys(o)){const p=Hu(h,Gu);for(const m of p)this._tokenTypeMatchers.push({matcher:m.matcher,type:o[h]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],r=this._rootScopeName,a=e.lookup(r);if(a){const o=a.injections;if(o)for(let u in o)Av(t,u,o[u],this,a);const l=this._grammarRepository.injections(r);l&&l.forEach(u=>{const f=this.getExternalGrammar(u);if(f){const h=f.injectionSelector;h&&Av(t,h,f,this,f)}})}return t.sort((o,l)=>o.priority-l.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,r=e(t);return this._ruleId2desc[t]=r,r}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const r=this._grammarRepository.lookup(e);if(r)return this._includedGrammars[e]=Rv(r,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,r=0){const a=this._tokenize(e,t,!1,r);return{tokens:a.lineTokens.getResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}tokenizeLine2(e,t,r=0){const a=this._tokenize(e,t,!0,r);return{tokens:a.lineTokens.getBinaryResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}_tokenize(e,t,r,a){this._rootId===-1&&(this._rootId=L4.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===Vh.NULL){o=!0;const p=this._basicScopeAttributesProvider.getDefaultAttributes(),m=this.themeProvider.getDefaults(),x=Ho.set(0,p.languageId,p.tokenType,null,m.fontStyle,m.foregroundId,m.backgroundId),v=this.getRule(this._rootId).getName(null,null);let _;v?_=dl.createRootAndLookUpScopeName(v,x,this):_=dl.createRoot("unknown",x),t=new Vh(null,this._rootId,-1,-1,!1,null,_,_)}else o=!1,t.reset();e=e+`
|
|
36
|
+
`;const l=this.createOnigString(e),u=l.content.length,f=new y5(r,e,this._tokenTypeMatchers,this.balancedBracketSelectors),h=O4(this,l,o,0,t,f,!0,a);return A4(l),{lineLength:u,lineTokens:f,ruleStack:h.stack,stoppedEarly:h.stoppedEarly}}};function Rv(e,t){return e=M3(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var dl=class qr{constructor(t,r,a){this.parent=t,this.scopePath=r,this.tokenAttributes=a}static fromExtension(t,r){let a=t,o=t?.scopePath??null;for(const l of r)o=rh.push(o,l.scopeNames),a=new qr(a,o,l.encodedTokenAttributes);return a}static createRoot(t,r){return new qr(null,new rh(null,t),r)}static createRootAndLookUpScopeName(t,r,a){const o=a.getMetadataForScope(t),l=new rh(null,t),u=a.themeProvider.themeMatch(l),f=qr.mergeAttributes(r,o,u);return new qr(null,l,f)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return qr.equals(this,t)}static equals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.scopeName!==r.scopeName||t.tokenAttributes!==r.tokenAttributes)return!1;t=t.parent,r=r.parent}while(!0)}static mergeAttributes(t,r,a){let o=-1,l=0,u=0;return a!==null&&(o=a.fontStyle,l=a.foregroundId,u=a.backgroundId),Ho.set(t,r.languageId,r.tokenType,null,o,l,u)}pushAttributed(t,r){if(t===null)return this;if(t.indexOf(" ")===-1)return qr._pushAttributed(this,t,r);const a=t.split(/ /g);let o=this;for(const l of a)o=qr._pushAttributed(o,l,r);return o}static _pushAttributed(t,r,a){const o=a.getMetadataForScope(r),l=t.scopePath.push(r),u=a.themeProvider.themeMatch(l),f=qr.mergeAttributes(t.tokenAttributes,o,u);return new qr(t,l,f)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const r=[];let a=this;for(;a&&a!==t;)r.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(a.parent?.scopePath??null)}),a=a.parent;return a===t?r.reverse():void 0}},Vh=class Ls{constructor(t,r,a,o,l,u,f,h){this.parent=t,this.ruleId=r,this.beginRuleCapturedEOL=l,this.endRule=u,this.nameScopesList=f,this.contentNameScopesList=h,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new Ls(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Ls._equals(this,t)}static _equals(t,r){return t===r?!0:this._structuralEquals(t,r)?dl.equals(t.contentNameScopesList,r.contentNameScopesList):!1}static _structuralEquals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.depth!==r.depth||t.ruleId!==r.ruleId||t.endRule!==r.endRule)return!1;t=t.parent,r=r.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Ls._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,r,a,o,l,u,f){return new Ls(this,t,r,a,o,l,u,f)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,r){return this.parent&&(r=this.parent._writeString(t,r)),t[r++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,r}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Ls(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let r=this;for(;r&&r._enterPos===t._enterPos;){if(r.ruleId===t.ruleId)return!0;r=r.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,r){const a=dl.fromExtension(t?.nameScopesList??null,r.nameScopesList);return new Ls(t,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,a,dl.fromExtension(a,r.contentNameScopesList))}},x5=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(r=>r==="*"?(this.allowAny=!0,[]):Hu(r,Gu).map(a=>a.matcher)),this.unbalancedBracketScopes=t.flatMap(r=>Hu(r,Gu).map(a=>a.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},y5=class{constructor(e,t,r,a){this.balancedBracketSelectors=a,this._emitBinaryTokens=e,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let a=e?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const l=e?.getScopeNames()??[];for(const u of this._tokenTypeOverrides)u.matcher(l)&&(a=Ho.set(a,0,u.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(l))}if(o&&(a=Ho.set(a,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(a),this._lastTokenEndIndex=t;return}const r=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:r}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const r=new Uint32Array(this._binaryTokens.length);for(let a=0,o=this._binaryTokens.length;a<o;a++)r[a]=this._binaryTokens[a];return r}},b5=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,r,a,o){if(!this._grammars.has(e)){let l=this._rawGrammars.get(e);if(!l)return null;this._grammars.set(e,h5(e,l,t,r,a,o,this,this._onigLib))}return this._grammars.get(e)}},v5=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new b5(Pu.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,r){this._syncRegistry.setTheme(Pu.createFromRawTheme(t,r))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,r,a){return this.loadGrammarWithConfiguration(t,r,{embeddedLanguages:a})}loadGrammarWithConfiguration(t,r,a){return this._loadGrammar(t,r,a.embeddedLanguages,a.tokenTypes,new x5(a.balancedBracketSelectors||[],a.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,r,a,o,l){const u=new X3(this._syncRegistry,t);for(;u.Q.length>0;)u.Q.map(f=>this._loadSingleGrammar(f.scopeName)),u.processQueue();return this._grammarForScopeName(t,r,a,o,l)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const r=this._options.loadGrammar(t);if(r){const a=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(r,a)}}addGrammar(t,r=[],a=0,o=null){return this._syncRegistry.addGrammar(t,r),this._grammarForScopeName(t.scopeName,a,o)}_grammarForScopeName(t,r=0,a=null,o=null,l=null){return this._syncRegistry.grammarForScopeName(t,r,a,o,l)}},Yh=Vh.NULL;function Vu(e,t){const r=typeof e=="string"?{}:{...e.colorReplacements},a=typeof e=="string"?e:e.name;for(const[o,l]of Object.entries(t?.colorReplacements||{}))typeof l=="string"?r[o]=l:o===a&&Object.assign(r,l);return r}function us(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function _5(e){return Array.isArray(e)?e:[e]}async function z4(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function ud(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Rm(e){return e==="ansi"||ud(e)}function dd(e){return e==="none"}function $4(e){return dd(e)}function fd(e,t=!1){if(e.length===0)return[["",0]];const r=e.split(/(\r?\n)/g);let a=0;const o=[];for(let l=0;l<r.length;l+=2){const u=t?r[l]+(r[l+1]||""):r[l];o.push([u,a]),a+=r[l].length,a+=r[l+1]?.length||0}return o}const Tv={light:"#333333",dark:"#bbbbbb"},Lv={light:"#fffffe",dark:"#1e1e1e"},Dv="__shiki_resolved";function Tm(e){if(e?.[Dv])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:r,fg:a}=t;if(!r||!a){const f=t.settings?t.settings.find(h=>!h.name&&!h.scope):void 0;f?.settings?.foreground&&(a=f.settings.foreground),f?.settings?.background&&(r=f.settings.background),!a&&t?.colors?.["editor.foreground"]&&(a=t.colors["editor.foreground"]),!r&&t?.colors?.["editor.background"]&&(r=t.colors["editor.background"]),a||(a=t.type==="light"?Tv.light:Tv.dark),r||(r=t.type==="light"?Lv.light:Lv.dark),t.fg=a,t.bg=r}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0;const l=new Map;function u(f){if(l.has(f))return l.get(f);o+=1;const h=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${h}`]?u(f):(l.set(f,h),h)}t.settings=t.settings.map(f=>{const h=f.settings?.foreground&&!f.settings.foreground.startsWith("#"),p=f.settings?.background&&!f.settings.background.startsWith("#");if(!h&&!p)return f;const m={...f,settings:{...f.settings}};if(h){const x=u(f.settings.foreground);t.colorReplacements[x]=f.settings.foreground,m.settings.foreground=x}if(p){const x=u(f.settings.background);t.colorReplacements[x]=f.settings.background,m.settings.background=x}return m});for(const f of Object.keys(t.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!t.colors[f]?.startsWith("#")){const h=u(t.colors[f]);t.colorReplacements[h]=t.colors[f],t.colors[f]=h}return Object.defineProperty(t,Dv,{enumerable:!1,writable:!1,value:!0}),t}async function B4(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Rm(t)).map(async t=>await z4(t).then(r=>Array.isArray(r)?r:[r])))).flat()))}async function I4(e){return(await Promise.all(e.map(async t=>$4(t)?null:Tm(await z4(t))))).filter(t=>!!t)}function U4(e,t){if(!t)return e;if(t[e]){const r=new Set([e]);for(;t[e];){if(e=t[e],r.has(e))throw new Rt(`Circular alias \`${Array.from(r).join(" -> ")} -> ${e}\``);r.add(e)}}return e}var w5=class extends v5{_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,r,a={}){super(e),this._resolver=e,this._themes=t,this._langs=r,this._alias=a,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=Tm(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Pu.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=U4(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const a=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(a.name=e.name,this._resolvedGrammars.set(e.name,a),e.aliases&&e.aliases.forEach(o=>{this._alias[o]=e.name}),this._loadedLanguagesCache=null,t.size)for(const o of t)this._resolvedGrammars.delete(o.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(o.scopeName),this._syncRegistry?._grammars?.delete(o.scopeName),this.loadLanguage(this._langMap.get(o.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const a of e)this.resolveEmbeddedLanguages(a);const t=Array.from(this._langGraph.entries()),r=t.filter(([a,o])=>!o);if(r.length){const a=t.filter(([o,l])=>l?(l.embeddedLanguages||l.embeddedLangs)?.some(u=>r.map(([f])=>f).includes(u)):!1).filter(o=>!r.includes(o));throw new Rt(`Missing languages ${r.map(([o])=>`\`${o}\``).join(", ")}, required by ${a.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[a,o]of t)this._resolver.addLanguage(o);for(const[a,o]of t)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const r of t)this._langGraph.set(r,this._langMap.get(r))}},S5=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},t.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let r=[];for(let a=1;a<=t.length;a++){const o=t.slice(0,a).join(".");r=[...r,...this._injections.get(o)||[]]}return r}};let Yi=0;function j5(e){Yi+=1,e.warnings!==!1&&Yi>=10&&Yi%10===0&&console.warn(`[Shiki] ${Yi} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Rt("`engine` option is required for synchronous mode");const r=(e.langs||[]).flat(1),a=(e.themes||[]).flat(1).map(Tm),o=new w5(new S5(e.engine,r),a,r,e.langAlias);let l;function u(A){return U4(A,e.langAlias)}function f(A){k();const E=o.getGrammar(typeof A=="string"?A:A.name);if(!E)throw new Rt(`Language \`${A}\` not found, you may need to load it first`);return E}function h(A){if(A==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};k();const E=o.getTheme(A);if(!E)throw new Rt(`Theme \`${A}\` not found, you may need to load it first`);return E}function p(A){k();const E=h(A);return l!==A&&(o.setTheme(E),l=A),{theme:E,colorMap:o.getColorMap()}}function m(){return k(),o.getLoadedThemes()}function x(){return k(),o.getLoadedLanguages()}function v(...A){k(),o.loadLanguages(A.flat(1))}async function _(...A){return v(await B4(A))}function w(...A){k();for(const E of A.flat(1))o.loadTheme(E)}async function S(...A){return k(),w(await I4(A))}function k(){if(t)throw new Rt("Shiki instance has been disposed")}function N(){t||(t=!0,o.dispose(),Yi-=1)}return{setTheme:p,getTheme:h,getLanguage:f,getLoadedThemes:m,getLoadedLanguages:x,resolveLangAlias:u,loadLanguage:_,loadLanguageSync:v,loadTheme:S,loadThemeSync:w,dispose:N,[Symbol.dispose]:N}}async function k5(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,r,a]=await Promise.all([I4(e.themes||[]),B4(e.langs||[]),e.engine]);return j5({...e,themes:t,langs:r,engine:a})}const P4=new WeakMap;function pd(e,t){P4.set(e,t)}function Sl(e){return P4.get(e)}var hd=class H4{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,r){return new H4(Object.fromEntries(_5(r).map(a=>[a,Yh])),t)}constructor(...t){if(t.length===2){const[r,a]=t;this.lang=a,this._stacks=r}else{const[r,a,o]=t;this.lang=a,this._stacks={[o]:r}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return N5(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function N5(e){const t=[],r=new Set;function a(o){if(r.has(o))return;r.add(o);const l=o?.nameScopesList?.scopeName;l&&t.push(l),o.parent&&a(o.parent)}return a(e),t}function E5(e,t){if(!(e instanceof hd))throw new Rt("Invalid grammar state");return e.getInternalStack(t)}function F4(e,t,r={}){const{theme:a=e.getLoadedThemes()[0]}=r;if(ud(e.resolveLangAlias(r.lang||"text"))||dd(a))return fd(t).map(f=>[{content:f[0],offset:f[1]}]);const{theme:o,colorMap:l}=e.setTheme(a),u=e.getLanguage(r.lang||"text");if(r.grammarState){if(r.grammarState.lang!==u.name)throw new Rt(`Grammar state language "${r.grammarState.lang}" does not match highlight language "${u.name}"`);if(!r.grammarState.themes.includes(o.name))throw new Rt(`Grammar state themes "${r.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return A5(t,u,o,l,r)}function C5(...e){if(e.length===2)return Sl(e[1]);const[t,r,a={}]=e,{lang:o="text",theme:l=t.getLoadedThemes()[0]}=a;if(ud(o)||dd(l))throw new Rt("Plain language does not have grammar state");if(o==="ansi")throw new Rt("ANSI language does not have grammar state");const{theme:u,colorMap:f}=t.setTheme(l),h=t.getLanguage(o);return new hd(Lm(r,h,u,f,a).stateStack,h.name,u.name)}function A5(e,t,r,a,o){const l=Lm(e,t,r,a,o),u=new hd(l.stateStack,t.name,r.name);return pd(l.tokens,u),l.tokens}function Lm(e,t,r,a,o){const l=Vu(r,o),{tokenizeMaxLineLength:u=0,tokenizeTimeLimit:f=500}=o,h=fd(e);let p=o.grammarState?E5(o.grammarState,r.name)??Yh:o.grammarContextCode!=null?Lm(o.grammarContextCode,t,r,a,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:Yh,m=[];const x=[];for(let v=0,_=h.length;v<_;v++){const[w,S]=h[v];if(w===""){m=[],x.push([]);continue}if(u>0&&w.length>=u){m=[],x.push([{content:w,offset:S,color:"",fontStyle:0}]);continue}let k,N,A;o.includeExplanation&&(k=t.tokenizeLine(w,p,f),N=k.tokens,A=0);const E=t.tokenizeLine2(w,p,f),D=E.tokens.length/2;for(let L=0;L<D;L++){const $=E.tokens[2*L],z=L+1<D?E.tokens[2*L+2]:w.length;if($===z)continue;const R=E.tokens[2*L+1],B=us(a[Ho.getForeground(R)],l),H=Ho.getFontStyle(R),J={content:w.substring($,z),offset:S+$,color:B,fontStyle:H};if(o.includeExplanation){const oe=[];if(o.includeExplanation!=="scopeName")for(const M of r.settings){let P;switch(typeof M.scope){case"string":P=M.scope.split(/,/).map(T=>T.trim());break;case"object":P=M.scope;break;default:continue}oe.push({settings:M,selectors:P.map(T=>T.split(/ /))})}J.explanation=[];let ce=0;for(;$+ce<z;){const M=N[A],P=w.substring(M.startIndex,M.endIndex);ce+=P.length,J.explanation.push({content:P,scopes:o.includeExplanation==="scopeName"?R5(M.scopes):T5(oe,M.scopes)}),A+=1}}m.push(J)}x.push(m),m=[],p=E.ruleStack}return{tokens:x,stateStack:p}}function R5(e){return e.map(t=>({scopeName:t}))}function T5(e,t){const r=[];for(let a=0,o=t.length;a<o;a++){const l=t[a];r[a]={scopeName:l,themeMatches:D5(e,l,t.slice(0,a))}}return r}function Ov(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function L5(e,t,r){if(!Ov(e[e.length-1],t))return!1;let a=e.length-2,o=r.length-1;for(;a>=0&&o>=0;)Ov(e[a],r[o])&&(a-=1),o-=1;return a===-1}function D5(e,t,r){const a=[];for(const{selectors:o,settings:l}of e)for(const u of o)if(L5(u,t,r)){a.push(l);break}return a}function q4(e,t,r,a=F4){const o=Object.entries(r.themes).filter(p=>p[1]).map(p=>({color:p[0],theme:p[1]})),l=o.map(p=>{const m=a(e,t,{...r,theme:p.theme});return{tokens:m,state:Sl(m),theme:typeof p.theme=="string"?p.theme:p.theme.name}}),u=O5(...l.map(p=>p.tokens)),f=u[0].map((p,m)=>p.map((x,v)=>{const _={content:x.content,variants:{},offset:x.offset};return"includeExplanation"in r&&r.includeExplanation&&(_.explanation=x.explanation),u.forEach((w,S)=>{const{content:k,explanation:N,offset:A,...E}=w[m][v];_.variants[o[S].color]=E}),_})),h=l[0].state?new hd(Object.fromEntries(l.map(p=>[p.theme,p.state?.getInternalStack(p.theme)])),l[0].state.lang):void 0;return h&&pd(f,h),f}function O5(...e){const t=e.map(()=>[]),r=e.length;for(let a=0;a<e[0].length;a++){const o=e.map(h=>h[a]),l=t.map(()=>[]);t.forEach((h,p)=>h.push(l[p]));const u=o.map(()=>0),f=o.map(h=>h[0]);for(;f.every(h=>h);){const h=Math.min(...f.map(p=>p.content.length));for(let p=0;p<r;p++){const m=f[p];m.content.length===h?(l[p].push(m),u[p]+=1,f[p]=o[p][u[p]]):(l[p].push({...m,content:m.content.slice(0,h)}),f[p]={...m,content:m.content.slice(h),offset:m.offset+h})}}}return t}const M5=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Mv={}.hasOwnProperty;function z5(e,t){const r=t||{};function a(o,...l){let u=a.invalid;const f=a.handlers;if(o&&Mv.call(o,e)){const h=String(o[e]);u=Mv.call(f,h)?f[h]:a.unknown}if(u)return u.call(this,o,...l)}return a.handlers=r.handlers||{},a.invalid=r.invalid,a.unknown=r.unknown,a}const $5=/["&'<>`]/g,B5=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,I5=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,U5=/[|\\{}()[\]^$+*?.]/g,zv=new WeakMap;function P5(e,t){if(e=e.replace(t.subset?H5(t.subset):$5,a),t.subset||t.escapeOnly)return e;return e.replace(B5,r).replace(I5,a);function r(o,l,u){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,u.charCodeAt(l+2),t)}function a(o,l,u){return t.format(o.charCodeAt(0),u.charCodeAt(l+1),t)}}function H5(e){let t=zv.get(e);return t||(t=F5(e),zv.set(e,t)),t}function F5(e){const t=[];let r=-1;for(;++r<e.length;)t.push(e[r].replace(U5,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const q5=/[\dA-Fa-f]/;function G5(e,t,r){const a="&#x"+e.toString(16).toUpperCase();return r&&t&&!q5.test(String.fromCharCode(t))?a:a+";"}const V5=/\d/;function Y5(e,t,r){const a="&#"+String(e);return r&&t&&!V5.test(String.fromCharCode(t))?a:a+";"}const K5=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],sh={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},X5=["cent","copy","divide","gt","lt","not","para","times"],G4={}.hasOwnProperty,Kh={};let du;for(du in sh)G4.call(sh,du)&&(Kh[sh[du]]=du);const Q5=/[^\dA-Za-z]/;function Z5(e,t,r,a){const o=String.fromCharCode(e);if(G4.call(Kh,o)){const l=Kh[o],u="&"+l;return r&&K5.includes(l)&&!X5.includes(l)&&(!a||t&&t!==61&&Q5.test(String.fromCharCode(t)))?u:u+";"}return""}function J5(e,t,r){let a=G5(e,t,r.omitOptionalSemicolons),o;if((r.useNamedReferences||r.useShortestReferences)&&(o=Z5(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!o)&&r.useShortestReferences){const l=Y5(e,t,r.omitOptionalSemicolons);l.length<a.length&&(a=l)}return o&&(!r.useShortestReferences||o.length<a.length)?o:a}function Bo(e,t){return P5(e,Object.assign({format:J5},t))}const W5=/^>|^->|<!--|-->|--!>|<!-$/g,eL=[">"],tL=["<",">"];function nL(e,t,r,a){return a.settings.bogusComments?"<?"+Bo(e.value,Object.assign({},a.settings.characterReferences,{subset:eL}))+">":"<!--"+e.value.replace(W5,o)+"-->";function o(l){return Bo(l,Object.assign({},a.settings.characterReferences,{subset:tL}))}}function rL(e,t,r,a){return"<!"+(a.settings.upperDoctype?"DOCTYPE":"doctype")+(a.settings.tightDoctype?"":" ")+"html>"}function $v(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,o=r.indexOf(t);for(;o!==-1;)a++,o=r.indexOf(t,o+t.length);return a}const cn=Y4(1),V4=Y4(-1),aL=[];function Y4(e){return t;function t(r,a,o){const l=r?r.children:aL;let u=(a||0)+e,f=l[u];if(!o)for(;f&&cd(f);)u+=e,f=l[u];return f}}const sL={}.hasOwnProperty;function K4(e){return t;function t(r,a,o){return sL.call(e,r.tagName)&&e[r.tagName](r,a,o)}}const Dm=K4({body:iL,caption:oh,colgroup:oh,dd:dL,dt:uL,head:oh,html:oL,li:cL,optgroup:fL,option:pL,p:lL,rp:Bv,rt:Bv,tbody:mL,td:Iv,tfoot:gL,th:Iv,thead:hL,tr:xL});function oh(e,t,r){const a=cn(r,t,!0);return!a||a.type!=="comment"&&!(a.type==="text"&&cd(a.value.charAt(0)))}function oL(e,t,r){const a=cn(r,t);return!a||a.type!=="comment"}function iL(e,t,r){const a=cn(r,t);return!a||a.type!=="comment"}function lL(e,t,r){const a=cn(r,t);return a?a.type==="element"&&(a.tagName==="address"||a.tagName==="article"||a.tagName==="aside"||a.tagName==="blockquote"||a.tagName==="details"||a.tagName==="div"||a.tagName==="dl"||a.tagName==="fieldset"||a.tagName==="figcaption"||a.tagName==="figure"||a.tagName==="footer"||a.tagName==="form"||a.tagName==="h1"||a.tagName==="h2"||a.tagName==="h3"||a.tagName==="h4"||a.tagName==="h5"||a.tagName==="h6"||a.tagName==="header"||a.tagName==="hgroup"||a.tagName==="hr"||a.tagName==="main"||a.tagName==="menu"||a.tagName==="nav"||a.tagName==="ol"||a.tagName==="p"||a.tagName==="pre"||a.tagName==="section"||a.tagName==="table"||a.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"))}function cL(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&a.tagName==="li"}function uL(e,t,r){const a=cn(r,t);return!!(a&&a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd"))}function dL(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd")}function Bv(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&(a.tagName==="rp"||a.tagName==="rt")}function fL(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&a.tagName==="optgroup"}function pL(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&(a.tagName==="option"||a.tagName==="optgroup")}function hL(e,t,r){const a=cn(r,t);return!!(a&&a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot"))}function mL(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot")}function gL(e,t,r){return!cn(r,t)}function xL(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&a.tagName==="tr"}function Iv(e,t,r){const a=cn(r,t);return!a||a.type==="element"&&(a.tagName==="td"||a.tagName==="th")}const yL=K4({body:_L,colgroup:wL,head:vL,html:bL,tbody:SL});function bL(e){const t=cn(e,-1);return!t||t.type!=="comment"}function vL(e){const t=new Set;for(const a of e.children)if(a.type==="element"&&(a.tagName==="base"||a.tagName==="title")){if(t.has(a.tagName))return!1;t.add(a.tagName)}const r=e.children[0];return!r||r.type==="element"}function _L(e){const t=cn(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&cd(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function wL(e,t,r){const a=V4(r,t),o=cn(e,-1,!0);return r&&a&&a.type==="element"&&a.tagName==="colgroup"&&Dm(a,r.children.indexOf(a),r)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function SL(e,t,r){const a=V4(r,t),o=cn(e,-1);return r&&a&&a.type==="element"&&(a.tagName==="thead"||a.tagName==="tbody")&&Dm(a,r.children.indexOf(a),r)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const fu={name:[[`
|
|
37
|
+
\f\r &/=>`.split(""),`
|
|
38
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
39
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
40
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
41
|
+
\f\r &>`.split(""),`\0
|
|
42
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
43
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
44
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function jL(e,t,r,a){const o=a.schema,l=o.space==="svg"?!1:a.settings.omitOptionalTags;let u=o.space==="svg"?a.settings.closeEmptyElements:a.settings.voids.includes(e.tagName.toLowerCase());const f=[];let h;o.space==="html"&&e.tagName==="svg"&&(a.schema=Ul);const p=kL(a,e.properties),m=a.all(o.space==="html"&&e.tagName==="template"?e.content:e);return a.schema=o,m&&(u=!1),(p||!l||!yL(e,t,r))&&(f.push("<",e.tagName,p?" "+p:""),u&&(o.space==="svg"||a.settings.closeSelfClosing)&&(h=p.charAt(p.length-1),(!a.settings.tightSelfClosing||h==="/"||h&&h!=='"'&&h!=="'")&&f.push(" "),f.push("/")),f.push(">")),f.push(m),!u&&(!l||!Dm(e,t,r))&&f.push("</"+e.tagName+">"),f.join("")}function kL(e,t){const r=[];let a=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const l=NL(e,o,t[o]);l&&r.push(l)}}for(;++a<r.length;){const l=e.settings.tightAttributes?r[a].charAt(r[a].length-1):void 0;a!==r.length-1&&l!=='"'&&l!=="'"&&(r[a]+=" ")}return r.join("")}function NL(e,t,r){const a=h4(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,l=e.settings.allowDangerousCharacters?0:1;let u=e.quote,f;if(a.overloadedBoolean&&(r===a.attribute||r==="")?r=!0:(a.boolean||a.overloadedBoolean)&&(typeof r!="string"||r===a.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const h=Bo(a.attribute,Object.assign({},e.settings.characterReferences,{subset:fu.name[o][l]}));return r===!0||(r=Array.isArray(r)?(a.commaSeparated?o4:g4)(r,{padLeft:!e.settings.tightCommaSeparatedLists}):String(r),e.settings.collapseEmptyAttributes&&!r)?h:(e.settings.preferUnquoted&&(f=Bo(r,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:fu.unquoted[o][l]}))),f!==r&&(e.settings.quoteSmart&&$v(r,u)>$v(r,e.alternative)&&(u=e.alternative),f=u+Bo(r,Object.assign({},e.settings.characterReferences,{subset:(u==="'"?fu.single:fu.double)[o][l],attribute:!0}))+u),h+(f&&"="+f))}const EL=["<","&"];function X4(e,t,r,a){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?e.value:Bo(e.value,Object.assign({},a.settings.characterReferences,{subset:EL}))}function CL(e,t,r,a){return a.settings.allowDangerousHtml?e.value:X4(e,t,r,a)}function AL(e,t,r,a){return a.all(e)}const RL=z5("type",{invalid:TL,unknown:LL,handlers:{comment:nL,doctype:rL,element:jL,raw:CL,root:AL,text:X4}});function TL(e){throw new Error("Expected node, not `"+e+"`")}function LL(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const DL={},OL={},ML=[];function zL(e,t){const r=t||DL,a=r.quote||'"',o=a==='"'?"'":'"';if(a!=='"'&&a!=="'")throw new Error("Invalid quote `"+a+"`, expected `'` or `\"`");return{one:$L,all:BL,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||M5,characterReferences:r.characterReferences||OL,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?Ul:m4,quote:a,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function $L(e,t,r){return RL(e,t,r,this)}function BL(e){const t=[],r=e&&e.children||ML;let a=-1;for(;++a<r.length;)t[a]=this.one(r[a],a,e);return t.join("")}function Q4(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const r=Array.isArray(t)?t:t.split(/\s+/g);for(const a of r)a&&!e.properties.class.includes(a)&&e.properties.class.push(a);return e}function IL(e){const t=fd(e,!0).map(([o])=>o);function r(o){if(o===e.length)return{line:t.length-1,character:t[t.length-1].length};let l=o,u=0;for(const f of t){if(l<f.length)break;l-=f.length,u++}return{line:u,character:l}}function a(o,l){let u=0;for(let f=0;f<o;f++)u+=t[f].length;return u+=l,u}return{lines:t,indexToPos:r,posToIndex:a}}function Z4(e,t,r){const a=new Set;for(const l of e.matchAll(/:?lang=["']([^"']+)["']/g)){const u=l[1].toLowerCase().trim();u&&a.add(u)}for(const l of e.matchAll(/(?:```|~~~)([\w-]+)/g)){const u=l[1].toLowerCase().trim();u&&a.add(u)}for(const l of e.matchAll(/\\begin\{([\w-]+)\}/g)){const u=l[1].toLowerCase().trim();u&&a.add(u)}for(const l of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){const u=l[1].toLowerCase().trim(),f=u.includes("/")?u.split("/").pop():u;f&&a.add(f)}if(!r)return Array.from(a);const o=r.getBundledLanguages();return Array.from(a).filter(l=>l&&o[l])}const Om="light-dark()",UL=["color","background-color"];function PL(e,t){let r=0;const a=[];for(const o of t)o>r&&a.push({...e,content:e.content.slice(r,o),offset:e.offset+r}),r=o;return r<e.content.length&&a.push({...e,content:e.content.slice(r),offset:e.offset+r}),a}function HL(e,t){const r=Array.from(t instanceof Set?t:new Set(t)).sort((a,o)=>a-o);return r.length?e.map(a=>a.flatMap(o=>{const l=r.filter(u=>o.offset<u&&u<o.offset+o.content.length).map(u=>u-o.offset).sort((u,f)=>u-f);return l.length?PL(o,l):o})):e}function FL(e,t,r,a,o="css-vars"){const l={content:e.content,explanation:e.explanation,offset:e.offset},u=t.map(m=>Yu(e.variants[m])),f=new Set(u.flatMap(m=>Object.keys(m))),h={},p=(m,x)=>{const v=x==="color"?"":x==="background-color"?"-bg":`-${x}`;return r+t[m]+(x==="color"?"":v)};return u.forEach((m,x)=>{for(const v of f){const _=m[v]||"inherit";if(x===0&&a&&UL.includes(v))if(a===Om&&u.length>1){const w=t.findIndex(k=>k==="light"),S=t.findIndex(k=>k==="dark");if(w===-1||S===-1)throw new Rt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');h[v]=`light-dark(${u[w][v]||"inherit"}, ${u[S][v]||"inherit"})`,o==="css-vars"&&(h[p(x,v)]=_)}else h[v]=_;else o==="css-vars"&&(h[p(x,v)]=_)}}),l.htmlStyle=h,l}function Yu(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Nn.Italic&&(t["font-style"]="italic"),e.fontStyle&Nn.Bold&&(t["font-weight"]="bold");const r=[];e.fontStyle&Nn.Underline&&r.push("underline"),e.fontStyle&Nn.Strikethrough&&r.push("line-through"),r.length&&(t["text-decoration"]=r.join(" "))}return t}function Xh(e){return typeof e=="string"?e:Object.entries(e).map(([t,r])=>`${t}:${r}`).join(";")}function qL(){const e=new WeakMap;function t(r){if(!e.has(r.meta)){let o=function(u){if(typeof u=="number"){if(u<0||u>r.source.length)throw new Rt(`Invalid decoration offset: ${u}. Code length: ${r.source.length}`);return{...a.indexToPos(u),offset:u}}else{const f=a.lines[u.line];if(f===void 0)throw new Rt(`Invalid decoration position ${JSON.stringify(u)}. Lines length: ${a.lines.length}`);let h=u.character;if(h<0&&(h=f.length+h),h<0||h>f.length)throw new Rt(`Invalid decoration position ${JSON.stringify(u)}. Line ${u.line} length: ${f.length}`);return{...u,character:h,offset:a.posToIndex(u.line,h)}}};const a=IL(r.source),l=(r.options.decorations||[]).map(u=>({...u,start:o(u.start),end:o(u.end)}));GL(l),e.set(r.meta,{decorations:l,converter:a,source:r.source})}return e.get(r.meta)}return{name:"shiki:decorations",tokens(r){if(this.options.decorations?.length)return HL(r,t(this).decorations.flatMap(a=>[a.start.offset,a.end.offset]))},code(r){if(!this.options.decorations?.length)return;const a=t(this),o=Array.from(r.children).filter(m=>m.type==="element"&&m.tagName==="span");if(o.length!==a.converter.lines.length)throw new Rt(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${a.converter.lines.length}). Failed to apply decorations.`);function l(m,x,v,_){const w=o[m];let S="",k=-1,N=-1;if(x===0&&(k=0),v===0&&(N=0),v===Number.POSITIVE_INFINITY&&(N=w.children.length),k===-1||N===-1)for(let E=0;E<w.children.length;E++)S+=J4(w.children[E]),k===-1&&S.length===x&&(k=E+1),N===-1&&S.length===v&&(N=E+1);if(k===-1)throw new Rt(`Failed to find start index for decoration ${JSON.stringify(_.start)}`);if(N===-1)throw new Rt(`Failed to find end index for decoration ${JSON.stringify(_.end)}`);const A=w.children.slice(k,N);if(!_.alwaysWrap&&A.length===w.children.length)f(w,_,"line");else if(!_.alwaysWrap&&A.length===1&&A[0].type==="element")f(A[0],_,"token");else{const E={type:"element",tagName:"span",properties:{},children:A};f(E,_,"wrapper"),w.children.splice(k,A.length,E)}}function u(m,x){o[m]=f(o[m],x,"line")}function f(m,x,v){const _=x.properties||{},w=x.transform||(S=>S);return m.tagName=x.tagName||"span",m.properties={...m.properties,..._,class:m.properties.class},x.properties?.class&&Q4(m,x.properties.class),m=w(m,v)||m,m}const h=[],p=a.decorations.sort((m,x)=>x.start.offset-m.start.offset||m.end.offset-x.end.offset);for(const m of p){const{start:x,end:v}=m;if(x.line===v.line)l(x.line,x.character,v.character,m);else if(x.line<v.line){l(x.line,x.character,Number.POSITIVE_INFINITY,m);for(let _=x.line+1;_<v.line;_++)h.unshift(()=>u(_,m));l(v.line,0,v.character,m)}}h.forEach(m=>m())}}}function GL(e){for(let t=0;t<e.length;t++){const r=e[t];if(r.start.offset>r.end.offset)throw new Rt(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let a=t+1;a<e.length;a++){const o=e[a],l=r.start.offset<=o.start.offset&&o.start.offset<r.end.offset,u=r.start.offset<o.end.offset&&o.end.offset<=r.end.offset,f=o.start.offset<=r.start.offset&&r.start.offset<o.end.offset,h=o.start.offset<r.end.offset&&r.end.offset<=o.end.offset;if(l||u||f||h){if(l&&u||f&&h||f&&r.start.offset===r.end.offset||u&&o.start.offset===o.end.offset)continue;throw new Rt(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function J4(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(J4).join(""):""}const VL=[qL()];function Ku(e){const t=YL(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...VL]}function YL(e){const t=[],r=[],a=[];for(const o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":r.push(o);break;default:a.push(o)}return{pre:t,post:r,normal:a}}var Ms=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],ih={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function KL(e,t){const r=e.indexOf("\x1B",t);if(r!==-1&&e[r+1]==="["){const a=e.indexOf("m",r);if(a!==-1)return{sequence:e.substring(r+2,a).split(";"),startPosition:r,position:a+1}}return{position:e.length}}function Uv(e){const t=e.shift();if(t==="2"){const r=e.splice(0,3).map(a=>Number.parseInt(a));return r.length!==3||r.some(a=>Number.isNaN(a))?void 0:{type:"rgb",rgb:r}}else if(t==="5"){const r=e.shift();if(r)return{type:"table",index:Number(r)}}}function XL(e){const t=[];for(;e.length>0;){const r=e.shift();if(!r)continue;const a=Number.parseInt(r);if(!Number.isNaN(a))if(a===0)t.push({type:"resetAll"});else if(a<=9)ih[a]&&t.push({type:"setDecoration",value:ih[a]});else if(a<=29){const o=ih[a-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(a<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Ms[a-30]}});else if(a===38){const o=Uv(e);o&&t.push({type:"setForegroundColor",value:o})}else if(a===39)t.push({type:"resetForegroundColor"});else if(a<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Ms[a-40]}});else if(a===48){const o=Uv(e);o&&t.push({type:"setBackgroundColor",value:o})}else a===49?t.push({type:"resetBackgroundColor"}):a===53?t.push({type:"setDecoration",value:"overline"}):a===55?t.push({type:"resetDecoration",value:"overline"}):a>=90&&a<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Ms[a-90+8]}}):a>=100&&a<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Ms[a-100+8]}})}return t}function QL(){let e=null,t=null,r=new Set;return{parse(a){const o=[];let l=0;do{const u=KL(a,l),f=u.sequence?a.substring(l,u.startPosition):a.substring(l);if(f.length>0&&o.push({value:f,foreground:e,background:t,decorations:new Set(r)}),u.sequence){const h=XL(u.sequence);for(const p of h)p.type==="resetAll"?(e=null,t=null,r.clear()):p.type==="resetForegroundColor"?e=null:p.type==="resetBackgroundColor"?t=null:p.type==="resetDecoration"&&r.delete(p.value);for(const p of h)p.type==="setForegroundColor"?e=p.value:p.type==="setBackgroundColor"?t=p.value:p.type==="setDecoration"&&r.add(p.value)}l=u.position}while(l<a.length);return o}}}var ZL={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function JL(e=ZL){function t(f){return e[f]}function r(f){return`#${f.map(h=>Math.max(0,Math.min(h,255)).toString(16).padStart(2,"0")).join("")}`}let a;function o(){if(a)return a;a=[];for(let p=0;p<Ms.length;p++)a.push(t(Ms[p]));let f=[0,95,135,175,215,255];for(let p=0;p<6;p++)for(let m=0;m<6;m++)for(let x=0;x<6;x++)a.push(r([f[p],f[m],f[x]]));let h=8;for(let p=0;p<24;p++,h+=10)a.push(r([h,h,h]));return a}function l(f){return o()[f]}function u(f){switch(f.type){case"named":return t(f.name);case"rgb":return r(f.rgb);case"table":return l(f.index)}}return{value:u}}const WL={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function eD(e,t,r){const a=Vu(e,r),o=fd(t),l=JL(Object.fromEntries(Ms.map(f=>{const h=`terminal.ansi${f[0].toUpperCase()}${f.substring(1)}`;return[f,e.colors?.[h]||WL[f]]}))),u=QL();return o.map(f=>u.parse(f[0]).map(h=>{let p,m;h.decorations.has("reverse")?(p=h.background?l.value(h.background):e.bg,m=h.foreground?l.value(h.foreground):e.fg):(p=h.foreground?l.value(h.foreground):e.fg,m=h.background?l.value(h.background):void 0),p=us(p,a),m=us(m,a),h.decorations.has("dim")&&(p=tD(p));let x=Nn.None;return h.decorations.has("bold")&&(x|=Nn.Bold),h.decorations.has("italic")&&(x|=Nn.Italic),h.decorations.has("underline")&&(x|=Nn.Underline),h.decorations.has("strikethrough")&&(x|=Nn.Strikethrough),{content:h.value,offset:f[1],color:p,bgColor:m,fontStyle:x}}))}function tD(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const a=t[1];if(a.length===8){const o=Math.round(Number.parseInt(a.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${a.slice(0,6)}${o}`}else{if(a.length===6)return`#${a}80`;if(a.length===4){const o=a[0],l=a[1],u=a[2],f=a[3];return`#${o}${o}${l}${l}${u}${u}${Math.round(Number.parseInt(`${f}${f}`,16)/2).toString(16).padStart(2,"0")}`}else if(a.length===3){const o=a[0],l=a[1],u=a[2];return`#${o}${o}${l}${l}${u}${u}80`}}}const r=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return r?`var(${r[1]}-dim)`:e}function Qh(e,t,r={}){const a=e.resolveLangAlias(r.lang||"text"),{theme:o=e.getLoadedThemes()[0]}=r;if(!ud(a)&&!dd(o)&&a==="ansi"){const{theme:l}=e.setTheme(o);return eD(l,t,r)}return F4(e,t,r)}function Xu(e,t,r){let a,o,l,u,f,h;if("themes"in r){const{defaultColor:p="light",cssVariablePrefix:m="--shiki-",colorsRendering:x="css-vars"}=r,v=Object.entries(r.themes).filter(N=>N[1]).map(N=>({color:N[0],theme:N[1]})).sort((N,A)=>N.color===p?-1:A.color===p?1:0);if(v.length===0)throw new Rt("`themes` option must not be empty");const _=q4(e,t,r,Qh);if(h=Sl(_),p&&Om!==p&&!v.find(N=>N.color===p))throw new Rt(`\`themes\` option must contain the defaultColor key \`${p}\``);const w=v.map(N=>e.getTheme(N.theme)),S=v.map(N=>N.color);l=_.map(N=>N.map(A=>FL(A,S,m,p,x))),h&&pd(l,h);const k=v.map(N=>Vu(N.theme,r));o=Pv(v,w,k,m,p,"fg",x),a=Pv(v,w,k,m,p,"bg",x),u=`shiki-themes ${w.map(N=>N.name).join(" ")}`,f=p?void 0:[o,a].join(";")}else if("theme"in r){const p=Vu(r.theme,r);l=Qh(e,t,r);const m=e.getTheme(r.theme);a=us(m.bg,p),o=us(m.fg,p),u=m.name,h=Sl(l)}else throw new Rt("Invalid options, either `theme` or `themes` must be provided");return{tokens:l,fg:o,bg:a,themeName:u,rootStyle:f,grammarState:h}}function Pv(e,t,r,a,o,l,u){return e.map((f,h)=>{const p=us(t[h][l],r[h])||"inherit",m=`${a+f.color}${l==="bg"?"-bg":""}:${p}`;if(h===0&&o){if(o===Om&&e.length>1){const x=e.findIndex(_=>_.color==="light"),v=e.findIndex(_=>_.color==="dark");if(x===-1||v===-1)throw new Rt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${us(t[x][l],r[x])||"inherit"}, ${us(t[v][l],r[v])||"inherit"});${m}`}return p}return u==="css-vars"?m:null}).filter(f=>!!f).join(";")}function Qu(e,t,r,a={meta:{},options:r,codeToHast:(o,l)=>Qu(e,o,l),codeToTokens:(o,l)=>Xu(e,o,l)}){let o=t;for(const w of Ku(r))o=w.preprocess?.call(a,o,r)||o;let{tokens:l,fg:u,bg:f,themeName:h,rootStyle:p,grammarState:m}=Xu(e,o,r);const{mergeWhitespaces:x=!0,mergeSameStyleTokens:v=!1}=r;x===!0?l=rD(l):x==="never"&&(l=aD(l)),v&&(l=sD(l));const _={...a,get source(){return o}};for(const w of Ku(r))l=w.tokens?.call(_,l)||l;return nD(l,{...r,fg:u,bg:f,themeName:h,rootStyle:r.rootStyle===!1?!1:r.rootStyle??p},_,m)}function nD(e,t,r,a=Sl(e)){const o=Ku(t),l=[],u={type:"root",children:[]},{structure:f="classic",tabindex:h="0"}=t,p={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?p.style=t.rootStyle:p.style=`background-color:${t.bg};color:${t.fg}`),h!==!1&&h!=null&&(p.tabindex=h.toString());for(const[S,k]of Object.entries(t.meta||{}))S.startsWith("_")||(p[S]=k);let m={type:"element",tagName:"pre",properties:p,children:[],data:t.data},x={type:"element",tagName:"code",properties:{},children:l};const v=[],_={...r,structure:f,addClassToHast:Q4,get source(){return r.source},get tokens(){return e},get options(){return t},get root(){return u},get pre(){return m},get code(){return x},get lines(){return v}};if(e.forEach((S,k)=>{k&&(f==="inline"?u.children.push({type:"element",tagName:"br",properties:{},children:[]}):f==="classic"&&l.push({type:"text",value:`
|
|
45
|
+
`}));let N={type:"element",tagName:"span",properties:{class:"line"},children:[]},A=0;for(const E of S){let D={type:"element",tagName:"span",properties:{...E.htmlAttrs},children:[{type:"text",value:E.content}]};const L=Xh(E.htmlStyle||Yu(E));L&&(D.properties.style=L);for(const $ of o)D=$?.span?.call(_,D,k+1,A,N,E)||D;f==="inline"?u.children.push(D):f==="classic"&&N.children.push(D),A+=E.content.length}if(f==="classic"){for(const E of o)N=E?.line?.call(_,N,k+1)||N;v.push(N),l.push(N)}else f==="inline"&&v.push(N)}),f==="classic"){for(const S of o)x=S?.code?.call(_,x)||x;m.children.push(x);for(const S of o)m=S?.pre?.call(_,m)||m;u.children.push(m)}else if(f==="inline"){const S=[];let k={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const A of u.children)A.type==="element"&&A.tagName==="br"?(S.push(k),k={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(A.type==="element"||A.type==="text")&&k.children.push(A);S.push(k);let N={type:"element",tagName:"code",properties:{},children:S};for(const A of o)N=A?.code?.call(_,N)||N;u.children=[];for(let A=0;A<N.children.length;A++){A>0&&u.children.push({type:"element",tagName:"br",properties:{},children:[]});const E=N.children[A];E.type==="element"&&u.children.push(...E.children)}}let w=u;for(const S of o)w=S?.root?.call(_,w)||w;return a&&pd(w,a),w}function rD(e){return e.map(t=>{const r=[];let a="",o;return t.forEach((l,u)=>{const f=!(l.fontStyle&&(l.fontStyle&Nn.Underline||l.fontStyle&Nn.Strikethrough));f&&l.content.match(/^\s+$/)&&t[u+1]?(o===void 0&&(o=l.offset),a+=l.content):a?(f?r.push({...l,offset:o,content:a+l.content}):r.push({content:a,offset:o},l),o=void 0,a=""):r.push(l)}),r})}function aD(e){return e.map(t=>t.flatMap(r=>{if(r.content.match(/^\s+$/))return r;const a=r.content.match(/^(\s*)(.*?)(\s*)$/);if(!a)return r;const[,o,l,u]=a;if(!o&&!u)return r;const f=[{...r,offset:r.offset+o.length,content:l}];return o&&f.unshift({content:o,offset:r.offset}),u&&f.push({content:u,offset:r.offset+o.length+l.length}),f}))}function sD(e){return e.map(t=>{const r=[];for(const a of t){if(r.length===0){r.push({...a});continue}const o=r[r.length-1],l=Xh(o.htmlStyle||Yu(o)),u=Xh(a.htmlStyle||Yu(a)),f=o.fontStyle&&(o.fontStyle&Nn.Underline||o.fontStyle&Nn.Strikethrough),h=a.fontStyle&&(a.fontStyle&Nn.Underline||a.fontStyle&Nn.Strikethrough);!f&&!h&&l===u?o.content+=a.content:r.push({...a})}return r})}const oD=zL;function iD(e,t,r){const a={meta:{},options:r,codeToHast:(l,u)=>Qu(e,l,u),codeToTokens:(l,u)=>Xu(e,l,u)};let o=oD(Qu(e,t,r,a));for(const l of Ku(r))o=l.postprocess?.call(a,o,r)||o;return o}async function lD(e){const t=await k5(e);return{getLastGrammarState:(...r)=>C5(t,...r),codeToTokensBase:(r,a)=>Qh(t,r,a),codeToTokensWithThemes:(r,a)=>q4(t,r,a),codeToTokens:(r,a)=>Xu(t,r,a),codeToHast:(r,a)=>Qu(t,r,a),codeToHtml:(r,a)=>iD(t,r,a),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function cD(e){const t=e.langs,r=e.themes,a=e.engine;async function o(l){function u(x){if(typeof x=="string"){if(x=l.langAlias?.[x]||x,Rm(x))return[];const v=t[x];if(!v)throw new Rt(`Language \`${x}\` is not included in this bundle. You may want to load it from external source.`);return v}return x}function f(x){if($4(x))return"none";if(typeof x=="string"){const v=r[x];if(!v)throw new Rt(`Theme \`${x}\` is not included in this bundle. You may want to load it from external source.`);return v}return x}const h=(l.themes??[]).map(x=>f(x)),p=(l.langs??[]).map(x=>u(x)),m=await lD({engine:l.engine??a(),...l,themes:h,langs:p});return{...m,loadLanguage(...x){return m.loadLanguage(...x.map(u))},loadTheme(...x){return m.loadTheme(...x.map(f))},getBundledLanguages(){return t},getBundledThemes(){return r}}}return o}function uD(e){let t;async function r(a={}){if(t){const o=await t;return await Promise.all([o.loadTheme(...a.themes||[]),o.loadLanguage(...a.langs||[])]),o}else{t=e({...a,themes:[],langs:[]});const o=await t;return await Promise.all([o.loadTheme(...a.themes||[]),o.loadLanguage(...a.langs||[])]),o}}return r}function dD(e,t){const r=uD(e);async function a(o,l){const u=await r({langs:[l.lang],themes:"theme"in l?[l.theme]:Object.values(l.themes)}),f=await t?.guessEmbeddedLanguages?.(o,l.lang,u);return f&&await u.loadLanguage(...f),u}return{getSingletonHighlighter(o){return r(o)},async codeToHtml(o,l){return(await a(o,l)).codeToHtml(o,l)},async codeToHast(o,l){return(await a(o,l)).codeToHast(o,l)},async codeToTokens(o,l){return(await a(o,l)).codeToTokens(o,l)},async codeToTokensBase(o,l){return(await a(o,l)).codeToTokensBase(o,l)},async codeToTokensWithThemes(o,l){return(await a(o,l)).codeToTokensWithThemes(o,l)},async getLastGrammarState(o,l){return(await r({langs:[l.lang],themes:[l.theme]})).getLastGrammarState(o,l)}}}var Hv=Object.prototype.hasOwnProperty;function Fv(e,t,r){for(r of e.keys())if(fl(r,t))return r}function fl(e,t){var r,a,o;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((a=e.length)===t.length)for(;a--&&fl(e[a],t[a]););return a===-1}if(r===Set){if(e.size!==t.size)return!1;for(a of e)if(o=a,o&&typeof o=="object"&&(o=Fv(t,o),!o)||!t.has(o))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(a of e)if(o=a[0],o&&typeof o=="object"&&(o=Fv(t,o),!o)||!fl(a[1],t.get(o)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((a=e.byteLength)===t.byteLength)for(;a--&&e.getInt8(a)===t.getInt8(a););return a===-1}if(ArrayBuffer.isView(e)){if((a=e.byteLength)===t.byteLength)for(;a--&&e[a]===t[a];);return a===-1}if(!r||typeof e=="object"){a=0;for(r in e)if(Hv.call(e,r)&&++a&&!Hv.call(t,r)||!(r in t)||!fl(e[r],t[r]))return!1;return Object.keys(t).length===a}}return e!==e&&t!==t}function W4(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=W4(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function qv(){for(var e,t,r=0,a="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=W4(e))&&(a&&(a+=" "),a+=t);return a}var lh=e=>{const t=b.useRef(e);return e!==t.current&&!fl(e,t.current)&&(t.current=e),t.current},fD=(e,t,r)=>{const a=Date.now();clearTimeout(t.current.timeoutId);const o=Math.max(0,t.current.nextAllowedTime-a);t.current.timeoutId=setTimeout(()=>{e().catch(console.error),t.current.nextAllowedTime=a+r},o)},ew="plaintext",Gv=e=>e==null?[]:Array.isArray(e)?e:[e],pD=e=>e==null?null:typeof e=="string"?`s:${e}`:`o:${e.name}::${e.scopeName}`,Vv=e=>{const t=new Set,r=[];for(const a of e){const o=pD(a);o==null||t.has(o)||(t.add(o),r.push(a))}return r},hD=(e,t)=>e==null?!1:typeof e=="string"?e in t:typeof e.name=="string"&&typeof e.scopeName=="string",mD=(e,t)=>Rm(e)||t.includes(e)?e:ew,gD=(e,t,r,a)=>{const o=Gv(t),l=Gv(a),u=[...o,...l];let f=ew,h;if(e==null||typeof e=="string"&&!e.trim())return{languageId:f,langsToLoad:Vv([...l,...o])};if(typeof e=="object")f=e.name,h=e;else{const p=e.toLowerCase(),m=v=>v?.toLowerCase()===p,x=u.find(v=>typeof v=="object"&&v!=null&&!!(m(v.name)||m(v.scopeName)||m(v.scopeName?.split(".").pop())||v.aliases?.some(m)||v.fileTypes?.some(m)));x?(f=x.name||e,h=x):r?.[e]?(f=r[e],h=r[e]):(f=e,h=e)}return{languageId:f,langsToLoad:Vv([h,...l,...o])}},Yv=e=>typeof e=="object"&&e!==null&&"tokenColors"in e&&Array.isArray(e.tokenColors);function xD(e){const t=Yv(e),r=typeof e=="object"&&e!==null&&!t,a=typeof e=="object"&&e!==null&&!t&&Object.entries(e).some(([o,l])=>o.trim()!==""&&(typeof l=="string"&&l.trim()!==""||Yv(l)));return r?{isMultiTheme:!0,themeId:a?`multi-${Object.values(e).map(l=>(typeof l=="string"?l:l?.name)||"custom").sort().join("-")}`:"multi-default",multiTheme:a?e:null,themesToLoad:a?Object.values(e):[]}:{isMultiTheme:!1,themeId:typeof e=="string"?e:e?.name||"custom",singleTheme:e,themesToLoad:[e]}}function yD(e=1){return{name:"react-shiki:line-numbers",code(t){if(this.addClassToHast(t,"has-line-numbers"),e!==1){const r=t.properties?.style||"",a=r?`${r}; --line-start: ${e}`:`--line-start: ${e}`;t.properties={...t.properties,style:a}}},line(t){return this.addClassToHast(t,"line-numbers"),t}}}var Kv={light:"github-light",dark:"github-dark"},bD=(e,t)=>e.isMultiTheme?{themes:e.multiTheme??Kv,defaultColor:t.defaultColor,cssVariablePrefix:t.cssVariablePrefix}:{theme:e.singleTheme??Kv.dark},vD=e=>{const t=[...e.transformers||[]];return e.showLineNumbers&&t.push(yD(e.startingLineNumber)),t},_D=({languageId:e,resolvedTheme:t,options:r})=>{const{defaultColor:a,cssVariablePrefix:o,showLineNumbers:l,startingLineNumber:u,transformers:f,...h}=r;return{lang:e,...bD(t,r),...h,transformers:vD(r)}},wD=(e,t,r)=>{const a=r.getBundledLanguages();return Z4(e).flatMap(o=>a[o]??[])},SD=(e,t,r,a={},o)=>{const[l,u]=b.useState(null),f=lh(t),h=lh(r),p=lh(a),{languageId:m,langsToLoad:x}=b.useMemo(()=>gD(f,p.customLanguages,p.langAlias,p.preloadLanguages),[f,p.customLanguages,p.preloadLanguages,p.langAlias]),v=b.useMemo(()=>xD(h),[h]),{themesToLoad:_}=v,w=b.useRef({nextAllowedTime:0,timeoutId:void 0}),S=b.useMemo(()=>_D({languageId:m,resolvedTheme:v,options:p}),[m,v,p]);return b.useEffect(()=>{let k=!0;const N=async()=>{if(!m)return;const E=p.highlighter?p.highlighter:await o(x,_,p.engine);if(!p.highlighter){const $=wD(e,m,E);$.length>0&&await E.loadLanguage(...$)}const D=mD(m,E.getLoadedLanguages()),L={...S,lang:D};if(k){const $=p.outputFormat==="html"?E.codeToHtml(e,L):p3(E.codeToHast(e,L),{jsx:c.jsx,jsxs:c.jsxs,Fragment:c.Fragment});u($)}},{delay:A}=p;return A?fD(N,w,A):N().catch(console.error),()=>{k=!1,clearTimeout(w.current.timeoutId)}},[e,S,p.delay,p.highlighter,x,_]),l};function jD(e,{insertAt:t}={}){if(typeof document>"u")return;const r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t==="top"&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}jD(`.relative {
|
|
46
|
+
position: relative;
|
|
47
|
+
}
|
|
48
|
+
.defaultStyles pre {
|
|
49
|
+
overflow: auto;
|
|
50
|
+
border-radius: 0.5rem;
|
|
51
|
+
padding-left: 1.5rem;
|
|
52
|
+
padding-right: 1.5rem;
|
|
53
|
+
padding-top: 1.25rem;
|
|
54
|
+
padding-bottom: 1.25rem;
|
|
55
|
+
}
|
|
56
|
+
.languageLabel {
|
|
57
|
+
position: absolute;
|
|
58
|
+
right: 0.75rem;
|
|
59
|
+
top: 0.5rem;
|
|
60
|
+
font-family: monospace;
|
|
61
|
+
font-size: 0.75rem;
|
|
62
|
+
letter-spacing: -0.05em;
|
|
63
|
+
color: rgba(107, 114, 128, 0.85);
|
|
64
|
+
}
|
|
65
|
+
.line-numbers::before {
|
|
66
|
+
counter-increment: line-number;
|
|
67
|
+
content: counter(line-number);
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
justify-content: flex-end;
|
|
70
|
+
align-items: flex-start;
|
|
71
|
+
box-sizing: content-box;
|
|
72
|
+
min-width: var(--line-numbers-width, 2ch);
|
|
73
|
+
padding-left: var(--line-numbers-padding-left, 2ch);
|
|
74
|
+
padding-right: var(--line-numbers-padding-right, 2ch);
|
|
75
|
+
color: var(--line-numbers-foreground, rgba(107, 114, 128, 0.6));
|
|
76
|
+
font-size: var(--line-numbers-font-size, inherit);
|
|
77
|
+
font-weight: var(--line-numbers-font-weight, inherit);
|
|
78
|
+
line-height: var(--line-numbers-line-height, inherit);
|
|
79
|
+
font-family: var(--line-numbers-font-family, inherit);
|
|
80
|
+
opacity: var(--line-numbers-opacity, 1);
|
|
81
|
+
user-select: none;
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
}
|
|
84
|
+
.has-line-numbers {
|
|
85
|
+
counter-reset: line-number calc(var(--line-start, 1) - 1);
|
|
86
|
+
--line-numbers-foreground: rgba(107, 114, 128, 0.5);
|
|
87
|
+
--line-numbers-width: 2ch;
|
|
88
|
+
--line-numbers-padding-left: 0ch;
|
|
89
|
+
--line-numbers-padding-right: 2ch;
|
|
90
|
+
--line-numbers-font-size: inherit;
|
|
91
|
+
--line-numbers-font-weight: inherit;
|
|
92
|
+
--line-numbers-line-height: inherit;
|
|
93
|
+
--line-numbers-font-family: inherit;
|
|
94
|
+
--line-numbers-opacity: 1;
|
|
95
|
+
}
|
|
96
|
+
`);var kD=e=>b.forwardRef(({language:t,theme:r,delay:a,transformers:o,defaultColor:l,cssVariablePrefix:u,addDefaultStyles:f=!0,style:h,langStyle:p,className:m,langClassName:x,showLanguage:v=!0,showLineNumbers:_=!1,startingLineNumber:w=1,children:S,as:k="pre",customLanguages:N,preloadLanguages:A,...E},D)=>{const L={delay:a,transformers:o,customLanguages:N,preloadLanguages:A,showLineNumbers:_,defaultColor:l,cssVariablePrefix:u,startingLineNumber:w,...E},$=typeof t=="object"?t.name||null:t?.trim()||null,z=e(S,t,r,L),R=typeof z=="string";return c.jsxs(k,{ref:D,"data-testid":"shiki-container",className:qv("relative","not-prose",f&&"defaultStyles",m),style:h,id:"shiki-container",children:[v&&$?c.jsx("span",{className:qv("languageLabel",x),style:p,id:"language-label",children:$}):null,R?c.jsx("div",{dangerouslySetInnerHTML:{__html:z}}):z]})}),Mm=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function ND(){return 2147483648}function ED(){return typeof performance<"u"?performance.now():Date.now()}const CD=(e,t)=>e+(t-e%t)%t;async function AD(e){let t,r;const a={};function o(_){r=_,a.HEAPU8=new Uint8Array(_),a.HEAPU32=new Uint32Array(_)}function l(_,w,S){a.HEAPU8.copyWithin(_,w,w+S)}function u(_){try{return t.grow(_-r.byteLength+65535>>>16),o(t.buffer),1}catch{}}function f(_){const w=a.HEAPU8.length;_=_>>>0;const S=ND();if(_>S)return!1;for(let k=1;k<=4;k*=2){let N=w*(1+.2/k);N=Math.min(N,_+100663296);const A=Math.min(S,CD(Math.max(_,N),65536));if(u(A))return!0}return!1}const h=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function p(_,w,S=1024){const k=w+S;let N=w;for(;_[N]&&!(N>=k);)++N;if(N-w>16&&_.buffer&&h)return h.decode(_.subarray(w,N));let A="";for(;w<N;){let E=_[w++];if(!(E&128)){A+=String.fromCharCode(E);continue}const D=_[w++]&63;if((E&224)===192){A+=String.fromCharCode((E&31)<<6|D);continue}const L=_[w++]&63;if((E&240)===224?E=(E&15)<<12|D<<6|L:E=(E&7)<<18|D<<12|L<<6|_[w++]&63,E<65536)A+=String.fromCharCode(E);else{const $=E-65536;A+=String.fromCharCode(55296|$>>10,56320|$&1023)}}return A}function m(_,w){return _?p(a.HEAPU8,_,w):""}const x={emscripten_get_now:ED,emscripten_memcpy_big:l,emscripten_resize_heap:f,fd_write:()=>0};async function v(){const w=await e({env:x,wasi_snapshot_preview1:x});t=w.memory,o(t.buffer),Object.assign(a,w),a.UTF8ToString=m}return await v(),a}var RD=Object.defineProperty,TD=(e,t,r)=>t in e?RD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,on=(e,t,r)=>TD(e,typeof t!="symbol"?t+"":t,r);let pn=null;function LD(e){throw new Mm(e.UTF8ToString(e.getLastOnigError()))}class md{constructor(t){on(this,"utf16Length"),on(this,"utf8Length"),on(this,"utf16Value"),on(this,"utf8Value"),on(this,"utf16OffsetToUtf8"),on(this,"utf8OffsetToUtf16");const r=t.length,a=md._utf8ByteLength(t),o=a!==r,l=o?new Uint32Array(r+1):null;o&&(l[r]=a);const u=o?new Uint32Array(a+1):null;o&&(u[a]=r);const f=new Uint8Array(a);let h=0;for(let p=0;p<r;p++){const m=t.charCodeAt(p);let x=m,v=!1;if(m>=55296&&m<=56319&&p+1<r){const _=t.charCodeAt(p+1);_>=56320&&_<=57343&&(x=(m-55296<<10)+65536|_-56320,v=!0)}o&&(l[p]=h,v&&(l[p+1]=h),x<=127?u[h+0]=p:x<=2047?(u[h+0]=p,u[h+1]=p):x<=65535?(u[h+0]=p,u[h+1]=p,u[h+2]=p):(u[h+0]=p,u[h+1]=p,u[h+2]=p,u[h+3]=p)),x<=127?f[h++]=x:x<=2047?(f[h++]=192|(x&1984)>>>6,f[h++]=128|(x&63)>>>0):x<=65535?(f[h++]=224|(x&61440)>>>12,f[h++]=128|(x&4032)>>>6,f[h++]=128|(x&63)>>>0):(f[h++]=240|(x&1835008)>>>18,f[h++]=128|(x&258048)>>>12,f[h++]=128|(x&4032)>>>6,f[h++]=128|(x&63)>>>0),v&&p++}this.utf16Length=r,this.utf8Length=a,this.utf16Value=t,this.utf8Value=f,this.utf16OffsetToUtf8=l,this.utf8OffsetToUtf16=u}static _utf8ByteLength(t){let r=0;for(let a=0,o=t.length;a<o;a++){const l=t.charCodeAt(a);let u=l,f=!1;if(l>=55296&&l<=56319&&a+1<o){const h=t.charCodeAt(a+1);h>=56320&&h<=57343&&(u=(l-55296<<10)+65536|h-56320,f=!0)}u<=127?r+=1:u<=2047?r+=2:u<=65535?r+=3:r+=4,f&&a++}return r}createString(t){const r=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,r),r}}const gd=class Gr{constructor(t){if(on(this,"id",++Gr.LAST_ID),on(this,"_onigBinding"),on(this,"content"),on(this,"utf16Length"),on(this,"utf8Length"),on(this,"utf16OffsetToUtf8"),on(this,"utf8OffsetToUtf16"),on(this,"ptr"),!pn)throw new Mm("Must invoke loadWasm first.");this._onigBinding=pn,this.content=t;const r=new md(t);this.utf16Length=r.utf16Length,this.utf8Length=r.utf8Length,this.utf16OffsetToUtf8=r.utf16OffsetToUtf8,this.utf8OffsetToUtf16=r.utf8OffsetToUtf16,this.utf8Length<1e4&&!Gr._sharedPtrInUse?(Gr._sharedPtr||(Gr._sharedPtr=pn.omalloc(1e4)),Gr._sharedPtrInUse=!0,pn.HEAPU8.set(r.utf8Value,Gr._sharedPtr),this.ptr=Gr._sharedPtr):this.ptr=r.createString(pn)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===Gr._sharedPtr?Gr._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};on(gd,"LAST_ID",0);on(gd,"_sharedPtr",0);on(gd,"_sharedPtrInUse",!1);let tw=gd;class DD{constructor(t){if(on(this,"_onigBinding"),on(this,"_ptr"),!pn)throw new Mm("Must invoke loadWasm first.");const r=[],a=[];for(let f=0,h=t.length;f<h;f++){const p=new md(t[f]);r[f]=p.createString(pn),a[f]=p.utf8Length}const o=pn.omalloc(4*t.length);pn.HEAPU32.set(r,o/4);const l=pn.omalloc(4*t.length);pn.HEAPU32.set(a,l/4);const u=pn.createOnigScanner(o,l,t.length);for(let f=0,h=t.length;f<h;f++)pn.ofree(r[f]);pn.ofree(l),pn.ofree(o),u===0&&LD(pn),this._onigBinding=pn,this._ptr=u}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,r,a){let o=0;if(typeof a=="number"&&(o=a),typeof t=="string"){t=new tw(t);const l=this._findNextMatchSync(t,r,!1,o);return t.dispose(),l}return this._findNextMatchSync(t,r,!1,o)}_findNextMatchSync(t,r,a,o){const l=this._onigBinding,u=l.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(r),o);if(u===0)return null;const f=l.HEAPU32;let h=u/4;const p=f[h++],m=f[h++],x=[];for(let v=0;v<m;v++){const _=t.convertUtf8OffsetToUtf16(f[h++]),w=t.convertUtf8OffsetToUtf16(f[h++]);x[v]={start:_,end:w,length:w-_}}return{index:p,captureIndices:x}}}function OD(e){return typeof e.instantiator=="function"}function MD(e){return typeof e.default=="function"}function zD(e){return typeof e.data<"u"}function $D(e){return typeof Response<"u"&&e instanceof Response}function BD(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let pu;function nw(e){if(pu)return pu;async function t(){pn=await AD(async r=>{let a=e;return a=await a,typeof a=="function"&&(a=await a(r)),typeof a=="function"&&(a=await a(r)),OD(a)?a=await a.instantiator(r):MD(a)?a=await a.default(r):(zD(a)&&(a=a.data),$D(a)?typeof WebAssembly.instantiateStreaming=="function"?a=await ID(a)(r):a=await UD(a)(r):BD(a)?a=await ch(a)(r):a instanceof WebAssembly.Module?a=await ch(a)(r):"default"in a&&a.default instanceof WebAssembly.Module&&(a=await ch(a.default)(r))),"instance"in a&&(a=a.instance),"exports"in a&&(a=a.exports),a})}return pu=t(),pu}function ch(e){return t=>WebAssembly.instantiate(e,t)}function ID(e){return t=>WebAssembly.instantiateStreaming(e,t)}function UD(e){return async t=>{const r=await e.arrayBuffer();return WebAssembly.instantiate(r,t)}}let rw;function PD(e){rw=e}function HD(){return rw}async function aw(e){return e&&await nw(e),{createScanner(t){return new DD(t.map(r=>typeof r=="string"?r:r.source))},createString(t){return new tw(t)}}}const FD=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:aw,getDefaultWasmLoader:HD,loadWasm:nw,setDefaultWasmLoader:PD},Symbol.toStringTag,{value:"Module"}));var sw=L3({});O3(sw,FD);const qD=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>le(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>le(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>le(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>le(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>le(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>le(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>le(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>le(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>le(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>le(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>le(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>le(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>le(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>le(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>le(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>le(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>le(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>le(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>le(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>le(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>le(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>le(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>le(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>le(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>le(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>le(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>le(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>le(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>le(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>le(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>le(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>le(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>le(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>le(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>le(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>le(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>le(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>le(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>le(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>le(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>le(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>le(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>le(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>le(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>le(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>le(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>le(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>le(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>le(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>le(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>le(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>le(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>le(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>le(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>le(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>le(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>le(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>le(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>le(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>le(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>le(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>le(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>le(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>le(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>le(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],GD=Object.fromEntries(qD.map(e=>[e.id,e.import])),ow=[{id:"angular-html",name:"Angular HTML",import:(()=>le(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>le(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"astro",name:"Astro",import:(()=>le(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([6,7,2,8,3,9,10])))},{id:"blade",name:"Blade",import:(()=>le(()=>import("./blade-BjGOyj-B.js"),__vite__mapDeps([11,12,1,2,3,13,14,15,7])))},{id:"c",name:"C",import:(()=>le(()=>import("./c-BIGW1oBm.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>le(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([16,2])))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>le(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([17,18,19,20,15])))},{id:"css",name:"CSS",import:(()=>le(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>le(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"glsl",name:"GLSL",import:(()=>le(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([19,20])))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>le(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([21,2,8,22,10])))},{id:"haml",name:"Ruby Haml",import:(()=>le(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([23,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>le(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([24,1,2,3,25])))},{id:"html",name:"HTML",import:(()=>le(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>le(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([12,1,2,3])))},{id:"http",name:"HTTP",import:(()=>le(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([26,27,7,13,14,21,2,8,22,10])))},{id:"hurl",name:"Hurl",import:(()=>le(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([28,21,2,8,22,10,13,14,29])))},{id:"imba",name:"Imba",import:(()=>le(()=>import("./imba-DGztddWO.js"),[]))},{id:"java",name:"Java",import:(()=>le(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>le(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>le(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([30,1,2,3])))},{id:"jison",name:"Jison",import:(()=>le(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([31,2])))},{id:"json",name:"JSON",import:(()=>le(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>le(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>le(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>le(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>le(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>le(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([32,17,18,19,20,15,33,2,34])))},{id:"less",name:"Less",import:(()=>le(()=>import("./less-B1dDrJ26.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>le(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>le(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([35,3,36,5,8])))},{id:"mdc",name:"MDC",import:(()=>le(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([37,38,25,12,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>le(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"php",name:"PHP",import:(()=>le(()=>import("./php-R6g_5hLQ.js"),__vite__mapDeps([39,1,2,3,13,14,15,7])))},{id:"postcss",name:"PostCSS",import:(()=>le(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>le(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([40,2,3,1])))},{id:"python",name:"Python",aliases:["py"],import:(()=>le(()=>import("./python-B6aJPvgy.js"),[]))},{id:"r",name:"R",import:(()=>le(()=>import("./r-Dspwwk_N.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>le(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"sass",name:"Sass",import:(()=>le(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scss",name:"SCSS",import:(()=>le(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>le(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"sql",name:"SQL",import:(()=>le(()=>import("./sql-BLtJtn59.js"),[]))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>le(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>le(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([41,2,8,3,9])))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>le(()=>import("./ts-tags-DQrlYJgV.js"),__vite__mapDeps([42,8,3,2,19,20,1,15,13,14])))},{id:"tsx",name:"TSX",import:(()=>le(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>le(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"vue",name:"Vue",import:(()=>le(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([43,3,2,8,7,1,12])))},{id:"vue-html",name:"Vue HTML",import:(()=>le(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([44,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>le(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([45,3,5,36,46,9,2])))},{id:"wasm",name:"WebAssembly",import:(()=>le(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>le(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>le(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"xml",name:"XML",import:(()=>le(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([13,14])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>le(()=>import("./yaml-Buea-lGh.js"),[]))}],VD=Object.fromEntries(ow.map(e=>[e.id,e.import])),YD=Object.fromEntries(ow.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),iw={...VD,...YD},KD=cD({langs:iw,themes:GD,engine:()=>(0,sw.createOnigurumaEngine)(le(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{getSingletonHighlighter:XD}=dD(KD,{guessEmbeddedLanguages:Z4});async function QD(e,t,r){const a=e.filter(o=>hD(o,iw));return await XD({langs:a,themes:t,engine:r??aw(le(()=>import("./wasm-CG6Dc4jp.js"),[]))})}var ZD=(e,t,r,a={})=>SD(e,t,r,a,QD),JD=kD(ZD),WD=JD;const e6={"actionBar.toggledBackground":"#525761","activityBar.background":"#282c34","activityBar.foreground":"#d7dae0","activityBarBadge.background":"#4d78cc","activityBarBadge.foreground":"#f8fafd","badge.background":"#282c34","button.background":"#404754","button.secondaryBackground":"#30333d","button.secondaryForeground":"#c0bdbd","checkbox.border":"#404754","debugToolBar.background":"#21252b",descriptionForeground:"#abb2bf","diffEditor.insertedTextBackground":"#00809b33","dropdown.background":"#21252b","dropdown.border":"#21252b","editor.background":"#282c34","editor.findMatchBackground":"#d19a6644","editor.findMatchBorder":"#ffffff5a","editor.findMatchHighlightBackground":"#ffffff22","editor.foreground":"#abb2bf","editor.lineHighlightBackground":"#2c313c","editor.selectionBackground":"#67769660","editor.selectionHighlightBackground":"#ffd33d44","editor.selectionHighlightBorder":"#dddddd","editor.wordHighlightBackground":"#d2e0ff2f","editor.wordHighlightBorder":"#7f848e","editor.wordHighlightStrongBackground":"#abb2bf26","editor.wordHighlightStrongBorder":"#7f848e","editorBracketHighlight.foreground1":"#d19a66","editorBracketHighlight.foreground2":"#c678dd","editorBracketHighlight.foreground3":"#56b6c2","editorBracketMatch.background":"#515a6b","editorBracketMatch.border":"#515a6b","editorCursor.background":"#ffffffc9","editorCursor.foreground":"#528bff","editorError.foreground":"#c24038","editorGroup.background":"#181a1f","editorGroup.border":"#181a1f","editorGroupHeader.tabsBackground":"#21252b","editorGutter.addedBackground":"#109868","editorGutter.deletedBackground":"#9A353D","editorGutter.modifiedBackground":"#948B60","editorHoverWidget.background":"#21252b","editorHoverWidget.border":"#181a1f","editorHoverWidget.highlightForeground":"#61afef","editorIndentGuide.activeBackground1":"#c8c8c859","editorIndentGuide.background1":"#3b4048","editorInlayHint.background":"#2c313c","editorInlayHint.foreground":"#abb2bf","editorLineNumber.activeForeground":"#abb2bf","editorLineNumber.foreground":"#495162","editorMarkerNavigation.background":"#21252b","editorOverviewRuler.addedBackground":"#109868","editorOverviewRuler.deletedBackground":"#9A353D","editorOverviewRuler.modifiedBackground":"#948B60","editorRuler.foreground":"#abb2bf26","editorSuggestWidget.background":"#21252b","editorSuggestWidget.border":"#181a1f","editorSuggestWidget.selectedBackground":"#2c313a","editorWarning.foreground":"#d19a66","editorWhitespace.foreground":"#ffffff1d","editorWidget.background":"#21252b",focusBorder:"#3e4452","gitDecoration.ignoredResourceForeground":"#636b78","input.background":"#1d1f23","input.foreground":"#abb2bf","list.activeSelectionBackground":"#2c313a","list.activeSelectionForeground":"#d7dae0","list.focusBackground":"#323842","list.focusForeground":"#f0f0f0","list.highlightForeground":"#ecebeb","list.hoverBackground":"#2c313a","list.hoverForeground":"#abb2bf","list.inactiveSelectionBackground":"#323842","list.inactiveSelectionForeground":"#d7dae0","list.warningForeground":"#d19a66","menu.foreground":"#abb2bf","menu.separatorBackground":"#343a45","minimapGutter.addedBackground":"#109868","minimapGutter.deletedBackground":"#9A353D","minimapGutter.modifiedBackground":"#948B60","multiDiffEditor.headerBackground":"#21252b","panel.border":"#3e4452","panelSectionHeader.background":"#21252b","peekViewEditor.background":"#1b1d23","peekViewEditor.matchHighlightBackground":"#29244b","peekViewResult.background":"#22262b","scrollbar.shadow":"#23252c","scrollbarSlider.activeBackground":"#747d9180","scrollbarSlider.background":"#4e566660","scrollbarSlider.hoverBackground":"#5a637580","settings.focusedRowBackground":"#282c34","settings.headerForeground":"#fff","sideBar.background":"#21252b","sideBar.foreground":"#abb2bf","sideBarSectionHeader.background":"#282c34","sideBarSectionHeader.foreground":"#abb2bf","statusBar.background":"#21252b","statusBar.debuggingBackground":"#cc6633","statusBar.debuggingBorder":"#ff000000","statusBar.debuggingForeground":"#ffffff","statusBar.foreground":"#9da5b4","statusBar.noFolderBackground":"#21252b","statusBarItem.remoteBackground":"#4d78cc","statusBarItem.remoteForeground":"#f8fafd","tab.activeBackground":"#282c34","tab.activeBorder":"#b4b4b4","tab.activeForeground":"#dcdcdc","tab.border":"#181a1f","tab.hoverBackground":"#323842","tab.inactiveBackground":"#21252b","tab.unfocusedHoverBackground":"#323842","terminal.ansiBlack":"#3f4451","terminal.ansiBlue":"#4aa5f0","terminal.ansiBrightBlack":"#4f5666","terminal.ansiBrightBlue":"#4dc4ff","terminal.ansiBrightCyan":"#4cd1e0","terminal.ansiBrightGreen":"#a5e075","terminal.ansiBrightMagenta":"#de73ff","terminal.ansiBrightRed":"#ff616e","terminal.ansiBrightWhite":"#e6e6e6","terminal.ansiBrightYellow":"#f0a45d","terminal.ansiCyan":"#42b3c2","terminal.ansiGreen":"#8cc265","terminal.ansiMagenta":"#c162de","terminal.ansiRed":"#e05561","terminal.ansiWhite":"#d7dae0","terminal.ansiYellow":"#d18f52","terminal.background":"#282c34","terminal.border":"#3e4452","terminal.foreground":"#abb2bf","terminal.selectionBackground":"#abb2bf30","textBlockQuote.background":"#2e3440","textBlockQuote.border":"#4b5362","textLink.foreground":"#61afef","textPreformat.foreground":"#d19a66","titleBar.activeBackground":"#282c34","titleBar.activeForeground":"#9da5b4","titleBar.inactiveBackground":"#282c34","titleBar.inactiveForeground":"#6b717d","tree.indentGuidesStroke":"#ffffff1d","walkThrough.embeddedEditorBackground":"#2e3440","welcomePage.buttonHoverBackground":"#404754"},t6="C4A Dark",n6="c4a-dark",r6=!0,a6={"annotation:dart":{foreground:"#d19a66"},enumMember:{foreground:"#56b6c2"},macro:{foreground:"#d19a66"},memberOperatorOverload:{foreground:"#c678dd"},"parameter.label:dart":{foreground:"#abb2bf"},"property:dart":{foreground:"#d19a66"},tomlArrayKey:{foreground:"#e5c07b"},"variable.constant":{foreground:"#d19a66"},"variable.defaultLibrary":{foreground:"#e5c07b"},"variable:dart":{foreground:"#d19a66"}},s6=JSON.parse('[{"scope":"meta.embedded","settings":{"foreground":"#abb2bf"}},{"scope":"punctuation.definition.delayed.unison,punctuation.definition.list.begin.unison,punctuation.definition.list.end.unison,punctuation.definition.ability.begin.unison,punctuation.definition.ability.end.unison,punctuation.operator.assignment.as.unison,punctuation.separator.pipe.unison,punctuation.separator.delimiter.unison,punctuation.definition.hash.unison","settings":{"foreground":"#e06c75"}},{"scope":"variable.other.generic-type.haskell","settings":{"foreground":"#c678dd"}},{"scope":"storage.type.haskell","settings":{"foreground":"#d19a66"}},{"scope":"support.variable.magic.python","settings":{"foreground":"#e06c75"}},{"scope":"punctuation.separator.period.python,punctuation.separator.element.python,punctuation.parenthesis.begin.python,punctuation.parenthesis.end.python","settings":{"foreground":"#abb2bf"}},{"scope":"variable.parameter.function.language.special.self.python","settings":{"foreground":"#e5c07b"}},{"scope":"variable.parameter.function.language.special.cls.python","settings":{"foreground":"#e5c07b"}},{"scope":"storage.modifier.lifetime.rust","settings":{"foreground":"#abb2bf"}},{"scope":"support.function.std.rust","settings":{"foreground":"#61afef"}},{"scope":"entity.name.lifetime.rust","settings":{"foreground":"#e5c07b"}},{"scope":"variable.language.rust","settings":{"foreground":"#e06c75"}},{"scope":"support.constant.edge","settings":{"foreground":"#c678dd"}},{"scope":"constant.other.character-class.regexp","settings":{"foreground":"#e06c75"}},{"scope":["keyword.operator.word"],"settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.quantifier.regexp","settings":{"foreground":"#d19a66"}},{"scope":"variable.parameter.function","settings":{"foreground":"#abb2bf"}},{"scope":"comment markup.link","settings":{"foreground":"#5c6370"}},{"scope":"markup.changed.diff","settings":{"foreground":"#e5c07b"}},{"scope":"meta.diff.header.from-file,meta.diff.header.to-file,punctuation.definition.from-file.diff,punctuation.definition.to-file.diff","settings":{"foreground":"#61afef"}},{"scope":"markup.inserted.diff","settings":{"foreground":"#98c379"}},{"scope":"markup.deleted.diff","settings":{"foreground":"#e06c75"}},{"scope":"meta.function.c,meta.function.cpp","settings":{"foreground":"#e06c75"}},{"scope":"punctuation.section.block.begin.bracket.curly.cpp,punctuation.section.block.end.bracket.curly.cpp,punctuation.terminator.statement.c,punctuation.section.block.begin.bracket.curly.c,punctuation.section.block.end.bracket.curly.c,punctuation.section.parens.begin.bracket.round.c,punctuation.section.parens.end.bracket.round.c,punctuation.section.parameters.begin.bracket.round.c,punctuation.section.parameters.end.bracket.round.c","settings":{"foreground":"#abb2bf"}},{"scope":"punctuation.separator.key-value","settings":{"foreground":"#abb2bf"}},{"scope":"keyword.operator.expression.import","settings":{"foreground":"#61afef"}},{"scope":"support.constant.math","settings":{"foreground":"#e5c07b"}},{"scope":"support.constant.property.math","settings":{"foreground":"#d19a66"}},{"scope":"variable.other.constant","settings":{"foreground":"#e5c07b"}},{"scope":["storage.type.annotation.java","storage.type.object.array.java"],"settings":{"foreground":"#e5c07b"}},{"scope":"source.java","settings":{"foreground":"#e06c75"}},{"scope":"punctuation.section.block.begin.java,punctuation.section.block.end.java,punctuation.definition.method-parameters.begin.java,punctuation.definition.method-parameters.end.java,meta.method.identifier.java,punctuation.section.method.begin.java,punctuation.section.method.end.java,punctuation.terminator.java,punctuation.section.class.begin.java,punctuation.section.class.end.java,punctuation.section.inner-class.begin.java,punctuation.section.inner-class.end.java,meta.method-call.java,punctuation.section.class.begin.bracket.curly.java,punctuation.section.class.end.bracket.curly.java,punctuation.section.method.begin.bracket.curly.java,punctuation.section.method.end.bracket.curly.java,punctuation.separator.period.java,punctuation.bracket.angle.java,punctuation.definition.annotation.java,meta.method.body.java","settings":{"foreground":"#abb2bf"}},{"scope":"meta.method.java","settings":{"foreground":"#61afef"}},{"scope":"storage.modifier.import.java,storage.type.java,storage.type.generic.java","settings":{"foreground":"#e5c07b"}},{"scope":"keyword.operator.instanceof.java","settings":{"foreground":"#c678dd"}},{"scope":"meta.definition.variable.name.java","settings":{"foreground":"#e06c75"}},{"scope":"keyword.operator.logical","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.bitwise","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.channel","settings":{"foreground":"#56b6c2"}},{"scope":"support.constant.property-value.scss,support.constant.property-value.css","settings":{"foreground":"#d19a66"}},{"scope":"keyword.operator.css,keyword.operator.scss,keyword.operator.less","settings":{"foreground":"#56b6c2"}},{"scope":"support.constant.color.w3c-standard-color-name.css,support.constant.color.w3c-standard-color-name.scss","settings":{"foreground":"#d19a66"}},{"scope":"punctuation.separator.list.comma.css","settings":{"foreground":"#abb2bf"}},{"scope":"support.constant.color.w3c-standard-color-name.css","settings":{"foreground":"#d19a66"}},{"scope":"support.type.vendored.property-name.css","settings":{"foreground":"#56b6c2"}},{"scope":"support.module.node,support.type.object.module,support.module.node","settings":{"foreground":"#e5c07b"}},{"scope":"entity.name.type.module","settings":{"foreground":"#e5c07b"}},{"scope":"variable.other.readwrite,meta.object-literal.key,support.variable.property,support.variable.object.process,support.variable.object.node","settings":{"foreground":"#e06c75"}},{"scope":"support.constant.json","settings":{"foreground":"#d19a66"}},{"scope":["keyword.operator.expression.instanceof","keyword.operator.new","keyword.operator.ternary","keyword.operator.optional","keyword.operator.expression.keyof"],"settings":{"foreground":"#c678dd"}},{"scope":"support.type.object.console","settings":{"foreground":"#e06c75"}},{"scope":"support.variable.property.process","settings":{"foreground":"#d19a66"}},{"scope":"entity.name.function,support.function.console","settings":{"foreground":"#61afef"}},{"scope":"keyword.operator.misc.rust","settings":{"foreground":"#abb2bf"}},{"scope":"keyword.operator.sigil.rust","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.delete","settings":{"foreground":"#c678dd"}},{"scope":"support.type.object.dom","settings":{"foreground":"#56b6c2"}},{"scope":"support.variable.dom,support.variable.property.dom","settings":{"foreground":"#e06c75"}},{"scope":"keyword.operator.arithmetic,keyword.operator.comparison,keyword.operator.decrement,keyword.operator.increment,keyword.operator.relational","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.assignment.c,keyword.operator.comparison.c,keyword.operator.c,keyword.operator.increment.c,keyword.operator.decrement.c,keyword.operator.bitwise.shift.c,keyword.operator.assignment.cpp,keyword.operator.comparison.cpp,keyword.operator.cpp,keyword.operator.increment.cpp,keyword.operator.decrement.cpp,keyword.operator.bitwise.shift.cpp","settings":{"foreground":"#c678dd"}},{"scope":"punctuation.separator.delimiter","settings":{"foreground":"#abb2bf"}},{"scope":"punctuation.separator.c,punctuation.separator.cpp","settings":{"foreground":"#c678dd"}},{"scope":"support.type.posix-reserved.c,support.type.posix-reserved.cpp","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.sizeof.c,keyword.operator.sizeof.cpp","settings":{"foreground":"#c678dd"}},{"scope":"variable.parameter.function.language.python","settings":{"foreground":"#d19a66"}},{"scope":"support.type.python","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.logical.python","settings":{"foreground":"#c678dd"}},{"scope":"variable.parameter.function.python","settings":{"foreground":"#d19a66"}},{"scope":"punctuation.definition.arguments.begin.python,punctuation.definition.arguments.end.python,punctuation.separator.arguments.python,punctuation.definition.list.begin.python,punctuation.definition.list.end.python","settings":{"foreground":"#abb2bf"}},{"scope":"meta.function-call.generic.python","settings":{"foreground":"#61afef"}},{"scope":"constant.character.format.placeholder.other.python","settings":{"foreground":"#d19a66"}},{"scope":"keyword.operator","settings":{"foreground":"#abb2bf"}},{"scope":"keyword.operator.assignment.compound","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.assignment.compound.js,keyword.operator.assignment.compound.ts","settings":{"foreground":"#56b6c2"}},{"scope":"keyword","settings":{"foreground":"#c678dd"}},{"scope":"entity.name.namespace","settings":{"foreground":"#e5c07b"}},{"scope":"variable","settings":{"foreground":"#e06c75"}},{"scope":"variable.c","settings":{"foreground":"#abb2bf"}},{"scope":"variable.language","settings":{"foreground":"#e5c07b"}},{"scope":"token.variable.parameter.java","settings":{"foreground":"#abb2bf"}},{"scope":"import.storage.java","settings":{"foreground":"#e5c07b"}},{"scope":"token.package.keyword","settings":{"foreground":"#c678dd"}},{"scope":"token.package","settings":{"foreground":"#abb2bf"}},{"scope":["entity.name.function","meta.require","support.function.any-method","variable.function"],"settings":{"foreground":"#61afef"}},{"scope":"entity.name.type.namespace","settings":{"foreground":"#e5c07b"}},{"scope":"support.class, entity.name.type.class","settings":{"foreground":"#e5c07b"}},{"scope":"entity.name.class.identifier.namespace.type","settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.class","variable.other.class.js","variable.other.class.ts"],"settings":{"foreground":"#e5c07b"}},{"scope":"variable.other.class.php","settings":{"foreground":"#e06c75"}},{"scope":"entity.name.type","settings":{"foreground":"#e5c07b"}},{"scope":"keyword.control","settings":{"foreground":"#c678dd"}},{"scope":"control.elements, keyword.operator.less","settings":{"foreground":"#d19a66"}},{"scope":"keyword.other.special-method","settings":{"foreground":"#61afef"}},{"scope":"storage","settings":{"foreground":"#c678dd"}},{"scope":"token.storage","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.expression.delete,keyword.operator.expression.in,keyword.operator.expression.of,keyword.operator.expression.instanceof,keyword.operator.new,keyword.operator.expression.typeof,keyword.operator.expression.void","settings":{"foreground":"#c678dd"}},{"scope":"token.storage.type.java","settings":{"foreground":"#e5c07b"}},{"scope":"support.function","settings":{"foreground":"#56b6c2"}},{"scope":"support.type.property-name","settings":{"foreground":"#abb2bf"}},{"scope":"support.type.property-name.toml, support.type.property-name.table.toml, support.type.property-name.array.toml","settings":{"foreground":"#e06c75"}},{"scope":"support.constant.property-value","settings":{"foreground":"#abb2bf"}},{"scope":"support.constant.font-name","settings":{"foreground":"#d19a66"}},{"scope":"meta.tag","settings":{"foreground":"#abb2bf"}},{"scope":"string","settings":{"foreground":"#98c379"}},{"scope":"constant.other.symbol","settings":{"foreground":"#56b6c2"}},{"scope":"constant.numeric","settings":{"foreground":"#d19a66"}},{"scope":"constant","settings":{"foreground":"#d19a66"}},{"scope":"punctuation.definition.constant","settings":{"foreground":"#d19a66"}},{"scope":"entity.name.tag","settings":{"foreground":"#e06c75"}},{"scope":"entity.other.attribute-name","settings":{"foreground":"#d19a66"}},{"scope":"entity.other.attribute-name.id","settings":{"foreground":"#61afef"}},{"scope":"entity.other.attribute-name.class.css","settings":{"foreground":"#d19a66"}},{"scope":"meta.selector","settings":{"foreground":"#c678dd"}},{"scope":"markup.heading","settings":{"foreground":"#ef6f2e"}},{"scope":"markup.heading punctuation.definition.heading, entity.name.section","settings":{"foreground":"#ef6f2e"}},{"scope":"keyword.other.unit","settings":{"foreground":"#e06c75"}},{"scope":"markup.bold,todo.bold","settings":{"foreground":"#d19a66"}},{"scope":"punctuation.definition.bold","settings":{"foreground":"#e5c07b"}},{"scope":"markup.italic, punctuation.definition.italic,todo.emphasis","settings":{"foreground":"#c678dd"}},{"scope":"emphasis md","settings":{"foreground":"#c678dd"}},{"scope":"entity.name.section.markdown","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.heading.markdown","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#e5c07b"}},{"scope":"markup.heading.setext","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.bold.markdown","settings":{"foreground":"#d19a66"}},{"scope":"markup.inline.raw.markdown","settings":{"foreground":"#98c379"}},{"scope":"markup.inline.raw.string.markdown","settings":{"foreground":"#98c379"}},{"scope":"punctuation.definition.raw.markdown","settings":{"foreground":"#e5c07b"}},{"scope":"punctuation.definition.list.markdown","settings":{"foreground":"#e5c07b"}},{"scope":["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","punctuation.definition.metadata.markdown"],"settings":{"foreground":"#e06c75"}},{"scope":["beginning.punctuation.definition.list.markdown"],"settings":{"foreground":"#e06c75"}},{"scope":"punctuation.definition.metadata.markdown","settings":{"foreground":"#e06c75"}},{"scope":"markup.underline.link.markdown,markup.underline.link.image.markdown","settings":{"foreground":"#c678dd"}},{"scope":"string.other.link.title.markdown,string.other.link.description.markdown","settings":{"foreground":"#61afef"}},{"scope":"markup.raw.monospace.asciidoc","settings":{"foreground":"#98c379"}},{"scope":"punctuation.definition.asciidoc","settings":{"foreground":"#e5c07b"}},{"scope":"markup.list.asciidoc","settings":{"foreground":"#e5c07b"}},{"scope":"markup.link.asciidoc,markup.other.url.asciidoc","settings":{"foreground":"#c678dd"}},{"scope":"string.unquoted.asciidoc,markup.other.url.asciidoc","settings":{"foreground":"#61afef"}},{"scope":"string.regexp","settings":{"foreground":"#56b6c2"}},{"scope":"punctuation.section.embedded, variable.interpolation","settings":{"foreground":"#e06c75"}},{"scope":"punctuation.section.embedded.begin,punctuation.section.embedded.end","settings":{"foreground":"#c678dd"}},{"scope":"invalid.illegal","settings":{"foreground":"#ffffff"}},{"scope":"invalid.illegal.bad-ampersand.html","settings":{"foreground":"#abb2bf"}},{"scope":"invalid.illegal.unrecognized-tag.html","settings":{"foreground":"#e06c75"}},{"scope":"invalid.broken","settings":{"foreground":"#ffffff"}},{"scope":"invalid.deprecated","settings":{"foreground":"#ffffff"}},{"scope":"invalid.deprecated.entity.other.attribute-name.html","settings":{"foreground":"#d19a66"}},{"scope":"invalid.unimplemented","settings":{"foreground":"#ffffff"}},{"scope":"source.json meta.structure.dictionary.json > string.quoted.json","settings":{"foreground":"#e06c75"}},{"scope":"source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string","settings":{"foreground":"#e06c75"}},{"scope":"source.json meta.structure.dictionary.json > value.json > string.quoted.json,source.json meta.structure.array.json > value.json > string.quoted.json,source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation,source.json meta.structure.array.json > value.json > string.quoted.json > punctuation","settings":{"foreground":"#98c379"}},{"scope":"source.json meta.structure.dictionary.json > constant.language.json,source.json meta.structure.array.json > constant.language.json","settings":{"foreground":"#56b6c2"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#e06c75"}},{"scope":"support.type.property-name.json punctuation","settings":{"foreground":"#e06c75"}},{"scope":"text.html.laravel-blade source.php.embedded.line.html entity.name.tag.laravel-blade","settings":{"foreground":"#c678dd"}},{"scope":"text.html.laravel-blade source.php.embedded.line.html support.constant.laravel-blade","settings":{"foreground":"#c678dd"}},{"scope":"support.other.namespace.use.php,support.other.namespace.use-as.php,entity.other.alias.php,meta.interface.php","settings":{"foreground":"#e5c07b"}},{"scope":"keyword.operator.error-control.php","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.type.php","settings":{"foreground":"#c678dd"}},{"scope":"punctuation.section.array.begin.php","settings":{"foreground":"#abb2bf"}},{"scope":"punctuation.section.array.end.php","settings":{"foreground":"#abb2bf"}},{"scope":"invalid.illegal.non-null-typehinted.php","settings":{"foreground":"#f44747"}},{"scope":"storage.type.php,meta.other.type.phpdoc.php,keyword.other.type.php,keyword.other.array.phpdoc.php","settings":{"foreground":"#e5c07b"}},{"scope":"meta.function-call.php,meta.function-call.object.php,meta.function-call.static.php","settings":{"foreground":"#61afef"}},{"scope":"punctuation.definition.parameters.begin.bracket.round.php,punctuation.definition.parameters.end.bracket.round.php,punctuation.separator.delimiter.php,punctuation.section.scope.begin.php,punctuation.section.scope.end.php,punctuation.terminator.expression.php,punctuation.definition.arguments.begin.bracket.round.php,punctuation.definition.arguments.end.bracket.round.php,punctuation.definition.storage-type.begin.bracket.round.php,punctuation.definition.storage-type.end.bracket.round.php,punctuation.definition.array.begin.bracket.round.php,punctuation.definition.array.end.bracket.round.php,punctuation.definition.begin.bracket.round.php,punctuation.definition.end.bracket.round.php,punctuation.definition.begin.bracket.curly.php,punctuation.definition.end.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php,punctuation.definition.section.switch-block.start.bracket.curly.php,punctuation.definition.section.switch-block.begin.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php","settings":{"foreground":"#abb2bf"}},{"scope":"support.constant.core.rust","settings":{"foreground":"#d19a66"}},{"scope":"support.constant.ext.php,support.constant.std.php,support.constant.core.php,support.constant.parser-token.php","settings":{"foreground":"#d19a66"}},{"scope":"entity.name.goto-label.php,support.other.php","settings":{"foreground":"#61afef"}},{"scope":"keyword.operator.logical.php,keyword.operator.bitwise.php,keyword.operator.arithmetic.php","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.regexp.php","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.comparison.php","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.heredoc.php,keyword.operator.nowdoc.php","settings":{"foreground":"#c678dd"}},{"scope":"meta.function.decorator.python","settings":{"foreground":"#61afef"}},{"scope":"support.token.decorator.python,meta.function.decorator.identifier.python","settings":{"foreground":"#56b6c2"}},{"scope":"function.parameter","settings":{"foreground":"#abb2bf"}},{"scope":"function.brace","settings":{"foreground":"#abb2bf"}},{"scope":"function.parameter.ruby, function.parameter.cs","settings":{"foreground":"#abb2bf"}},{"scope":"constant.language.symbol.ruby","settings":{"foreground":"#56b6c2"}},{"scope":"constant.language.symbol.hashkey.ruby","settings":{"foreground":"#56b6c2"}},{"scope":"rgb-value","settings":{"foreground":"#56b6c2"}},{"scope":"inline-color-decoration rgb-value","settings":{"foreground":"#d19a66"}},{"scope":"less rgb-value","settings":{"foreground":"#d19a66"}},{"scope":"selector.sass","settings":{"foreground":"#e06c75"}},{"scope":"support.type.primitive.ts,support.type.builtin.ts,support.type.primitive.tsx,support.type.builtin.tsx","settings":{"foreground":"#e5c07b"}},{"scope":"block.scope.end,block.scope.begin","settings":{"foreground":"#abb2bf"}},{"scope":"storage.type.cs","settings":{"foreground":"#e5c07b"}},{"scope":"entity.name.variable.local.cs","settings":{"foreground":"#e06c75"}},{"scope":"token.info-token","settings":{"foreground":"#61afef"}},{"scope":"token.warn-token","settings":{"foreground":"#d19a66"}},{"scope":"token.error-token","settings":{"foreground":"#f44747"}},{"scope":"token.debug-token","settings":{"foreground":"#c678dd"}},{"scope":["punctuation.definition.template-expression.begin","punctuation.definition.template-expression.end","punctuation.section.embedded"],"settings":{"foreground":"#c678dd"}},{"scope":["meta.template.expression"],"settings":{"foreground":"#abb2bf"}},{"scope":["keyword.operator.module"],"settings":{"foreground":"#c678dd"}},{"scope":["support.type.type.flowtype"],"settings":{"foreground":"#61afef"}},{"scope":["support.type.primitive"],"settings":{"foreground":"#e5c07b"}},{"scope":["meta.property.object"],"settings":{"foreground":"#e06c75"}},{"scope":["variable.parameter.function.js"],"settings":{"foreground":"#e06c75"}},{"scope":["keyword.other.template.begin"],"settings":{"foreground":"#98c379"}},{"scope":["keyword.other.template.end"],"settings":{"foreground":"#98c379"}},{"scope":["keyword.other.substitution.begin"],"settings":{"foreground":"#98c379"}},{"scope":["keyword.other.substitution.end"],"settings":{"foreground":"#98c379"}},{"scope":["keyword.operator.assignment"],"settings":{"foreground":"#56b6c2"}},{"scope":["keyword.operator.assignment.go"],"settings":{"foreground":"#e5c07b"}},{"scope":["keyword.operator.arithmetic.go","keyword.operator.address.go"],"settings":{"foreground":"#c678dd"}},{"scope":["keyword.operator.arithmetic.c","keyword.operator.arithmetic.cpp"],"settings":{"foreground":"#c678dd"}},{"scope":["entity.name.package.go"],"settings":{"foreground":"#e5c07b"}},{"scope":["support.type.prelude.elm"],"settings":{"foreground":"#56b6c2"}},{"scope":["support.constant.elm"],"settings":{"foreground":"#d19a66"}},{"scope":["punctuation.quasi.element"],"settings":{"foreground":"#c678dd"}},{"scope":["constant.character.entity"],"settings":{"foreground":"#e06c75"}},{"scope":["entity.other.attribute-name.pseudo-element","entity.other.attribute-name.pseudo-class"],"settings":{"foreground":"#56b6c2"}},{"scope":["entity.global.clojure"],"settings":{"foreground":"#e5c07b"}},{"scope":["meta.symbol.clojure"],"settings":{"foreground":"#e06c75"}},{"scope":["constant.keyword.clojure"],"settings":{"foreground":"#56b6c2"}},{"scope":["meta.arguments.coffee","variable.parameter.function.coffee"],"settings":{"foreground":"#e06c75"}},{"scope":["source.ini"],"settings":{"foreground":"#98c379"}},{"scope":["meta.scope.prerequisites.makefile"],"settings":{"foreground":"#e06c75"}},{"scope":["source.makefile"],"settings":{"foreground":"#e5c07b"}},{"scope":["storage.modifier.import.groovy"],"settings":{"foreground":"#e5c07b"}},{"scope":["meta.method.groovy"],"settings":{"foreground":"#61afef"}},{"scope":["meta.definition.variable.name.groovy"],"settings":{"foreground":"#e06c75"}},{"scope":["meta.definition.class.inherited.classes.groovy"],"settings":{"foreground":"#98c379"}},{"scope":["support.variable.semantic.hlsl"],"settings":{"foreground":"#e5c07b"}},{"scope":["support.type.texture.hlsl","support.type.sampler.hlsl","support.type.object.hlsl","support.type.object.rw.hlsl","support.type.fx.hlsl","support.type.object.hlsl"],"settings":{"foreground":"#c678dd"}},{"scope":["text.variable","text.bracketed"],"settings":{"foreground":"#e06c75"}},{"scope":["support.type.swift","support.type.vb.asp"],"settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.function.xi"],"settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.class.xi"],"settings":{"foreground":"#56b6c2"}},{"scope":["constant.character.character-class.regexp.xi"],"settings":{"foreground":"#e06c75"}},{"scope":["constant.regexp.xi"],"settings":{"foreground":"#c678dd"}},{"scope":["keyword.control.xi"],"settings":{"foreground":"#56b6c2"}},{"scope":["invalid.xi"],"settings":{"foreground":"#abb2bf"}},{"scope":["beginning.punctuation.definition.quote.markdown.xi"],"settings":{"foreground":"#98c379"}},{"scope":["beginning.punctuation.definition.list.markdown.xi"],"settings":{"foreground":"#7f848e"}},{"scope":["constant.character.xi"],"settings":{"foreground":"#61afef"}},{"scope":["accent.xi"],"settings":{"foreground":"#61afef"}},{"scope":["wikiword.xi"],"settings":{"foreground":"#d19a66"}},{"scope":["constant.other.color.rgb-value.xi"],"settings":{"foreground":"#ffffff"}},{"scope":["punctuation.definition.tag.xi"],"settings":{"foreground":"#5c6370"}},{"scope":["entity.name.label.cs","entity.name.scope-resolution.function.call","entity.name.scope-resolution.function.definition"],"settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.label.cs","markup.heading.setext.1.markdown","markup.heading.setext.2.markdown"],"settings":{"foreground":"#ef6f2e"}},{"scope":[" meta.brace.square"],"settings":{"foreground":"#abb2bf"}},{"scope":"comment, punctuation.definition.comment","settings":{"fontStyle":"italic","foreground":"#7f848e"}},{"scope":"markup.quote.markdown","settings":{"foreground":"#5c6370"}},{"scope":"punctuation.definition.block.sequence.item.yaml","settings":{"foreground":"#abb2bf"}},{"scope":["constant.language.symbol.elixir","constant.language.symbol.double-quoted.elixir"],"settings":{"foreground":"#56b6c2"}},{"scope":["entity.name.variable.parameter.cs"],"settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.variable.field.cs"],"settings":{"foreground":"#e06c75"}},{"scope":"markup.deleted","settings":{"foreground":"#e06c75"}},{"scope":"markup.inserted","settings":{"foreground":"#98c379"}},{"scope":"markup.underline","settings":{"fontStyle":"underline"}},{"scope":["punctuation.section.embedded.begin.php","punctuation.section.embedded.end.php"],"settings":{"foreground":"#BE5046"}},{"scope":["support.other.namespace.php"],"settings":{"foreground":"#abb2bf"}},{"scope":["variable.parameter.function.latex"],"settings":{"foreground":"#e06c75"}},{"scope":["variable.other.object"],"settings":{"foreground":"#e5c07b"}},{"scope":["variable.other.constant.property"],"settings":{"foreground":"#e06c75"}},{"scope":["entity.other.inherited-class"],"settings":{"foreground":"#e5c07b"}},{"scope":"variable.other.readwrite.c","settings":{"foreground":"#e06c75"}},{"scope":"entity.name.variable.parameter.php,punctuation.separator.colon.php,constant.other.php","settings":{"foreground":"#abb2bf"}},{"scope":["constant.numeric.decimal.asm.x86_64"],"settings":{"foreground":"#c678dd"}},{"scope":["support.other.parenthesis.regexp"],"settings":{"foreground":"#d19a66"}},{"scope":["constant.character.escape"],"settings":{"foreground":"#56b6c2"}},{"scope":["string.regexp"],"settings":{"foreground":"#e06c75"}},{"scope":["log.info"],"settings":{"foreground":"#98c379"}},{"scope":["log.warning"],"settings":{"foreground":"#e5c07b"}},{"scope":["log.error"],"settings":{"foreground":"#e06c75"}},{"scope":"keyword.operator.expression.is","settings":{"foreground":"#c678dd"}},{"scope":"entity.name.label","settings":{"foreground":"#e06c75"}},{"scope":["support.class.math.block.environment.latex","constant.other.general.math.tex"],"settings":{"foreground":"#61afef"}},{"scope":["constant.character.math.tex"],"settings":{"foreground":"#98c379"}},{"scope":"entity.other.attribute-name.js,entity.other.attribute-name.ts,entity.other.attribute-name.jsx,entity.other.attribute-name.tsx,variable.parameter,variable.language.super","settings":{"fontStyle":"italic"}},{"scope":"comment.line.double-slash,comment.block.documentation","settings":{"fontStyle":"italic"}},{"scope":"markup.italic.markdown","settings":{"fontStyle":"italic"}}]'),o6="dark",i6={colors:e6,displayName:t6,name:n6,semanticHighlighting:r6,semanticTokenColors:a6,tokenColors:s6,type:o6},l6={"activityBar.background":"#FAFAFA","activityBar.foreground":"#121417","activityBarBadge.background":"#526FFF","activityBarBadge.foreground":"#FFFFFF","badge.background":"#526FFF","badge.foreground":"#FFFFFF","button.background":"#5871EF","button.foreground":"#FFFFFF","button.hoverBackground":"#6B83ED","diffEditor.insertedTextBackground":"#00809B33","dropdown.background":"#FFFFFF","dropdown.border":"#DBDBDC","editor.background":"#FAFAFA","editor.findMatchHighlightBackground":"#526FFF33","editor.foreground":"#383A42","editor.lineHighlightBackground":"#383A420C","editor.selectionBackground":"#E5E5E6","editorCursor.foreground":"#526FFF","editorGroup.background":"#EAEAEB","editorGroup.border":"#DBDBDC","editorGroupHeader.tabsBackground":"#EAEAEB","editorHoverWidget.background":"#EAEAEB","editorHoverWidget.border":"#DBDBDC","editorIndentGuide.activeBackground":"#626772","editorIndentGuide.background":"#383A4233","editorInlayHint.background":"#F5F5F5","editorInlayHint.foreground":"#AFB2BB","editorLineNumber.activeForeground":"#383A42","editorLineNumber.foreground":"#9D9D9F","editorRuler.foreground":"#383A4233","editorSuggestWidget.background":"#EAEAEB","editorSuggestWidget.border":"#DBDBDC","editorSuggestWidget.selectedBackground":"#FFFFFF","editorWhitespace.foreground":"#383A4233","editorWidget.background":"#EAEAEB","editorWidget.border":"#E5E5E6","extensionButton.prominentBackground":"#3BBA54","extensionButton.prominentHoverBackground":"#4CC263",focusBorder:"#526FFF","input.background":"#FFFFFF","input.border":"#DBDBDC","list.activeSelectionBackground":"#DBDBDC","list.activeSelectionForeground":"#232324","list.focusBackground":"#DBDBDC","list.highlightForeground":"#121417","list.hoverBackground":"#DBDBDC66","list.inactiveSelectionBackground":"#DBDBDC","list.inactiveSelectionForeground":"#232324","notebook.cellEditorBackground":"#F5F5F5","notification.background":"#333333","peekView.border":"#526FFF","peekViewEditor.background":"#FFFFFF","peekViewResult.background":"#EAEAEB","peekViewResult.selectionBackground":"#DBDBDC","peekViewTitle.background":"#FFFFFF","pickerGroup.border":"#526FFF","scrollbarSlider.activeBackground":"#747D9180","scrollbarSlider.background":"#4E566680","scrollbarSlider.hoverBackground":"#5A637580","sideBar.background":"#EAEAEB","sideBarSectionHeader.background":"#FAFAFA","statusBar.background":"#EAEAEB","statusBar.debuggingForeground":"#FFFFFF","statusBar.foreground":"#424243","statusBar.noFolderBackground":"#EAEAEB","statusBarItem.hoverBackground":"#DBDBDC","tab.activeBackground":"#FAFAFA","tab.activeForeground":"#121417","tab.border":"#DBDBDC","tab.inactiveBackground":"#EAEAEB","titleBar.activeBackground":"#EAEAEB","titleBar.activeForeground":"#424243","titleBar.inactiveBackground":"#EAEAEB","titleBar.inactiveForeground":"#424243"},c6="C4A Light",u6="c4a-light",d6=JSON.parse('[{"scope":["comment"],"settings":{"fontStyle":"italic","foreground":"#A0A1A7"}},{"scope":["comment markup.link"],"settings":{"foreground":"#A0A1A7"}},{"scope":["entity.name.type"],"settings":{"foreground":"#C18401"}},{"scope":["entity.other.inherited-class"],"settings":{"foreground":"#C18401"}},{"scope":["keyword"],"settings":{"foreground":"#A626A4"}},{"scope":["keyword.control"],"settings":{"foreground":"#A626A4"}},{"scope":["keyword.operator"],"settings":{"foreground":"#383A42"}},{"scope":["keyword.other.special-method"],"settings":{"foreground":"#4078F2"}},{"scope":["keyword.other.unit"],"settings":{"foreground":"#986801"}},{"scope":["storage"],"settings":{"foreground":"#A626A4"}},{"scope":["storage.type.annotation","storage.type.primitive"],"settings":{"foreground":"#A626A4"}},{"scope":["storage.modifier.package","storage.modifier.import"],"settings":{"foreground":"#383A42"}},{"scope":["constant"],"settings":{"foreground":"#986801"}},{"scope":["constant.variable"],"settings":{"foreground":"#986801"}},{"scope":["constant.character.escape"],"settings":{"foreground":"#0184BC"}},{"scope":["constant.numeric"],"settings":{"foreground":"#986801"}},{"scope":["constant.other.color"],"settings":{"foreground":"#0184BC"}},{"scope":["constant.other.symbol"],"settings":{"foreground":"#0184BC"}},{"scope":["variable"],"settings":{"foreground":"#E45649"}},{"scope":["variable.interpolation"],"settings":{"foreground":"#CA1243"}},{"scope":["variable.parameter"],"settings":{"foreground":"#383A42"}},{"scope":["string"],"settings":{"foreground":"#50A14F"}},{"scope":["string > source","string embedded"],"settings":{"foreground":"#383A42"}},{"scope":["string.regexp"],"settings":{"foreground":"#0184BC"}},{"scope":["string.regexp source.ruby.embedded"],"settings":{"foreground":"#C18401"}},{"scope":["string.other.link"],"settings":{"foreground":"#E45649"}},{"scope":["punctuation.definition.comment"],"settings":{"foreground":"#A0A1A7"}},{"scope":["punctuation.definition.method-parameters","punctuation.definition.function-parameters","punctuation.definition.parameters","punctuation.definition.separator","punctuation.definition.seperator","punctuation.definition.array"],"settings":{"foreground":"#383A42"}},{"scope":["punctuation.definition.heading","punctuation.definition.identity"],"settings":{"foreground":"#4078F2"}},{"scope":["punctuation.definition.bold"],"settings":{"fontStyle":"bold","foreground":"#C18401"}},{"scope":["punctuation.definition.italic"],"settings":{"fontStyle":"italic","foreground":"#A626A4"}},{"scope":["punctuation.section.embedded"],"settings":{"foreground":"#CA1243"}},{"scope":["punctuation.section.method","punctuation.section.class","punctuation.section.inner-class"],"settings":{"foreground":"#383A42"}},{"scope":["support.class"],"settings":{"foreground":"#C18401"}},{"scope":["support.type"],"settings":{"foreground":"#0184BC"}},{"scope":["support.function"],"settings":{"foreground":"#0184BC"}},{"scope":["support.function.any-method"],"settings":{"foreground":"#4078F2"}},{"scope":["entity.name.function"],"settings":{"foreground":"#4078F2"}},{"scope":["entity.name.class","entity.name.type.class"],"settings":{"foreground":"#C18401"}},{"scope":["entity.name.section"],"settings":{"foreground":"#4078F2"}},{"scope":["entity.name.tag"],"settings":{"foreground":"#E45649"}},{"scope":["entity.other.attribute-name"],"settings":{"foreground":"#986801"}},{"scope":["entity.other.attribute-name.id"],"settings":{"foreground":"#4078F2"}},{"scope":["meta.class"],"settings":{"foreground":"#C18401"}},{"scope":["meta.class.body"],"settings":{"foreground":"#383A42"}},{"scope":["meta.method-call","meta.method"],"settings":{"foreground":"#383A42"}},{"scope":["meta.definition.variable"],"settings":{"foreground":"#E45649"}},{"scope":["meta.link"],"settings":{"foreground":"#986801"}},{"scope":["meta.require"],"settings":{"foreground":"#4078F2"}},{"scope":["meta.selector"],"settings":{"foreground":"#A626A4"}},{"scope":["meta.separator"],"settings":{"foreground":"#383A42"}},{"scope":["meta.tag"],"settings":{"foreground":"#383A42"}},{"scope":["underline"],"settings":{"text-decoration":"underline"}},{"scope":["none"],"settings":{"foreground":"#383A42"}},{"scope":["invalid.deprecated"],"settings":{"background":"#F2A60D","foreground":"#000000"}},{"scope":["invalid.illegal"],"settings":{"background":"#FF1414","foreground":"#50A14F"}},{"scope":["markup.bold"],"settings":{"fontStyle":"bold","foreground":"#986801"}},{"scope":["markup.changed"],"settings":{"foreground":"#A626A4"}},{"scope":["markup.deleted"],"settings":{"foreground":"#E45649"}},{"scope":["markup.italic"],"settings":{"fontStyle":"italic","foreground":"#A626A4"}},{"scope":["markup.heading"],"settings":{"foreground":"#ef6f2e"}},{"scope":["markup.heading punctuation.definition.heading"],"settings":{"foreground":"#ef6f2e"}},{"scope":["markup.link"],"settings":{"foreground":"#0184BC"}},{"scope":["markup.inserted"],"settings":{"foreground":"#50A14F"}},{"scope":["markup.quote"],"settings":{"foreground":"#986801"}},{"scope":["markup.raw"],"settings":{"foreground":"#50A14F"}},{"scope":["source.c keyword.operator"],"settings":{"foreground":"#A626A4"}},{"scope":["source.cpp keyword.operator"],"settings":{"foreground":"#A626A4"}},{"scope":["source.cs keyword.operator"],"settings":{"foreground":"#A626A4"}},{"scope":["source.css property-name","source.css property-value"],"settings":{"foreground":"#696C77"}},{"scope":["source.css property-name.support","source.css property-value.support"],"settings":{"foreground":"#383A42"}},{"scope":["source.elixir source.embedded.source"],"settings":{"foreground":"#383A42"}},{"scope":["source.elixir constant.language","source.elixir constant.numeric","source.elixir constant.definition"],"settings":{"foreground":"#4078F2"}},{"scope":["source.elixir variable.definition","source.elixir variable.anonymous"],"settings":{"foreground":"#A626A4"}},{"scope":["source.elixir parameter.variable.function"],"settings":{"fontStyle":"italic","foreground":"#986801"}},{"scope":["source.elixir quoted"],"settings":{"foreground":"#50A14F"}},{"scope":["source.elixir keyword.special-method","source.elixir embedded.section","source.elixir embedded.source.empty"],"settings":{"foreground":"#E45649"}},{"scope":["source.elixir readwrite.module punctuation"],"settings":{"foreground":"#E45649"}},{"scope":["source.elixir regexp.section","source.elixir regexp.string"],"settings":{"foreground":"#CA1243"}},{"scope":["source.elixir separator","source.elixir keyword.operator"],"settings":{"foreground":"#986801"}},{"scope":["source.elixir variable.constant"],"settings":{"foreground":"#C18401"}},{"scope":["source.elixir array","source.elixir scope","source.elixir section"],"settings":{"foreground":"#696C77"}},{"scope":["source.gfm markup"],"settings":{"-webkit-font-smoothing":"auto"}},{"scope":["source.gfm link entity"],"settings":{"foreground":"#4078F2"}},{"scope":["source.go storage.type.string"],"settings":{"foreground":"#A626A4"}},{"scope":["source.ini keyword.other.definition.ini"],"settings":{"foreground":"#E45649"}},{"scope":["source.java storage.modifier.import"],"settings":{"foreground":"#C18401"}},{"scope":["source.java storage.type"],"settings":{"foreground":"#C18401"}},{"scope":["source.java keyword.operator.instanceof"],"settings":{"foreground":"#A626A4"}},{"scope":["source.java-properties meta.key-pair"],"settings":{"foreground":"#E45649"}},{"scope":["source.java-properties meta.key-pair > punctuation"],"settings":{"foreground":"#383A42"}},{"scope":["source.js keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["source.js keyword.operator.delete","source.js keyword.operator.in","source.js keyword.operator.of","source.js keyword.operator.instanceof","source.js keyword.operator.new","source.js keyword.operator.typeof","source.js keyword.operator.void"],"settings":{"foreground":"#A626A4"}},{"scope":["source.ts keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["source.flow keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["source.json meta.structure.dictionary.json > string.quoted.json"],"settings":{"foreground":"#E45649"}},{"scope":["source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string"],"settings":{"foreground":"#E45649"}},{"scope":["source.json meta.structure.dictionary.json > value.json > string.quoted.json","source.json meta.structure.array.json > value.json > string.quoted.json","source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation","source.json meta.structure.array.json > value.json > string.quoted.json > punctuation"],"settings":{"foreground":"#50A14F"}},{"scope":["source.json meta.structure.dictionary.json > constant.language.json","source.json meta.structure.array.json > constant.language.json"],"settings":{"foreground":"#0184BC"}},{"scope":["ng.interpolation"],"settings":{"foreground":"#E45649"}},{"scope":["ng.interpolation.begin","ng.interpolation.end"],"settings":{"foreground":"#4078F2"}},{"scope":["ng.interpolation function"],"settings":{"foreground":"#E45649"}},{"scope":["ng.interpolation function.begin","ng.interpolation function.end"],"settings":{"foreground":"#4078F2"}},{"scope":["ng.interpolation bool"],"settings":{"foreground":"#986801"}},{"scope":["ng.interpolation bracket"],"settings":{"foreground":"#383A42"}},{"scope":["ng.pipe","ng.operator"],"settings":{"foreground":"#383A42"}},{"scope":["ng.tag"],"settings":{"foreground":"#0184BC"}},{"scope":["ng.attribute-with-value attribute-name"],"settings":{"foreground":"#C18401"}},{"scope":["ng.attribute-with-value string"],"settings":{"foreground":"#A626A4"}},{"scope":["ng.attribute-with-value string.begin","ng.attribute-with-value string.end"],"settings":{"foreground":"#383A42"}},{"scope":["source.ruby constant.other.symbol > punctuation"],"settings":{"foreground":"inherit"}},{"scope":["source.php class.bracket"],"settings":{"foreground":"#383A42"}},{"scope":["source.python keyword.operator.logical.python"],"settings":{"foreground":"#A626A4"}},{"scope":["source.python variable.parameter"],"settings":{"foreground":"#986801"}},{"scope":"customrule","settings":{"foreground":"#383A42"}},{"scope":"support.type.property-name","settings":{"foreground":"#383A42"}},{"scope":"string.quoted.double punctuation","settings":{"foreground":"#50A14F"}},{"scope":"support.constant","settings":{"foreground":"#986801"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#E45649"}},{"scope":"support.type.property-name.json punctuation","settings":{"foreground":"#E45649"}},{"scope":["punctuation.separator.key-value.ts","punctuation.separator.key-value.js","punctuation.separator.key-value.tsx"],"settings":{"foreground":"#0184BC"}},{"scope":["source.js.embedded.html keyword.operator","source.ts.embedded.html keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["variable.other.readwrite.js","variable.other.readwrite.ts","variable.other.readwrite.tsx"],"settings":{"foreground":"#383A42"}},{"scope":["support.variable.dom.js","support.variable.dom.ts"],"settings":{"foreground":"#E45649"}},{"scope":["support.variable.property.dom.js","support.variable.property.dom.ts"],"settings":{"foreground":"#E45649"}},{"scope":["meta.template.expression.js punctuation.definition","meta.template.expression.ts punctuation.definition"],"settings":{"foreground":"#CA1243"}},{"scope":["source.ts punctuation.definition.typeparameters","source.js punctuation.definition.typeparameters","source.tsx punctuation.definition.typeparameters"],"settings":{"foreground":"#383A42"}},{"scope":["source.ts punctuation.definition.block","source.js punctuation.definition.block","source.tsx punctuation.definition.block"],"settings":{"foreground":"#383A42"}},{"scope":["source.ts punctuation.separator.comma","source.js punctuation.separator.comma","source.tsx punctuation.separator.comma"],"settings":{"foreground":"#383A42"}},{"scope":["support.variable.property.js","support.variable.property.ts","support.variable.property.tsx"],"settings":{"foreground":"#E45649"}},{"scope":["keyword.control.default.js","keyword.control.default.ts","keyword.control.default.tsx"],"settings":{"foreground":"#E45649"}},{"scope":["keyword.operator.expression.instanceof.js","keyword.operator.expression.instanceof.ts","keyword.operator.expression.instanceof.tsx"],"settings":{"foreground":"#A626A4"}},{"scope":["keyword.operator.expression.of.js","keyword.operator.expression.of.ts","keyword.operator.expression.of.tsx"],"settings":{"foreground":"#A626A4"}},{"scope":["meta.brace.round.js","meta.array-binding-pattern-variable.js","meta.brace.square.js","meta.brace.round.ts","meta.array-binding-pattern-variable.ts","meta.brace.square.ts","meta.brace.round.tsx","meta.array-binding-pattern-variable.tsx","meta.brace.square.tsx"],"settings":{"foreground":"#383A42"}},{"scope":["source.js punctuation.accessor","source.ts punctuation.accessor","source.tsx punctuation.accessor"],"settings":{"foreground":"#383A42"}},{"scope":["punctuation.terminator.statement.js","punctuation.terminator.statement.ts","punctuation.terminator.statement.tsx"],"settings":{"foreground":"#383A42"}},{"scope":["meta.array-binding-pattern-variable.js variable.other.readwrite.js","meta.array-binding-pattern-variable.ts variable.other.readwrite.ts","meta.array-binding-pattern-variable.tsx variable.other.readwrite.tsx"],"settings":{"foreground":"#986801"}},{"scope":["source.js support.variable","source.ts support.variable","source.tsx support.variable"],"settings":{"foreground":"#E45649"}},{"scope":["variable.other.constant.property.js","variable.other.constant.property.ts","variable.other.constant.property.tsx"],"settings":{"foreground":"#986801"}},{"scope":["keyword.operator.new.ts","keyword.operator.new.j","keyword.operator.new.tsx"],"settings":{"foreground":"#A626A4"}},{"scope":["source.ts keyword.operator","source.tsx keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["punctuation.separator.parameter.js","punctuation.separator.parameter.ts","punctuation.separator.parameter.tsx "],"settings":{"foreground":"#383A42"}},{"scope":["constant.language.import-export-all.js","constant.language.import-export-all.ts"],"settings":{"foreground":"#E45649"}},{"scope":["constant.language.import-export-all.jsx","constant.language.import-export-all.tsx"],"settings":{"foreground":"#0184BC"}},{"scope":["keyword.control.as.js","keyword.control.as.ts","keyword.control.as.jsx","keyword.control.as.tsx"],"settings":{"foreground":"#383A42"}},{"scope":["variable.other.readwrite.alias.js","variable.other.readwrite.alias.ts","variable.other.readwrite.alias.jsx","variable.other.readwrite.alias.tsx"],"settings":{"foreground":"#E45649"}},{"scope":["variable.other.constant.js","variable.other.constant.ts","variable.other.constant.jsx","variable.other.constant.tsx"],"settings":{"foreground":"#986801"}},{"scope":["meta.export.default.js variable.other.readwrite.js","meta.export.default.ts variable.other.readwrite.ts"],"settings":{"foreground":"#E45649"}},{"scope":["source.js meta.template.expression.js punctuation.accessor","source.ts meta.template.expression.ts punctuation.accessor","source.tsx meta.template.expression.tsx punctuation.accessor"],"settings":{"foreground":"#50A14F"}},{"scope":["source.js meta.import-equals.external.js keyword.operator","source.jsx meta.import-equals.external.jsx keyword.operator","source.ts meta.import-equals.external.ts keyword.operator","source.tsx meta.import-equals.external.tsx keyword.operator"],"settings":{"foreground":"#383A42"}},{"scope":"entity.name.type.module.js,entity.name.type.module.ts,entity.name.type.module.jsx,entity.name.type.module.tsx","settings":{"foreground":"#50A14F"}},{"scope":"meta.class.js,meta.class.ts,meta.class.jsx,meta.class.tsx","settings":{"foreground":"#383A42"}},{"scope":["meta.definition.property.js variable","meta.definition.property.ts variable","meta.definition.property.jsx variable","meta.definition.property.tsx variable"],"settings":{"foreground":"#383A42"}},{"scope":["meta.type.parameters.js support.type","meta.type.parameters.jsx support.type","meta.type.parameters.ts support.type","meta.type.parameters.tsx support.type"],"settings":{"foreground":"#383A42"}},{"scope":["source.js meta.tag.js keyword.operator","source.jsx meta.tag.jsx keyword.operator","source.ts meta.tag.ts keyword.operator","source.tsx meta.tag.tsx keyword.operator"],"settings":{"foreground":"#383A42"}},{"scope":["meta.tag.js punctuation.section.embedded","meta.tag.jsx punctuation.section.embedded","meta.tag.ts punctuation.section.embedded","meta.tag.tsx punctuation.section.embedded"],"settings":{"foreground":"#383A42"}},{"scope":["meta.array.literal.js variable","meta.array.literal.jsx variable","meta.array.literal.ts variable","meta.array.literal.tsx variable"],"settings":{"foreground":"#C18401"}},{"scope":["support.type.object.module.js","support.type.object.module.jsx","support.type.object.module.ts","support.type.object.module.tsx"],"settings":{"foreground":"#E45649"}},{"scope":["constant.language.json"],"settings":{"foreground":"#0184BC"}},{"scope":["variable.other.constant.object.js","variable.other.constant.object.jsx","variable.other.constant.object.ts","variable.other.constant.object.tsx"],"settings":{"foreground":"#986801"}},{"scope":["storage.type.property.js","storage.type.property.jsx","storage.type.property.ts","storage.type.property.tsx"],"settings":{"foreground":"#0184BC"}},{"scope":["meta.template.expression.js string.quoted punctuation.definition","meta.template.expression.jsx string.quoted punctuation.definition","meta.template.expression.ts string.quoted punctuation.definition","meta.template.expression.tsx string.quoted punctuation.definition"],"settings":{"foreground":"#50A14F"}},{"scope":["meta.template.expression.js string.template punctuation.definition.string.template","meta.template.expression.jsx string.template punctuation.definition.string.template","meta.template.expression.ts string.template punctuation.definition.string.template","meta.template.expression.tsx string.template punctuation.definition.string.template"],"settings":{"foreground":"#50A14F"}},{"scope":["keyword.operator.expression.in.js","keyword.operator.expression.in.jsx","keyword.operator.expression.in.ts","keyword.operator.expression.in.tsx"],"settings":{"foreground":"#A626A4"}},{"scope":["variable.other.object.js","variable.other.object.ts"],"settings":{"foreground":"#383A42"}},{"scope":["meta.object-literal.key.js","meta.object-literal.key.ts"],"settings":{"foreground":"#E45649"}},{"scope":"source.python constant.other","settings":{"foreground":"#383A42"}},{"scope":"source.python constant","settings":{"foreground":"#986801"}},{"scope":"constant.character.format.placeholder.other.python storage","settings":{"foreground":"#986801"}},{"scope":"support.variable.magic.python","settings":{"foreground":"#E45649"}},{"scope":"meta.function.parameters.python","settings":{"foreground":"#986801"}},{"scope":"punctuation.separator.annotation.python","settings":{"foreground":"#383A42"}},{"scope":"punctuation.separator.parameters.python","settings":{"foreground":"#383A42"}},{"scope":"entity.name.variable.field.cs","settings":{"foreground":"#E45649"}},{"scope":"source.cs keyword.operator","settings":{"foreground":"#383A42"}},{"scope":"variable.other.readwrite.cs","settings":{"foreground":"#383A42"}},{"scope":"variable.other.object.cs","settings":{"foreground":"#383A42"}},{"scope":"variable.other.object.property.cs","settings":{"foreground":"#383A42"}},{"scope":"entity.name.variable.property.cs","settings":{"foreground":"#4078F2"}},{"scope":"storage.type.cs","settings":{"foreground":"#C18401"}},{"scope":"keyword.other.unsafe.rust","settings":{"foreground":"#A626A4"}},{"scope":"entity.name.type.rust","settings":{"foreground":"#0184BC"}},{"scope":"storage.modifier.lifetime.rust","settings":{"foreground":"#383A42"}},{"scope":"entity.name.lifetime.rust","settings":{"foreground":"#986801"}},{"scope":"storage.type.core.rust","settings":{"foreground":"#0184BC"}},{"scope":"meta.attribute.rust","settings":{"foreground":"#986801"}},{"scope":"storage.class.std.rust","settings":{"foreground":"#0184BC"}},{"scope":"markup.raw.block.markdown","settings":{"foreground":"#383A42"}},{"scope":"punctuation.definition.variable.shell","settings":{"foreground":"#E45649"}},{"scope":"support.constant.property-value.css","settings":{"foreground":"#383A42"}},{"scope":"punctuation.definition.constant.css","settings":{"foreground":"#986801"}},{"scope":"punctuation.separator.key-value.scss","settings":{"foreground":"#E45649"}},{"scope":"punctuation.definition.constant.scss","settings":{"foreground":"#986801"}},{"scope":"meta.property-list.scss punctuation.separator.key-value.scss","settings":{"foreground":"#383A42"}},{"scope":"storage.type.primitive.array.java","settings":{"foreground":"#C18401"}},{"scope":"entity.name.section.markdown","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.heading.markdown","settings":{"foreground":"#ef6f2e"}},{"scope":"markup.heading.setext","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.bold.markdown","settings":{"foreground":"#986801"}},{"scope":"markup.inline.raw.markdown","settings":{"foreground":"#50A14F"}},{"scope":"beginning.punctuation.definition.list.markdown","settings":{"foreground":"#E45649"}},{"scope":"markup.quote.markdown","settings":{"fontStyle":"italic","foreground":"#A0A1A7"}},{"scope":["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","punctuation.definition.metadata.markdown"],"settings":{"foreground":"#383A42"}},{"scope":"punctuation.definition.metadata.markdown","settings":{"foreground":"#A626A4"}},{"scope":["markup.underline.link.markdown","markup.underline.link.image.markdown"],"settings":{"foreground":"#A626A4"}},{"scope":["string.other.link.title.markdown","string.other.link.description.markdown"],"settings":{"foreground":"#4078F2"}},{"scope":"punctuation.separator.variable.ruby","settings":{"foreground":"#E45649"}},{"scope":"variable.other.constant.ruby","settings":{"foreground":"#986801"}},{"scope":"keyword.operator.other.ruby","settings":{"foreground":"#50A14F"}},{"scope":"punctuation.definition.variable.php","settings":{"foreground":"#E45649"}},{"scope":"meta.class.php","settings":{"foreground":"#383A42"}}]'),f6="light",p6={colors:l6,displayName:c6,name:u6,tokenColors:d6,type:f6},h6={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",go:"go",rs:"rust",java:"java",kt:"kotlin",rb:"ruby",php:"php",cs:"csharp",cpp:"cpp",c:"c",h:"c",swift:"swift",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",html:"html",css:"css",scss:"scss",sql:"sql",sh:"bash",bash:"bash",zsh:"bash",dockerfile:"dockerfile"};function m6(e){if(!e)return"plaintext";const t=e.split(".").pop()?.toLowerCase();return t?h6[t]??"plaintext":"plaintext"}function Xv({code:e,language:t,sourcePath:r}){const a=Sm(f=>f.theme),l=(a==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a)==="dark"?i6:p6,u=t??m6(r);return c.jsx("div",{className:"flex min-w-0 flex-1 flex-col rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface text-xs leading-relaxed overflow-auto c4a-scrollbar [&>*]:flex-1 [&_pre]:min-h-full [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:!bg-transparent [&_code]:!bg-transparent",children:c.jsx(WD,{language:u,theme:l,children:e})})}let hu=null,mu=[];const gu=ea((e,t)=>({cache:new Map,pending:new Set,resolve:r=>{const{cache:a,pending:o}=t(),l=r.filter(u=>!a.has(u)&&!o.has(u)&&!mu.includes(u));l.length!==0&&(mu.push(...l),e({pending:new Set([...o,...l])}),hu&&clearTimeout(hu),hu=setTimeout(()=>{const u=[...mu];mu=[],hu=null,u.length!==0&&ze.post("/resolve",{refs:u}).then(f=>{const{cache:h,pending:p}=t(),m=new Map(h),x=new Set(p);for(const v of u){const _=f[v];_?m.set(v,_):m.set(v,{exists:!1}),x.delete(v)}e({cache:m,pending:x})}).catch(()=>{const{cache:f,pending:h}=t(),p=new Map(f),m=new Set(h);for(const x of u)p.set(x,{error:!0,exists:!1}),m.delete(x);e({cache:p,pending:m})})},50))},retry:r=>{const{cache:a}=t(),o=new Map(a);o.delete(r),e({cache:o}),t().resolve([r])}})),uh="/studio",sr={entity:e=>`${uh}/entities/${e}`,relation:e=>`${uh}/relations/${e}`,content:e=>`${uh}/contents/${e}`},lw=/^ref:(entity|relation|content):(.+)$/;function g6(e){const t=lw.exec(e);return!t||!t[2]?null:{type:t[1],id:t[2]}}function zm(e){return typeof e=="string"&&lw.test(e)}const Qv={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function x6(e,t){if(e.type==="content")return"📄";if(e.type==="relation")return"🔗";const r=t?.entity_type;return r&&Qv[r]?Qv[r]:"🔹"}function y6(e){switch(e.type){case"entity":return sr.entity(e.id);case"relation":return sr.relation(e.id);case"content":return sr.content(e.id);default:return"#"}}function $m({pointer:e}){const t=Tt(),{t:r}=ye(),a=Ko(),o=gu(_=>_.cache),l=gu(_=>_.pending);b.useEffect(()=>{gu.getState().resolve([e])},[e]);const u=g6(e);if(!u)return c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:e});const f=o.get(e);if(l.has(e)||!f&&!o.has(e))return c.jsx("span",{className:"inline-block animate-pulse bg-c4a-bg-hover rounded px-2 py-0.5 text-xs font-mono w-24 h-4"});if(f?.error)return c.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted cursor-pointer",title:r("ref.retry"),onClick:()=>gu.getState().retry(e),children:["<",r("ref.unknown"),": ",u.id.slice(0,12),">"]});if(f&&!f.exists)return c.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted line-through",title:e,children:["<",r("ref.stale"),": ",u.id.slice(0,12),">"]});const p=x6(u,f),m=u.type==="relation"?f?.relation_type||u.id.slice(0,12):f?.name||u.id.slice(0,12),x=y6(u),v=()=>{a?.active?a.navigate(u.type,u.id,m,p):t(x)};return c.jsxs("span",{className:"inline-flex items-center gap-1 text-c4a-accent hover:underline cursor-pointer text-xs font-mono",onClick:v,title:e,children:[c.jsx("span",{children:p}),c.jsx("span",{children:m})]})}function Hl({data:e,defaultExpanded:t=2}){return c.jsx("div",{className:"font-mono text-xs",children:c.jsx(Zh,{value:e,depth:0,defaultExpanded:t})})}function Zh({keyName:e,value:t,depth:r,defaultExpanded:a}){const[o,l]=b.useState(r<a);if(typeof t=="string"&&zm(t))return c.jsxs("div",{className:"flex items-baseline gap-1",style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsx($m,{pointer:t})]});if(t==null)return c.jsxs("div",{style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsx("span",{className:"text-c4a-text-muted",children:"null"})]});if(typeof t=="string")return c.jsxs("div",{style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsxs("span",{className:"text-c4a-accent",children:['"',t,'"']})]});if(typeof t=="number")return c.jsxs("div",{style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsx("span",{className:"text-c4a-success",children:t})]});if(typeof t=="boolean")return c.jsxs("div",{style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsx("span",{className:"text-c4a-warning",children:String(t)})]});if(Array.isArray(t))return t.length===0?c.jsxs("div",{style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsx("span",{className:"text-c4a-text-muted",children:"[]"})]}):c.jsxs("div",{children:[c.jsxs("div",{style:{paddingLeft:r*16},className:"cursor-pointer hover:bg-c4a-bg-hover rounded px-1 -mx-1",onClick:()=>l(!o),children:[c.jsx("span",{className:"text-c4a-text-muted mr-1",children:o?"▼":"▶"}),e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),!o&&c.jsxs("span",{className:"text-c4a-text-muted",children:["[",t.length," items]"]})]}),o&&t.map((u,f)=>c.jsx(Zh,{keyName:String(f),value:u,depth:r+1,defaultExpanded:a},f))]});if(typeof t=="object"){const u=Object.entries(t);return u.length===0?c.jsxs("div",{style:{paddingLeft:r*16},children:[e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),c.jsx("span",{className:"text-c4a-text-muted",children:"{}"})]}):c.jsxs("div",{children:[c.jsxs("div",{style:{paddingLeft:r*16},className:"cursor-pointer hover:bg-c4a-bg-hover rounded px-1 -mx-1",onClick:()=>l(!o),children:[c.jsx("span",{className:"text-c4a-text-muted mr-1",children:o?"▼":"▶"}),e!==void 0&&c.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),!o&&c.jsx("span",{className:"text-c4a-text-muted",children:"{ ... }"})]}),o&&u.map(([f,h])=>c.jsx(Zh,{keyName:f,value:h,depth:r+1,defaultExpanded:a},f))]})}return null}const b6={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function Zv({entity:e}){const t=Tt(),r=Ko(),a=b6[e.type]??"🔹",o=()=>{r?.active?r.navigate("entity",e.id,e.name,a):t(sr.entity(e.id))};return c.jsx("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-3 cursor-pointer hover:border-c4a-accent transition-colors",onClick:o,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"shrink-0",children:a}),c.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:e.name}),e.kind&&c.jsx(Bt,{variant:"muted",children:e.kind})]})})}const v6=new Set(["ts","tsx","js","jsx","mts","mjs","cts","cjs","py","pyi","go","rs","java","kt","c","cpp","h","hpp","cs","rb","php","swift","scala","zig","lua","sh","bash","vue","svelte"]),_6=new Set(["md","txt","rst","adoc"]);function Jv(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}function Wv({data:e}){const{t}=ye(),r=Tt(),a=Ko(),o=e.manifest??{},l=o.name??e.name??t("package.unknown"),u=o.version,f=o.license,h=o.description,p=o.dependencies,m=o.devDependencies,x=p?Object.entries(p):[],v=m?Object.entries(m):[],[_,w]=b.useState(!1),[S,k]=b.useState(null),N=e.files??[],A=N.filter(L=>v6.has(Jv(L.path))),E=N.filter(L=>_6.has(Jv(L.path)));b.useEffect(()=>{const L=N.find($=>{const z=$.path.toLowerCase();return(z==="readme.md"||z.endsWith("/readme.md"))&&$.hash_id});if(!L?.hash_id){k(null);return}ze.get(`/contents/${L.hash_id}/raw`).then($=>k($.content)).catch(()=>k(null))},[N]);const D=(L,$)=>{a?.active?a.navigate("content",L,$,"📄"):r(sr.content(L))};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:t("raw.basic_info")}),c.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 font-mono text-xs",children:[c.jsx("span",{className:"text-c4a-text-muted uppercase",children:t("raw.field.name")}),c.jsx("span",{className:"text-c4a-text-primary font-bold",children:l}),u&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-c4a-text-muted uppercase",children:t("raw.field.version")}),c.jsx("span",{className:"text-c4a-text-primary",children:u})]}),f&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-c4a-text-muted uppercase",children:t("raw.field.license")}),c.jsx("span",{className:"text-c4a-text-primary",children:f})]}),h&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-c4a-text-muted uppercase",children:t("raw.field.description")}),c.jsx("span",{className:"text-c4a-text-secondary",children:h})]})]}),e.manifest_type&&c.jsx("div",{className:"mt-2",children:c.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase text-c4a-accent/60",children:e.manifest_type})})]}),N.length>0&&c.jsxs("div",{className:"flex flex-wrap gap-3",children:[c.jsx(ln,{icon:c.jsx(vm,{size:14}),label:t("raw.code_files"),value:A.length,size:"sm"}),c.jsx(ln,{icon:c.jsx(On,{size:14}),label:t("raw.doc_files"),value:E.length,size:"sm"}),c.jsx(ln,{icon:c.jsx(Dr,{size:14}),label:t("raw.total_files"),value:N.length,size:"sm"})]}),c.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsxs("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:[t("raw.dependencies")," (",x.length,")"]}),x.length===0?c.jsx("p",{className:"font-mono text-xs text-c4a-text-muted",children:t("raw.no_dependencies")}):c.jsx("div",{className:"space-y-1",children:x.map(([L,$])=>c.jsxs("div",{className:"flex justify-between font-mono text-xs",children:[c.jsx("span",{className:"text-c4a-text-primary",children:L}),c.jsx("span",{className:"text-c4a-text-muted",children:$})]},L))})]}),v.length>0&&c.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5",onClick:()=>w(L=>!L),children:[c.jsx($t,{size:12,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${_?"rotate-90":""}`}),c.jsxs("h4",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:[t("raw.dev_dependencies")," (",v.length,")"]})]}),_&&c.jsx("div",{className:"mt-2 space-y-1",children:v.map(([L,$])=>c.jsxs("div",{className:"flex justify-between font-mono text-xs",children:[c.jsx("span",{className:"text-c4a-text-primary",children:L}),c.jsx("span",{className:"text-c4a-text-muted",children:$})]},L))})]}),S&&c.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:t("raw.readme")}),c.jsx("div",{className:"max-h-64 overflow-y-auto c4a-scrollbar prose prose-invert prose-sm max-w-none text-c4a-text-secondary",children:c.jsx("pre",{className:"whitespace-pre-wrap font-sans text-sm leading-relaxed",children:S})})]}),N.length>0&&c.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsxs("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:[t("package.files")," (",N.length,")"]}),c.jsx("div",{className:"space-y-1",children:N.map(L=>c.jsxs("div",{className:"flex items-center justify-between font-mono text-xs",children:[c.jsxs("span",{className:"flex items-center gap-1 text-c4a-text-secondary",children:[c.jsx("span",{children:"📄"}),c.jsx("span",{children:L.path})]}),L.hash_id&&c.jsx("span",{className:"font-mono text-[10px] text-c4a-accent hover:underline cursor-pointer",onClick:()=>D(L.hash_id,L.path),children:L.hash_id.slice(0,12)})]},L.path))})]})]})}const xu=["daemon_starting","cloning","preparing"],w6=["scanning","parsing","analyzing","uploading"],Ki=["chunking","annotating","post-processing","embedding","storing"],Jh={daemon_starting:"index.stage.daemon_starting",cloning:"index.stage.cloning",preparing:"index.stage.preparing",scanning:"index.stage.scanning",parsing:"index.stage.parsing",analyzing:"index.stage.analyzing",uploading:"index.stage.uploading",skipping:"index.stage.skipping",chunking:"index.stage.chunking",annotating:"index.stage.annotating","post-processing":"index.stage.post_processing",embedding:"index.stage.embedding",storing:"index.stage.storing"},e_={daemon_starting:5,cloning:10,preparing:5,scanning:15,parsing:55,analyzing:20,uploading:10},S6={chunking:10,annotating:75,"post-processing":85,embedding:95,storing:100};function j6(e){const t=e.reduce((o,l)=>o+(e_[l]??10),0),r={};let a=0;for(const o of e)a+=(e_[o]??10)/t*100,r[o]=Math.round(a);return r[e[e.length-1]]=100,r}const k6={COMMIT_NOT_AVAILABLE:"index.error.commit_not_available",DAEMON_AUTO_START_FAILED:"index.error.daemon_start_failed",GIT_ARCHIVE_FAILED:"index.error.git_archive_failed"};function N6(e,t){if(e){const r=k6[e];return r?t(r):e}return t("index.code.error")}function Xi(){const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`}function yu(e,t,r,a){switch(e){case"daemon_starting":return t("index.log.daemon_ready");case"cloning":return t("index.log.clone_done");case"preparing":return t("index.log.prepare_done");case"scanning":return t("index.log.scan_done");case"parsing":return r!=null?t("index.log.parse_done",{count:r}):`${t(Jh.parsing)} ${t("index.log.done_suffix")}`;case"analyzing":return t("index.log.analyze_done");case"uploading":return a?t("index.log.upload_done",{name:a}):t("index.log.done_suffix");default:return`${t(Jh[e])} ${t("index.log.done_suffix")}`}}function E6({sourceId:e,onComplete:t,retryModules:r}){const{t:a}=ye(),o=kt(ne=>ne.indexingTasks.get(e)),[l,u]=b.useState([]),[f,h]=b.useState(!1),[p,m]=b.useState(!1),x=b.useRef(null),v=b.useRef(!1),_=b.useRef(null),w=b.useRef(null),[S,k]=b.useState(null),N=b.useRef(null),[A,E]=b.useState([]),[D,L]=b.useState(null),[$,z]=b.useState(new Set),[R,B]=b.useState(!0);b.useEffect(()=>{if(!o)return;const ne=o.stage;S!=="doc"&&xu.includes(ne)&&!$.has(ne)&&z(ge=>new Set(ge).add(ne))},[o?.stage,S]),b.useEffect(()=>{if(o?.stage){if(Ki.includes(o.stage)){S!=="doc"&&(k("doc"),x.current=null);return}!S&&o.stage!=="pending"&&o.stage!=="skipping"&&k("code")}},[o?.stage,S]),b.useEffect(()=>{o?.stage&&o.stage!=="skipping"&&o.stage!=="pending"&&(w.current=o.stage)},[o?.stage]);const H=S==="doc"||o?.stage&&Ki.includes(o.stage)?"doc":S??"code",J=H==="doc"?Ki:[...xu.filter(ne=>$.has(ne)),...w6],oe=J.map(ne=>({key:ne,label:a(Jh[ne])})),ce=H==="doc"?S6:j6(J),M=b.useRef(0);b.useEffect(()=>{const ne=o?.pendingSkips;if(!ne||ne.length===0)return;const ge=ne.length;if(ge<=M.current)return;const Ne=ne.slice(M.current);M.current=ge;const qe=Xi();u(Fe=>[...Fe,...Ne.map(be=>`[${qe}] ⏭ ${be}`)].slice(-500))},[o?.pendingSkips]);const P=b.useRef(null),T=b.useRef(null);b.useEffect(()=>{if(!o||o.terminalState)return;const{stage:ne,currentFile:ge,totalFiles:Ne,processedFiles:qe,moduleName:Fe}=o;if(H==="doc"){const he=Xi(),ve=[],Ve=Ki.indexOf(ne);if(ne!==x.current&&(ne==="chunking"&&ve.push(`[${he}] ${a("index.doc.log.chunking")}`),ne==="annotating"&&ve.push(`[${he}] ${a("index.doc.log.annotating_start")}`),ne==="post-processing"&&ve.push(`[${he}] ${a("index.doc.log.post_processing")}`),ne==="embedding"&&ve.push(`[${he}] ${a("index.doc.log.embedding")}`),ne==="storing"&&ve.push(`[${he}] ${a("index.doc.log.storing")}`),Ve>=0&&E(De=>{const Xe=new Set(De);for(const It of Ki.slice(0,Ve))Xe.add(It);return Xe.size===De.length?De:[...Xe]}),L(ne),x.current=ne),o.message){const De=typeof o.message=="string"?o.message:a(o.message.key,o.message.params);De!==N.current&&(ve.push(`[${he}] ${De}`),N.current=De)}ve.length>0&&u(De=>[...De,...ve].slice(-500));return}if(ne==="skipping")return;const be=Xi(),fe=[],_e=Fe!=null&&Fe!==P.current;if(ne!==x.current){if(x.current==="pending"||x.current===null){L(ne),x.current=ne;const ve=J.indexOf(ne);ve>0&&E(Ve=>{const De=new Set(Ve);for(const Xe of J.slice(0,ve))De.add(Xe);return De.size===Ve.length?Ve:[...De]}),xu.includes(ne)&&fe.push(`[${be}] ${a(`index.log.${ne}`)}`),fe.length>0&&u(Ve=>[...Ve,...fe].slice(-500));return}const he=J.indexOf(ne);if(he>=0){const ve=J.slice(0,he);if(E(Ve=>{const De=new Set(Ve);for(const Xe of ve)De.add(Xe);return De.size===Ve.length?Ve:[...De]}),x.current&&x.current!=="skipping"){const Ve=J.indexOf(x.current);if(Ve<=he){for(let De=Ve;De<he;De++){const Xe=J[De];fe.push(`[${be}] ${yu(Xe,a,T.current,P.current)}`)}xu.includes(ne)&&fe.push(`[${be}] ${a(`index.log.${ne}`)}`)}else{for(let De=Ve;De<J.length;De++){const Xe=J[De];fe.push(`[${be}] ${yu(Xe,a,T.current,P.current)}`)}_e&&(fe.push(`[${be}] ── ${Fe} ──`),P.current=Fe,T.current=null);for(let De=0;De<he;De++){const Xe=J[De];fe.push(`[${be}] ${yu(Xe,a,null,null)}`)}}}}L(ne),x.current=ne}_e&&P.current!==Fe&&(fe.push(`[${be}] ── ${Fe} ──`),P.current=Fe,T.current=null),Ne!=null&&(T.current=Ne),ge&&qe!=null&&Ne!=null&&fe.push(`[${be}] ${ge} (${qe}/${Ne})`),fe.length>0&&u(he=>[...he,...fe].slice(-500))},[o,a,H,J]),b.useEffect(()=>{if(!o?.terminalState){v.current=!1;return}if(v.current)return;v.current=!0;const ne=Xi();if(o.terminalState==="done"){const ge=[];x.current==="uploading"&&P.current&&ge.push(`[${ne}] ${yu("uploading",a,T.current,P.current)}`),ge.push(`[${ne}] ${a("index.code.complete")}`),o.unchangedCount&&ge.push(`[${ne}] ${a("index.code.unchanged_count",{count:o.unchangedCount})}`),u(Ne=>[...Ne,...ge].slice(-500)),E(J.slice()),L(null);return}if(o.terminalState==="error"){const ge=o.errorMessage??a("index.code.error");u(Ne=>[...Ne,`[${ne}] ERROR: ${ge}`].slice(-500)),h(!0),L(null);return}if(o.terminalState==="timeout"){u(ge=>[...ge,`[${ne}] ${a("index.code.timeout")}`].slice(-500)),m(!0),L(null);return}},[o?.terminalState,e,a,t]),b.useEffect(()=>{_.current?.scrollIntoView({behavior:"smooth"})},[l]),b.useEffect(()=>{if(o?.terminalState!=="done"||!R)return;const ne=setTimeout(()=>{kt.getState().clearIndexTask(e),t?.()},2e3);return()=>{clearTimeout(ne)}},[o?.terminalState,R,e,t]);const q=o&&!o.terminalState?{percent:o.progress,label:o.currentFile??""}:null,[ee,ae]=b.useState(!1),W=b.useCallback(async()=>{ae(!0);try{(await kt.getState().triggerIndex(e,r)).status==="skipped"?(kt.getState().clearIndexTask(e),t?.()):(m(!1),h(!1),u([]),E([]),L(null),k(null),x.current=null,w.current=null,z(new Set))}catch{h(!0);const ne=Xi();u(ge=>[...ge,`[${ne}] ${a("index.code.error")}`].slice(-500))}finally{ae(!1)}},[e,r,a,t]),O=b.useCallback(()=>{kt.getState().clearIndexTask(e),t?.()},[e,t]),V=b.useCallback(()=>{kt.getState().clearIndexTask(e),t?.()},[e,t]),re=o?.terminalState==="done",se=!!o&&!o?.terminalState;return c.jsxs("div",{className:"flex flex-col gap-4 pb-8",children:[c.jsx(K1,{stages:oe,currentStage:D,completedStages:A,failedStage:f?w.current:null,progress:q,breakpoints:ce,headerRight:re&&!R?c.jsx("button",{type:"button",className:"rounded-sm bg-c4a-accent px-2 py-0.5 font-mono text-[11px] text-white hover:bg-c4a-accent/90",onClick:V,children:a("index.code.done_continue")}):re&&R?c.jsx("span",{className:"animate-pulse font-mono text-[11px] text-c4a-text-muted",children:a("index.code.auto_continue_pending")}):se||re?c.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 select-none",children:[c.jsx("span",{className:`flex h-3.5 w-3.5 items-center justify-center rounded-sm border transition-colors ${R?"border-c4a-accent bg-c4a-accent":"border-c4a-border-default bg-transparent"}`,onClick:()=>B(ne=>!ne),children:R&&c.jsx(Wr,{size:10,className:"text-white"})}),c.jsx("span",{className:"font-mono text-[11px] text-c4a-text-muted",onClick:()=>B(ne=>!ne),children:a("index.code.auto_continue")})]}):void 0}),p&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-c4a-warning",children:a("index.code.timeout")}),c.jsx("button",{type:"button",className:`shrink-0 rounded bg-c4a-accent px-3 py-1 font-mono text-xs text-white hover:bg-c4a-accent/90 ${ee?"opacity-50 cursor-not-allowed":""}`,onClick:W,disabled:ee,children:a("sources.import.retry")}),c.jsx("button",{type:"button",className:`shrink-0 rounded border border-c4a-border-default px-3 py-1 font-mono text-xs text-c4a-text-muted hover:text-c4a-text-primary ${ee?"opacity-50 cursor-not-allowed":""}`,onClick:O,disabled:ee,children:a("index.code.dismiss")})]}),f&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-c4a-error",children:N6(o?.errorMessage,a)}),c.jsx("button",{type:"button",className:`shrink-0 rounded bg-c4a-accent px-3 py-1 font-mono text-xs text-white hover:bg-c4a-accent/90 ${ee?"opacity-50 cursor-not-allowed":""}`,onClick:W,disabled:ee,children:a("sources.import.retry")}),c.jsx("button",{type:"button",className:`shrink-0 rounded border border-c4a-border-default px-3 py-1 font-mono text-xs text-c4a-text-muted hover:text-c4a-text-primary ${ee?"opacity-50 cursor-not-allowed":""}`,onClick:O,disabled:ee,children:a("index.code.dismiss")})]}),c.jsxs("div",{className:"mt-4 min-h-[200px] max-h-[50vh] overflow-y-auto rounded bg-c4a-bg-base p-3 c4a-scrollbar",children:[l.map((ne,ge)=>c.jsx("div",{className:`font-mono text-xs leading-relaxed ${ne.includes("ERROR")?"text-red-400/80":"text-c4a-text-muted"}`,children:ne},ge)),c.jsx("div",{ref:_})]})]})}const C6=["entities","relations","behaviors","attributes","states","rules","transitions","events","decisions","metrics","roles","constraints","comparisons","boundaries"],A6={critical:{label:"CRITICAL",className:"text-red-400 bg-red-500/10"},major:{label:"MAJOR",className:"text-amber-400 bg-amber-500/10"},minor:{label:"MINOR",className:"text-c4a-text-muted bg-c4a-bg-elevated"},must:{label:"MUST",className:"text-red-400 bg-red-500/10"},should:{label:"SHOULD",className:"text-amber-400 bg-amber-500/10"},may:{label:"MAY",className:"text-c4a-text-muted bg-c4a-bg-elevated"}};function R6(e){if(e==null)return"";if(Array.isArray(e)){const t=e.map(r=>String(r));return t.length<=5?t.join(", "):`${t.slice(0,5).join(", ")} … (${t.length})`}return typeof e=="object"?JSON.stringify(e):String(e)}function T6(e){return C6.map(t=>({type:t,atoms:Array.isArray(e[t])?e[t]:[]}))}function L6(e){return e.every(t=>t.atoms.length===0)}function D6({severity:e}){if(!e)return null;const t=A6[e];return t?c.jsxs("span",{className:"relative inline-block group cursor-default ml-2",children:[c.jsx("span",{className:`inline-flex rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${t.className}`,children:t.label}),c.jsx("span",{className:"pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-1.5 px-2 py-1 rounded bg-c4a-bg-elevated text-c4a-text-primary text-[11px] font-sans normal-case whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity duration-150 shadow-lg border border-c4a-border-subtle z-50",children:e})]}):c.jsxs("span",{className:"relative inline-block group cursor-default ml-2",children:[c.jsx("span",{className:"inline-flex rounded-sm bg-c4a-bg-elevated px-1.5 py-0.5 font-mono text-[10px] uppercase text-c4a-text-muted",children:e}),c.jsx("span",{className:"pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-1.5 px-2 py-1 rounded bg-c4a-bg-elevated text-c4a-text-primary text-[11px] font-sans normal-case whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity duration-150 shadow-lg border border-c4a-border-subtle z-50",children:e})]})}function bu({name:e}){return c.jsx("span",{className:"text-c4a-accent font-mono",children:e})}function Qi({label:e}){return c.jsx("span",{className:"inline-flex rounded-sm bg-c4a-bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:e})}function O6({atom:e,t}){const r=typeof e.severity=="string"?e.severity:void 0,a=typeof e.confidence=="number"?e.confidence:void 0,o=Yo(a);return c.jsxs(c.Fragment,{children:[c.jsx(D6,{severity:r}),o?c.jsx("span",{className:"ml-2 inline-flex",children:c.jsx(Bt,{variant:o.variant,tooltip:`${o.value.toFixed(2)} — ${t(o.tipKey)}`,children:t(o.labelKey)})}):null]})}function M6(e,t){const r=[];switch(e){case"relations":typeof t.description=="string"&&r.push(t.description);break;case"attributes":t.value!==void 0&&r.push(R6(t.value));break;case"states":Array.isArray(t.values)&&r.push(c.jsxs(c.Fragment,{children:["[",t.values.join(", "),"]"]})),typeof t.ref_sor=="string"&&r.push(t.ref_sor);break;case"rules":typeof t.expression=="string"&&r.push(c.jsx("span",{className:"font-mono",children:t.expression})),Array.isArray(t.depends_on)&&t.depends_on.length>0&&r.push(c.jsxs(c.Fragment,{children:["depends: ",t.depends_on.join(", ")]}));break;case"behaviors":typeof t.description=="string"&&r.push(t.description),typeof t.signature=="string"&&r.push(c.jsx("span",{className:"font-mono",children:t.signature}));break;case"metrics":typeof t.target=="string"&&r.push(c.jsxs(c.Fragment,{children:["target: ",t.target]})),typeof t.threshold=="string"&&r.push(c.jsxs(c.Fragment,{children:["threshold: ",t.threshold]}));break;case"roles":typeof t.description=="string"&&r.push(t.description),Array.isArray(t.performs)&&t.performs.length>0&&r.push(c.jsxs(c.Fragment,{children:["performs: ",t.performs.join(", ")]}));break;case"boundaries":Array.isArray(t.contains)&&t.contains.length>0&&r.push(c.jsxs(c.Fragment,{children:["⊃ ",t.contains.join(", ")]})),Array.isArray(t.excludes)&&t.excludes.length>0&&r.push(c.jsxs(c.Fragment,{children:["⊅ ",t.excludes.join(", ")]}));break;case"decisions":typeof t.rationale=="string"&&r.push(t.rationale),Array.isArray(t.alternatives)&&t.alternatives.length>0&&r.push(c.jsxs(c.Fragment,{children:["alternatives: ",t.alternatives.join(", ")]}));break;case"comparisons":Array.isArray(t.subjects)&&r.push(t.subjects.join(" vs ")),typeof t.conclusion=="string"&&r.push(t.conclusion);break;case"transitions":typeof t.guard=="string"&&r.push(c.jsxs(c.Fragment,{children:["guard: ",c.jsx("span",{className:"font-mono",children:t.guard})]}));break;case"events":Array.isArray(t.trigger_for)&&t.trigger_for.length>0&&r.push(c.jsxs(c.Fragment,{children:["triggers: ",t.trigger_for.join(", ")]}));break;case"constraints":typeof t.metric_ref=="string"&&r.push(c.jsxs(c.Fragment,{children:["metric: ",t.metric_ref]}));break}return r}function z6(e,t){switch(e){case"relations":return c.jsxs(c.Fragment,{children:[c.jsx(bu,{name:String(t.from??"")}),c.jsx("span",{className:"mx-1 text-c4a-text-muted",children:"→"}),c.jsx(bu,{name:String(t.to??"")}),typeof t.type=="string"?c.jsx("span",{className:"ml-1",children:c.jsx(Qi,{label:t.type})}):null]});case"transitions":return c.jsxs(c.Fragment,{children:[c.jsx(bu,{name:String(t.from??"")}),c.jsx("span",{className:"mx-1 text-c4a-text-muted",children:"→"}),c.jsx(bu,{name:String(t.to??"")}),typeof t.trigger=="string"?c.jsx("span",{className:"ml-1",children:c.jsx(Qi,{label:t.trigger})}):null]});case"entities":return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-medium",children:String(t.name??"")}),typeof t.kind=="string"?c.jsx("span",{className:"ml-1",children:c.jsx(Qi,{label:t.kind})}):null]});case"attributes":return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-medium",children:String(t.name??"")}),typeof t.type=="string"?c.jsx("span",{className:"ml-1",children:c.jsx(Qi,{label:t.type})}):null]});case"roles":return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-medium",children:String(t.name??"")}),typeof t.kind=="string"?c.jsx("span",{className:"ml-1",children:c.jsx(Qi,{label:t.kind})}):null]});case"metrics":return c.jsx("span",{className:"font-medium",children:String(t.name??"")});case"states":return c.jsx("span",{className:"font-medium",children:String(t.name??"")});case"boundaries":return c.jsx("span",{className:"font-medium",children:String(t.name??"")});case"comparisons":return c.jsx("span",{className:"font-medium",children:String(t.name??"")});case"behaviors":return c.jsx("span",{className:"font-medium",children:String(t.name??"")});case"events":return c.jsx("span",{className:"font-medium",children:String(t.name??"")});default:return c.jsx("span",{children:String(t.description??t.name??JSON.stringify(t))})}}function $6({type:e,atom:t,t:r}){const a=z6(e,t),o=M6(e,t);return c.jsxs("div",{className:"pl-3 text-xs text-c4a-text-secondary leading-relaxed break-words",children:[c.jsxs("div",{children:[a,c.jsx(O6,{atom:t,t:r})]}),o.length>0?c.jsx("div",{className:"pl-3 text-c4a-text-muted",children:o.map((l,u)=>c.jsx("div",{children:l},u))}):null]})}function B6({digest:e}){const{t}=ye(),r=b.useMemo(()=>e.sections.map((a,o)=>({section:a,sectionIndex:o})),[e.sections]);return c.jsx("div",{className:"w-full rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4 overflow-hidden",children:r.map(({section:a,sectionIndex:o})=>{const l=a.heading?.trim();return c.jsxs("div",{className:"border-t border-c4a-border-subtle pt-4 mt-4 first:border-t-0 first:mt-0 first:pt-0",children:[l?c.jsx("div",{className:"mb-3 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:l}):null,a.paragraphs.map((u,f)=>{const h=`${o}-${f}`,p=T6(u.atoms),m=L6(p);return c.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 px-3 py-3 border-b border-c4a-border-subtle last:border-b-0",children:[c.jsx("div",{className:"lg:w-1/2 w-full min-w-0 text-xs text-c4a-text-secondary leading-relaxed whitespace-pre-wrap break-words overflow-hidden",children:u.text}),c.jsx("div",{className:"lg:w-1/2 w-full min-w-0 min-h-[2rem]",children:m?c.jsx("div",{className:"text-xs text-c4a-text-muted italic",children:t("digest.doc.no_atoms")}):p.map(x=>x.atoms.length>0?c.jsxs("div",{className:"mb-2 last:mb-0",children:[c.jsx("div",{className:"mb-1 font-mono text-xs uppercase tracking-tight text-c4a-accent",children:t(`digest.doc.atom.${x.type}`)}),c.jsx("div",{className:"space-y-1",children:x.atoms.map((v,_)=>c.jsx($6,{type:x.type,atom:v,t},`${x.type}-${_}`))})]},x.type):null)})]},h)})]},`section-${o}`)})})}function ka(){return{data:null,loading:!1,error:null,warnings:[],pagination:null}}function dh(){return{data:null,loading:!1,error:null,warnings:[]}}function Zi(e){const t={};for(const[r,a]of Object.entries(e))a!=null&&(Array.isArray(a)?t[r]=a.join(","):t[r]=String(a));return t}const t_=new Map;function Ji(e){const t=t_.get(e);t&&t.abort();const r=new AbortController;return t_.set(e,r),r.signal}const Mn=ea((e,t)=>({symbols:{...ka()},callGraph:{...ka()},imports:{...ka()},inheritance:{...ka()},paragraphs:{...dh()},fetchSymbols:async(r,a)=>{const o=Ji("symbols");e(l=>({symbols:{...l.symbols,loading:!0,error:null}}));try{const l=await ze.get("/query/symbols",Zi({sourceIds:r.sourceIds,exportedOnly:r.exportedOnly,kind:r.kind,namePattern:r.namePattern,filePath:r.filePath,limit:r.limit,offset:r.offset}),{signal:o,skipDedup:!0});if(o.aborted)return;const u=a?.append?t().symbols.data??[]:[];e({symbols:{data:[...u,...l.symbols],pagination:l.pagination,loading:!1,error:null,warnings:l.warnings??[]}})}catch(l){if(o.aborted||l instanceof DOMException&&l.name==="AbortError")return;e(u=>({symbols:{...u.symbols,loading:!1,error:String(l)}}))}},fetchCallGraph:async r=>{const a=Ji("callGraph");e({callGraph:{data:null,loading:!0,error:null,warnings:[],pagination:null}});try{const o=await ze.get("/query/call-graph",Zi({sourceIds:r.sourceIds,functionName:r.functionName,direction:r.direction,maxDepth:r.maxDepth,limit:r.limit,offset:r.offset}),{signal:a,skipDedup:!0});if(a.aborted)return;e({callGraph:{data:o.entries,pagination:o.pagination,loading:!1,error:null,warnings:o.warnings??[]}})}catch(o){if(a.aborted||o instanceof DOMException&&o.name==="AbortError")return;e({callGraph:{data:null,loading:!1,error:String(o),warnings:[],pagination:null}})}},fetchImports:async r=>{const a=Ji("imports");e({imports:{data:null,loading:!0,error:null,warnings:[],pagination:null}});try{const o=await ze.get("/query/imports",Zi({sourceIds:r.sourceIds,filePath:r.filePath,direction:r.direction,limit:r.limit,offset:r.offset}),{signal:a,skipDedup:!0});if(a.aborted)return;e({imports:{data:o.imports,pagination:o.pagination,loading:!1,error:null,warnings:o.warnings??[]}})}catch(o){if(a.aborted||o instanceof DOMException&&o.name==="AbortError")return;e({imports:{data:null,loading:!1,error:String(o),warnings:[],pagination:null}})}},fetchInheritance:async r=>{const a=Ji("inheritance");e({inheritance:{data:null,loading:!0,error:null,warnings:[],pagination:null}});try{const o=await ze.get("/query/inheritance",Zi({sourceIds:r.sourceIds,className:r.className,direction:r.direction,limit:r.limit,offset:r.offset}),{signal:a,skipDedup:!0});if(a.aborted)return;e({inheritance:{data:o.relations,pagination:o.pagination,loading:!1,error:null,warnings:o.warnings??[]}})}catch(o){if(a.aborted||o instanceof DOMException&&o.name==="AbortError")return;e({inheritance:{data:null,loading:!1,error:String(o),warnings:[],pagination:null}})}},fetchParagraphs:async r=>{const a=Ji("paragraphs");e({paragraphs:{data:null,loading:!0,error:null,warnings:[]}});try{const o=await ze.get("/query/paragraphs",Zi({sourceIds:r.sourceIds,text:r.text,topK:r.topK,scoreLow:r.scoreLow}),{signal:a,skipDedup:!0});if(a.aborted)return;e({paragraphs:{data:o.results,loading:!1,error:null,warnings:[]}})}catch(o){if(a.aborted||o instanceof DOMException&&o.name==="AbortError")return;e({paragraphs:{data:null,loading:!1,error:String(o),warnings:[]}})}},resetQuery:r=>{e(r?r==="paragraphs"?{[r]:dh()}:{[r]:ka()}:{symbols:ka(),callGraph:ka(),imports:ka(),inheritance:ka(),paragraphs:dh()})}}));function xd({warnings:e}){const{t}=ye(),[r,a]=b.useState(!1);return e.length===0?null:c.jsxs("div",{className:"rounded-lg bg-c4a-warning/10 border border-c4a-warning/20 px-3 py-2 mb-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(SA,{size:14,className:"text-c4a-warning shrink-0"}),c.jsx("span",{className:"font-mono text-xs text-c4a-warning",children:e[0]}),e.length>1&&c.jsx("button",{type:"button",className:"font-mono text-[10px] text-c4a-warning/70 underline cursor-pointer",onClick:()=>a(!r),children:t("query.warning.more",{count:e.length-1})})]}),r&&e.slice(1).map((o,l)=>c.jsx("div",{className:"mt-1 pl-6 font-mono text-xs text-c4a-warning/80",children:o},l))]})}function I6(e){const t={children:[]},r=new Map,a=new Map;for(const l of e)a.set(l.filePath,(a.get(l.filePath)??0)+1);for(const[l,u]of a){const f=l.split("/").filter(Boolean);let h="",p=t;for(let m=0;m<f.length;m++){const x=f[m];h=h?`${h}/${x}`:x;const v=m===f.length-1;let _=r.get(h);_||(_={name:x,fullPath:h,isFile:v,children:[],symbolCount:0},r.set(h,_),p.children.push(_)),v&&(_.symbolCount=u,_.isFile=!0),p=_}}const o=l=>{l.sort((u,f)=>u.isFile!==f.isFile?u.isFile?1:-1:u.name.localeCompare(f.name));for(const u of l)u.children.length>0&&o(u.children)};return o(t.children),t.children}function U6({symbols:e,selectedFilePath:t,onSelectFile:r,sourceId:a}){const o=b.useMemo(()=>I6(e),[e]);return c.jsx("div",{className:"overflow-y-auto c4a-scrollbar",children:c.jsx(cw,{nodes:o,depth:0,selectedFilePath:t,onSelectFile:r,sourceId:a})})}function cw({nodes:e,depth:t,selectedFilePath:r,onSelectFile:a,sourceId:o}){return c.jsx(c.Fragment,{children:e.map(l=>c.jsx(P6,{node:l,depth:t,selectedFilePath:r,onSelectFile:a,sourceId:o},l.fullPath))})}function P6({node:e,depth:t,selectedFilePath:r,onSelectFile:a,sourceId:o}){const{t:l}=ye(),u=Aa(_=>_.openTab),[f,h]=b.useState(t<2),p=e.isFile&&e.fullPath===r,m=t*16,x=b.useCallback(()=>{e.isFile?a(p?null:e.fullPath):h(_=>!_)},[e.isFile,e.fullPath,p,a]),v=b.useCallback(_=>{_.stopPropagation(),u({id:`import-deps:${e.fullPath}`,type:"import-deps",resourceId:e.fullPath,label:e.name,meta:{sourceIds:[o]}})},[e.fullPath,e.name,o,u]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`group/node flex h-7 items-center cursor-pointer font-mono text-xs ${p?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-secondary hover:bg-c4a-bg-hover/50"}`,style:{paddingLeft:m},onClick:x,children:[e.isFile?c.jsx("span",{className:"w-4 shrink-0"}):c.jsx($t,{size:12,className:`shrink-0 transition-transform duration-200 text-c4a-text-muted ${f?"rotate-90":""}`}),e.isFile?c.jsx(vm,{size:13,className:"mx-1 shrink-0 text-c4a-text-muted"}):c.jsx(Gn,{size:13,className:"mx-1 shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:"truncate flex-1",children:e.name}),e.isFile&&c.jsx("button",{type:"button",className:"opacity-0 group-hover/node:opacity-100 p-0.5 rounded hover:bg-c4a-bg-active shrink-0 mr-1",title:l("query.import_deps.open"),onClick:v,children:c.jsx(HE,{size:12,className:"text-c4a-text-muted"})})]}),!e.isFile&&f&&e.children.length>0&&c.jsx(cw,{nodes:e.children,depth:t+1,selectedFilePath:r,onSelectFile:a,sourceId:o})]})}function H6({symbol:e}){return e.kind==="class"||e.kind==="interface"?c.jsx(F6,{symbol:e}):e.kind==="function"?c.jsx(q6,{symbol:e}):c.jsxs("div",{className:Bm,children:[c.jsxs(jl,{children:[e.kind.toUpperCase(),": ",e.name]}),e.signature&&c.jsx("p",{className:"font-mono text-xs text-c4a-text-secondary",children:e.signature})]})}function F6({symbol:e}){const{t}=ye();return c.jsxs("div",{className:Bm,children:[e.methods&&e.methods.length>0&&c.jsxs("div",{className:"mb-2",children:[c.jsxs(jl,{children:[t("query.symbol.methods")," (",e.methods.length,")"]}),c.jsx("table",{className:"w-full font-mono text-xs",children:c.jsx("tbody",{children:e.methods.map((r,a)=>c.jsxs("tr",{className:"even:bg-c4a-bg-base",children:[c.jsx("td",{className:"py-0.5 pr-3 text-c4a-text-primary",children:r.name}),c.jsxs("td",{className:"py-0.5 pr-3 text-c4a-text-muted",children:["(",r.params.map(o=>`${o.name}: ${o.type??"unknown"}`).join(", "),")"]}),c.jsx("td",{className:"py-0.5 text-c4a-text-secondary",children:r.returnType??"void"})]},a))})})]}),e.properties&&e.properties.length>0&&c.jsxs("div",{className:"mb-2",children:[c.jsxs(jl,{children:[t("query.symbol.properties")," (",e.properties.length,")"]}),c.jsx("table",{className:"w-full font-mono text-xs",children:c.jsx("tbody",{children:e.properties.map((r,a)=>c.jsxs("tr",{className:"even:bg-c4a-bg-base",children:[c.jsx("td",{className:"py-0.5 pr-3 text-c4a-text-primary",children:r.name}),c.jsx("td",{className:"py-0.5 text-c4a-text-secondary",children:r.type??"unknown"})]},a))})})]}),e.baseClass&&c.jsxs("div",{className:"font-mono text-xs text-c4a-text-secondary",children:[c.jsxs("span",{className:"text-c4a-text-muted",children:[t("query.symbol.extends"),":"]})," ",e.baseClass]}),e.interfaces&&e.interfaces.length>0&&c.jsxs("div",{className:"font-mono text-xs text-c4a-text-secondary",children:[c.jsxs("span",{className:"text-c4a-text-muted",children:[t("query.symbol.implements"),":"]})," ",e.interfaces.join(", ")]})]})}function q6({symbol:e}){const{t}=ye();return c.jsxs("div",{className:Bm,children:[e.signature&&c.jsxs("div",{className:"mb-1",children:[c.jsx(jl,{children:t("query.symbol.signature")}),c.jsx("p",{className:"font-mono text-xs text-c4a-text-primary",children:e.signature})]}),e.params&&e.params.length>0&&c.jsxs("div",{className:"mb-1",children:[c.jsx(jl,{children:t("query.symbol.parameters")}),c.jsx("div",{className:"font-mono text-xs",children:e.params.map((r,a)=>c.jsxs("div",{className:"text-c4a-text-secondary",children:[c.jsx("span",{className:"text-c4a-text-primary",children:r.name}),": ",r.type??"unknown"]},a))})]}),e.returnType&&c.jsxs("div",{className:"font-mono text-xs text-c4a-text-secondary",children:[c.jsxs("span",{className:"text-c4a-text-muted",children:[t("query.symbol.returns"),":"]})," ",e.returnType]}),e.isAsync&&c.jsxs("div",{className:"font-mono text-xs text-c4a-text-muted",children:[t("query.symbol.async"),": ✓"]})]})}const Bm="ml-6 mt-1 mb-2 rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-3";function jl({children:e}){return c.jsx("div",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted mb-1",children:e})}const G6={class:"■",interface:"◇",function:"ƒ",enum:"▣",type_alias:"◈"};function V6(e,t){if(!t)return e;const r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:c.jsxs(c.Fragment,{children:[e.slice(0,r),c.jsx("mark",{className:"bg-c4a-accent/20 text-c4a-accent",children:e.slice(r,r+t.length)}),e.slice(r+t.length)]})}function Y6({symbols:e,searchQuery:t,sourceId:r}){const{t:a}=ye(),[o,l]=b.useState(null),u=Aa(m=>m.openTab),f=b.useCallback(m=>{l(x=>x===m?null:m)},[]),h=b.useCallback((m,x)=>{m.stopPropagation(),u({id:`call-graph:${x.filePath}:${x.name}`,type:"call-graph",resourceId:`${x.filePath}#${x.name}`,label:`Calls: ${x.name}`,icon:"🔗",meta:{sourceIds:[r]}})},[r,u]),p=b.useCallback((m,x)=>{m.stopPropagation(),u({id:`inheritance:${x.filePath}:${x.name}`,type:"inheritance",resourceId:`${x.filePath}#${x.name}`,label:`Inherit: ${x.name}`,icon:"📐",meta:{sourceIds:[r]}})},[r,u]);return e.length===0?c.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:c.jsx("p",{className:"font-mono text-xs text-c4a-text-muted",children:a("query.symbol.empty")})}):c.jsx("div",{className:"overflow-y-auto c4a-scrollbar",children:e.map(m=>{const x=`${m.filePath}:${m.name}:${m.line}`,v=o===x;return c.jsxs("div",{children:[c.jsxs("div",{className:"group flex h-8 items-center gap-2 px-3 cursor-pointer border-b border-c4a-border-subtle last:border-b-0 hover:bg-c4a-bg-hover/50",onClick:()=>f(x),children:[c.jsx("span",{className:"shrink-0 w-4 text-center font-mono text-xs text-c4a-text-muted",children:G6[m.kind]??"·"}),c.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate flex-1",children:V6(m.name,t)}),c.jsx(Bt,{variant:"muted",children:m.kind.replace("_"," ")}),m.isExported&&c.jsx(Bt,{variant:"accent",children:"Export"}),m.kind==="function"&&c.jsx("button",{type:"button",className:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-c4a-bg-active shrink-0",title:a("query.call_graph.open"),onClick:_=>h(_,m),children:c.jsx(Uu,{size:13,className:"text-c4a-text-muted"})}),(m.kind==="class"||m.kind==="interface")&&c.jsx("button",{type:"button",className:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-c4a-bg-active shrink-0",title:a("query.inheritance.open"),onClick:_=>p(_,m),children:c.jsx(eA,{size:13,className:"text-c4a-text-muted"})})]}),v&&c.jsx(H6,{symbol:m})]},x)})})}const n_=200,K6=200;function X6({sourceId:e}){const{t}=ye(),{data:r,loading:a,error:o,warnings:l,pagination:u}=Mn(z=>z.symbols),f=Mn(z=>z.fetchSymbols),h=Mn(z=>z.resetQuery),[p,m]=b.useState(!0),[x,v]=b.useState(""),[_,w]=b.useState(null),S=b.useRef(null),[k,N]=b.useState("");b.useEffect(()=>(f({sourceIds:[e],exportedOnly:!0,limit:n_}),()=>h("symbols")),[e]);const A=b.useCallback(()=>{const z=!p;m(z),w(null),f({sourceIds:[e],exportedOnly:z,limit:n_})},[p,e,f]),E=b.useCallback(z=>{const R=z.target.value;v(R),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>N(R),300)},[]),D=b.useCallback(()=>{!r||!u||f({sourceIds:[e],exportedOnly:p,limit:K6,offset:r.length},{append:!0})},[r,u,e,p,f]),L=b.useMemo(()=>{if(!r)return[];let z=r;if(_&&(z=z.filter(R=>R.filePath===_)),k){const R=k.toLowerCase();z=z.filter(B=>B.name.toLowerCase().includes(R))}return z},[r,_,k]),$=u&&r&&u.total>r.length;return a&&!r?c.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[Array.from({length:5}).map((z,R)=>c.jsx("div",{className:"h-7 bg-c4a-bg-hover animate-pulse rounded"},R)),c.jsx("div",{className:"mt-2 text-center",children:c.jsx(ta,{labelKey:"query.symbol.loading"})})]}):o&&!r?c.jsx(wt,{title:t("query.symbol.empty"),description:o}):!a&&r&&r.length===0?c.jsx(wt,{title:t("query.symbol.empty"),description:t("query.symbol.empty_desc")}):c.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.length>0&&c.jsx("div",{className:"px-4 pt-3",children:c.jsx(xd,{warnings:l})}),c.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-c4a-border-subtle",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(gl,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-c4a-text-muted"}),c.jsx("input",{className:"w-full rounded-lg border border-c4a-border-default bg-c4a-bg-surface pl-8 pr-3 py-1.5 text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none focus:ring-2 focus:ring-c4a-accent/30",placeholder:t("query.symbol.search_placeholder"),value:x,onChange:E})]}),c.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer shrink-0",children:[c.jsx("input",{type:"checkbox",checked:p,onChange:A,className:"accent-c4a-accent"}),c.jsx("span",{className:"font-mono text-[11px] uppercase tracking-tight text-c4a-text-secondary",children:t("query.symbol.exported_only")})]})]}),c.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[c.jsx("div",{className:"w-1/3 min-w-[200px] max-w-[300px] border-r border-c4a-border-subtle overflow-y-auto c4a-scrollbar",children:r&&c.jsx(U6,{symbols:r,selectedFilePath:_,onSelectFile:w,sourceId:e})}),c.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[c.jsx("div",{className:"flex-1 overflow-y-auto c4a-scrollbar",children:c.jsx(Y6,{symbols:L,searchQuery:k,sourceId:e})}),$&&c.jsx("div",{className:"flex items-center justify-center border-t border-c4a-border-subtle py-2",children:c.jsx("button",{type:"button",className:"rounded-lg border border-c4a-border-default bg-c4a-bg-surface px-4 py-1.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary hover:bg-c4a-bg-hover cursor-pointer",onClick:D,disabled:a,children:a?c.jsx("span",{className:"animate-pulse",children:t("query.symbol.loading")}):t("query.symbol.load_more",{count:u.total-r.length})})})]})]})]})}function Q6(e){return e>=.7?{stars:3,label:"⭐⭐⭐",key:"query.doc.relevance.high"}:e>=.5?{stars:2,label:"⭐⭐",key:"query.doc.relevance.medium"}:{stars:1,label:"⭐",key:"query.doc.relevance.low"}}function Z6(e,t){if(!t)return e;const r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:c.jsxs(c.Fragment,{children:[e.slice(0,r),c.jsx("mark",{className:"bg-c4a-accent/20 text-c4a-accent",children:e.slice(r,r+t.length)}),e.slice(r+t.length)]})}function J6({result:e,searchQuery:t}){const{t:r}=ye(),a=Aa(f=>f.openTab),o=Q6(e.score),l=()=>{a({id:`content:${e.hashId}:s${e.sectionIndex}p${e.paragraphIndex}`,type:"content",resourceId:e.hashId,label:e.sourceName,meta:{sectionIndex:e.sectionIndex,paragraphIndex:e.paragraphIndex,sourcePath:e.sourcePath}})},u=e.sectionHeading?e.sectionHeading.split(" > ").filter(Boolean):[];return c.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4 hover:border-c4a-accent/30 cursor-pointer transition-colors",onClick:l,children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm",children:o.label}),c.jsx("span",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:r(o.key)})]}),c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted truncate ml-2",children:e.sourceName})]}),c.jsx("p",{className:"text-sm text-c4a-text-primary leading-relaxed line-clamp-4",children:Z6(e.paragraphText,t)}),u.length>0&&c.jsxs("div",{className:"flex items-center gap-1 mt-3 font-mono text-[11px] text-c4a-text-muted",children:[c.jsx(On,{size:12,className:"shrink-0"}),u.map((f,h)=>c.jsxs("span",{className:"flex items-center gap-1",children:[h>0&&c.jsx("span",{className:"text-c4a-text-muted/50",children:">"}),c.jsx("span",{children:f})]},h))]})]})}function W6({sourceId:e}){const{t}=ye(),[r,a]=b.useState(""),[o,l]=b.useState(""),[u,f]=b.useState(null),{data:h,loading:p,error:m}=Mn(S=>S.paragraphs),x=Mn(S=>S.fetchParagraphs),v=Mn(S=>S.resetQuery);b.useEffect(()=>{a(""),l(""),v("paragraphs")},[e,v]),b.useEffect(()=>{m&&!p&&(console.error("[DocSearchBox] search failed:",m),f({title:t("query.doc.error.title"),detail:m}))},[m,p,t]);const _=b.useCallback(()=>{const S=r.trim();S&&(l(S),x({sourceIds:[e],text:S,topK:10}))},[r,e,x]),w=S=>{S.key==="Enter"&&_()};return c.jsxs("div",{className:"flex flex-col h-full",children:[c.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-c4a-border-subtle",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(gl,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-c4a-text-muted"}),c.jsx("input",{className:"w-full rounded-lg border border-c4a-border-default bg-c4a-bg-surface pl-8 pr-3 py-1.5 text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none focus:ring-2 focus:ring-c4a-accent/30",placeholder:t("query.doc.search_placeholder"),value:r,onChange:S=>a(S.target.value),onKeyDown:w})]}),c.jsx("button",{type:"button",className:"rounded px-4 py-1.5 bg-c4a-accent text-white font-mono text-xs uppercase tracking-tight hover:bg-c4a-accent/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",onClick:_,disabled:!r.trim()||p,children:t("query.doc.search_button")})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto c4a-scrollbar p-4",children:[p&&c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(ta,{labelKey:"query.doc.searching"})}),u&&c.jsx(Bl,{error:u,onClose:()=>f(null)}),!p&&!m&&h&&h.length===0&&c.jsx(wt,{title:t("query.doc.empty.title"),description:t("query.doc.empty.desc")}),!p&&!m&&h&&h.length>0&&c.jsx("div",{className:"flex flex-col gap-3",children:h.map(S=>c.jsx(J6,{result:S,searchQuery:o},`${S.hashId}-${S.paragraphIndex}`))})]})]})}function eO({sourceType:e,sourceId:t,indexStatus:r}){const{t:a}=ye();return r==="indexing"?c.jsx(wt,{title:a("query.indexing.title"),description:a("query.indexing.desc")}):e==="code"&&t?c.jsx(X6,{sourceId:t}):e&&e!=="code"&&t?c.jsx(W6,{sourceId:t}):c.jsx(wt,{title:a("query.doc.empty.title"),description:a("query.doc.empty.desc")})}function r_(e){try{const t=JSON.parse(e);return t&&typeof t=="object"&&"manifest_type"in t}catch{return!1}}function a_({sourceId:e,isDaemonOnline:t,indexModules:r}){const{t:a}=ye(),o=kt(h=>h.triggerIndex),[l,u]=b.useState(null),f=async()=>{if(e){u(null);try{(await o(e,r)).status==="skipped"&&(u(a("index.code.skipped")),setTimeout(()=>u(null),3e3))}catch{u(a("index.code.error")),setTimeout(()=>u(null),3e3)}}};return c.jsx(wt,{title:a("common.empty.content_raw.title"),description:a("common.empty.content_raw.description"),action:e?c.jsxs("div",{className:"flex flex-col items-center gap-2",children:[c.jsx("button",{type:"button",className:`rounded bg-c4a-accent px-4 py-2 text-sm font-medium text-white hover:bg-c4a-accent/90 ${t?"":"opacity-40 cursor-not-allowed"}`,onClick:t?f:void 0,title:t?void 0:a("daemon.offline_tooltip"),children:a("common.empty.content_raw.cta")}),l&&c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:l})]}):void 0})}function uw({hashId:e,sourcePath:t,sourceId:r,isCodeIndexing:a,isDaemonOnline:o,indexModules:l,sourceType:u,indexStatus:f,paragraphMeta:h}){const{t:p}=ye(),[m,x]=b.useState(null),[v,_]=b.useState(null),w=h!=null&&typeof h.sectionIndex=="number",[S,k]=b.useState(w?"digest":"raw"),[N,A]=b.useState(!1);b.useEffect(()=>{w&&k("digest")},[w,h?.sectionIndex,h?.paragraphIndex]),b.useEffect(()=>{if(!e){x(null),_(null);return}_(null),ze.get(`/contents/${e}`).then(L=>{x(L),w||k("raw")}).catch(L=>{L instanceof hn&&L.status===404?_("not_found"):_("load_failed")})},[e]);const E=b.useCallback(()=>{A(!0),e&&ze.get(`/contents/${e}`).then(L=>x(L)).catch(()=>{})},[e]);b.useEffect(()=>{a&&A(!1)},[a]);const D=a&&!N&&r;return c.jsx("div",{className:"flex flex-1 flex-col",children:c.jsxs(a4,{value:S,onChange:L=>k(L),children:[c.jsxs(s4,{children:[c.jsx(Vr,{value:"raw",children:p("content.detail.tab.raw")}),c.jsx(Vr,{value:"digest",children:p("content.detail.tab.digest")}),c.jsx(Vr,{value:"extraction",children:p("content.detail.tab.extraction")}),c.jsx(Vr,{value:"entities",children:p("content.detail.tab.entities")}),f&&f!=="none"&&c.jsx(Vr,{value:"query",children:p("query.tab.label")})]}),c.jsx("div",{className:"mt-4 flex flex-1 flex-col",children:D?c.jsx(E6,{sourceId:r,onComplete:E,retryModules:l}):v?e?c.jsx(wt,{title:p(`common.error.${v}`),description:p(`common.error.${v}_description`)}):c.jsx(a_,{sourceId:r,isDaemonOnline:o,indexModules:l}):e?m?c.jsxs(c.Fragment,{children:[c.jsx(Yr,{value:"raw",children:c.jsx(tO,{hashId:m.hash_id,sourcePath:t})}),c.jsx(Yr,{value:"digest",children:c.jsx(nO,{hashId:m.hash_id,sourceId:r,sourcePath:t,isDaemonOnline:o,available:m.stages?.digest?.available,indexModules:l})}),c.jsx(Yr,{value:"extraction",children:c.jsx(rO,{hashId:m.hash_id,available:m.stages?.extraction?.available})}),c.jsx(Yr,{value:"entities",children:c.jsx(aO,{hashId:m.hash_id,available:m.stages?.extraction?.available})}),f&&f!=="none"&&c.jsx(Yr,{value:"query",children:c.jsx(eO,{sourceType:u,sourceId:r,indexStatus:f})})]}):c.jsx(Fl,{}):c.jsx(a_,{sourceId:r,isDaemonOnline:o,indexModules:l})})]})})}function Fl(){return c.jsx("div",{className:"flex flex-1 items-center justify-center pb-15",children:c.jsx(Zt,{size:24,className:"animate-spin text-c4a-text-muted"})})}function tO({hashId:e,sourcePath:t}){const{t:r}=ye(),[a,o]=b.useState(null),[l,u]=b.useState(!1),[f,h]=b.useState(!1);if(b.useEffect(()=>{u(!1),o(null),ze.get(`/contents/${e}/raw`).then(p=>{o(p),u(!0),h(!1)}).catch(p=>{p instanceof hn&&p.status===404&&h(!0),u(!0)})},[e]),!l){if(a){if(r_(a.content))try{return c.jsx(Wv,{data:JSON.parse(a.content)})}catch{}return c.jsx(Xv,{code:a.content,sourcePath:t})}return c.jsx(Fl,{})}if(f||!a||a.source==="unavailable")return c.jsx(wt,{title:r("common.empty.content_raw.title"),description:r("common.empty.content_raw.description")});if(r_(a.content))try{const p=JSON.parse(a.content);return c.jsx(Wv,{data:p})}catch{}return c.jsx(Xv,{code:a.content,sourcePath:t})}function nO({hashId:e,sourceId:t,sourcePath:r,isDaemonOnline:a,available:o,indexModules:l}){const{t:u}=ye(),[f,h]=b.useState(null),[p,m]=b.useState(!1),[x,v]=b.useState(!1),[_,w]=b.useState(null),S=kt(D=>D.triggerIndex),k=kt(D=>D.currentRoot),A=(k&&r?zl(k.tree,r):null)?.source_type==="doc",E=A?!0:!!a;return b.useEffect(()=>{if(o===!1){v(!0),m(!0),h(null);return}m(!1),v(!1),h(null);const D=A?"?digestType=doc_llm":"";ze.get(`/contents/${e}/digest${D}`).then(L=>{const $="digest"in L?L.digest:L.digests?.[0];$?h($):v(!0),m(!0)}).catch(L=>{L instanceof hn&&L.status===404&&v(!0),m(!0)})},[e,o,A]),p?x||!f?c.jsx(wt,{title:u(A?"digest.doc.empty.title":"digest.empty.title"),description:u(A?"digest.doc.empty.description":"digest.empty.description"),action:t?c.jsxs("div",{className:"flex flex-col items-center gap-2",children:[c.jsx("button",{type:"button",className:`rounded bg-c4a-accent px-4 py-2 text-sm font-medium text-white hover:bg-c4a-accent/90 ${E?"":"opacity-40 cursor-not-allowed"}`,onClick:E?async()=>{w(null);try{(await S(t,l)).status==="skipped"&&(w(u("index.code.skipped")),setTimeout(()=>w(null),3e3))}catch{w(u("index.code.error")),setTimeout(()=>w(null),3e3)}}:void 0,title:!E&&!A?u("daemon.offline_tooltip"):void 0,children:u(A?"digest.doc.empty.cta":"digest.empty.cta")}),_&&c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:_})]}):void 0}):c.jsx(s_,{data:f}):f?c.jsx(s_,{data:f}):c.jsx(Fl,{})}function s_({data:e}){const{t}=ye(),r=e.digest_data,a=r.classes||r.functions||r.relations;if(e.digest_type==="doc_llm")return c.jsx(B6,{digest:r});if(!a)return c.jsxs("div",{className:"flex flex-1 flex-col gap-3",children:[r.language&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("span",{className:"text-xs text-c4a-text-muted",children:[t("content.detail.language"),":"]}),c.jsx(Bt,{children:r.language})]}),c.jsx("div",{className:"flex flex-1 flex-col overflow-auto rounded border border-c4a-border-subtle p-3",children:c.jsx(Hl,{data:r,defaultExpanded:2})})]});const o=Array.isArray(r.files)?r.files.length:0,l=Array.isArray(r.classes)?r.classes.length:0,u=Array.isArray(r.functions)?r.functions.length:0,f=(Array.isArray(r.relations?.imports)?r.relations.imports.length:0)+(Array.isArray(r.relations?.calls)?r.relations.calls.length:0)+(Array.isArray(r.relations?.inheritance)?r.relations.inheritance.length:0),h=Array.isArray(r.techStack)?r.techStack:[],p=Array.isArray(r.modules)?r.modules:[];return c.jsxs("div",{className:"flex flex-1 flex-col gap-6 overflow-auto c4a-scrollbar",children:[c.jsxs("div",{className:"flex flex-wrap gap-3",children:[c.jsx(ln,{icon:c.jsx(On,{size:14}),label:t("digest.stats.files"),value:o,size:"sm"}),c.jsx(ln,{icon:c.jsx(A1,{size:14}),label:t("digest.stats.classes"),value:l,size:"sm"}),c.jsx(ln,{icon:c.jsx(AA,{size:14}),label:t("digest.stats.functions"),value:u,size:"sm"}),c.jsx(ln,{icon:c.jsx(PC,{size:14}),label:t("digest.stats.relations"),value:f,size:"sm"})]}),h.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:t("digest.tech_stack")}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(m=>c.jsx(Bt,{children:m},m))})]}),p.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:t("digest.modules")}),c.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface",children:p.map(m=>c.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 font-mono text-xs border-b border-c4a-border-subtle last:border-b-0",children:[c.jsx("span",{className:"text-c4a-text-primary",children:m.path||m.name}),c.jsxs("span",{className:"text-c4a-text-muted",children:[m.fileCount," files · ",m.totalLines>=1e3?`${(m.totalLines/1e3).toFixed(1)}k`:m.totalLines," lines"]})]},m.path))})]})]})}function rO({hashId:e,available:t}){const{t:r}=ye(),[a,o]=b.useState(null),[l,u]=b.useState(!1),[f,h]=b.useState(!1);return b.useEffect(()=>{if(t===!1){h(!0),u(!0),o(null);return}u(!1),o(null),h(!1),ze.get(`/contents/${e}/extractions`).then(p=>{!p.extractions||p.extractions.length===0?h(!0):o(p),u(!0)}).catch(p=>{p instanceof hn&&p.status===404&&h(!0),u(!0)})},[e,t]),l?f||!a?c.jsx(wt,{title:r("common.empty.content_extraction.title"),description:r("common.empty.content_extraction.description")}):c.jsx(o_,{extractions:a.extractions}):a?c.jsx(o_,{extractions:a.extractions}):c.jsx(Fl,{})}function o_({extractions:e}){const{t}=ye();return c.jsx("div",{className:"flex flex-1 flex-col gap-4 overflow-auto c4a-scrollbar",children:e.map(r=>{const a=Yo(r.extraction_confidence);return c.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.model&&c.jsx(Bt,{variant:"muted",children:r.model}),a&&c.jsx(Bt,{variant:a.variant,tooltip:`${a.value.toFixed(2)} — ${t(a.tipKey)}`,children:t(a.labelKey)})]}),c.jsx(Hl,{data:{atoms:r.atoms,candidate_entities:r.candidate_entities},defaultExpanded:2})]},r.id)})})}function aO({hashId:e,available:t}){const{t:r}=ye(),[a,o]=b.useState([]),[l,u]=b.useState(!1),[f,h]=b.useState(!1);return b.useEffect(()=>{if(t===!1){h(!0),u(!0),o([]);return}u(!1),o([]),h(!1),ze.get(`/contents/${e}/entities`).then(p=>{!p.entities||p.entities.length===0?h(!0):o(p.entities),u(!0)}).catch(p=>{p instanceof hn&&p.status===404&&h(!0),u(!0)})},[e,t]),l?f||a.length===0?c.jsx(wt,{title:r("common.empty.content_entities.title"),description:r("common.empty.content_entities.description")}):c.jsx("div",{className:"flex flex-1 flex-col overflow-auto c4a-scrollbar",children:c.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(p=>c.jsx(Zv,{entity:p},p.id))})}):a.length>0?c.jsx("div",{className:"flex flex-1 flex-col overflow-auto c4a-scrollbar",children:c.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(p=>c.jsx(Zv,{entity:p},p.id))})}):c.jsx(Fl,{})}const i_={entities:"Entities",behaviors:"Behaviors",roles:"Roles",attributes:"Attributes",states:"States",transitions:"Transitions",events:"Events",rules:"Rules",constraints:"Constraints",decisions:"Decisions",metrics:"Metrics",claims:"Claims",relations:"Relations",comparisons:"Comparisons",boundaries:"Boundaries"};function sO({data:e,atoms:t}){return c.jsxs("div",{className:"space-y-4",children:[e&&Object.keys(e).length>0&&c.jsx("div",{children:c.jsx(Hl,{data:e,defaultExpanded:2})}),t&&c.jsx(oO,{atoms:t})]})}function oO({atoms:e}){const t=Object.keys(i_);return c.jsx("div",{className:"space-y-2",children:t.map(r=>{const a=e[r];return!a||a.length===0?null:c.jsx(iO,{type:r,label:i_[r]??r,items:a},r)})})}function iO({type:e,label:t,items:r}){const[a,o]=b.useState(!0);return c.jsxs("details",{open:a,onToggle:l=>o(l.target.open),children:[c.jsxs("summary",{className:"cursor-pointer font-mono text-xs uppercase text-c4a-text-secondary hover:text-c4a-text-primary py-1.5",children:[t," (",r.length,")"]}),c.jsx("div",{className:"pl-4 pb-2",children:c.jsx(lO,{type:e,items:r})})]})}function lO({type:e,items:t}){switch(e){case"entities":case"behaviors":case"events":case"relations":return c.jsx(l_,{items:t});case"roles":return c.jsx(cO,{items:t});case"attributes":return c.jsx(uO,{items:t});case"states":return c.jsx(dO,{items:t});case"transitions":return c.jsx(fO,{items:t});case"rules":case"constraints":return c.jsx(pO,{items:t});case"decisions":return c.jsx(hO,{items:t});case"metrics":return c.jsx(mO,{items:t});case"claims":return c.jsx(gO,{items:t});case"comparisons":return c.jsx(xO,{items:t});case"boundaries":return c.jsx(yO,{items:t});default:return c.jsx(l_,{items:t})}}function ra({value:e}){const{t}=ye(),r=Yo(e);return r?c.jsx(Bt,{variant:r.variant,tooltip:`${r.value.toFixed(2)} — ${t(r.tipKey)}`,children:t(r.labelKey)}):null}function l_({items:e}){return c.jsx("div",{className:"space-y-1",children:e.map((t,r)=>c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[t.ref&&zm(t.ref)?c.jsx($m,{pointer:t.ref}):c.jsx("span",{className:"text-c4a-text-primary",children:t.name??String(t)}),c.jsx(ra,{value:t.confidence})]},r))})}function cO({items:e}){return c.jsx("div",{className:"space-y-1.5",children:e.map((t,r)=>c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsx(Bt,{variant:"accent",children:t.name??"role"}),!!t.performs&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-c4a-text-muted",children:"performs"}),zm(String(t.performs))?c.jsx($m,{pointer:String(t.performs)}):c.jsx("span",{className:"text-c4a-text-primary",children:String(t.performs)})]}),c.jsx(ra,{value:t.confidence})]},r))})}function uO({items:e}){return c.jsx("div",{className:"space-y-1",children:e.map((t,r)=>c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsxs("span",{className:"text-c4a-text-secondary font-mono",children:[t.name,":"]}),c.jsx("span",{className:"text-c4a-text-primary",children:String(t.value??"")}),c.jsx(ra,{value:t.confidence})]},r))})}function dO({items:e}){return c.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map((t,r)=>c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(Bt,{children:t.name??String(t)}),c.jsx(ra,{value:t.confidence})]},r))})}function fO({items:e}){return c.jsx("div",{className:"space-y-1.5",children:e.map((t,r)=>{const a=t;return c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsx(Bt,{variant:"muted",children:String(a.from_state??"?")}),c.jsx("span",{className:"text-c4a-text-muted",children:"→"}),c.jsx(Bt,{variant:"muted",children:String(a.to_state??"?")}),!!a.trigger&&c.jsx("span",{className:"text-c4a-text-muted italic",children:String(a.trigger)}),c.jsx(ra,{value:t.confidence})]},r)})})}function pO({items:e}){return c.jsx("div",{className:"space-y-1.5",children:e.map((t,r)=>{const a=t;return c.jsx("div",{className:"text-xs",children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"text-c4a-warning font-mono font-bold",children:"IF"}),c.jsx("span",{className:"text-c4a-text-primary",children:String(a.condition??a.name??"")}),c.jsx("span",{className:"text-c4a-accent font-mono font-bold",children:"THEN"}),c.jsx("span",{className:"text-c4a-text-primary",children:String(a.conclusion??a.description??"")}),c.jsx(ra,{value:t.confidence})]})},r)})})}function hO({items:e}){return c.jsx("div",{className:"space-y-1.5",children:e.map((t,r)=>c.jsxs("div",{className:"text-xs",children:[c.jsx("span",{className:"text-c4a-text-primary font-mono",children:t.name}),t.description&&c.jsx("span",{className:"text-c4a-text-muted ml-2",children:t.description}),c.jsx(ra,{value:t.confidence})]},r))})}function mO({items:e}){return c.jsx("div",{className:"space-y-1",children:e.map((t,r)=>{const a=t;return c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsx("span",{className:"text-c4a-text-primary font-mono",children:t.name}),!!a.unit&&c.jsx("span",{className:"text-c4a-text-muted",children:String(a.unit)}),!!a.threshold&&c.jsxs("span",{className:"text-c4a-text-secondary",children:["< ",String(a.threshold)]}),c.jsx(ra,{value:t.confidence})]},r)})})}function gO({items:e}){return c.jsx("div",{className:"space-y-1.5",children:e.map((t,r)=>{const a=t;return c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[!!a.claim_type&&c.jsx(Bt,{variant:"warning",children:String(a.claim_type)}),c.jsx("span",{className:"text-c4a-text-primary",children:t.description??t.name}),!!a.valid_from&&c.jsxs("span",{className:"text-c4a-text-muted",children:[String(a.valid_from)," 起"]}),c.jsx(ra,{value:t.confidence})]},r)})})}function xO({items:e}){return c.jsx("div",{className:"space-y-3",children:e.map((t,r)=>{const a=t,o=a.criteria,l=a.options;return!o||!l?c.jsx("div",{className:"text-xs text-c4a-text-muted",children:c.jsx(Hl,{data:t,defaultExpanded:1})},r):c.jsx("div",{className:"rounded border border-c4a-border-subtle overflow-auto",children:c.jsxs("table",{className:"w-full text-xs font-mono",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-c4a-border-subtle bg-c4a-bg-surface text-c4a-text-muted",children:[c.jsx("th",{className:"px-2 py-1 text-left",children:"Criteria"}),l.map((u,f)=>c.jsx("th",{className:"px-2 py-1 text-left",children:String(u.name??`Option ${f+1}`)},f))]})}),c.jsx("tbody",{children:o.map((u,f)=>c.jsxs("tr",{className:"border-b border-c4a-border-subtle",children:[c.jsx("td",{className:"px-2 py-1 text-c4a-text-secondary",children:u}),l.map((h,p)=>{const m=h.values;return c.jsx("td",{className:"px-2 py-1 text-c4a-text-primary",children:m?.[f]??"—"},p)})]},f))})]})},r)})})}function yO({items:e}){return c.jsx("div",{className:"space-y-1",children:e.map((t,r)=>{const a=t,o=a.included!==!1&&a.type!=="exclude";return c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsx("span",{className:o?"text-c4a-success":"text-c4a-error",children:o?"✓ 包含":"✗ 排除"}),c.jsx("span",{className:"text-c4a-text-primary",children:t.name??t.description}),c.jsx(ra,{value:t.confidence})]},r)})})}function bO({relation:e}){const t=Tt(),{t:r}=ye(),a=Ko(),o=Yo(e.confidence),l=e.direction==="incoming"?"←":"→",u=()=>{a?.active?a.navigate("relation",e.id,e.type,"↔"):t(sr.relation(e.id))},f=(h,p)=>{h.stopPropagation(),a?.active?a.navigate("entity",p.id,p.name,"🔹"):t(sr.entity(p.id))};return c.jsxs("div",{className:"flex items-center gap-3 py-2 px-3 rounded hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:u,children:[c.jsx(Bt,{variant:"accent",children:e.type}),c.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline cursor-pointer truncate",onClick:h=>f(h,e.from),children:e.from.name}),c.jsx("span",{className:"text-c4a-text-muted text-xs shrink-0",children:l}),c.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline cursor-pointer truncate",onClick:h=>f(h,e.to),children:e.to.name}),e.weight!==void 0&&c.jsxs("span",{className:"text-xs text-c4a-text-muted ml-auto shrink-0",children:["w: ",e.weight]}),o&&c.jsx(Bt,{variant:o.variant,tooltip:`${o.value.toFixed(2)} — ${r(o.tipKey)}`,children:r(o.labelKey)})]})}function vO({entityId:e}){const{t}=ye(),[r,a]=b.useState([]),[o,l]=b.useState(!1),[u,f]=b.useState("both"),[h,p]=b.useState(""),[m,x]=b.useState([]);return b.useEffect(()=>{const v={};u!=="both"&&(v.direction=u),h&&(v.type=h),ze.get(`/entities/${e}/relations`,v).then(_=>{if(a(_.relations),m.length===0){const w=[...new Set(_.relations.map(S=>S.type))];x(w)}l(!0)}).catch(()=>{l(!0)})},[e,u,h]),o?r.length===0?c.jsx(wt,{title:t("common.empty.entity_relations.title"),description:t("common.empty.entity_relations.description")}):c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[c.jsxs("select",{value:u,onChange:v=>f(v.target.value),className:"bg-c4a-bg-surface border border-c4a-border-subtle rounded px-2 py-1 text-xs font-mono text-c4a-text-secondary",children:[c.jsx("option",{value:"both",children:t("relation.filter.direction.all")}),c.jsx("option",{value:"outgoing",children:t("relation.filter.direction.outgoing")}),c.jsx("option",{value:"incoming",children:t("relation.filter.direction.incoming")})]}),m.length>1&&c.jsxs("select",{value:h,onChange:v=>p(v.target.value),className:"bg-c4a-bg-surface border border-c4a-border-subtle rounded px-2 py-1 text-xs font-mono text-c4a-text-secondary",children:[c.jsx("option",{value:"",children:t("relation.filter.type.all")}),m.map(v=>c.jsx("option",{value:v,children:v},v))]})]}),c.jsx("div",{className:"space-y-1",children:r.map(v=>c.jsx(bO,{relation:v},v.id))})]}):c.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function _O(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function dw({content:e}){const{t}=ye(),r=Tt(),a=Ko(),o=e.hash_id.slice(0,12),l=()=>{const u=e.source_path??o;a?.active?a.navigate("content",e.hash_id,u,"📄"):r(sr.content(e.hash_id))};return c.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3 cursor-pointer hover:border-c4a-accent transition-colors",onClick:l,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"shrink-0",children:"📄"}),c.jsx("span",{className:"font-mono text-xs text-c4a-accent hover:underline truncate",children:o}),e.byte_size!=null&&c.jsx("span",{className:"text-xs text-c4a-text-muted shrink-0",children:_O(e.byte_size)})]}),e.source_path&&c.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted truncate",children:e.source_path}),e.span&&c.jsx("p",{className:"mt-0.5 text-xs text-c4a-text-muted",children:t("content.card.lines",{start:e.span.start,end:e.span.end})})]})}function wO({entityId:e}){const{t}=ye(),[r,a]=b.useState([]),[o,l]=b.useState(!1);return b.useEffect(()=>{ze.get(`/entities/${e}/contents`).then(u=>{a(u.contents??[]),l(!0)}).catch(()=>l(!0))},[e]),o?r.length===0?c.jsx(wt,{title:t("common.empty.entity_contents.title"),description:t("common.empty.entity_contents.description")}):c.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:r.map(u=>c.jsx(dw,{content:u},u.hash_id))}):c.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function SO({entityId:e}){const{t}=ye(),r=Tt(),[a,o]=b.useState([]),[l,u]=b.useState(!1);return b.useEffect(()=>{ze.get(`/entities/${e}/referrers`).then(f=>{o(f.referrers??[]),u(!0)}).catch(()=>u(!0))},[e]),l?a.length===0?c.jsx(wt,{title:t("common.empty.entity_referrers.title"),description:t("common.empty.entity_referrers.description")}):c.jsx("div",{className:"space-y-1",children:a.map(f=>c.jsxs("div",{className:"flex items-center gap-3 py-2 px-3 rounded hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:()=>r(sr.entity(f.id)),children:[c.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline truncate",children:f.name}),c.jsx("span",{className:"text-xs text-c4a-text-muted shrink-0",children:f.type}),c.jsx("span",{className:"text-xs text-c4a-text-muted font-mono ml-auto shrink-0",children:f.ref_field}),c.jsxs("span",{className:"text-xs text-c4a-text-muted shrink-0",children:["(",f.ref_type,")"]})]},`${f.id}-${f.ref_field}`))}):c.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function jO(e,t){var r,a=1;e==null&&(e=0),t==null&&(t=0);function o(){var l,u=r.length,f,h=0,p=0;for(l=0;l<u;++l)f=r[l],h+=f.x,p+=f.y;for(h=(h/u-e)*a,p=(p/u-t)*a,l=0;l<u;++l)f=r[l],f.x-=h,f.y-=p}return o.initialize=function(l){r=l},o.x=function(l){return arguments.length?(e=+l,o):e},o.y=function(l){return arguments.length?(t=+l,o):t},o.strength=function(l){return arguments.length?(a=+l,o):a},o}function kO(e){const t=+this._x.call(null,e),r=+this._y.call(null,e);return fw(this.cover(t,r),t,r,e)}function fw(e,t,r,a){if(isNaN(t)||isNaN(r))return e;var o,l=e._root,u={data:a},f=e._x0,h=e._y0,p=e._x1,m=e._y1,x,v,_,w,S,k,N,A;if(!l)return e._root=u,e;for(;l.length;)if((S=t>=(x=(f+p)/2))?f=x:p=x,(k=r>=(v=(h+m)/2))?h=v:m=v,o=l,!(l=l[N=k<<1|S]))return o[N]=u,e;if(_=+e._x.call(null,l.data),w=+e._y.call(null,l.data),t===_&&r===w)return u.next=l,o?o[N]=u:e._root=u,e;do o=o?o[N]=new Array(4):e._root=new Array(4),(S=t>=(x=(f+p)/2))?f=x:p=x,(k=r>=(v=(h+m)/2))?h=v:m=v;while((N=k<<1|S)===(A=(w>=v)<<1|_>=x));return o[A]=l,o[N]=u,e}function NO(e){var t,r,a=e.length,o,l,u=new Array(a),f=new Array(a),h=1/0,p=1/0,m=-1/0,x=-1/0;for(r=0;r<a;++r)isNaN(o=+this._x.call(null,t=e[r]))||isNaN(l=+this._y.call(null,t))||(u[r]=o,f[r]=l,o<h&&(h=o),o>m&&(m=o),l<p&&(p=l),l>x&&(x=l));if(h>m||p>x)return this;for(this.cover(h,p).cover(m,x),r=0;r<a;++r)fw(this,u[r],f[r],e[r]);return this}function EO(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,a=this._y0,o=this._x1,l=this._y1;if(isNaN(r))o=(r=Math.floor(e))+1,l=(a=Math.floor(t))+1;else{for(var u=o-r||1,f=this._root,h,p;r>e||e>=o||a>t||t>=l;)switch(p=(t<a)<<1|e<r,h=new Array(4),h[p]=f,f=h,u*=2,p){case 0:o=r+u,l=a+u;break;case 1:r=o-u,l=a+u;break;case 2:o=r+u,a=l-u;break;case 3:r=o-u,a=l-u;break}this._root&&this._root.length&&(this._root=f)}return this._x0=r,this._y0=a,this._x1=o,this._y1=l,this}function CO(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function AO(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Dn(e,t,r,a,o){this.node=e,this.x0=t,this.y0=r,this.x1=a,this.y1=o}function RO(e,t,r){var a,o=this._x0,l=this._y0,u,f,h,p,m=this._x1,x=this._y1,v=[],_=this._root,w,S;for(_&&v.push(new Dn(_,o,l,m,x)),r==null?r=1/0:(o=e-r,l=t-r,m=e+r,x=t+r,r*=r);w=v.pop();)if(!(!(_=w.node)||(u=w.x0)>m||(f=w.y0)>x||(h=w.x1)<o||(p=w.y1)<l))if(_.length){var k=(u+h)/2,N=(f+p)/2;v.push(new Dn(_[3],k,N,h,p),new Dn(_[2],u,N,k,p),new Dn(_[1],k,f,h,N),new Dn(_[0],u,f,k,N)),(S=(t>=N)<<1|e>=k)&&(w=v[v.length-1],v[v.length-1]=v[v.length-1-S],v[v.length-1-S]=w)}else{var A=e-+this._x.call(null,_.data),E=t-+this._y.call(null,_.data),D=A*A+E*E;if(D<r){var L=Math.sqrt(r=D);o=e-L,l=t-L,m=e+L,x=t+L,a=_.data}}return a}function TO(e){if(isNaN(m=+this._x.call(null,e))||isNaN(x=+this._y.call(null,e)))return this;var t,r=this._root,a,o,l,u=this._x0,f=this._y0,h=this._x1,p=this._y1,m,x,v,_,w,S,k,N;if(!r)return this;if(r.length)for(;;){if((w=m>=(v=(u+h)/2))?u=v:h=v,(S=x>=(_=(f+p)/2))?f=_:p=_,t=r,!(r=r[k=S<<1|w]))return this;if(!r.length)break;(t[k+1&3]||t[k+2&3]||t[k+3&3])&&(a=t,N=k)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(l=r.next)&&delete r.next,o?(l?o.next=l:delete o.next,this):t?(l?t[k]=l:delete t[k],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(a?a[N]=r:this._root=r),this):(this._root=l,this)}function LO(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}function DO(){return this._root}function OO(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function MO(e){var t=[],r,a=this._root,o,l,u,f,h;for(a&&t.push(new Dn(a,this._x0,this._y0,this._x1,this._y1));r=t.pop();)if(!e(a=r.node,l=r.x0,u=r.y0,f=r.x1,h=r.y1)&&a.length){var p=(l+f)/2,m=(u+h)/2;(o=a[3])&&t.push(new Dn(o,p,m,f,h)),(o=a[2])&&t.push(new Dn(o,l,m,p,h)),(o=a[1])&&t.push(new Dn(o,p,u,f,m)),(o=a[0])&&t.push(new Dn(o,l,u,p,m))}return this}function zO(e){var t=[],r=[],a;for(this._root&&t.push(new Dn(this._root,this._x0,this._y0,this._x1,this._y1));a=t.pop();){var o=a.node;if(o.length){var l,u=a.x0,f=a.y0,h=a.x1,p=a.y1,m=(u+h)/2,x=(f+p)/2;(l=o[0])&&t.push(new Dn(l,u,f,m,x)),(l=o[1])&&t.push(new Dn(l,m,f,h,x)),(l=o[2])&&t.push(new Dn(l,u,x,m,p)),(l=o[3])&&t.push(new Dn(l,m,x,h,p))}r.push(a)}for(;a=r.pop();)e(a.node,a.x0,a.y0,a.x1,a.y1);return this}function $O(e){return e[0]}function BO(e){return arguments.length?(this._x=e,this):this._x}function IO(e){return e[1]}function UO(e){return arguments.length?(this._y=e,this):this._y}function Im(e,t,r){var a=new Um(t??$O,r??IO,NaN,NaN,NaN,NaN);return e==null?a:a.addAll(e)}function Um(e,t,r,a,o,l){this._x=e,this._y=t,this._x0=r,this._y0=a,this._x1=o,this._y1=l,this._root=void 0}function c_(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var $n=Im.prototype=Um.prototype;$n.copy=function(){var e=new Um(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,r,a;if(!t)return e;if(!t.length)return e._root=c_(t),e;for(r=[{source:t,target:e._root=new Array(4)}];t=r.pop();)for(var o=0;o<4;++o)(a=t.source[o])&&(a.length?r.push({source:a,target:t.target[o]=new Array(4)}):t.target[o]=c_(a));return e};$n.add=kO;$n.addAll=NO;$n.cover=EO;$n.data=CO;$n.extent=AO;$n.find=RO;$n.remove=TO;$n.removeAll=LO;$n.root=DO;$n.size=OO;$n.visit=MO;$n.visitAfter=zO;$n.x=BO;$n.y=UO;function Bs(e){return function(){return e}}function cs(e){return(e()-.5)*1e-6}function PO(e){return e.x+e.vx}function HO(e){return e.y+e.vy}function FO(e){var t,r,a,o=1,l=1;typeof e!="function"&&(e=Bs(e==null?1:+e));function u(){for(var p,m=t.length,x,v,_,w,S,k,N=0;N<l;++N)for(x=Im(t,PO,HO).visitAfter(f),p=0;p<m;++p)v=t[p],S=r[v.index],k=S*S,_=v.x+v.vx,w=v.y+v.vy,x.visit(A);function A(E,D,L,$,z){var R=E.data,B=E.r,H=S+B;if(R){if(R.index>v.index){var J=_-R.x-R.vx,oe=w-R.y-R.vy,ce=J*J+oe*oe;ce<H*H&&(J===0&&(J=cs(a),ce+=J*J),oe===0&&(oe=cs(a),ce+=oe*oe),ce=(H-(ce=Math.sqrt(ce)))/ce*o,v.vx+=(J*=ce)*(H=(B*=B)/(k+B)),v.vy+=(oe*=ce)*H,R.vx-=J*(H=1-H),R.vy-=oe*H)}return}return D>_+H||$<_-H||L>w+H||z<w-H}}function f(p){if(p.data)return p.r=r[p.data.index];for(var m=p.r=0;m<4;++m)p[m]&&p[m].r>p.r&&(p.r=p[m].r)}function h(){if(t){var p,m=t.length,x;for(r=new Array(m),p=0;p<m;++p)x=t[p],r[x.index]=+e(x,p,t)}}return u.initialize=function(p,m){t=p,a=m,h()},u.iterations=function(p){return arguments.length?(l=+p,u):l},u.strength=function(p){return arguments.length?(o=+p,u):o},u.radius=function(p){return arguments.length?(e=typeof p=="function"?p:Bs(+p),h(),u):e},u}function qO(e){return e.index}function u_(e,t){var r=e.get(t);if(!r)throw new Error("node not found: "+t);return r}function GO(e){var t=qO,r=x,a,o=Bs(30),l,u,f,h,p,m=1;e==null&&(e=[]);function x(k){return 1/Math.min(f[k.source.index],f[k.target.index])}function v(k){for(var N=0,A=e.length;N<m;++N)for(var E=0,D,L,$,z,R,B,H;E<A;++E)D=e[E],L=D.source,$=D.target,z=$.x+$.vx-L.x-L.vx||cs(p),R=$.y+$.vy-L.y-L.vy||cs(p),B=Math.sqrt(z*z+R*R),B=(B-l[E])/B*k*a[E],z*=B,R*=B,$.vx-=z*(H=h[E]),$.vy-=R*H,L.vx+=z*(H=1-H),L.vy+=R*H}function _(){if(u){var k,N=u.length,A=e.length,E=new Map(u.map((L,$)=>[t(L,$,u),L])),D;for(k=0,f=new Array(N);k<A;++k)D=e[k],D.index=k,typeof D.source!="object"&&(D.source=u_(E,D.source)),typeof D.target!="object"&&(D.target=u_(E,D.target)),f[D.source.index]=(f[D.source.index]||0)+1,f[D.target.index]=(f[D.target.index]||0)+1;for(k=0,h=new Array(A);k<A;++k)D=e[k],h[k]=f[D.source.index]/(f[D.source.index]+f[D.target.index]);a=new Array(A),w(),l=new Array(A),S()}}function w(){if(u)for(var k=0,N=e.length;k<N;++k)a[k]=+r(e[k],k,e)}function S(){if(u)for(var k=0,N=e.length;k<N;++k)l[k]=+o(e[k],k,e)}return v.initialize=function(k,N){u=k,p=N,_()},v.links=function(k){return arguments.length?(e=k,_(),v):e},v.id=function(k){return arguments.length?(t=k,v):t},v.iterations=function(k){return arguments.length?(m=+k,v):m},v.strength=function(k){return arguments.length?(r=typeof k=="function"?k:Bs(+k),w(),v):r},v.distance=function(k){return arguments.length?(o=typeof k=="function"?k:Bs(+k),S(),v):o},v}var VO={value:()=>{}};function yd(){for(var e=0,t=arguments.length,r={},a;e<t;++e){if(!(a=arguments[e]+"")||a in r||/[\s.]/.test(a))throw new Error("illegal type: "+a);r[a]=[]}return new Ru(r)}function Ru(e){this._=e}function YO(e,t){return e.trim().split(/^|\s+/).map(function(r){var a="",o=r.indexOf(".");if(o>=0&&(a=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:a}})}Ru.prototype=yd.prototype={constructor:Ru,on:function(e,t){var r=this._,a=YO(e+"",r),o,l=-1,u=a.length;if(arguments.length<2){for(;++l<u;)if((o=(e=a[l]).type)&&(o=KO(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(o=(e=a[l]).type)r[o]=d_(r[o],e.name,t);else if(t==null)for(o in r)r[o]=d_(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Ru(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),a=0,o,l;a<o;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],a=0,o=l.length;a<o;++a)l[a].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],o=0,l=a.length;o<l;++o)a[o].value.apply(t,r)}};function KO(e,t){for(var r=0,a=e.length,o;r<a;++r)if((o=e[r]).name===t)return o.value}function d_(e,t,r){for(var a=0,o=e.length;a<o;++a)if(e[a].name===t){e[a]=VO,e=e.slice(0,a).concat(e.slice(a+1));break}return r!=null&&e.push({name:t,value:r}),e}var Fo=0,ol=0,Wi=0,pw=1e3,Zu,il,Ju=0,Ps=0,bd=0,kl=typeof performance=="object"&&performance.now?performance:Date,hw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Pm(){return Ps||(hw(XO),Ps=kl.now()+bd)}function XO(){Ps=0}function Wu(){this._call=this._time=this._next=null}Wu.prototype=Hm.prototype={constructor:Wu,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Pm():+r)+(t==null?0:+t),!this._next&&il!==this&&(il?il._next=this:Zu=this,il=this),this._call=e,this._time=r,Wh()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wh())}};function Hm(e,t,r){var a=new Wu;return a.restart(e,t,r),a}function QO(){Pm(),++Fo;for(var e=Zu,t;e;)(t=Ps-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Fo}function f_(){Ps=(Ju=kl.now())+bd,Fo=ol=0;try{QO()}finally{Fo=0,JO(),Ps=0}}function ZO(){var e=kl.now(),t=e-Ju;t>pw&&(bd-=t,Ju=e)}function JO(){for(var e,t=Zu,r,a=1/0;t;)t._call?(a>t._time&&(a=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Zu=r);il=e,Wh(a)}function Wh(e){if(!Fo){ol&&(ol=clearTimeout(ol));var t=e-Ps;t>24?(e<1/0&&(ol=setTimeout(f_,e-kl.now()-bd)),Wi&&(Wi=clearInterval(Wi))):(Wi||(Ju=kl.now(),Wi=setInterval(ZO,pw)),Fo=1,hw(f_))}}function p_(e,t,r){var a=new Wu;return t=t==null?0:+t,a.restart(o=>{a.stop(),e(o+t)},t,r),a}const WO=1664525,eM=1013904223,h_=4294967296;function tM(){let e=1;return()=>(e=(WO*e+eM)%h_)/h_}function nM(e){return e.x}function rM(e){return e.y}var aM=10,sM=Math.PI*(3-Math.sqrt(5));function oM(e){var t,r=1,a=.001,o=1-Math.pow(a,1/300),l=0,u=.6,f=new Map,h=Hm(x),p=yd("tick","end"),m=tM();e==null&&(e=[]);function x(){v(),p.call("tick",t),r<a&&(h.stop(),p.call("end",t))}function v(S){var k,N=e.length,A;S===void 0&&(S=1);for(var E=0;E<S;++E)for(r+=(l-r)*o,f.forEach(function(D){D(r)}),k=0;k<N;++k)A=e[k],A.fx==null?A.x+=A.vx*=u:(A.x=A.fx,A.vx=0),A.fy==null?A.y+=A.vy*=u:(A.y=A.fy,A.vy=0);return t}function _(){for(var S=0,k=e.length,N;S<k;++S){if(N=e[S],N.index=S,N.fx!=null&&(N.x=N.fx),N.fy!=null&&(N.y=N.fy),isNaN(N.x)||isNaN(N.y)){var A=aM*Math.sqrt(.5+S),E=S*sM;N.x=A*Math.cos(E),N.y=A*Math.sin(E)}(isNaN(N.vx)||isNaN(N.vy))&&(N.vx=N.vy=0)}}function w(S){return S.initialize&&S.initialize(e,m),S}return _(),t={tick:v,restart:function(){return h.restart(x),t},stop:function(){return h.stop(),t},nodes:function(S){return arguments.length?(e=S,_(),f.forEach(w),t):e},alpha:function(S){return arguments.length?(r=+S,t):r},alphaMin:function(S){return arguments.length?(a=+S,t):a},alphaDecay:function(S){return arguments.length?(o=+S,t):+o},alphaTarget:function(S){return arguments.length?(l=+S,t):l},velocityDecay:function(S){return arguments.length?(u=1-S,t):1-u},randomSource:function(S){return arguments.length?(m=S,f.forEach(w),t):m},force:function(S,k){return arguments.length>1?(k==null?f.delete(S):f.set(S,w(k)),t):f.get(S)},find:function(S,k,N){var A=0,E=e.length,D,L,$,z,R;for(N==null?N=1/0:N*=N,A=0;A<E;++A)z=e[A],D=S-z.x,L=k-z.y,$=D*D+L*L,$<N&&(R=z,N=$);return R},on:function(S,k){return arguments.length>1?(p.on(S,k),t):p.on(S)}}}function iM(){var e,t,r,a,o=Bs(-30),l,u=1,f=1/0,h=.81;function p(_){var w,S=e.length,k=Im(e,nM,rM).visitAfter(x);for(a=_,w=0;w<S;++w)t=e[w],k.visit(v)}function m(){if(e){var _,w=e.length,S;for(l=new Array(w),_=0;_<w;++_)S=e[_],l[S.index]=+o(S,_,e)}}function x(_){var w=0,S,k,N=0,A,E,D;if(_.length){for(A=E=D=0;D<4;++D)(S=_[D])&&(k=Math.abs(S.value))&&(w+=S.value,N+=k,A+=k*S.x,E+=k*S.y);_.x=A/N,_.y=E/N}else{S=_,S.x=S.data.x,S.y=S.data.y;do w+=l[S.data.index];while(S=S.next)}_.value=w}function v(_,w,S,k){if(!_.value)return!0;var N=_.x-t.x,A=_.y-t.y,E=k-w,D=N*N+A*A;if(E*E/h<D)return D<f&&(N===0&&(N=cs(r),D+=N*N),A===0&&(A=cs(r),D+=A*A),D<u&&(D=Math.sqrt(u*D)),t.vx+=N*_.value*a/D,t.vy+=A*_.value*a/D),!0;if(_.length||D>=f)return;(_.data!==t||_.next)&&(N===0&&(N=cs(r),D+=N*N),A===0&&(A=cs(r),D+=A*A),D<u&&(D=Math.sqrt(u*D)));do _.data!==t&&(E=l[_.data.index]*a/D,t.vx+=N*E,t.vy+=A*E);while(_=_.next)}return p.initialize=function(_,w){e=_,r=w,m()},p.strength=function(_){return arguments.length?(o=typeof _=="function"?_:Bs(+_),m(),p):o},p.distanceMin=function(_){return arguments.length?(u=_*_,p):Math.sqrt(u)},p.distanceMax=function(_){return arguments.length?(f=_*_,p):Math.sqrt(f)},p.theta=function(_){return arguments.length?(h=_*_,p):Math.sqrt(h)},p}var em="http://www.w3.org/1999/xhtml";const m_={svg:"http://www.w3.org/2000/svg",xhtml:em,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function vd(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),m_.hasOwnProperty(t)?{space:m_[t],local:e}:e}function lM(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===em&&t.documentElement.namespaceURI===em?t.createElement(e):t.createElementNS(r,e)}}function cM(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mw(e){var t=vd(e);return(t.local?cM:lM)(t)}function uM(){}function Fm(e){return e==null?uM:function(){return this.querySelector(e)}}function dM(e){typeof e!="function"&&(e=Fm(e));for(var t=this._groups,r=t.length,a=new Array(r),o=0;o<r;++o)for(var l=t[o],u=l.length,f=a[o]=new Array(u),h,p,m=0;m<u;++m)(h=l[m])&&(p=e.call(h,h.__data__,m,l))&&("__data__"in h&&(p.__data__=h.__data__),f[m]=p);return new or(a,this._parents)}function fM(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function pM(){return[]}function gw(e){return e==null?pM:function(){return this.querySelectorAll(e)}}function hM(e){return function(){return fM(e.apply(this,arguments))}}function mM(e){typeof e=="function"?e=hM(e):e=gw(e);for(var t=this._groups,r=t.length,a=[],o=[],l=0;l<r;++l)for(var u=t[l],f=u.length,h,p=0;p<f;++p)(h=u[p])&&(a.push(e.call(h,h.__data__,p,u)),o.push(h));return new or(a,o)}function xw(e){return function(){return this.matches(e)}}function yw(e){return function(t){return t.matches(e)}}var gM=Array.prototype.find;function xM(e){return function(){return gM.call(this.children,e)}}function yM(){return this.firstElementChild}function bM(e){return this.select(e==null?yM:xM(typeof e=="function"?e:yw(e)))}var vM=Array.prototype.filter;function _M(){return Array.from(this.children)}function wM(e){return function(){return vM.call(this.children,e)}}function SM(e){return this.selectAll(e==null?_M:wM(typeof e=="function"?e:yw(e)))}function jM(e){typeof e!="function"&&(e=xw(e));for(var t=this._groups,r=t.length,a=new Array(r),o=0;o<r;++o)for(var l=t[o],u=l.length,f=a[o]=[],h,p=0;p<u;++p)(h=l[p])&&e.call(h,h.__data__,p,l)&&f.push(h);return new or(a,this._parents)}function bw(e){return new Array(e.length)}function kM(){return new or(this._enter||this._groups.map(bw),this._parents)}function ed(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ed.prototype={constructor:ed,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function NM(e){return function(){return e}}function EM(e,t,r,a,o,l){for(var u=0,f,h=t.length,p=l.length;u<p;++u)(f=t[u])?(f.__data__=l[u],a[u]=f):r[u]=new ed(e,l[u]);for(;u<h;++u)(f=t[u])&&(o[u]=f)}function CM(e,t,r,a,o,l,u){var f,h,p=new Map,m=t.length,x=l.length,v=new Array(m),_;for(f=0;f<m;++f)(h=t[f])&&(v[f]=_=u.call(h,h.__data__,f,t)+"",p.has(_)?o[f]=h:p.set(_,h));for(f=0;f<x;++f)_=u.call(e,l[f],f,l)+"",(h=p.get(_))?(a[f]=h,h.__data__=l[f],p.delete(_)):r[f]=new ed(e,l[f]);for(f=0;f<m;++f)(h=t[f])&&p.get(v[f])===h&&(o[f]=h)}function AM(e){return e.__data__}function RM(e,t){if(!arguments.length)return Array.from(this,AM);var r=t?CM:EM,a=this._parents,o=this._groups;typeof e!="function"&&(e=NM(e));for(var l=o.length,u=new Array(l),f=new Array(l),h=new Array(l),p=0;p<l;++p){var m=a[p],x=o[p],v=x.length,_=TM(e.call(m,m&&m.__data__,p,a)),w=_.length,S=f[p]=new Array(w),k=u[p]=new Array(w),N=h[p]=new Array(v);r(m,x,S,k,N,_,t);for(var A=0,E=0,D,L;A<w;++A)if(D=S[A]){for(A>=E&&(E=A+1);!(L=k[E])&&++E<w;);D._next=L||null}}return u=new or(u,a),u._enter=f,u._exit=h,u}function TM(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function LM(){return new or(this._exit||this._groups.map(bw),this._parents)}function DM(e,t,r){var a=this.enter(),o=this,l=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?l.remove():r(l),a&&o?a.merge(o).order():o}function OM(e){for(var t=e.selection?e.selection():e,r=this._groups,a=t._groups,o=r.length,l=a.length,u=Math.min(o,l),f=new Array(o),h=0;h<u;++h)for(var p=r[h],m=a[h],x=p.length,v=f[h]=new Array(x),_,w=0;w<x;++w)(_=p[w]||m[w])&&(v[w]=_);for(;h<o;++h)f[h]=r[h];return new or(f,this._parents)}function MM(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var a=e[t],o=a.length-1,l=a[o],u;--o>=0;)(u=a[o])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function zM(e){e||(e=$M);function t(x,v){return x&&v?e(x.__data__,v.__data__):!x-!v}for(var r=this._groups,a=r.length,o=new Array(a),l=0;l<a;++l){for(var u=r[l],f=u.length,h=o[l]=new Array(f),p,m=0;m<f;++m)(p=u[m])&&(h[m]=p);h.sort(t)}return new or(o,this._parents).order()}function $M(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function BM(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function IM(){return Array.from(this)}function UM(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var a=e[t],o=0,l=a.length;o<l;++o){var u=a[o];if(u)return u}return null}function PM(){let e=0;for(const t of this)++e;return e}function HM(){return!this.node()}function FM(e){for(var t=this._groups,r=0,a=t.length;r<a;++r)for(var o=t[r],l=0,u=o.length,f;l<u;++l)(f=o[l])&&e.call(f,f.__data__,l,o);return this}function qM(e){return function(){this.removeAttribute(e)}}function GM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function VM(e,t){return function(){this.setAttribute(e,t)}}function YM(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function KM(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function XM(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function QM(e,t){var r=vd(e);if(arguments.length<2){var a=this.node();return r.local?a.getAttributeNS(r.space,r.local):a.getAttribute(r)}return this.each((t==null?r.local?GM:qM:typeof t=="function"?r.local?XM:KM:r.local?YM:VM)(r,t))}function vw(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ZM(e){return function(){this.style.removeProperty(e)}}function JM(e,t,r){return function(){this.style.setProperty(e,t,r)}}function WM(e,t,r){return function(){var a=t.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,r)}}function e8(e,t,r){return arguments.length>1?this.each((t==null?ZM:typeof t=="function"?WM:JM)(e,t,r??"")):qo(this.node(),e)}function qo(e,t){return e.style.getPropertyValue(t)||vw(e).getComputedStyle(e,null).getPropertyValue(t)}function t8(e){return function(){delete this[e]}}function n8(e,t){return function(){this[e]=t}}function r8(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function a8(e,t){return arguments.length>1?this.each((t==null?t8:typeof t=="function"?r8:n8)(e,t)):this.node()[e]}function _w(e){return e.trim().split(/^|\s+/)}function qm(e){return e.classList||new ww(e)}function ww(e){this._node=e,this._names=_w(e.getAttribute("class")||"")}ww.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Sw(e,t){for(var r=qm(e),a=-1,o=t.length;++a<o;)r.add(t[a])}function jw(e,t){for(var r=qm(e),a=-1,o=t.length;++a<o;)r.remove(t[a])}function s8(e){return function(){Sw(this,e)}}function o8(e){return function(){jw(this,e)}}function i8(e,t){return function(){(t.apply(this,arguments)?Sw:jw)(this,e)}}function l8(e,t){var r=_w(e+"");if(arguments.length<2){for(var a=qm(this.node()),o=-1,l=r.length;++o<l;)if(!a.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?i8:t?s8:o8)(r,t))}function c8(){this.textContent=""}function u8(e){return function(){this.textContent=e}}function d8(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function f8(e){return arguments.length?this.each(e==null?c8:(typeof e=="function"?d8:u8)(e)):this.node().textContent}function p8(){this.innerHTML=""}function h8(e){return function(){this.innerHTML=e}}function m8(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function g8(e){return arguments.length?this.each(e==null?p8:(typeof e=="function"?m8:h8)(e)):this.node().innerHTML}function x8(){this.nextSibling&&this.parentNode.appendChild(this)}function y8(){return this.each(x8)}function b8(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function v8(){return this.each(b8)}function _8(e){var t=typeof e=="function"?e:mw(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function w8(){return null}function S8(e,t){var r=typeof e=="function"?e:mw(e),a=t==null?w8:typeof t=="function"?t:Fm(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),a.apply(this,arguments)||null)})}function j8(){var e=this.parentNode;e&&e.removeChild(this)}function k8(){return this.each(j8)}function N8(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function E8(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function C8(e){return this.select(e?E8:N8)}function A8(e){return arguments.length?this.property("__data__",e):this.node().__data__}function R8(e){return function(t){e.call(this,t,this.__data__)}}function T8(e){return e.trim().split(/^|\s+/).map(function(t){var r="",a=t.indexOf(".");return a>=0&&(r=t.slice(a+1),t=t.slice(0,a)),{type:t,name:r}})}function L8(e){return function(){var t=this.__on;if(t){for(var r=0,a=-1,o=t.length,l;r<o;++r)l=t[r],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++a]=l;++a?t.length=a:delete this.__on}}}function D8(e,t,r){return function(){var a=this.__on,o,l=R8(t);if(a){for(var u=0,f=a.length;u<f;++u)if((o=a[u]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=l,o.options=r),o.value=t;return}}this.addEventListener(e.type,l,r),o={type:e.type,name:e.name,value:t,listener:l,options:r},a?a.push(o):this.__on=[o]}}function O8(e,t,r){var a=T8(e+""),o,l=a.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,p=f.length,m;h<p;++h)for(o=0,m=f[h];o<l;++o)if((u=a[o]).type===m.type&&u.name===m.name)return m.value}return}for(f=t?D8:L8,o=0;o<l;++o)this.each(f(a[o],t,r));return this}function kw(e,t,r){var a=vw(e),o=a.CustomEvent;typeof o=="function"?o=new o(t,r):(o=a.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function M8(e,t){return function(){return kw(this,e,t)}}function z8(e,t){return function(){return kw(this,e,t.apply(this,arguments))}}function $8(e,t){return this.each((typeof t=="function"?z8:M8)(e,t))}function*B8(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var a=e[t],o=0,l=a.length,u;o<l;++o)(u=a[o])&&(yield u)}var Nw=[null];function or(e,t){this._groups=e,this._parents=t}function ql(){return new or([[document.documentElement]],Nw)}function I8(){return this}or.prototype=ql.prototype={constructor:or,select:dM,selectAll:mM,selectChild:bM,selectChildren:SM,filter:jM,data:RM,enter:kM,exit:LM,join:DM,merge:OM,selection:I8,order:MM,sort:zM,call:BM,nodes:IM,node:UM,size:PM,empty:HM,each:FM,attr:QM,style:e8,property:a8,classed:l8,text:f8,html:g8,raise:y8,lower:v8,append:_8,insert:S8,remove:k8,clone:C8,datum:A8,on:O8,dispatch:$8,[Symbol.iterator]:B8};function wr(e){return typeof e=="string"?new or([[document.querySelector(e)]],[document.documentElement]):new or([[e]],Nw)}function U8(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ts(e,t){if(e=U8(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var a=r.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(t.getScreenCTM().inverse()),[a.x,a.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const tm={capture:!0,passive:!1};function nm(e){e.preventDefault(),e.stopImmediatePropagation()}function P8(e){var t=e.document.documentElement,r=wr(e).on("dragstart.drag",nm,tm);"onselectstart"in t?r.on("selectstart.drag",nm,tm):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function H8(e,t){var r=e.document.documentElement,a=wr(e).on("dragstart.drag",null);t&&(a.on("click.drag",nm,tm),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in r?a.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}function Gm(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Ew(e,t){var r=Object.create(e.prototype);for(var a in t)r[a]=t[a];return r}function Gl(){}var Nl=.7,td=1/Nl,Io="\\s*([+-]?\\d+)\\s*",El="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",F8=/^#([0-9a-f]{3,8})$/,q8=new RegExp(`^rgb\\(${Io},${Io},${Io}\\)$`),G8=new RegExp(`^rgb\\(${Zr},${Zr},${Zr}\\)$`),V8=new RegExp(`^rgba\\(${Io},${Io},${Io},${El}\\)$`),Y8=new RegExp(`^rgba\\(${Zr},${Zr},${Zr},${El}\\)$`),K8=new RegExp(`^hsl\\(${El},${Zr},${Zr}\\)$`),X8=new RegExp(`^hsla\\(${El},${Zr},${Zr},${El}\\)$`),g_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Gm(Gl,Cl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:x_,formatHex:x_,formatHex8:Q8,formatHsl:Z8,formatRgb:y_,toString:y_});function x_(){return this.rgb().formatHex()}function Q8(){return this.rgb().formatHex8()}function Z8(){return Cw(this).formatHsl()}function y_(){return this.rgb().formatRgb()}function Cl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=F8.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?b_(t):r===3?new Vn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?vu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?vu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=q8.exec(e))?new Vn(t[1],t[2],t[3],1):(t=G8.exec(e))?new Vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=V8.exec(e))?vu(t[1],t[2],t[3],t[4]):(t=Y8.exec(e))?vu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=K8.exec(e))?w_(t[1],t[2]/100,t[3]/100,1):(t=X8.exec(e))?w_(t[1],t[2]/100,t[3]/100,t[4]):g_.hasOwnProperty(e)?b_(g_[e]):e==="transparent"?new Vn(NaN,NaN,NaN,0):null}function b_(e){return new Vn(e>>16&255,e>>8&255,e&255,1)}function vu(e,t,r,a){return a<=0&&(e=t=r=NaN),new Vn(e,t,r,a)}function J8(e){return e instanceof Gl||(e=Cl(e)),e?(e=e.rgb(),new Vn(e.r,e.g,e.b,e.opacity)):new Vn}function rm(e,t,r,a){return arguments.length===1?J8(e):new Vn(e,t,r,a??1)}function Vn(e,t,r,a){this.r=+e,this.g=+t,this.b=+r,this.opacity=+a}Gm(Vn,rm,Ew(Gl,{brighter(e){return e=e==null?td:Math.pow(td,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Nl:Math.pow(Nl,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vn(Is(this.r),Is(this.g),Is(this.b),nd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:v_,formatHex:v_,formatHex8:W8,formatRgb:__,toString:__}));function v_(){return`#${zs(this.r)}${zs(this.g)}${zs(this.b)}`}function W8(){return`#${zs(this.r)}${zs(this.g)}${zs(this.b)}${zs((isNaN(this.opacity)?1:this.opacity)*255)}`}function __(){const e=nd(this.opacity);return`${e===1?"rgb(":"rgba("}${Is(this.r)}, ${Is(this.g)}, ${Is(this.b)}${e===1?")":`, ${e})`}`}function nd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Is(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zs(e){return e=Is(e),(e<16?"0":"")+e.toString(16)}function w_(e,t,r,a){return a<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Tr(e,t,r,a)}function Cw(e){if(e instanceof Tr)return new Tr(e.h,e.s,e.l,e.opacity);if(e instanceof Gl||(e=Cl(e)),!e)return new Tr;if(e instanceof Tr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,a=e.b/255,o=Math.min(t,r,a),l=Math.max(t,r,a),u=NaN,f=l-o,h=(l+o)/2;return f?(t===l?u=(r-a)/f+(r<a)*6:r===l?u=(a-t)/f+2:u=(t-r)/f+4,f/=h<.5?l+o:2-l-o,u*=60):f=h>0&&h<1?0:u,new Tr(u,f,h,e.opacity)}function ez(e,t,r,a){return arguments.length===1?Cw(e):new Tr(e,t,r,a??1)}function Tr(e,t,r,a){this.h=+e,this.s=+t,this.l=+r,this.opacity=+a}Gm(Tr,ez,Ew(Gl,{brighter(e){return e=e==null?td:Math.pow(td,e),new Tr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Nl:Math.pow(Nl,e),new Tr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,a=r+(r<.5?r:1-r)*t,o=2*r-a;return new Vn(fh(e>=240?e-240:e+120,o,a),fh(e,o,a),fh(e<120?e+240:e-120,o,a),this.opacity)},clamp(){return new Tr(S_(this.h),_u(this.s),_u(this.l),nd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=nd(this.opacity);return`${e===1?"hsl(":"hsla("}${S_(this.h)}, ${_u(this.s)*100}%, ${_u(this.l)*100}%${e===1?")":`, ${e})`}`}}));function S_(e){return e=(e||0)%360,e<0?e+360:e}function _u(e){return Math.max(0,Math.min(1,e||0))}function fh(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Aw=e=>()=>e;function tz(e,t){return function(r){return e+r*t}}function nz(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(a){return Math.pow(e+a*t,r)}}function rz(e){return(e=+e)==1?Rw:function(t,r){return r-t?nz(t,r,e):Aw(isNaN(t)?r:t)}}function Rw(e,t){var r=t-e;return r?tz(e,r):Aw(isNaN(e)?t:e)}const j_=(function e(t){var r=rz(t);function a(o,l){var u=r((o=rm(o)).r,(l=rm(l)).r),f=r(o.g,l.g),h=r(o.b,l.b),p=Rw(o.opacity,l.opacity);return function(m){return o.r=u(m),o.g=f(m),o.b=h(m),o.opacity=p(m),o+""}}return a.gamma=e,a})(1);function ss(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var am=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ph=new RegExp(am.source,"g");function az(e){return function(){return e}}function sz(e){return function(t){return e(t)+""}}function oz(e,t){var r=am.lastIndex=ph.lastIndex=0,a,o,l,u=-1,f=[],h=[];for(e=e+"",t=t+"";(a=am.exec(e))&&(o=ph.exec(t));)(l=o.index)>r&&(l=t.slice(r,l),f[u]?f[u]+=l:f[++u]=l),(a=a[0])===(o=o[0])?f[u]?f[u]+=o:f[++u]=o:(f[++u]=null,h.push({i:u,x:ss(a,o)})),r=ph.lastIndex;return r<t.length&&(l=t.slice(r),f[u]?f[u]+=l:f[++u]=l),f.length<2?h[0]?sz(h[0].x):az(t):(t=h.length,function(p){for(var m=0,x;m<t;++m)f[(x=h[m]).i]=x.x(p);return f.join("")})}var k_=180/Math.PI,sm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tw(e,t,r,a,o,l){var u,f,h;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(h=e*r+t*a)&&(r-=e*h,a-=t*h),(f=Math.sqrt(r*r+a*a))&&(r/=f,a/=f,h/=f),e*a<t*r&&(e=-e,t=-t,h=-h,u=-u),{translateX:o,translateY:l,rotate:Math.atan2(t,e)*k_,skewX:Math.atan(h)*k_,scaleX:u,scaleY:f}}var wu;function iz(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?sm:Tw(t.a,t.b,t.c,t.d,t.e,t.f)}function lz(e){return e==null||(wu||(wu=document.createElementNS("http://www.w3.org/2000/svg","g")),wu.setAttribute("transform",e),!(e=wu.transform.baseVal.consolidate()))?sm:(e=e.matrix,Tw(e.a,e.b,e.c,e.d,e.e,e.f))}function Lw(e,t,r,a){function o(p){return p.length?p.pop()+" ":""}function l(p,m,x,v,_,w){if(p!==x||m!==v){var S=_.push("translate(",null,t,null,r);w.push({i:S-4,x:ss(p,x)},{i:S-2,x:ss(m,v)})}else(x||v)&&_.push("translate("+x+t+v+r)}function u(p,m,x,v){p!==m?(p-m>180?m+=360:m-p>180&&(p+=360),v.push({i:x.push(o(x)+"rotate(",null,a)-2,x:ss(p,m)})):m&&x.push(o(x)+"rotate("+m+a)}function f(p,m,x,v){p!==m?v.push({i:x.push(o(x)+"skewX(",null,a)-2,x:ss(p,m)}):m&&x.push(o(x)+"skewX("+m+a)}function h(p,m,x,v,_,w){if(p!==x||m!==v){var S=_.push(o(_)+"scale(",null,",",null,")");w.push({i:S-4,x:ss(p,x)},{i:S-2,x:ss(m,v)})}else(x!==1||v!==1)&&_.push(o(_)+"scale("+x+","+v+")")}return function(p,m){var x=[],v=[];return p=e(p),m=e(m),l(p.translateX,p.translateY,m.translateX,m.translateY,x,v),u(p.rotate,m.rotate,x,v),f(p.skewX,m.skewX,x,v),h(p.scaleX,p.scaleY,m.scaleX,m.scaleY,x,v),p=m=null,function(_){for(var w=-1,S=v.length,k;++w<S;)x[(k=v[w]).i]=k.x(_);return x.join("")}}}var cz=Lw(iz,"px, ","px)","deg)"),uz=Lw(lz,", ",")",")"),dz=1e-12;function N_(e){return((e=Math.exp(e))+1/e)/2}function fz(e){return((e=Math.exp(e))-1/e)/2}function pz(e){return((e=Math.exp(2*e))-1)/(e+1)}const hz=(function e(t,r,a){function o(l,u){var f=l[0],h=l[1],p=l[2],m=u[0],x=u[1],v=u[2],_=m-f,w=x-h,S=_*_+w*w,k,N;if(S<dz)N=Math.log(v/p)/t,k=function(z){return[f+z*_,h+z*w,p*Math.exp(t*z*N)]};else{var A=Math.sqrt(S),E=(v*v-p*p+a*S)/(2*p*r*A),D=(v*v-p*p-a*S)/(2*v*r*A),L=Math.log(Math.sqrt(E*E+1)-E),$=Math.log(Math.sqrt(D*D+1)-D);N=($-L)/t,k=function(z){var R=z*N,B=N_(L),H=p/(r*A)*(B*pz(t*R+L)-fz(L));return[f+H*_,h+H*w,p*B/N_(t*R+L)]}}return k.duration=N*1e3*t/Math.SQRT2,k}return o.rho=function(l){var u=Math.max(.001,+l),f=u*u,h=f*f;return e(u,f,h)},o})(Math.SQRT2,2,4);var mz=yd("start","end","cancel","interrupt"),gz=[],Dw=0,E_=1,om=2,Tu=3,C_=4,im=5,Lu=6;function _d(e,t,r,a,o,l){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;xz(e,r,{name:t,index:a,group:o,on:mz,tween:gz,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:Dw})}function Vm(e,t){var r=Mr(e,t);if(r.state>Dw)throw new Error("too late; already scheduled");return r}function aa(e,t){var r=Mr(e,t);if(r.state>Tu)throw new Error("too late; already running");return r}function Mr(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function xz(e,t,r){var a=e.__transition,o;a[t]=r,r.timer=Hm(l,0,r.time);function l(p){r.state=E_,r.timer.restart(u,r.delay,r.time),r.delay<=p&&u(p-r.delay)}function u(p){var m,x,v,_;if(r.state!==E_)return h();for(m in a)if(_=a[m],_.name===r.name){if(_.state===Tu)return p_(u);_.state===C_?(_.state=Lu,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete a[m]):+m<t&&(_.state=Lu,_.timer.stop(),_.on.call("cancel",e,e.__data__,_.index,_.group),delete a[m])}if(p_(function(){r.state===Tu&&(r.state=C_,r.timer.restart(f,r.delay,r.time),f(p))}),r.state=om,r.on.call("start",e,e.__data__,r.index,r.group),r.state===om){for(r.state=Tu,o=new Array(v=r.tween.length),m=0,x=-1;m<v;++m)(_=r.tween[m].value.call(e,e.__data__,r.index,r.group))&&(o[++x]=_);o.length=x+1}}function f(p){for(var m=p<r.duration?r.ease.call(null,p/r.duration):(r.timer.restart(h),r.state=im,1),x=-1,v=o.length;++x<v;)o[x].call(e,m);r.state===im&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=Lu,r.timer.stop(),delete a[t];for(var p in a)return;delete e.__transition}}function Du(e,t){var r=e.__transition,a,o,l=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((a=r[u]).name!==t){l=!1;continue}o=a.state>om&&a.state<im,a.state=Lu,a.timer.stop(),a.on.call(o?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete r[u]}l&&delete e.__transition}}function yz(e){return this.each(function(){Du(this,e)})}function bz(e,t){var r,a;return function(){var o=aa(this,e),l=o.tween;if(l!==r){a=r=l;for(var u=0,f=a.length;u<f;++u)if(a[u].name===t){a=a.slice(),a.splice(u,1);break}}o.tween=a}}function vz(e,t,r){var a,o;if(typeof r!="function")throw new Error;return function(){var l=aa(this,e),u=l.tween;if(u!==a){o=(a=u).slice();for(var f={name:t,value:r},h=0,p=o.length;h<p;++h)if(o[h].name===t){o[h]=f;break}h===p&&o.push(f)}l.tween=o}}function _z(e,t){var r=this._id;if(e+="",arguments.length<2){for(var a=Mr(this.node(),r).tween,o=0,l=a.length,u;o<l;++o)if((u=a[o]).name===e)return u.value;return null}return this.each((t==null?bz:vz)(r,e,t))}function Ym(e,t,r){var a=e._id;return e.each(function(){var o=aa(this,a);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return Mr(o,a).value[t]}}function Ow(e,t){var r;return(typeof t=="number"?ss:t instanceof Cl?j_:(r=Cl(t))?(t=r,j_):oz)(e,t)}function wz(e){return function(){this.removeAttribute(e)}}function Sz(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jz(e,t,r){var a,o=r+"",l;return function(){var u=this.getAttribute(e);return u===o?null:u===a?l:l=t(a=u,r)}}function kz(e,t,r){var a,o=r+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===a?l:l=t(a=u,r)}}function Nz(e,t,r){var a,o,l;return function(){var u,f=r(this),h;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=f+"",u===h?null:u===a&&h===o?l:(o=h,l=t(a=u,f)))}}function Ez(e,t,r){var a,o,l;return function(){var u,f=r(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=f+"",u===h?null:u===a&&h===o?l:(o=h,l=t(a=u,f)))}}function Cz(e,t){var r=vd(e),a=r==="transform"?uz:Ow;return this.attrTween(e,typeof t=="function"?(r.local?Ez:Nz)(r,a,Ym(this,"attr."+e,t)):t==null?(r.local?Sz:wz)(r):(r.local?kz:jz)(r,a,t))}function Az(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Rz(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Tz(e,t){var r,a;function o(){var l=t.apply(this,arguments);return l!==a&&(r=(a=l)&&Rz(e,l)),r}return o._value=t,o}function Lz(e,t){var r,a;function o(){var l=t.apply(this,arguments);return l!==a&&(r=(a=l)&&Az(e,l)),r}return o._value=t,o}function Dz(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var a=vd(e);return this.tween(r,(a.local?Tz:Lz)(a,t))}function Oz(e,t){return function(){Vm(this,e).delay=+t.apply(this,arguments)}}function Mz(e,t){return t=+t,function(){Vm(this,e).delay=t}}function zz(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Oz:Mz)(t,e)):Mr(this.node(),t).delay}function $z(e,t){return function(){aa(this,e).duration=+t.apply(this,arguments)}}function Bz(e,t){return t=+t,function(){aa(this,e).duration=t}}function Iz(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$z:Bz)(t,e)):Mr(this.node(),t).duration}function Uz(e,t){if(typeof t!="function")throw new Error;return function(){aa(this,e).ease=t}}function Pz(e){var t=this._id;return arguments.length?this.each(Uz(t,e)):Mr(this.node(),t).ease}function Hz(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;aa(this,e).ease=r}}function Fz(e){if(typeof e!="function")throw new Error;return this.each(Hz(this._id,e))}function qz(e){typeof e!="function"&&(e=xw(e));for(var t=this._groups,r=t.length,a=new Array(r),o=0;o<r;++o)for(var l=t[o],u=l.length,f=a[o]=[],h,p=0;p<u;++p)(h=l[p])&&e.call(h,h.__data__,p,l)&&f.push(h);return new La(a,this._parents,this._name,this._id)}function Gz(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,a=t.length,o=r.length,l=Math.min(a,o),u=new Array(a),f=0;f<l;++f)for(var h=t[f],p=r[f],m=h.length,x=u[f]=new Array(m),v,_=0;_<m;++_)(v=h[_]||p[_])&&(x[_]=v);for(;f<a;++f)u[f]=t[f];return new La(u,this._parents,this._name,this._id)}function Vz(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function Yz(e,t,r){var a,o,l=Vz(t)?Vm:aa;return function(){var u=l(this,e),f=u.on;f!==a&&(o=(a=f).copy()).on(t,r),u.on=o}}function Kz(e,t){var r=this._id;return arguments.length<2?Mr(this.node(),r).on.on(e):this.each(Yz(r,e,t))}function Xz(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Qz(){return this.on("end.remove",Xz(this._id))}function Zz(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Fm(e));for(var a=this._groups,o=a.length,l=new Array(o),u=0;u<o;++u)for(var f=a[u],h=f.length,p=l[u]=new Array(h),m,x,v=0;v<h;++v)(m=f[v])&&(x=e.call(m,m.__data__,v,f))&&("__data__"in m&&(x.__data__=m.__data__),p[v]=x,_d(p[v],t,r,v,p,Mr(m,r)));return new La(l,this._parents,t,r)}function Jz(e){var t=this._name,r=this._id;typeof e!="function"&&(e=gw(e));for(var a=this._groups,o=a.length,l=[],u=[],f=0;f<o;++f)for(var h=a[f],p=h.length,m,x=0;x<p;++x)if(m=h[x]){for(var v=e.call(m,m.__data__,x,h),_,w=Mr(m,r),S=0,k=v.length;S<k;++S)(_=v[S])&&_d(_,t,r,S,v,w);l.push(v),u.push(m)}return new La(l,u,t,r)}var Wz=ql.prototype.constructor;function e$(){return new Wz(this._groups,this._parents)}function t$(e,t){var r,a,o;return function(){var l=qo(this,e),u=(this.style.removeProperty(e),qo(this,e));return l===u?null:l===r&&u===a?o:o=t(r=l,a=u)}}function Mw(e){return function(){this.style.removeProperty(e)}}function n$(e,t,r){var a,o=r+"",l;return function(){var u=qo(this,e);return u===o?null:u===a?l:l=t(a=u,r)}}function r$(e,t,r){var a,o,l;return function(){var u=qo(this,e),f=r(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),qo(this,e))),u===h?null:u===a&&h===o?l:(o=h,l=t(a=u,f))}}function a$(e,t){var r,a,o,l="style."+t,u="end."+l,f;return function(){var h=aa(this,e),p=h.on,m=h.value[l]==null?f||(f=Mw(t)):void 0;(p!==r||o!==m)&&(a=(r=p).copy()).on(u,o=m),h.on=a}}function s$(e,t,r){var a=(e+="")=="transform"?cz:Ow;return t==null?this.styleTween(e,t$(e,a)).on("end.style."+e,Mw(e)):typeof t=="function"?this.styleTween(e,r$(e,a,Ym(this,"style."+e,t))).each(a$(this._id,e)):this.styleTween(e,n$(e,a,t),r).on("end.style."+e,null)}function o$(e,t,r){return function(a){this.style.setProperty(e,t.call(this,a),r)}}function i$(e,t,r){var a,o;function l(){var u=t.apply(this,arguments);return u!==o&&(a=(o=u)&&o$(e,u,r)),a}return l._value=t,l}function l$(e,t,r){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(t==null)return this.tween(a,null);if(typeof t!="function")throw new Error;return this.tween(a,i$(e,t,r??""))}function c$(e){return function(){this.textContent=e}}function u$(e){return function(){var t=e(this);this.textContent=t??""}}function d$(e){return this.tween("text",typeof e=="function"?u$(Ym(this,"text",e)):c$(e==null?"":e+""))}function f$(e){return function(t){this.textContent=e.call(this,t)}}function p$(e){var t,r;function a(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&f$(o)),t}return a._value=e,a}function h$(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,p$(e))}function m$(){for(var e=this._name,t=this._id,r=zw(),a=this._groups,o=a.length,l=0;l<o;++l)for(var u=a[l],f=u.length,h,p=0;p<f;++p)if(h=u[p]){var m=Mr(h,t);_d(h,e,r,p,u,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new La(a,this._parents,e,r)}function g$(){var e,t,r=this,a=r._id,o=r.size();return new Promise(function(l,u){var f={value:u},h={value:function(){--o===0&&l()}};r.each(function(){var p=aa(this,a),m=p.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(h)),p.on=t}),o===0&&l()})}var x$=0;function La(e,t,r,a){this._groups=e,this._parents=t,this._name=r,this._id=a}function zw(){return++x$}var Na=ql.prototype;La.prototype={constructor:La,select:Zz,selectAll:Jz,selectChild:Na.selectChild,selectChildren:Na.selectChildren,filter:qz,merge:Gz,selection:e$,transition:m$,call:Na.call,nodes:Na.nodes,node:Na.node,size:Na.size,empty:Na.empty,each:Na.each,on:Kz,attr:Cz,attrTween:Dz,style:s$,styleTween:l$,text:d$,textTween:h$,remove:Qz,tween:_z,delay:zz,duration:Iz,ease:Pz,easeVarying:Fz,end:g$,[Symbol.iterator]:Na[Symbol.iterator]};function y$(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var b$={time:null,delay:0,duration:250,ease:y$};function v$(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function _$(e){var t,r;e instanceof La?(t=e._id,e=e._name):(t=zw(),(r=b$).time=Pm(),e=e==null?null:e+"");for(var a=this._groups,o=a.length,l=0;l<o;++l)for(var u=a[l],f=u.length,h,p=0;p<f;++p)(h=u[p])&&_d(h,e,t,p,u,r||v$(h,t));return new La(a,this._parents,e,t)}ql.prototype.interrupt=yz;ql.prototype.transition=_$;const Su=e=>()=>e;function w$(e,{sourceEvent:t,target:r,transform:a,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:o}})}function Ra(e,t,r){this.k=e,this.x=t,this.y=r}Ra.prototype={constructor:Ra,scale:function(e){return e===1?this:new Ra(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ra(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Km=new Ra(1,0,0);Ra.prototype;function hh(e){e.stopImmediatePropagation()}function el(e){e.preventDefault(),e.stopImmediatePropagation()}function S$(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function j$(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function A_(){return this.__zoom||Km}function k$(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function N$(){return navigator.maxTouchPoints||"ontouchstart"in this}function E$(e,t,r){var a=e.invertX(t[0][0])-r[0][0],o=e.invertX(t[1][0])-r[1][0],l=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function C$(){var e=S$,t=j$,r=E$,a=k$,o=N$,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=hz,p=yd("start","zoom","end"),m,x,v,_=500,w=150,S=0,k=10;function N(M){M.property("__zoom",A_).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",H).filter(o).on("touchstart.zoom",J).on("touchmove.zoom",oe).on("touchend.zoom touchcancel.zoom",ce).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(M,P,T,q){var ee=M.selection?M.selection():M;ee.property("__zoom",A_),M!==ee?L(M,P,T,q):ee.interrupt().each(function(){$(this,arguments).event(q).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},N.scaleBy=function(M,P,T,q){N.scaleTo(M,function(){var ee=this.__zoom.k,ae=typeof P=="function"?P.apply(this,arguments):P;return ee*ae},T,q)},N.scaleTo=function(M,P,T,q){N.transform(M,function(){var ee=t.apply(this,arguments),ae=this.__zoom,W=T==null?D(ee):typeof T=="function"?T.apply(this,arguments):T,O=ae.invert(W),V=typeof P=="function"?P.apply(this,arguments):P;return r(E(A(ae,V),W,O),ee,u)},T,q)},N.translateBy=function(M,P,T,q){N.transform(M,function(){return r(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),u)},null,q)},N.translateTo=function(M,P,T,q,ee){N.transform(M,function(){var ae=t.apply(this,arguments),W=this.__zoom,O=q==null?D(ae):typeof q=="function"?q.apply(this,arguments):q;return r(Km.translate(O[0],O[1]).scale(W.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof T=="function"?-T.apply(this,arguments):-T),ae,u)},q,ee)};function A(M,P){return P=Math.max(l[0],Math.min(l[1],P)),P===M.k?M:new Ra(P,M.x,M.y)}function E(M,P,T){var q=P[0]-T[0]*M.k,ee=P[1]-T[1]*M.k;return q===M.x&&ee===M.y?M:new Ra(M.k,q,ee)}function D(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function L(M,P,T,q){M.on("start.zoom",function(){$(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){$(this,arguments).event(q).end()}).tween("zoom",function(){var ee=this,ae=arguments,W=$(ee,ae).event(q),O=t.apply(ee,ae),V=T==null?D(O):typeof T=="function"?T.apply(ee,ae):T,re=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),se=ee.__zoom,ne=typeof P=="function"?P.apply(ee,ae):P,ge=h(se.invert(V).concat(re/se.k),ne.invert(V).concat(re/ne.k));return function(Ne){if(Ne===1)Ne=ne;else{var qe=ge(Ne),Fe=re/qe[2];Ne=new Ra(Fe,V[0]-qe[0]*Fe,V[1]-qe[1]*Fe)}W.zoom(null,Ne)}})}function $(M,P,T){return!T&&M.__zooming||new z(M,P)}function z(M,P){this.that=M,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(M,P),this.taps=0}z.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,P){return this.mouse&&M!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var P=wr(this.that).datum();p.call(M,this.that,new w$(M,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:p}),P)}};function R(M,...P){if(!e.apply(this,arguments))return;var T=$(this,P).event(M),q=this.__zoom,ee=Math.max(l[0],Math.min(l[1],q.k*Math.pow(2,a.apply(this,arguments)))),ae=Ts(M);if(T.wheel)(T.mouse[0][0]!==ae[0]||T.mouse[0][1]!==ae[1])&&(T.mouse[1]=q.invert(T.mouse[0]=ae)),clearTimeout(T.wheel);else{if(q.k===ee)return;T.mouse=[ae,q.invert(ae)],Du(this),T.start()}el(M),T.wheel=setTimeout(W,w),T.zoom("mouse",r(E(A(q,ee),T.mouse[0],T.mouse[1]),T.extent,u));function W(){T.wheel=null,T.end()}}function B(M,...P){if(v||!e.apply(this,arguments))return;var T=M.currentTarget,q=$(this,P,!0).event(M),ee=wr(M.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",re,!0),ae=Ts(M,T),W=M.clientX,O=M.clientY;P8(M.view),hh(M),q.mouse=[ae,this.__zoom.invert(ae)],Du(this),q.start();function V(se){if(el(se),!q.moved){var ne=se.clientX-W,ge=se.clientY-O;q.moved=ne*ne+ge*ge>S}q.event(se).zoom("mouse",r(E(q.that.__zoom,q.mouse[0]=Ts(se,T),q.mouse[1]),q.extent,u))}function re(se){ee.on("mousemove.zoom mouseup.zoom",null),H8(se.view,q.moved),el(se),q.event(se).end()}}function H(M,...P){if(e.apply(this,arguments)){var T=this.__zoom,q=Ts(M.changedTouches?M.changedTouches[0]:M,this),ee=T.invert(q),ae=T.k*(M.shiftKey?.5:2),W=r(E(A(T,ae),q,ee),t.apply(this,P),u);el(M),f>0?wr(this).transition().duration(f).call(L,W,q,M):wr(this).call(N.transform,W,q,M)}}function J(M,...P){if(e.apply(this,arguments)){var T=M.touches,q=T.length,ee=$(this,P,M.changedTouches.length===q).event(M),ae,W,O,V;for(hh(M),W=0;W<q;++W)O=T[W],V=Ts(O,this),V=[V,this.__zoom.invert(V),O.identifier],ee.touch0?!ee.touch1&&ee.touch0[2]!==V[2]&&(ee.touch1=V,ee.taps=0):(ee.touch0=V,ae=!0,ee.taps=1+!!m);m&&(m=clearTimeout(m)),ae&&(ee.taps<2&&(x=V[0],m=setTimeout(function(){m=null},_)),Du(this),ee.start())}}function oe(M,...P){if(this.__zooming){var T=$(this,P).event(M),q=M.changedTouches,ee=q.length,ae,W,O,V;for(el(M),ae=0;ae<ee;++ae)W=q[ae],O=Ts(W,this),T.touch0&&T.touch0[2]===W.identifier?T.touch0[0]=O:T.touch1&&T.touch1[2]===W.identifier&&(T.touch1[0]=O);if(W=T.that.__zoom,T.touch1){var re=T.touch0[0],se=T.touch0[1],ne=T.touch1[0],ge=T.touch1[1],Ne=(Ne=ne[0]-re[0])*Ne+(Ne=ne[1]-re[1])*Ne,qe=(qe=ge[0]-se[0])*qe+(qe=ge[1]-se[1])*qe;W=A(W,Math.sqrt(Ne/qe)),O=[(re[0]+ne[0])/2,(re[1]+ne[1])/2],V=[(se[0]+ge[0])/2,(se[1]+ge[1])/2]}else if(T.touch0)O=T.touch0[0],V=T.touch0[1];else return;T.zoom("touch",r(E(W,O,V),T.extent,u))}}function ce(M,...P){if(this.__zooming){var T=$(this,P).event(M),q=M.changedTouches,ee=q.length,ae,W;for(hh(M),v&&clearTimeout(v),v=setTimeout(function(){v=null},_),ae=0;ae<ee;++ae)W=q[ae],T.touch0&&T.touch0[2]===W.identifier?delete T.touch0:T.touch1&&T.touch1[2]===W.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(W=Ts(W,this),Math.hypot(x[0]-W[0],x[1]-W[1])<k)){var O=wr(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return N.wheelDelta=function(M){return arguments.length?(a=typeof M=="function"?M:Su(+M),N):a},N.filter=function(M){return arguments.length?(e=typeof M=="function"?M:Su(!!M),N):e},N.touchable=function(M){return arguments.length?(o=typeof M=="function"?M:Su(!!M),N):o},N.extent=function(M){return arguments.length?(t=typeof M=="function"?M:Su([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),N):t},N.scaleExtent=function(M){return arguments.length?(l[0]=+M[0],l[1]=+M[1],N):[l[0],l[1]]},N.translateExtent=function(M){return arguments.length?(u[0][0]=+M[0][0],u[1][0]=+M[1][0],u[0][1]=+M[0][1],u[1][1]=+M[1][1],N):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},N.constrain=function(M){return arguments.length?(r=M,N):r},N.duration=function(M){return arguments.length?(f=+M,N):f},N.interpolate=function(M){return arguments.length?(h=M,N):h},N.on=function(){var M=p.on.apply(p,arguments);return M===p?N:M},N.clickDistance=function(M){return arguments.length?(S=(M=+M)*M,N):Math.sqrt(S)},N.tapDistance=function(M){return arguments.length?(k=+M,N):k},N}const A$=new Set(["CONTAINS","IMPLEMENTS","CORRESPONDS"]),R$=new Set(["REFERENCES","MENTIONS"]);function T$(e){return A$.has(e)?"skeleton":R$.has(e)?"weak":"standard"}const L$=30,ju=800,tl=500;function D$({centerNode:e,neighbors:t}){const[r,a]=b.useState(t.length>L$?"table":"graph");return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-end gap-1 mb-3",children:[c.jsx("button",{onClick:()=>a("graph"),className:`p-1.5 rounded transition-colors ${r==="graph"?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,title:"力导向图",children:c.jsx(NC,{size:16})}),c.jsx("button",{onClick:()=>a("table"),className:`p-1.5 rounded transition-colors ${r==="table"?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,title:"表格模式",children:c.jsx(TC,{size:16})})]}),r==="graph"?c.jsx(O$,{centerNode:e,neighbors:t}):c.jsx(M$,{neighbors:t})]})}function O$({centerNode:e,neighbors:t}){const r=b.useRef(null),a=Tt(),{t:o}=ye(),l=b.useCallback(f=>a(sr.entity(f)),[a]),u=b.useCallback(f=>a(sr.relation(f)),[a]);return b.useEffect(()=>{const f=r.current;if(!f)return;const h=wr(f);h.selectAll("*").remove();const p=new Map;p.set(e.id,{id:e.id,name:e.name,type:e.type,kind:e.kind,isCenter:!0,x:ju/2,y:tl/2});for(const E of t)p.has(E.neighbor.id)||p.set(E.neighbor.id,{id:E.neighbor.id,name:E.neighbor.name,type:E.neighbor.type,kind:E.neighbor.kind,isCenter:!1});const m=Array.from(p.values()),x=t.map(E=>{const D={id:E.id,type:E.type,edgeClass:T$(E.type),source:E.direction==="outgoing"?e.id:E.neighbor.id,target:E.direction==="outgoing"?E.neighbor.id:e.id};return E.confidence!==void 0&&(D.confidence=E.confidence),D});h.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 6").attr("refX",28).attr("refY",3).attr("markerWidth",10).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M0,0L10,3L0,6").attr("fill","var(--c4a-border-subtle)");const _=h.append("g"),w=C$().scaleExtent([.3,3]).on("zoom",E=>{_.attr("transform",E.transform)});h.call(w).call(w.transform,Km);const S=_.selectAll("line.link").data(x).join("line").attr("class","link").attr("stroke",E=>E.edgeClass==="skeleton"?"var(--c4a-text-secondary)":"var(--c4a-border-subtle)").attr("stroke-width",E=>E.edgeClass==="skeleton"?2:1).attr("stroke-dasharray",E=>E.edgeClass==="weak"?"4 3":null).attr("opacity",E=>E.edgeClass==="weak"?.6:1).attr("marker-end","url(#arrow)").style("cursor","pointer").on("click",(E,D)=>u(D.id)).on("mouseenter",function(){wr(this).attr("stroke","var(--c4a-accent)").attr("stroke-width",function(){return Number(wr(this).attr("stroke-width"))+1})}).on("mouseleave",function(E,D){wr(this).attr("stroke",D.edgeClass==="skeleton"?"var(--c4a-text-secondary)":"var(--c4a-border-subtle)").attr("stroke-width",D.edgeClass==="skeleton"?2:1)});S.append("title").text(E=>{const D=Yo(E.confidence);return D?`${E.type} · ${o(D.labelKey)}`:E.type});const k=_.selectAll("text.link-label").data(x).join("text").attr("class","link-label").text(E=>E.type).attr("font-family","var(--font-mono)").attr("font-size",9).attr("fill","var(--c4a-text-muted)").attr("text-anchor","middle").attr("dy",-4),N=_.selectAll("g.node").data(m,E=>E.id).join("g").attr("class","node").style("cursor","pointer").on("click",(E,D)=>l(D.id));N.append("circle").attr("r",E=>E.isCenter?24:18).attr("fill",E=>E.isCenter?"var(--c4a-accent)":"var(--c4a-bg-elevated)").attr("stroke",E=>E.isCenter?"#fff":"var(--c4a-border-default)").attr("stroke-width",E=>E.isCenter?2:1),N.append("text").text(E=>E.name.length>12?E.name.slice(0,12)+"…":E.name).attr("font-family","var(--font-mono)").attr("font-size",10).attr("fill","var(--c4a-text-primary)").attr("text-anchor","middle").attr("dy",E=>E.isCenter?36:30),N.append("title").text(E=>{let D=`${E.name}
|
|
97
|
+
type: ${E.type}`;return E.kind&&(D+=`
|
|
98
|
+
kind: ${E.kind}`),D});const A=oM(m).force("link",GO(x).id(E=>E.id).distance(120)).force("charge",iM().strength(-300)).force("center",jO(ju/2,tl/2)).force("collide",FO(30)).on("tick",()=>{S.attr("x1",E=>E.source.x??0).attr("y1",E=>E.source.y??0).attr("x2",E=>E.target.x??0).attr("y2",E=>E.target.y??0),k.attr("x",E=>{const D=E.source.x??0,L=E.target.x??0;return(D+L)/2}).attr("y",E=>{const D=E.source.y??0,L=E.target.y??0;return(D+L)/2}),N.attr("transform",E=>`translate(${E.x??0},${E.y??0})`)});return N.each(function(E,D){const L=wr(this);let $=!1;L.on("mousedown.drag",z=>{z.stopPropagation(),$=!0;const R=m[D],B=f.getBoundingClientRect(),H=oe=>{if(!$)return;const ce=_.attr("transform");let M=0,P=0,T=1;if(ce){const ae=ce.match(/translate\(([-\d.e+]+)[, ]([-\d.e+]+)\)\s*scale\(([-\d.e+]+)\)/);ae&&(M=parseFloat(ae[1]),P=parseFloat(ae[2]),T=parseFloat(ae[3]))}const q=(oe.clientX-B.left)/B.width*ju,ee=(oe.clientY-B.top)/B.height*tl;R.fx=(q-M)/T,R.fy=(ee-P)/T,A.alpha(.3).restart()},J=()=>{$=!1,R.fx=null,R.fy=null,document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",J)};document.addEventListener("mousemove",H),document.addEventListener("mouseup",J)})}),()=>{A.stop()}},[e,t,l,u]),c.jsx("svg",{ref:r,width:"100%",height:tl,viewBox:`0 0 ${ju} ${tl}`,className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface"})}function M$({neighbors:e}){const t=Tt();return c.jsx("div",{className:"rounded border border-c4a-border-subtle overflow-auto",children:c.jsxs("table",{className:"w-full text-xs font-mono",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-c4a-border-subtle bg-c4a-bg-surface text-c4a-text-muted text-left",children:[c.jsx("th",{className:"px-3 py-2",children:"NAME"}),c.jsx("th",{className:"px-3 py-2",children:"TYPE"}),c.jsx("th",{className:"px-3 py-2",children:"KIND"}),c.jsx("th",{className:"px-3 py-2",children:"EDGE"}),c.jsx("th",{className:"px-3 py-2",children:"DIRECTION"})]})}),c.jsx("tbody",{children:e.map(r=>c.jsxs("tr",{className:"border-b border-c4a-border-subtle hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:()=>t(sr.entity(r.neighbor.id)),children:[c.jsx("td",{className:"px-3 py-2 text-c4a-accent",children:r.neighbor.name}),c.jsx("td",{className:"px-3 py-2 text-c4a-text-secondary",children:r.neighbor.type}),c.jsx("td",{className:"px-3 py-2 text-c4a-text-muted",children:r.neighbor.kind??"—"}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(Bt,{variant:"accent",children:r.type})}),c.jsx("td",{className:"px-3 py-2 text-c4a-text-muted",children:r.direction==="outgoing"?"→":"←"})]},r.id))})]})})}function z$({entityId:e,centerNode:t}){const{t:r}=ye(),[a,o]=b.useState([]),[l,u]=b.useState(!1);return b.useEffect(()=>{ze.get(`/entities/${e}/neighbors`).then(f=>{const h=[];for(const p of f.neighbors)for(const m of p.via)h.push({id:m.relation_id,type:m.type,direction:m.direction,neighbor:{id:p.id,name:p.name,type:p.type,...p.kind?{kind:p.kind}:{}},...m.weight!==void 0?{weight:m.weight}:{},...m.confidence!==void 0?{confidence:m.confidence}:{}});o(h),u(!0)}).catch(()=>u(!0))},[e]),l?a.length===0?c.jsx(wt,{title:r("common.empty.entity_neighbors.title"),description:r("common.empty.entity_neighbors.description")}):c.jsx(D$,{centerNode:t,neighbors:a}):c.jsx("p",{className:"text-sm text-c4a-text-muted",children:r("common.loading")})}const $$={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function B$({entityId:e}){const{t}=ye(),[r,a]=b.useState(null),[o,l]=b.useState(null),[u,f]=b.useState("overview");if(b.useEffect(()=>{e&&(l(null),a(null),f("overview"),ze.get(`/entities/${e}`).then(a).catch(S=>{S instanceof hn&&S.status===404?l("not_found"):l("load_failed")}))},[e]),o)return c.jsx(wt,{title:t(`common.error.${o}`),description:t(`common.error.${o}_description`)});if(!r)return c.jsx("div",{className:"flex items-center justify-center p-8",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})});const h=$$[r.type]??"🔹",p=r._links,m=p?.relations?.count,x=p?.contents?.count,v=p?.referrers?.count,{atoms:_,...w}=r.data;return c.jsxs("div",{className:"flex flex-1 flex-col",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xl",children:h}),c.jsx("h2",{className:"font-mono text-xl font-bold text-c4a-text-primary",children:r.name})]}),c.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[c.jsx(Bt,{children:r.type}),r.kind&&c.jsx(Bt,{variant:"muted",children:r.kind})]}),(r.perspective||r.scope)&&c.jsxs("div",{className:"mt-1 flex flex-wrap items-baseline gap-4 text-xs text-c4a-text-muted",children:[r.perspective&&c.jsxs("span",{children:[t("entity.detail.perspective"),":"," ",c.jsx("span",{className:"text-c4a-text-secondary",children:r.perspective})]}),r.scope&&c.jsxs("span",{children:[t("entity.detail.scope"),":"," ",c.jsx("span",{className:"text-c4a-text-secondary",children:r.scope})]})]}),c.jsxs(a4,{value:u,onChange:S=>f(S),children:[c.jsx("div",{className:"mt-3",children:c.jsxs(s4,{children:[c.jsx(Vr,{value:"overview",children:t("entity.detail.tab.overview")}),c.jsxs(Vr,{value:"relations",children:[t("entity.detail.tab.relations"),m!==void 0&&` (${m})`]}),c.jsxs(Vr,{value:"contents",children:[t("entity.detail.tab.contents"),x!==void 0&&` (${x})`]}),c.jsxs(Vr,{value:"referrers",children:[t("entity.detail.tab.referrers"),v!==void 0&&` (${v})`]}),c.jsx(Vr,{value:"neighbors",children:t("entity.detail.tab.neighbors")})]})}),c.jsxs("div",{className:"mt-4 flex-1",children:[c.jsx(Yr,{value:"overview",children:c.jsx(sO,{data:w,atoms:_})}),c.jsx(Yr,{value:"relations",children:c.jsx(vO,{entityId:r.id})}),c.jsx(Yr,{value:"contents",children:c.jsx(wO,{entityId:r.id})}),c.jsx(Yr,{value:"referrers",children:c.jsx(SO,{entityId:r.id})}),c.jsx(Yr,{value:"neighbors",children:c.jsx(z$,{entityId:r.id,centerNode:{id:r.id,name:r.name,type:r.type,...r.kind?{kind:r.kind}:{}}})})]})]})]})}const $w={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function I$(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return e}}function U$({relationId:e}){const{t}=ye(),r=Tt(),a=Ko(),[o,l]=b.useState(null),[u,f]=b.useState(null),[h,p]=b.useState([]),[m,x]=b.useState(!1);b.useEffect(()=>{e&&(f(null),l(null),p([]),x(!1),ze.get(`/relations/${e}`).then(S=>{l(S),ze.get(`/relations/${e}/contents`).then(k=>{p(k.contents??[]),x(!0)}).catch(()=>x(!0))}).catch(S=>{S instanceof hn&&S.status===404?f("not_found"):f("load_failed")}))},[e]);const v=S=>{const k=$w[S.type]??"🔹";a?.active?a.navigate("entity",S.id,S.name,k):r(sr.entity(S.id))};if(u)return c.jsx(wt,{title:t(`common.error.${u}`),description:t(`common.error.${u}_description`)});if(!o)return c.jsx("div",{className:"flex items-center justify-center p-8",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})});const _=Yo(o.confidence),w=o.metadata?._source==="field_sync"?t("relation.detail.source_field_sync"):t("relation.detail.source_explicit");return c.jsxs("div",{className:"flex flex-1 flex-col",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h2",{className:"font-mono text-xl font-bold text-c4a-text-primary",children:o.type}),_&&c.jsx(Bt,{variant:_.variant,tooltip:`${_.value.toFixed(2)} — ${t(_.tipKey)}`,children:t(_.labelKey)})]}),c.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-4",children:[c.jsx(R_,{label:t("relation.detail.from"),entity:o.from,onClick:()=>v(o.from)}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-c4a-text-muted text-lg",children:"→"}),c.jsx(Bt,{variant:"accent",children:o.type}),c.jsx("span",{className:"text-c4a-text-muted text-lg",children:"→"})]}),c.jsx(R_,{label:t("relation.detail.to"),entity:o.to,onClick:()=>v(o.to)})]}),!!o.data.description&&c.jsxs("div",{className:"mt-4",children:[c.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.description")}),c.jsx("p",{className:"text-sm text-c4a-text-secondary",children:String(o.data.description)})]}),Object.keys(o.data).filter(S=>S!=="description").length>0&&c.jsxs("div",{className:"mt-4",children:[c.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.data")}),c.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3",children:c.jsx(Hl,{data:Object.fromEntries(Object.entries(o.data).filter(([S])=>S!=="description")),defaultExpanded:2})})]}),m&&h.length>0&&c.jsxs("div",{className:"mt-4",children:[c.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.source_refs")}),c.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:h.map(S=>c.jsx(dw,{content:{hash_id:S.hash_id,...S.source_path?{source_path:S.source_path}:{},...S.span?{span:S.span}:{}}},S.hash_id))})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.meta")}),c.jsxs("div",{className:"flex flex-wrap gap-4 text-xs",children:[c.jsxs("span",{className:"text-c4a-text-muted",children:[t("relation.detail.source_label"),":",c.jsx("span",{className:"text-c4a-text-secondary ml-1",children:w})]}),o.metadata?.created_at&&c.jsxs("span",{className:"text-c4a-text-muted",children:[t("content.detail.created_at"),":",c.jsx("span",{className:"text-c4a-text-secondary ml-1",children:I$(String(o.metadata.created_at))})]})]})]})]})}function R_({label:e,entity:t,onClick:r}){const a=$w[t.type]??"🔹";return c.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3 cursor-pointer hover:border-c4a-accent transition-colors min-w-[160px]",onClick:r,children:[c.jsx("p",{className:"text-[10px] font-mono uppercase text-c4a-text-muted mb-1",children:e}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{children:a}),c.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:t.name})]}),c.jsxs("div",{className:"mt-1 flex items-center gap-1",children:[c.jsx(Bt,{children:t.type}),t.kind&&c.jsx(Bt,{variant:"muted",children:t.kind})]})]})}const P$=[1,2,3];function H$({functionName:e,sourceIds:t}){const{t:r}=ye(),[a,o]=b.useState("callers"),[l,u]=b.useState(1),{data:f,loading:h,error:p,warnings:m}=Mn(S=>S.callGraph),x=Mn(S=>S.fetchCallGraph),v=Mn(S=>S.resetQuery);b.useEffect(()=>{if(t?.length)return x({sourceIds:t,functionName:e,direction:a,maxDepth:l}),()=>v("callGraph")},[e,a,l,t?.join(",")]);const _=b.useCallback(S=>{o(S)},[]),w=f??[];return c.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h3",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:[r("query.call_graph.title"),": ",e.includes("#")?e.slice(e.indexOf("#")+1):e]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex gap-1",children:[c.jsx(mh,{label:r("query.call_graph.callers"),active:a==="callers",onClick:()=>_("callers")}),c.jsx(mh,{label:r("query.call_graph.callees"),active:a==="callees",onClick:()=>_("callees")})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:[r("query.call_graph.depth"),":"]}),P$.map(S=>c.jsx(mh,{label:String(S),active:l===S,onClick:()=>u(S)},S))]})]})]}),m.length>0&&c.jsx(xd,{warnings:m}),h?c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(ta,{labelKey:"query.symbol.loading"})}):p?c.jsx(wt,{title:r("query.call_graph.empty"),description:p}):w.length===0?c.jsx(wt,{title:r("query.call_graph.empty"),description:r("query.call_graph.empty_desc",{direction:r(`query.call_graph.${a}`)})}):c.jsx("div",{className:"overflow-y-auto c4a-scrollbar",children:w.map((S,k)=>c.jsx(F$,{entry:S,direction:a},`${S.caller}-${S.callee}-${k}`))})]})}function mh({label:e,active:t,onClick:r}){return c.jsx("button",{type:"button",className:`rounded px-2.5 py-1 font-mono text-[11px] uppercase tracking-tight cursor-pointer ${t?"bg-c4a-accent text-white":"bg-c4a-bg-surface text-c4a-text-muted hover:bg-c4a-bg-hover"}`,onClick:r,children:e})}function F$({entry:e,direction:t}){const r=t==="callers"?e.caller:e.callee,a=(e.depth-1)*16,o=r.indexOf("#"),l=o>=0?r.slice(o+1):r,u=o>=0?r.slice(0,o):null;return c.jsxs("div",{className:"flex items-center gap-2 px-3 h-8 border-b border-c4a-border-subtle last:border-b-0 hover:bg-c4a-bg-hover/50",style:{paddingLeft:a+12},children:[c.jsx("span",{className:"shrink-0 w-4 text-center font-mono text-xs text-c4a-text-muted",children:"ƒ"}),c.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:l}),u&&c.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted truncate",children:[u,e.line!=null?`:${e.line}`:""]}),e.isExternal&&c.jsx("span",{className:"font-mono text-[10px] uppercase text-c4a-text-muted bg-c4a-bg-active px-1 py-0.5 rounded-sm shrink-0",children:"ext"})]})}function q$({filePath:e,sourceIds:t}){const{t:r}=ye(),[a,o]=b.useState("forward"),{data:l,loading:u,error:f,warnings:h}=Mn(N=>N.imports),p=Mn(N=>N.fetchImports),m=Mn(N=>N.resetQuery),x=Aa(N=>N.openTab);b.useEffect(()=>{if(t?.length)return p({sourceIds:t,filePath:e,direction:a}),()=>m("imports")},[e,a,t?.join(",")]);const v=b.useCallback(N=>{o(N)},[]),_=b.useCallback(N=>{if(!N.hashId)return;const A=a==="forward"?N.to:N.from;x({id:`content:${N.hashId}`,type:"content",resourceId:N.hashId,label:A,meta:{sourcePath:A}})},[a,x]),w=l??[],{external:S,internal:k}=b.useMemo(()=>{const N=[],A=[];for(const E of w)E.isExternal?N.push(E):A.push(E);return{external:N,internal:A}},[w]);return c.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h3",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary truncate",children:[r("query.import_deps.title"),": ",e]}),c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsx(T_,{label:r("query.import_deps.forward"),active:a==="forward",onClick:()=>v("forward")}),c.jsx(T_,{label:r("query.import_deps.reverse"),active:a==="reverse",onClick:()=>v("reverse")})]})]}),h.length>0&&c.jsx(xd,{warnings:h}),u?c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(ta,{labelKey:"query.symbol.loading"})}):f?c.jsx(wt,{title:r("query.import_deps.empty"),description:f}):w.length===0?c.jsx(wt,{title:r("query.import_deps.empty"),description:r("query.import_deps.empty")}):c.jsxs("div",{className:"overflow-y-auto c4a-scrollbar",children:[S.length>0&&c.jsx(L_,{title:r("query.import_deps.external"),count:S.length,entries:S,isExternal:!0,direction:a}),k.length>0&&c.jsx(L_,{title:r("query.import_deps.internal"),count:k.length,entries:k,isExternal:!1,direction:a,onOpen:_})]})]})}function T_({label:e,active:t,onClick:r}){return c.jsx("button",{type:"button",className:`rounded px-2.5 py-1 font-mono text-[11px] uppercase tracking-tight cursor-pointer ${t?"bg-c4a-accent text-white":"bg-c4a-bg-surface text-c4a-text-muted hover:bg-c4a-bg-hover"}`,onClick:r,children:e})}function L_({title:e,count:t,entries:r,isExternal:a,direction:o,onOpen:l}){return c.jsxs("div",{className:"mb-4",children:[c.jsxs("div",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted mb-2",children:[e," (",t,")"]}),r.map((u,f)=>c.jsx(G$,{entry:u,isExternal:a,direction:o,onOpen:l},`${u.from}-${u.to}-${f}`))]})}function G$({entry:e,isExternal:t,direction:r,onOpen:a}){const o=t?Dr:vm,l=r==="forward"?e.to:e.from,u=e.symbols.join(", "),f=!t&&!!e.hashId&&!!a;return c.jsxs("div",{className:`flex items-center gap-2 px-3 h-8 border-b border-c4a-border-subtle last:border-b-0 hover:bg-c4a-bg-hover/50 ${f?"cursor-pointer":""}`,onClick:f?()=>a(e):void 0,children:[c.jsx(o,{size:13,className:"shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:`font-mono text-sm truncate ${f?"text-c4a-accent hover:underline":"text-c4a-text-primary"}`,children:l}),u&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-c4a-text-muted shrink-0",children:"→"}),c.jsx("span",{className:"font-mono text-xs text-c4a-text-secondary truncate",children:u})]})]})}function V$({className:e,sourceIds:t}){const{t:r}=ye(),[a,o]=b.useState("descendants"),{data:l,loading:u,error:f,warnings:h}=Mn(k=>k.inheritance),p=Mn(k=>k.fetchInheritance),m=Mn(k=>k.resetQuery),x=kt(k=>k.rootSources),v=b.useMemo(()=>x.filter(k=>k.source_type==="code"&&(k.index_status==="indexed"||k.index_status==="stale")).map(k=>k.id),[x]),_=v.length>0?v:t??[];b.useEffect(()=>{if(_.length)return p({sourceIds:_,className:e,direction:a}),()=>m("inheritance")},[e,a,_.join(",")]);const w=b.useCallback(k=>{o(k)},[]),S=l??[];return c.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h3",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary truncate",children:[r("query.inheritance.title"),": ",e.includes("#")?e.slice(e.indexOf("#")+1):e]}),c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsx(D_,{label:r("query.inheritance.descendants"),active:a==="descendants",onClick:()=>w("descendants")}),c.jsx(D_,{label:r("query.inheritance.ancestors"),active:a==="ancestors",onClick:()=>w("ancestors")})]})]}),h.length>0&&c.jsx(xd,{warnings:h}),u?c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(ta,{labelKey:"query.symbol.loading"})}):f?c.jsx(wt,{title:r("query.inheritance.empty"),description:f}):S.length===0?c.jsx(wt,{title:r("query.inheritance.empty"),description:r("query.inheritance.empty")}):c.jsxs("div",{className:"overflow-y-auto c4a-scrollbar",children:[S.map((k,N)=>c.jsx(Y$,{entry:k,direction:a},`${k.child}-${k.parent}-${N}`)),_.length>1&&c.jsx("div",{className:"mt-3 px-3 font-mono text-[11px] text-c4a-text-muted",children:r("query.inheritance.cross_source",{count:_.length})})]})]})}function D_({label:e,active:t,onClick:r}){return c.jsx("button",{type:"button",className:`rounded px-2.5 py-1 font-mono text-[11px] uppercase tracking-tight cursor-pointer ${t?"bg-c4a-accent text-white":"bg-c4a-bg-surface text-c4a-text-muted hover:bg-c4a-bg-hover"}`,onClick:r,children:e})}function Y$({entry:e,direction:t}){const r=t==="descendants"?e.child:e.parent;return c.jsxs("div",{className:"flex items-center gap-2 px-3 h-8 border-b border-c4a-border-subtle last:border-b-0 hover:bg-c4a-bg-hover/50",children:[c.jsx("span",{className:"shrink-0 w-4 text-center font-mono text-xs text-c4a-text-muted",children:"■"}),c.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:r}),c.jsx(Bt,{variant:"muted",children:e.kind}),c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted truncate",children:e.sourceId})]})}function K$({anchor:e,children:t}){const{t:r}=ye(),a=Aa(w=>w.tabs),o=Aa(w=>w.activeTabId),l=Aa(w=>w.mode),{reset:u,setAnchor:f,activateTab:h,closeTab:p,closeAll:m,toggleMode:x}=Aa.getState();b.useEffect(()=>(u(),f({id:`${e.type}:${e.resourceId}`,type:e.type,resourceId:e.resourceId,label:e.label,...e.icon!=null&&{icon:e.icon}}),()=>u()),[e.id]);const v=a.find(w=>w.id===o),_=a.length>1;return c.jsx(PT,{children:c.jsxs("div",{className:"flex flex-1 flex-col",children:[c.jsx("div",{className:"flex flex-1 flex-col",children:!v||v.isAnchor?t:c.jsx(X$,{tab:v})}),_&&c.jsxs("div",{className:"fixed bottom-0 left-0 right-0 z-40 flex h-6 items-center border-t border-c4a-border-subtle bg-c4a-bg-surface md:left-[220px]",children:[c.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:a.map(w=>{const S=w.id===o;return c.jsxs("div",{className:`flex min-w-0 shrink items-center gap-1 px-2 h-5 font-mono text-[10px] uppercase tracking-tight truncate cursor-pointer border-r border-c4a-border-subtle ${S?"bg-c4a-bg-base text-c4a-text-primary border-b border-b-c4a-accent":"bg-c4a-bg-surface text-c4a-text-muted hover:bg-c4a-bg-hover"}`,onClick:()=>h(w.id),children:[w.icon&&c.jsx("span",{className:"shrink-0 text-[10px]",children:w.icon}),c.jsx("span",{className:"truncate",children:w.label}),!w.isAnchor&&c.jsx("button",{type:"button",className:"ml-0.5 shrink-0 text-c4a-text-muted hover:text-c4a-text-primary",onClick:k=>{k.stopPropagation(),p(w.id)},children:c.jsx(Or,{className:"h-2 w-2"})})]},w.id)})}),c.jsxs("div",{className:"flex items-center gap-0.5 px-1 shrink-0",children:[c.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded-sm text-c4a-text-muted hover:text-c4a-text-primary hover:bg-c4a-bg-hover cursor-pointer",title:r(l==="append"?"explorer.mode.append_tooltip":"explorer.mode.replace_tooltip"),onClick:x,children:c.jsx("span",{className:"text-[10px]",children:l==="append"?"📑":"📌"})}),c.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded-sm text-c4a-text-muted hover:text-c4a-text-primary hover:bg-c4a-bg-hover cursor-pointer",title:r("explorer.close_all"),onClick:m,children:c.jsx(Or,{className:"h-2.5 w-2.5"})})]})]})]})})}function X$({tab:e}){switch(e.type){case"content":return c.jsx(uw,{hashId:e.resourceId,sourcePath:e.meta?.sourcePath??e.label,paragraphMeta:e.meta});case"entity":return c.jsx(B$,{entityId:e.resourceId});case"relation":return c.jsx(U$,{relationId:e.resourceId});case"call-graph":return c.jsx(H$,{functionName:e.resourceId,sourceIds:e.meta?.sourceIds});case"import-deps":return c.jsx(q$,{filePath:e.resourceId,sourceIds:e.meta?.sourceIds});case"inheritance":return c.jsx(V$,{className:e.resourceId,sourceIds:e.meta?.sourceIds});default:return null}}function O_(e){if(!e)return"";try{const t=new Date(e),r=new Date,a=t.getFullYear()===r.getFullYear(),o=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0"),u=String(t.getHours()).padStart(2,"0"),f=String(t.getMinutes()).padStart(2,"0");return a?`${o}-${l} ${u}:${f}`:`${t.getFullYear()}-${o}-${l} ${u}:${f}`}catch{return""}}function Q$({versions:e,currentHashId:t,onChange:r}){const[a,o]=b.useState(!1),l=b.useRef(null),u=b.useRef(null),f=b.useCallback(v=>{l.current&&!l.current.contains(v.target)&&o(!1)},[]);b.useEffect(()=>{if(a)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[a,f]);const h=b.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),e.length>1&&o(!0)},[e.length]),p=b.useCallback(()=>{u.current=setTimeout(()=>o(!1),150)},[]),m=e.find(v=>v.hash_id===t)??e[0],x=O_(m?.created_at);return c.jsxs("div",{ref:l,className:"relative",onMouseEnter:h,onMouseLeave:p,children:[c.jsxs("button",{type:"button",onClick:e.length>1?()=>o(v=>!v):void 0,className:`flex h-7 items-center gap-1.5 rounded-sm border border-c4a-border-default px-2 font-mono text-[10px] text-c4a-text-secondary transition-colors ${e.length>1?"cursor-pointer hover:border-c4a-border-strong hover:bg-c4a-bg-hover hover:text-c4a-text-primary":""}`,children:[c.jsxs("span",{children:[c.jsx("span",{className:"font-extrabold",children:m?.version_label}),x?` ${x}`:""]}),e.length>1&&c.jsx($t,{size:12,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${a?"rotate-90":""}`})]}),a&&c.jsx("div",{className:"absolute right-0 top-full z-10 mt-1 min-w-full rounded-sm border border-c4a-border-default bg-c4a-bg-elevated shadow-c4a-md max-h-40 overflow-y-auto c4a-scrollbar",children:e.map(v=>{const _=v.hash_id===t,w=O_(v.created_at);return c.jsx("div",{className:`flex cursor-pointer items-center px-2 py-1 font-mono text-[10px] transition-colors hover:bg-c4a-bg-hover ${_?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,onClick:()=>{r(v.hash_id),o(!1)},children:c.jsxs("span",{children:[c.jsx("span",{className:"font-extrabold",children:v.version_label}),w?` ${w}`:""]})},v.hash_id)})})]})}function M_(e){if(!e)return"";try{const t=new Date(e),r=new Date,a=t.getFullYear()===r.getFullYear(),o=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0"),u=String(t.getHours()).padStart(2,"0"),f=String(t.getMinutes()).padStart(2,"0");return a?`${o}-${l} ${u}:${f}`:`${t.getFullYear()}-${o}-${l} ${u}:${f}`}catch{return""}}function Z$({commits:e,currentHashId:t,onChange:r}){const[a,o]=b.useState(!1),l=b.useRef(null),u=b.useRef(null),f=b.useCallback(v=>{l.current&&!l.current.contains(v.target)&&o(!1)},[]);b.useEffect(()=>{if(a)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[a,f]);const h=b.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),e.length>1&&o(!0)},[e.length]),p=b.useCallback(()=>{u.current=setTimeout(()=>o(!1),150)},[]),m=e.find(v=>v.hash_id===t)??e[0];if(!m)return null;const x=M_(m.created_at);return c.jsxs("div",{ref:l,className:"relative",onMouseEnter:h,onMouseLeave:p,children:[c.jsxs("button",{type:"button",onClick:e.length>1?()=>o(v=>!v):void 0,className:`flex h-7 items-center gap-1.5 rounded-sm border border-c4a-border-default px-2 font-mono text-[10px] text-c4a-text-secondary transition-colors ${e.length>1?"cursor-pointer hover:border-c4a-border-strong hover:bg-c4a-bg-hover hover:text-c4a-text-primary":""}`,children:[c.jsxs("span",{children:[c.jsx("span",{className:"font-extrabold",children:m.branch})," · ",m.commit_hash.slice(0,7),x?` · ${x}`:""]}),e.length>1&&c.jsx($t,{size:12,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${a?"rotate-90":""}`})]}),a&&c.jsx("div",{className:"absolute right-0 top-full z-10 mt-1 min-w-full rounded-sm border border-c4a-border-default bg-c4a-bg-elevated shadow-c4a-md max-h-40 overflow-y-auto c4a-scrollbar",children:e.map(v=>{const _=v.hash_id===t,w=M_(v.created_at);return c.jsx("div",{className:`flex cursor-pointer items-center px-2 py-1 font-mono text-[10px] transition-colors hover:bg-c4a-bg-hover ${_?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,onClick:()=>{r(v.hash_id),o(!1)},children:c.jsxs("span",{children:[c.jsx("span",{className:"font-extrabold",children:v.branch})," · ",v.commit_hash.slice(0,7),w?` · ${w}`:""]})},v.hash_id)})})]})}const z_={none:"bg-c4a-bg-active text-c4a-text-secondary",indexing:"bg-c4a-accent/10 text-c4a-accent animate-pulse",indexed:"bg-c4a-success text-white",stale:"bg-c4a-warning/10 text-c4a-warning"};function J$({sourceId:e,status:t,loading:r,onDeleted:a,isDaemonOnline:o,indexModules:l,isCloudDoc:u}){const{t:f}=ye(),[h,p]=b.useState(!1),[m,x]=b.useState(null),v=kt($=>$.triggerIndex),_=kt($=>$.deleteIndex),w=b.useCallback(($,z)=>{console.error(`[IndexBadge] ${$}
|
|
99
|
+
`,z),x({title:$,detail:z})},[]),S=b.useCallback(async()=>{if(o)try{const z=(t==="indexed"||t==="stale")&&l?l.map(B=>({...B,force:!0})):l;(await v(e,z)).status==="skipped"&&Qr(f("index.code.skipped"))}catch($){const z=$ instanceof hn?`POST /sources/${e}/index
|
|
100
|
+
HTTP ${$.status} ${$.code}
|
|
101
|
+
${$.message}`:`POST /sources/${e}/index
|
|
102
|
+
${String($)}`;w(f("index.code.error"),z)}},[e,o,v,l,t,f,w]),k=b.useCallback(async()=>{if(window.confirm(f("index.code.delete_confirm"))){p(!0);try{await _(e,l),Qr(f("index.code.delete_success")),a()}catch($){const z=$ instanceof hn?`DELETE /sources/${e}/index
|
|
103
|
+
HTTP ${$.status} ${$.code}
|
|
104
|
+
${$.message}`:`DELETE /sources/${e}/index
|
|
105
|
+
${String($)}`;w(f("index.code.delete_failed"),z)}finally{p(!1)}}},[e,_,l,f,a,w]),N=b.useCallback(()=>{(t==="none"||t==="indexed"||t==="stale")&&S()},[t,S]),A=(()=>{switch(t){case"indexing":return f("index.code.indexing");case"indexed":return f("sources.status.indexed");case"stale":return f("sources.status.stale");default:return f("sources.status.none")}})(),E=(()=>{switch(t){case"none":return f("index.code.go_index");case"indexed":return f("index.code.reindex");case"stale":return f("index.code.reindex");default:return""}})(),D=t!=="indexing",L=!o;return r?null:c.jsxs(c.Fragment,{children:[t==="indexing"?c.jsx("span",{className:`rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${z_.indexing}`,children:A}):c.jsxs("span",{className:`group/idx relative inline-block rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${z_[t]} ${D&&!L?"cursor-pointer hover:bg-c4a-accent hover:text-white":""} ${L?"opacity-40 cursor-not-allowed":""}`,onClick:D&&!L?N:void 0,title:L?f("daemon.offline_tooltip"):void 0,children:[c.jsx("span",{className:D&&!L?"group-hover/idx:hidden":"",children:A}),D&&!L&&c.jsx("span",{className:"hidden group-hover/idx:inline",children:E})]}),t==="indexed"&&!h&&!u&&c.jsx("span",{className:"cursor-pointer rounded-sm p-0.5 text-c4a-text-muted hover:bg-c4a-error/10 hover:text-c4a-error",onClick:k,title:f("index.code.delete"),children:c.jsx(ld,{size:12})}),h&&c.jsx("span",{className:"inline-flex items-center gap-1 font-mono text-[10px] text-c4a-text-muted",children:c.jsx(Zt,{size:10,className:"animate-spin"})}),m&&c.jsx(Bl,{error:m,onClose:()=>x(null)})]})}function W$(e,t){for(const r of t)if(e===r||e.startsWith(r+"/")||r.startsWith(e+"/"))return!0;return!1}function e9(){const{t:e}=ye(),{sourceUuid:t}=Vo(),[r]=Ol(),a=r.get("path")||"",o=Tt(),{currentRoot:l,loading:u,error:f,fetchRootSource:h}=kt(),p=Qt(ds(Fs)),[m,x]=b.useState(null),[v,_]=b.useState([]),[w,S]=b.useState(!0),[k,N]=b.useState(!1),[A,E]=b.useState(""),[D,L]=b.useState([]),$=l?.library_id,z=p.find(fe=>fe.id===$),R=z?.type==="cloud"?!0:z?.is_online??!1,B=kt(fe=>l?fe.indexingTasks.get(l.id):void 0),H=b.useMemo(()=>{if(B)return!B.modules||!a||W$(a,B.modules)?B:void 0},[B,a]),J=b.useMemo(()=>{if(l?.source_type==="code")return!0;if(!l?.tree)return!1;const fe=_e=>{for(const he of _e)if(he.kind==="source"&&he.source_type==="code"||he.children&&fe(he.children))return!0;return!1};return fe(l.tree)},[l]),[oe,ce]=b.useState(!1);b.useEffect(()=>{t&&h(t).catch(()=>{})},[t,h]),b.useEffect(()=>{N(!1),S(!0),ce(!1)},[t,a]),b.useEffect(()=>{if(!l?.id||H)return;let fe=!1;return ze.get(`/sources/${l.id}/index/status`).then(_e=>{fe||ce(!!_e.is_stale)}).catch(()=>{}),()=>{fe=!0}},[l?.id,H]);const M=b.useRef(null);b.useEffect(()=>{!l?.id||H||M.current!==l.id&&(M.current=l.id,ze.get(`/sources/${l.id}/index/status`).then(fe=>{if(fe.indexing){const _e=fe.progress?.stage??"scanning",he=fe.progress?.percent??0;kt.getState().updateIndexProgress({sourceId:l.id,stage:_e,progress:he,modules:fe.modules_scope??void 0})}}).catch(()=>{}))},[l?.id,H]);const P=b.useMemo(()=>l?a?zl(l.tree,a):l.kind==="source"?{path:"",kind:l.kind,source_type:l.source_type,name:l.name,metadata:l.metadata,index_status:l.index_status}:null:null,[l,a]),T=z,q=l?.id,ee=l?.kind==="source"&&!a,ae=b.useCallback(async fe=>{if(!q||!P){S(!1),N(!0);return}if(!fe&&P.index_status!=="indexed"&&P.index_status!=="stale"){x(null),_([]),S(!1),N(!0);return}const _e=ee?"":a||P.path;if(_e===void 0){S(!1),N(!0);return}S(!0),x(null),_([]);try{const he=await ze.get(`/sources/${q}/files`,{path:_e});x(he.hash_id),E(he.hash_id);try{const ve=await ze.get(`/sources/${q}/files/versions`,{path:_e});_(ve.versions??[])}catch{_([{version:he.version,version_label:he.version_label,hash_id:he.hash_id,created_at:he.created_at??null}])}}catch(he){he instanceof hn&&he.status===404&&(x(null),_([]))}finally{S(!1),N(!0)}},[q,P,a,ee]);b.useEffect(()=>{ae()},[ae]);const W=b.useRef(!1);b.useEffect(()=>{const fe=W.current,_e=!!H;W.current=_e,fe&&!_e&&(q?h(q).then(()=>ae(!0)).catch(()=>{}):ae(!0))},[H,ae,q,h]),b.useEffect(()=>{const fe=l?.metadata,_e=fe?.pinned_branch?String(fe.pinned_branch):"main";if(v.length>0&&P?.source_type==="code"){const he=v.map(ve=>({hash_id:ve.hash_id,branch:_e,commit_hash:ve.version_label,created_at:ve.created_at??null}));L(he)}else fe?.pinned_hash&&fe?.pinned_branch?L([{hash_id:A||m||"",branch:String(fe.pinned_branch),commit_hash:String(fe.pinned_hash),created_at:l?.updated_at??null}]):L([])},[l,v,P?.source_type,A,m]);const O=P?.metadata,V=P?.source_type==="code"||!P?.source_type&&J,re=P?.name??l?.name??"",se=P?.source_type??null,ne=b.useMemo(()=>{if(P){if(V){if(!a)return;const fe=a.includes("/")?a.split("/").slice(0,-1).join("/"):".";return fe==="."?void 0:[{path:fe}]}return a?[{path:a}]:[{path:"."}]}},[P,V,a]),ge=b.useMemo(()=>{if(!l||!T)return[];const fe=l.kind==="source"&&!a,_e=[{label:T.is_default?e("sources.library.default_cloud_name"):T.name,to:`/studio/sources/${T.id}`},{label:l.name,...fe?{}:{to:`/studio/sources/${T.id}?rootId=${l.id}`}}];if(a){const he=al(l.tree,a);for(let ve=0;ve<he.length-1;ve++){const Ve=he[ve];_e.push({label:Ve.name,to:`/studio/sources/${T.id}?rootId=${l.id}&path=${encodeURIComponent(Ve.path)}`})}he.length>0&&_e.push({label:he[he.length-1].name})}return _e},[l,T,a,e]);if(!u&&f)return c.jsx("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:c.jsx(wt,{fullPage:!0,title:e("sources.detail.not_found_title"),description:e("sources.detail.not_found_desc"),action:c.jsx("button",{className:"rounded bg-c4a-accent px-4 py-2 text-sm font-medium text-white hover:bg-c4a-accent/90",onClick:()=>o("/studio/sources"),children:e("common.back")})})});if(u||!l||!P)return c.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[c.jsx(Ta,{segments:[]}),c.jsxs("div",{className:"mt-3 mb-3 flex items-center gap-2",children:[c.jsx("div",{className:"h-5 w-5 shrink-0 animate-pulse rounded bg-c4a-bg-hover"}),c.jsx("div",{className:"h-6 w-56 animate-pulse rounded bg-c4a-bg-hover"})]}),c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(Zt,{size:24,className:"animate-spin text-c4a-text-muted"})})]});const Ne=m!==null&&!w,qe=ee?P?.name??"":a||P?.path||P?.name||"",Fe=H&&!H.terminalState?"indexing":H?.terminalState==="done"?"indexed":k?Ne?oe?"stale":"indexed":"none":P?.index_status==="indexed"?"indexed":P?.index_status==="stale"?"stale":"none",be=!!H;return c.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[c.jsxs("div",{className:"shrink-0 px-4 pt-4 md:px-6 md:pt-6",children:[c.jsx(Ta,{segments:ge}),c.jsxs("div",{className:"mt-3 mb-3 flex items-end gap-3",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[V?c.jsx(Dr,{size:20,className:"shrink-0 text-c4a-accent"}):c.jsx(On,{size:20,className:"shrink-0 text-c4a-accent"}),c.jsx("h1",{className:"mb-[0.125rem] min-w-0 break-all font-mono text-xl font-bold leading-none text-c4a-text-primary",children:re})]}),q&&c.jsx(J$,{sourceId:q,status:Fe,loading:!k&&w&&P?.index_status!=="indexed",onDeleted:()=>{x(null),E(""),_([]),q&&h(q).catch(()=>{})},isDaemonOnline:R,indexModules:ne,isCloudDoc:z?.type==="cloud"&&!V}),c.jsxs("span",{className:"group relative cursor-default",children:[c.jsx(Bt,{variant:"muted",children:e(se==="code"?"sources.type.code":"sources.type.doc")}),c.jsx("div",{className:"pointer-events-none absolute left-0 top-full z-10 mt-1.5 hidden w-max rounded border border-c4a-border-default bg-c4a-bg-elevated px-3 py-2 shadow-c4a-md group-hover:block",children:c.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-[10px]",children:[c.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.origin")}),c.jsxs("dd",{className:"text-c4a-text-secondary",children:[T?.is_default?e("sources.library.default_cloud_name"):T?.name," / ",l?.name]}),!!O?.repo_name&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.repo")}),c.jsx("dd",{className:"text-c4a-text-secondary",children:O.repo_url?c.jsx("a",{href:String(O.repo_url),target:"_blank",rel:"noopener noreferrer",className:"text-c4a-accent hover:underline",children:String(O.repo_name)}):String(O.repo_name)})]}),c.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.type")}),c.jsx("dd",{className:"text-c4a-text-secondary uppercase",children:re.includes(".")?re.slice(re.lastIndexOf(".")+1):se??"—"})]})})]}),c.jsx("div",{className:"flex-1"}),V&&D.length>0&&c.jsx("div",{className:"self-center",children:c.jsx(Z$,{commits:D,currentHashId:A,onChange:E})}),!V&&Ne&&v.length>0&&c.jsx("div",{className:"self-center",children:c.jsx(Q$,{versions:v,currentHashId:A,onChange:E})})]})]}),c.jsx("div",{className:"flex flex-1 flex-col overflow-y-auto c4a-scrollbar px-4 pb-8 md:px-6 md:pb-10",children:c.jsx(K$,{anchor:{id:`content:${A||"pending"}`,type:"content",resourceId:A||"pending",label:re,icon:V?"📦":"📄"},children:c.jsx(uw,{hashId:A||"",sourcePath:qe,sourceId:q,isCodeIndexing:be,isDaemonOnline:R,indexModules:ne,sourceType:se,indexStatus:Fe})})})]})}function t9({docSources:e,onConfirm:t,onCancel:r}){const{t:a}=ye(),[o,l]=b.useState(!0),[u,f]=b.useState(null),[h,p]=b.useState(null),m=b.useMemo(()=>{const x=new Map;for(const v of e)x.has(v.sourceId)||x.set(v.sourceId,[]),x.get(v.sourceId).push(v.modulePath);return[...x.entries()].map(([v,_])=>({sourceId:v,paths:_}))},[e]);return b.useEffect(()=>{let x=!1;async function v(){l(!0);try{const _=await Promise.all(m.map(({sourceId:S,paths:k})=>{const N=k.length>0?`?paths=${k.map(encodeURIComponent).join(",")}`:"";return ze.get(`/sources/${S}/index/estimate${N}`)}));if(x)return;const w=_.reduce((S,k)=>({tokens:S.tokens+k.estimated_tokens,calls:S.calls+k.estimated_calls,chunks:S.chunks+k.chunk_count}),{tokens:0,calls:0,chunks:0});f(w)}catch(_){if(x)return;const w=_ instanceof hn?`GET /sources/:id/index/estimate
|
|
106
|
+
HTTP ${_.status} ${_.code}
|
|
107
|
+
${_.message}`:`GET /sources/:id/index/estimate
|
|
108
|
+
${String(_)}`;console.error(`[DocIndexConfirmDialog] estimate failed
|
|
109
|
+
`,w),p({title:a("index.doc.confirm_title"),detail:w})}finally{x||l(!1)}}return v(),()=>{x=!0}},[m,a]),h?c.jsx(Bl,{error:h,onClose:()=>{p(null),r()}}):c.jsxs(lr,{onClose:r,className:"w-full max-w-lg rounded-xl bg-c4a-bg-surface p-6",children:[c.jsx("h2",{className:"font-mono text-sm uppercase tracking-tight text-c4a-text-primary mb-4",children:a("index.doc.confirm_title")}),o?c.jsx(ta,{labelKey:"index.doc.estimating"}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-sm text-c4a-text-secondary mb-4",children:a("index.doc.confirm_desc")}),c.jsx("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-base p-3 mb-4 max-h-32 overflow-y-auto c4a-scrollbar",children:e.map((x,v)=>c.jsxs("div",{className:"flex items-center gap-2 py-1",children:[c.jsx(On,{size:12,className:"shrink-0 text-c4a-text-muted"}),c.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:x.sourceName})]},`${x.sourceId}:${v}`))}),u&&c.jsxs("div",{className:"flex gap-3 mb-4",children:[c.jsx(ln,{icon:c.jsx(XE,{}),label:a("index.doc.estimate_tokens"),value:`~${u.tokens.toLocaleString()}`,size:"sm"}),c.jsx(ln,{icon:c.jsx(oA,{}),label:a("index.doc.estimate_calls"),value:`~${u.calls}`,size:"sm"}),c.jsx(ln,{icon:c.jsx(IC,{}),label:a("index.doc.estimate_chunks"),value:u.chunks,size:"sm"})]}),u&&c.jsx("p",{className:"text-xs text-c4a-text-muted font-mono mb-6",children:a("index.doc.estimate_summary",{tokens:u.tokens.toLocaleString(),calls:u.calls})}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx("button",{onClick:r,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:a("index.doc.cancel")}),c.jsx("button",{onClick:t,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:a("index.doc.confirm_btn")})]})]})]})}function Ou(e){return e.source_type==="code"?e.path.includes("/")?e.path.split("/").slice(0,-1).join("/"):".":e.path}function Bw(e){return e.index_status==="indexed"||e.index_status==="stale"}function n9(e,t){const r=[],a=o=>{for(const l of o){if(l.kind==="source"){const u=Ou(l);r.push({sourceId:t,modulePath:u,moduleName:l.name,moduleType:l.source_type==="code"?"package":"document",hasDigest:Bw(l),digestStale:l.index_status==="stale"})}l.children&&a(l.children)}};return a(e),r}function Iw(e,t){for(const r of e){if(r.path===t&&r.children)return r.children;if(r.children){const a=Iw(r.children,t);if(a.length>0)return a}}return[]}function Uw(e,t){for(const r of e){if(r.path===t)return r;if(r.children){const a=Uw(r.children,t);if(a)return a}}return null}function r9({node:e,sourceId:t,depth:r,selected:a,indeterminate:o,expanded:l,onToggleExpand:u,onToggleSelect:f,t:h}){const p=e.kind==="folder",m=e.source_type==="code",x=Bw(e),v=p?Gn:m?Dr:On,_="text-c4a-text-secondary";return c.jsxs("div",{className:"group/row flex h-8 cursor-pointer items-center gap-1.5 hover:bg-c4a-bg-hover",style:{paddingLeft:`${r*24+8}px`},children:[p?c.jsx("button",{onClick:()=>u(t,e.path),className:"flex h-4 w-4 shrink-0 items-center justify-center text-c4a-text-muted",children:c.jsx($t,{size:12,className:`transition-transform duration-200 ${l?"rotate-90":""}`})}):c.jsx("span",{className:"h-4 w-4 shrink-0"}),c.jsx("input",{type:"checkbox",checked:a,ref:w=>{w&&(w.indeterminate=o)},onChange:()=>f(t,e.path),className:"c4a-check"}),c.jsx(v,{size:14,className:`shrink-0 ${_}`}),c.jsx("span",{className:`truncate text-xs ${_}`,children:e.name}),!p&&x&&c.jsx("span",{className:"ml-1 shrink-0 rounded-sm bg-c4a-success px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",children:h("index.batch.already_indexed")})]})}function lm({nodes:e,depth:t,selectedPaths:r,expandedPaths:a,sourceId:o,onToggleExpand:l,onToggleSelect:u,getSelectionState:f,t:h}){const p=b.useMemo(()=>[...e].sort((m,x)=>m.kind!==x.kind?m.kind==="folder"?-1:1:m.name.localeCompare(x.name)),[e]);return c.jsx(c.Fragment,{children:p.map(m=>{const{selected:x,indeterminate:v}=f(o,m),_=a.has(`${o}:${m.path}`);return c.jsxs("div",{children:[c.jsx(r9,{node:m,sourceId:o,depth:t,selected:x,indeterminate:v,expanded:_,onToggleExpand:l,onToggleSelect:u,t:h}),m.kind==="folder"&&_&&m.children&&c.jsx(lm,{nodes:m.children,depth:t+1,selectedPaths:r,expandedPaths:a,sourceId:o,onToggleExpand:l,onToggleSelect:u,getSelectionState:f,t:h})]},m.path)})})}function a9({root:e,expanded:t,selected:r,indeterminate:a,onToggleExpand:o,onToggleSelect:l}){const u=e.kind==="folder",h=e.metadata?.origin==="remote",p=u?h?Ml:Gn:e.source_type==="code"?Dr:On,m="text-c4a-text-secondary";return c.jsxs("div",{className:"group/row flex h-8 cursor-pointer items-center gap-1.5 hover:bg-c4a-bg-hover",style:{paddingLeft:"8px"},children:[u?c.jsx("button",{onClick:o,className:"flex h-4 w-4 shrink-0 items-center justify-center text-c4a-text-muted",children:c.jsx($t,{size:12,className:`transition-transform duration-200 ${t?"rotate-90":""}`})}):c.jsx("span",{className:"h-4 w-4 shrink-0"}),c.jsx("input",{type:"checkbox",checked:r,ref:x=>{x&&(x.indeterminate=a)},onChange:l,className:"c4a-check"}),c.jsx(p,{size:14,className:`shrink-0 ${m}`}),c.jsx("span",{className:`truncate text-xs ${m}`,children:e.name})]})}function s9({selectedNodes:e,targetRoots:t,setSelectedPaths:r,t:a}){const l=b.useMemo(()=>new Set(e.map(h=>h.sourceId)),[e]).size>1,u=b.useMemo(()=>{const h=new Map;for(const p of t)h.set(p.id,p.name);return h},[t]),f=b.useMemo(()=>{const h=[],p=new Map;for(const m of e){if(!p.has(m.sourceId)){const x=[];p.set(m.sourceId,x),h.push({sourceId:m.sourceId,nodes:x})}p.get(m.sourceId).push(m)}return h},[e]);return c.jsx("div",{className:"flex flex-col gap-0.5",children:f.map(({sourceId:h,nodes:p})=>c.jsxs("div",{children:[l&&c.jsx("div",{className:"mt-1 mb-0.5 border-b border-c4a-border-subtle px-2 pb-1 font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:u.get(h)||h}),p.map(m=>c.jsxs("div",{className:"flex items-center gap-2 rounded-sm px-2 py-1 text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover",children:[m.moduleType==="package"?c.jsx(Dr,{size:12,className:"shrink-0"}):c.jsx(On,{size:12,className:"shrink-0"}),c.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[c.jsx("span",{className:"truncate",children:m.moduleName}),m.modulePath!=="."&&m.modulePath!==m.moduleName&&c.jsx("span",{className:"truncate font-mono text-[10px] text-c4a-text-muted",title:m.modulePath,children:m.modulePath})]}),m.hasDigest&&c.jsx("span",{className:"shrink-0 rounded bg-amber-500/10 px-1 font-mono text-[10px] text-amber-500",children:a("index.batch.reindex_tag")}),c.jsx("button",{onClick:()=>{r(x=>{const v=new Set(x);return v.delete(`${m.sourceId}:${m.modulePath}`),v})},className:"shrink-0 text-c4a-text-muted hover:text-c4a-accent",children:c.jsx(Or,{size:12})})]},`${m.sourceId}:${m.modulePath}`))]},h))})}function o9(){const{t:e}=ye(),t=Tt(),{libId:r}=Vo(),[a]=Ol(),o=a.get("rootId")||null,l=a.get("path")||"",f=Qt(ds(Fs)).find(be=>be.id===r),{rootSources:h,currentRoot:p,fetchRootSources:m,fetchRootSource:x,triggerIndex:v}=kt(),_=f?.type==="cloud"?!0:f?.is_online??!1,[w,S]=b.useState(new Set),[k,N]=b.useState(new Set),[A,E]=b.useState(!1),[D,L]=b.useState(null),[$,z]=b.useState(!1),[R,B]=b.useState([]),[H,J]=b.useState([]);b.useEffect(()=>{r&&m({library_id:r})},[r,m]),b.useEffect(()=>{o&&x(o).catch(()=>{})},[o,x]);const oe=b.useMemo(()=>{let be;return o&&p?be=[p]:be=h.filter(fe=>fe.kind!=="folder"||fe.tree&&fe.tree.length>0),l?be.map(fe=>{const _e=Iw(fe.tree,l);return{...fe,tree:_e}}).filter(fe=>fe.tree.length>0):be},[o,p,h,l]);b.useEffect(()=>{N(new Set)},[oe]);const ce=b.useMemo(()=>{const be=[];for(const fe of oe)if(fe.kind==="source"){const _e=fe.index_status==="indexed"||fe.index_status==="stale";be.push({sourceId:fe.id,modulePath:".",moduleName:fe.name,moduleType:fe.source_type==="code"?"package":"document",hasDigest:_e,digestStale:fe.index_status==="stale"})}else be.push(...n9(fe.tree,fe.id));return be},[oe]),M=b.useMemo(()=>ce.filter(be=>w.has(`${be.sourceId}:${be.modulePath}`)),[ce,w]),P=b.useCallback(be=>{const fe=[],_e=he=>{he.kind==="source"&&fe.push(Ou(he)),he.children&&he.children.forEach(_e)};return _e(be),fe},[]),T=b.useCallback((be,fe)=>{const _e=oe.find(he=>he.id===be);return _e?Uw(_e.tree,fe):null},[oe]),q=b.useCallback((be,fe)=>{const _e=`${be}:${fe}`;N(he=>{const ve=new Set(he);return ve.has(_e)?ve.delete(_e):ve.add(_e),ve})},[]),ee=b.useCallback((be,fe)=>{const _e=T(be,fe);_e&&S(he=>{const ve=new Set(he);if(_e.kind==="source"){const Ve=`${be}:${Ou(_e)}`;ve.has(Ve)?ve.delete(Ve):ve.add(Ve)}else{const Ve=P(_e).map(Xe=>`${be}:${Xe}`);Ve.every(Xe=>ve.has(Xe))?Ve.forEach(Xe=>ve.delete(Xe)):Ve.forEach(Xe=>ve.add(Xe))}return ve})},[T,P]),ae=b.useCallback((be,fe)=>{if(fe.kind==="source"){const ve=`${be}:${Ou(fe)}`;return{selected:w.has(ve),indeterminate:!1}}const _e=P(fe).map(ve=>`${be}:${ve}`);if(_e.length===0)return{selected:!1,indeterminate:!1};const he=_e.filter(ve=>w.has(ve)).length;return{selected:he===_e.length,indeterminate:he>0&&he<_e.length}},[w,P]),W=!o&&oe.length>0,O=b.useCallback(be=>{const _e=ce.filter(he=>he.sourceId===be).map(he=>`${he.sourceId}:${he.modulePath}`);_e.length!==0&&S(he=>{const ve=new Set(he);return _e.every(De=>ve.has(De))?_e.forEach(De=>ve.delete(De)):_e.forEach(De=>ve.add(De)),ve})},[ce]),V=b.useCallback(be=>{const fe=ce.filter(ve=>ve.sourceId===be);if(fe.length===0)return{selected:!1,indeterminate:!1};const _e=fe.map(ve=>`${ve.sourceId}:${ve.modulePath}`),he=_e.filter(ve=>w.has(ve)).length;return{selected:he===_e.length,indeterminate:he>0&&he<_e.length}},[ce,w]),re=b.useCallback(async be=>{const fe=new Map;for(const _e of be)fe.has(_e.sourceId)||fe.set(_e.sourceId,[]),fe.get(_e.sourceId).push({path:_e.modulePath,force:!!_e.hasDigest});return Promise.allSettled(Array.from(fe.entries()).map(async([_e,he])=>{const ve=await v(_e,he);return{sourceId:_e,...ve}}))},[v]),se=b.useCallback((be,fe)=>{let _e=!1;const he=[];for(const ve of be)if(ve.status==="fulfilled")(ve.value.status==="started"||ve.value.status==="completed")&&(_e=!0);else{const Ve=ve.reason instanceof Error?ve.reason.message:String(ve.reason);he.push(Ve)}if(he.length>0&&console.error("[BatchIndex] index errors:",he),E(!1),_e&&fe.length>0){he.length>0&&Qr(e("index.batch.toast_partial_fail"));const ve=[...fe].sort((De,Xe)=>{const It=De.modulePath==="."?0:De.modulePath.split("/").length,un=Xe.modulePath==="."?0:Xe.modulePath.split("/").length;return It-un})[0],Ve=ve.modulePath==="."?"":`?path=${encodeURIComponent(ve.modulePath)}`;t(`/studio/source/${ve.sourceId}${Ve}`,{replace:!0})}else he.length>0?L({title:e("index.batch.error"),detail:he.join(`
|
|
110
|
+
|
|
111
|
+
`)}):(Qr(e("index.batch.toast_skipped")),t(-1))},[t,e]),ne=b.useCallback(async()=>{if(M.length===0)return;const be=M.filter(he=>he.moduleType==="document"),fe=M.filter(he=>he.moduleType==="package");if(be.length>0){B(be),J(fe),z(!0);return}E(!0);const _e=await re(fe);se([..._e],fe)},[M,re,se]),ge=b.useCallback(async()=>{z(!1),E(!0);const be=[...H,...R],[fe,_e]=await Promise.all([H.length>0?re(H):Promise.resolve([]),re(R)]);se([...fe,..._e],be)},[R,H,re,se]),Ne=b.useCallback(()=>{z(!1),B([]),J([])},[]),qe=b.useMemo(()=>{if(!f)return[];const be=[{label:f.is_default?e("sources.library.default_cloud_name"):f.name,to:`/studio/sources/${f.id}`}];if(o&&p&&(be.push({label:p.name,to:`/studio/sources/${f.id}?rootId=${p.id}`}),l)){const fe=l.split("/");be.push({label:fe[fe.length-1]||l,to:`/studio/sources/${f.id}?rootId=${p.id}&path=${encodeURIComponent(l)}`})}return be.push({label:e("index.batch.title")}),be},[f,o,p,l,e]);if(!f)return c.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:c.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Fe=M.length>50;return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col bg-c4a-bg-default p-4 md:p-6",children:[c.jsx(Ta,{segments:qe}),c.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col gap-4 lg:flex-row",children:[c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border border-c4a-border-default rounded-lg lg:w-1/2",children:[c.jsx("div",{className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted px-3 py-2 border-b border-c4a-border-subtle",children:e("index.batch.panel_a_title")}),c.jsx("div",{className:"flex-1 overflow-y-auto c4a-scrollbar",children:oe.map(be=>{if(W){const fe=`${be.id}:__root__`,_e=k.has(fe),{selected:he,indeterminate:ve}=V(be.id);return c.jsxs("div",{children:[c.jsx(a9,{root:be,expanded:_e,selected:he,indeterminate:ve,onToggleExpand:()=>{N(Ve=>{const De=new Set(Ve);return De.has(fe)?De.delete(fe):De.add(fe),De})},onToggleSelect:()=>O(be.id)}),be.kind==="folder"&&_e&&c.jsx(lm,{nodes:be.tree,depth:1,selectedPaths:w,expandedPaths:k,sourceId:be.id,onToggleExpand:q,onToggleSelect:ee,getSelectionState:ae,t:e})]},be.id)}return c.jsx(lm,{nodes:be.tree,depth:0,selectedPaths:w,expandedPaths:k,sourceId:be.id,onToggleExpand:q,onToggleSelect:ee,getSelectionState:ae,t:e},be.id)})})]}),c.jsxs("div",{className:"flex min-h-0 flex-col border border-c4a-border-default rounded-lg lg:w-1/2",children:[c.jsx("div",{className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted px-3 py-2 border-b border-c4a-border-subtle",children:e("index.batch.panel_b_title")}),c.jsx("div",{className:"px-3 py-2",children:c.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:e("index.batch.selected_count",{n:M.length,total:ce.length}).split(/(\d+)/).map((be,fe)=>/^\d+$/.test(be)?c.jsx("span",{className:"text-c4a-accent font-extrabold",children:be},fe):c.jsx("span",{children:be},fe))})}),c.jsx("div",{className:"flex-1 overflow-y-auto c4a-scrollbar px-3",children:M.length===0?null:c.jsx(s9,{selectedNodes:M,targetRoots:oe,setSelectedPaths:S,t:e})})]})]}),c.jsxs("div",{className:"sticky bottom-0 mt-4 flex items-center justify-end gap-3 bg-c4a-bg-default px-4 py-3",children:[Fe&&c.jsx("span",{className:"mr-auto font-mono text-xs text-c4a-warning",children:e("index.batch.warning_over_50")}),c.jsx("button",{onClick:()=>t(-1),className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:e("index.batch.back")}),c.jsxs("button",{onClick:ne,disabled:M.length===0||A||!_,title:_?void 0:e("daemon.offline_tooltip"),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40 disabled:cursor-not-allowed",children:[e("index.batch.confirm")," (",M.length,")"]})]}),D&&c.jsx(Bl,{error:D,onClose:()=>{L(null),t(-1)}}),$&&c.jsx(t9,{docSources:R.map(be=>({sourceId:be.sourceId,sourceName:be.moduleName,modulePath:be.modulePath})),onConfirm:ge,onCancel:Ne})]})}const i9=b.lazy(()=>le(()=>import("./ContentDetail-B5s8bbFo.js"),[]).then(e=>({default:e.ContentDetail}))),l9=b.lazy(()=>le(()=>import("./EntityDetail-DyDH4GAw.js"),[]).then(e=>({default:e.EntityDetail}))),c9=b.lazy(()=>le(()=>import("./RelationDetail-CpoGdy25.js"),[]).then(e=>({default:e.RelationDetail}))),u9=SE([{element:c.jsx(JA,{}),errorElement:c.jsx(nv,{}),children:[{path:"/",element:c.jsx(iR,{})},{path:"/login",element:c.jsx(uR,{})},{path:"/auth/callback",element:c.jsx(fR,{})},{path:"/docs",element:c.jsx(pR,{})}]},{path:"/studio",element:c.jsx(oR,{}),errorElement:c.jsx(nv,{}),children:[{index:!0,element:c.jsx(ZN,{to:"/studio/sources",replace:!0})},{path:"sources",element:c.jsx(oT,{})},{path:"sources/add-client",element:c.jsx(IT,{})},{path:"sources/import/:libId",element:c.jsx(_T,{})},{path:"sources/import-dir/:libId",element:c.jsx(NT,{})},{path:"sources/import-remote/:libId",element:c.jsx(BT,{})},{path:"sources/:libId",element:c.jsx(sT,{})},{path:"sources/:libId/batch-index",element:c.jsx(o9,{})},{path:"source/:sourceUuid",element:c.jsx(e9,{})},{path:"contents/:hashId",element:c.jsx(b.Suspense,{fallback:null,children:c.jsx(i9,{})})},{path:"entities/:entityId",element:c.jsx(b.Suspense,{fallback:null,children:c.jsx(l9,{})})},{path:"relations/:relationId",element:c.jsx(b.Suspense,{fallback:null,children:c.jsx(c9,{})})},{path:"modeling",element:c.jsx(mR,{})},{path:"modeling/code/setup",element:c.jsx(kR,{})},{path:"modeling/code/compile",element:c.jsx(NR,{})},{path:"modeling/code/review",element:c.jsx(ER,{})},{path:"modeling/code/result",element:c.jsx(CR,{})},{path:"brain",element:c.jsx(gR,{})},{path:"discovery",element:c.jsx(xR,{})},{path:"sharing",element:c.jsx(yR,{})},{path:"collaboration",element:c.jsx(bR,{})},{path:"settings/api-keys",element:c.jsx(vR,{})}]},{path:"*",element:c.jsx(hR,{})}]);function d9(){return b.useEffect(()=>{Yn.getState().init(),xl.getState().init();const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return En.connect(t),()=>{En.disconnect()}},[]),c.jsx(KN,{router:u9})}ck.createRoot(document.getElementById("root")).render(c.jsx(b.StrictMode,{children:c.jsx(d9,{})}));export{uw as C,B$ as E,U$ as R,ye as a,Vo as b,$e as c,c as j,Tt as u};
|