@c4a/server-cli 0.4.12-beta.15 → 0.4.12-beta.16
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/package.json +1 -1
- package/serve.js +80 -16
- package/web/assets/ContentDetail-9FQR0nUv.js +1 -0
- package/web/assets/ContentDetail-CeycCxX9.js +1 -0
- package/web/assets/EntityDetail-C8JJSpvK.js +1 -0
- package/web/assets/EntityDetail-Cbkby_pm.js +1 -0
- package/web/assets/RelationDetail-BhPm2sEi.js +1 -0
- package/web/assets/RelationDetail-CRyUyze3.js +1 -0
- package/web/assets/index-COuF_21f.css +1 -0
- package/web/assets/index-Cg2XyLTU.js +193 -0
- package/web/assets/index-CxvmfJRj.js +193 -0
- package/web/index.html +2 -2
|
@@ -0,0 +1,193 @@
|
|
|
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 K4(e,t){for(var a=0;a<t.length;a++){const r=t[a];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function a(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=a(i);fetch(i.href,l)}})();function Kb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oh={exports:{}},ko={};var n0;function X4(){if(n0)return ko;n0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(r,i,l){var u=null;if(l!==void 0&&(u=""+l),i.key!==void 0&&(u=""+i.key),"key"in i){l={};for(var f in i)f!=="key"&&(l[f]=i[f])}else l=i;return i=l.ref,{$$typeof:e,type:r,key:u,ref:i!==void 0?i:null,props:l}}return ko.Fragment=t,ko.jsx=a,ko.jsxs=a,ko}var a0;function Q4(){return a0||(a0=1,oh.exports=X4()),oh.exports}var d=Q4();const ze=e=>typeof e=="string",Ro=()=>{let e,t;const a=new Promise((r,i)=>{e=r,t=i});return a.resolve=e,a.reject=t,a},r0=e=>e==null?"":""+e,Z4=(e,t,a)=>{e.forEach(r=>{t[r]&&(a[r]=t[r])})},J4=/###/g,s0=e=>e&&e.indexOf("###")>-1?e.replace(J4,"."):e,i0=e=>!e||ze(e),Ko=(e,t,a)=>{const r=ze(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(i0(e))return{};const l=s0(r[i]);!e[l]&&a&&(e[l]=new a),Object.prototype.hasOwnProperty.call(e,l)?e=e[l]:e={},++i}return i0(e)?{}:{obj:e,k:s0(r[i])}},o0=(e,t,a)=>{const{obj:r,k:i}=Ko(e,t,Object);if(r!==void 0||t.length===1){r[i]=a;return}let l=t[t.length-1],u=t.slice(0,t.length-1),f=Ko(e,u,Object);for(;f.obj===void 0&&u.length;)l=`${u[u.length-1]}.${l}`,u=u.slice(0,u.length-1),f=Ko(e,u,Object),f?.obj&&typeof f.obj[`${f.k}.${l}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${l}`]=a},W4=(e,t,a,r)=>{const{obj:i,k:l}=Ko(e,t,Object);i[l]=i[l]||[],i[l].push(a)},hu=(e,t)=>{const{obj:a,k:r}=Ko(e,t);if(a&&Object.prototype.hasOwnProperty.call(a,r))return a[r]},eN=(e,t,a)=>{const r=hu(e,a);return r!==void 0?r:hu(t,a)},Xb=(e,t,a)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?ze(e[r])||e[r]instanceof String||ze(t[r])||t[r]instanceof String?a&&(e[r]=t[r]):Xb(e[r],t[r],a):e[r]=t[r]);return e},_s=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var tN={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const nN=e=>ze(e)?e.replace(/[&<>"'\/]/g,t=>tN[t]):e;class aN{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const a=this.regExpMap.get(t);if(a!==void 0)return a;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const rN=[" ",",","?","!",";"],sN=new aN(20),iN=(e,t,a)=>{t=t||"",a=a||"";const r=rN.filter(u=>t.indexOf(u)<0&&a.indexOf(u)<0);if(r.length===0)return!0;const i=sN.getRegExp(`(${r.map(u=>u==="?"?"\\?":u).join("|")})`);let l=!i.test(e);if(!l){const u=e.indexOf(a);u>0&&!i.test(e.substring(0,u))&&(l=!0)}return l},qh=(e,t,a=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(a);let i=e;for(let l=0;l<r.length;){if(!i||typeof i!="object")return;let u,f="";for(let m=l;m<r.length;++m)if(m!==l&&(f+=a),f+=r[m],u=i[f],u!==void 0){if(["string","number","boolean"].indexOf(typeof u)>-1&&m<r.length-1)continue;l+=m-l+1;break}i=u}return i},Wo=e=>e?.replace("_","-"),oN={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 mu{constructor(t,a={}){this.init(t,a)}init(t,a={}){this.prefix=a.prefix||"i18next:",this.logger=t||oN,this.options=a,this.debug=a.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,a,r,i){return i&&!this.debug?null:(ze(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[a](t))}create(t){return new mu(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new mu(this.logger,t)}}var qa=new mu;class Ou{constructor(){this.observers={}}on(t,a){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(a)||0;this.observers[r].set(a,i+1)}),this}off(t,a){if(this.observers[t]){if(!a){delete this.observers[t];return}this.observers[t].delete(a)}}emit(t,...a){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([i,l])=>{for(let u=0;u<l;u++)i(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,l])=>{for(let u=0;u<l;u++)i.apply(i,[t,...a])})}}class l0 extends Ou{constructor(t,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=a,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 a=this.options.ns.indexOf(t);a>-1&&this.options.ns.splice(a,1)}getResource(t,a,r,i={}){const l=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,u=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;t.indexOf(".")>-1?f=t.split("."):(f=[t,a],r&&(Array.isArray(r)?f.push(...r):ze(r)&&l?f.push(...r.split(l)):f.push(r)));const m=hu(this.data,f);return!m&&!a&&!r&&t.indexOf(".")>-1&&(t=f[0],a=f[1],r=f.slice(2).join(".")),m||!u||!ze(r)?m:qh(this.data?.[t]?.[a],r,l)}addResource(t,a,r,i,l={silent:!1}){const u=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let f=[t,a];r&&(f=f.concat(u?r.split(u):r)),t.indexOf(".")>-1&&(f=t.split("."),i=a,a=f[1]),this.addNamespaces(a),o0(this.data,f,i),l.silent||this.emit("added",t,a,r,i)}addResources(t,a,r,i={silent:!1}){for(const l in r)(ze(r[l])||Array.isArray(r[l]))&&this.addResource(t,a,l,r[l],{silent:!0});i.silent||this.emit("added",t,a,r)}addResourceBundle(t,a,r,i,l,u={silent:!1,skipCopy:!1}){let f=[t,a];t.indexOf(".")>-1&&(f=t.split("."),i=r,r=a,a=f[1]),this.addNamespaces(a);let m=hu(this.data,f)||{};u.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Xb(m,r,l):m={...m,...r},o0(this.data,f,m),u.silent||this.emit("added",t,a,r)}removeResourceBundle(t,a){this.hasResourceBundle(t,a)&&delete this.data[t][a],this.removeNamespaces(a),this.emit("removed",t,a)}hasResourceBundle(t,a){return this.getResource(t,a)!==void 0}getResourceBundle(t,a){return a||(a=this.options.defaultNS),this.getResource(t,a)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const a=this.getDataByLanguage(t);return!!(a&&Object.keys(a)||[]).find(i=>a[i]&&Object.keys(a[i]).length>0)}toJSON(){return this.data}}var Qb={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,a,r,i){return e.forEach(l=>{t=this.processors[l]?.process(t,a,r,i)??t}),t}};const Zb=Symbol("i18next/PATH_KEY");function lN(){const e=[],t=Object.create(null);let a;return t.get=(r,i)=>(a?.revoke?.(),i===Zb?e:(e.push(i),a=Proxy.revocable(r,t),a.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Fh(e,t){const{[Zb]:a}=e(lN());return a.join(t?.keySeparator??".")}const c0={},lh=e=>!ze(e)&&typeof e!="boolean"&&typeof e!="number";class pu extends Ou{constructor(t,a={}){super(),Z4(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=qa.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,a={interpolation:{}}){const r={...a};if(t==null)return!1;const i=this.resolve(t,r);if(i?.res===void 0)return!1;const l=lh(i.res);return!(r.returnObjects===!1&&l)}extractFromKey(t,a){let r=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let l=a.ns||this.options.defaultNS||[];const u=r&&t.indexOf(r)>-1,f=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!iN(t,r,i);if(u&&!f){const m=t.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:t,namespaces:ze(l)?[l]:l};const h=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(h[0])>-1)&&(l=h.shift()),t=h.join(i)}return{key:t,namespaces:ze(l)?[l]:l}}translate(t,a,r){let i=typeof a=="object"?{...a}:a;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";typeof t=="function"&&(t=Fh(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]);const l=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,u=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:f,namespaces:m}=this.extractFromKey(t[t.length-1],i),h=m[m.length-1];let g=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;g===void 0&&(g=":");const y=i.lng||this.language,v=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(y?.toLowerCase()==="cimode")return v?l?{res:`${h}${g}${f}`,usedKey:f,exactUsedKey:f,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(i)}:`${h}${g}${f}`:l?{res:f,usedKey:f,exactUsedKey:f,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(i)}:f;const b=this.resolve(t,i);let w=b?.res;const N=b?.usedKey||f,j=b?.exactUsedKey||f,E=["[object Number]","[object Function]","[object RegExp]"],R=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,O=i.count!==void 0&&!ze(i.count),I=pu.hasDefaultValue(i),B=O?this.pluralResolver.getSuffix(y,i.count,i):"",H=i.ordinal&&O?this.pluralResolver.getSuffix(y,i.count,{ordinal:!1}):"",T=O&&!i.ordinal&&i.count===0,P=T&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${B}`]||i[`defaultValue${H}`]||i.defaultValue;let X=w;k&&!w&&I&&(X=P);const de=lh(X),le=Object.prototype.toString.apply(X);if(k&&X&&de&&E.indexOf(le)<0&&!(ze(R)&&Array.isArray(X))){if(!i.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(N,X,{...i,ns:m}):`key '${f} (${this.language})' returned an object instead of string.`;return l?(b.res=ce,b.usedParams=this.getUsedParamsDetails(i),b):ce}if(u){const ce=Array.isArray(X),D=ce?[]:{},F=ce?j:N;for(const A in X)if(Object.prototype.hasOwnProperty.call(X,A)){const G=`${F}${u}${A}`;I&&!w?D[A]=this.translate(G,{...i,defaultValue:lh(P)?P[A]:void 0,joinArrays:!1,ns:m}):D[A]=this.translate(G,{...i,joinArrays:!1,ns:m}),D[A]===G&&(D[A]=X[A])}w=D}}else if(k&&ze(R)&&Array.isArray(w))w=w.join(R),w&&(w=this.extendTranslation(w,t,i,r));else{let ce=!1,D=!1;!this.isValidLookup(w)&&I&&(ce=!0,w=P),this.isValidLookup(w)||(D=!0,w=f);const A=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&D?void 0:w,G=I&&P!==w&&this.options.updateMissing;if(D||ce||G){if(this.logger.log(G?"updateKey":"missingKey",y,h,f,G?P:w),u){const L=this.resolve(f,{...i,keySeparator:!1});L&&L.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 ae=[];const ee=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ee&&ee[0])for(let L=0;L<ee.length;L++)ae.push(ee[L]);else this.options.saveMissingTo==="all"?ae=this.languageUtils.toResolveHierarchy(i.lng||this.language):ae.push(i.lng||this.language);const J=(L,q,re)=>{const ie=I&&re!==w?re:A;this.options.missingKeyHandler?this.options.missingKeyHandler(L,h,q,ie,G,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(L,h,q,ie,G,i),this.emit("missingKey",L,h,q,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?ae.forEach(L=>{const q=this.pluralResolver.getSuffixes(L,i);T&&i[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(re=>{J([L],f+re,i[`defaultValue${re}`]||P)})}):J(ae,f,P))}w=this.extendTranslation(w,t,i,b,r),D&&w===f&&this.options.appendNamespaceToMissingKey&&(w=`${h}${g}${f}`),(D||ce)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${g}${f}`:f,ce?w:void 0,i))}return l?(b.res=w,b.usedParams=this.getUsedParamsDetails(i),b):w}extendTranslation(t,a,r,i,l){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const m=ze(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(m){const y=t.match(this.interpolator.nestingRegexp);h=y&&y.length}let g=r.replace&&!ze(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),t=this.interpolator.interpolate(t,g,r.lng||this.language||i.usedLng,r),m){const y=t.match(this.interpolator.nestingRegexp),v=y&&y.length;h<v&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...y)=>l?.[0]===y[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${a[0]}`),null):this.translate(...y,a),r)),r.interpolation&&this.interpolator.reset()}const u=r.postProcess||this.options.postProcess,f=ze(u)?[u]:u;return t!=null&&f?.length&&r.applyPostProcessor!==!1&&(t=Qb.handle(f,t,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,a={}){let r,i,l,u,f;return ze(t)&&(t=[t]),t.forEach(m=>{if(this.isValidLookup(r))return;const h=this.extractFromKey(m,a),g=h.key;i=g;let y=h.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const v=a.count!==void 0&&!ze(a.count),b=v&&!a.ordinal&&a.count===0,w=a.context!==void 0&&(ze(a.context)||typeof a.context=="number")&&a.context!=="",N=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);y.forEach(j=>{this.isValidLookup(r)||(f=j,!c0[`${N[0]}-${j}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(f)&&(c0[`${N[0]}-${j}`]=!0,this.logger.warn(`key "${i}" for languages "${N.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!!!")),N.forEach(E=>{if(this.isValidLookup(r))return;u=E;const R=[g];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(R,g,E,j,a);else{let O;v&&(O=this.pluralResolver.getSuffix(E,a.count,a));const I=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(a.ordinal&&O.indexOf(B)===0&&R.push(g+O.replace(B,this.options.pluralSeparator)),R.push(g+O),b&&R.push(g+I)),w){const H=`${g}${this.options.contextSeparator||"_"}${a.context}`;R.push(H),v&&(a.ordinal&&O.indexOf(B)===0&&R.push(H+O.replace(B,this.options.pluralSeparator)),R.push(H+O),b&&R.push(H+I))}}let k;for(;k=R.pop();)this.isValidLookup(r)||(l=k,r=this.getResource(E,j,k,a))}))})}),{res:r,usedKey:i,exactUsedKey:l,usedLng:u,usedNS:f}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,a,r,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,a,r,i):this.resourceStore.getResource(t,a,r,i)}getUsedParamsDetails(t={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!ze(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const l of a)delete i[l]}return i}static hasDefaultValue(t){const a="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&a===r.substring(0,a.length)&&t[r]!==void 0)return!0;return!1}}class u0{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=qa.create("languageUtils")}getScriptPartFromCode(t){if(t=Wo(t),!t||t.indexOf("-")<0)return null;const a=t.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(t){if(t=Wo(t),!t||t.indexOf("-")<0)return t;const a=t.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(t){if(ze(t)&&t.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(t)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(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 a;return t.forEach(r=>{if(a)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(a=i)}),!a&&this.options.supportedLngs&&t.forEach(r=>{if(a)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return a=i;const l=this.getLanguagePartFromCode(r);if(this.isSupportedCode(l))return a=l;a=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})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(t,a){if(!t)return[];if(typeof t=="function"&&(t=t(a)),ze(t)&&(t=[t]),Array.isArray(t))return t;if(!a)return t.default||[];let r=t[a];return r||(r=t[this.getScriptPartFromCode(a)]),r||(r=t[this.formatLanguageCode(a)]),r||(r=t[this.getLanguagePartFromCode(a)]),r||(r=t.default),r||[]}toResolveHierarchy(t,a){const r=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],t),i=[],l=u=>{u&&(this.isSupportedCode(u)?i.push(u):this.logger.warn(`rejecting language code not found in supportedLngs: ${u}`))};return ze(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))):ze(t)&&l(this.formatLanguageCode(t)),r.forEach(u=>{i.indexOf(u)<0&&l(this.formatLanguageCode(u))}),i}}const d0={zero:0,one:1,two:2,few:3,many:4,other:5},f0={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class cN{constructor(t,a={}){this.languageUtils=t,this.options=a,this.logger=qa.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,a={}){const r=Wo(t==="dev"?"en":t),i=a.ordinal?"ordinal":"cardinal",l=JSON.stringify({cleanedCode:r,type:i});if(l in this.pluralRulesCache)return this.pluralRulesCache[l];let u;try{u=new Intl.PluralRules(r,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),f0;if(!t.match(/-|_/))return f0;const m=this.languageUtils.getLanguagePartFromCode(t);u=this.getRule(m,a)}return this.pluralRulesCache[l]=u,u}needsPlural(t,a={}){let r=this.getRule(t,a);return r||(r=this.getRule("dev",a)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,a,r={}){return this.getSuffixes(t,r).map(i=>`${a}${i}`)}getSuffixes(t,a={}){let r=this.getRule(t,a);return r||(r=this.getRule("dev",a)),r?r.resolvedOptions().pluralCategories.sort((i,l)=>d0[i]-d0[l]).map(i=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,a,r={}){const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(a)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",a,r))}}const h0=(e,t,a,r=".",i=!0)=>{let l=eN(e,t,a);return!l&&i&&ze(a)&&(l=qh(e,a,r),l===void 0&&(l=qh(t,a,r))),l},ch=e=>e.replace(/\$/g,"$$$$");class m0{constructor(t={}){this.logger=qa.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(a=>a),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:a,escapeValue:r,useRawValueToEscape:i,prefix:l,prefixEscaped:u,suffix:f,suffixEscaped:m,formatSeparator:h,unescapeSuffix:g,unescapePrefix:y,nestingPrefix:v,nestingPrefixEscaped:b,nestingSuffix:w,nestingSuffixEscaped:N,nestingOptionsSeparator:j,maxReplaces:E,alwaysFormat:R}=t.interpolation;this.escape=a!==void 0?a:nN,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=l?_s(l):u||"{{",this.suffix=f?_s(f):m||"}}",this.formatSeparator=h||",",this.unescapePrefix=g?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":g||"",this.nestingPrefix=v?_s(v):b||_s("$t("),this.nestingSuffix=w?_s(w):N||_s(")"),this.nestingOptionsSeparator=j||",",this.maxReplaces=E||1e3,this.alwaysFormat=R!==void 0?R:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(a,r)=>a?.source===r?(a.lastIndex=0,a):new RegExp(r,"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,a,r,i){let l,u,f;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=b=>{if(b.indexOf(this.formatSeparator)<0){const E=h0(a,m,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,r,{...i,...a,interpolationkey:b}):E}const w=b.split(this.formatSeparator),N=w.shift().trim(),j=w.join(this.formatSeparator).trim();return this.format(h0(a,m,N,this.options.keySeparator,this.options.ignoreJSONStructure),j,r,{...i,...a,interpolationkey:N})};this.resetRegExp();const g=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,y=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>ch(b)},{regex:this.regexp,safeValue:b=>this.escapeValue?ch(this.escape(b)):ch(b)}].forEach(b=>{for(f=0;l=b.regex.exec(t);){const w=l[1].trim();if(u=h(w),u===void 0)if(typeof g=="function"){const j=g(t,l,i);u=ze(j)?j:""}else if(i&&Object.prototype.hasOwnProperty.call(i,w))u="";else if(y){u=l[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${t}`),u="";else!ze(u)&&!this.useRawValueToEscape&&(u=r0(u));const N=b.safeValue(u);if(t=t.replace(l[0],N),y?(b.regex.lastIndex+=u.length,b.regex.lastIndex-=l[0].length):b.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),t}nest(t,a,r={}){let i,l,u;const f=(m,h)=>{const g=this.nestingOptionsSeparator;if(m.indexOf(g)<0)return m;const y=m.split(new RegExp(`${_s(g)}[ ]*{`));let v=`{${y[1]}`;m=y[0],v=this.interpolate(v,u);const b=v.match(/'/g),w=v.match(/"/g);((b?.length??0)%2===0&&!w||(w?.length??0)%2!==0)&&(v=v.replace(/'/g,'"'));try{u=JSON.parse(v),h&&(u={...h,...u})}catch(N){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,N),`${m}${g}${v}`}return u.defaultValue&&u.defaultValue.indexOf(this.prefix)>-1&&delete u.defaultValue,m};for(;i=this.nestingRegexp.exec(t);){let m=[];u={...r},u=u.replace&&!ze(u.replace)?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;const h=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(h!==-1&&(m=i[1].slice(h).split(this.formatSeparator).map(g=>g.trim()).filter(Boolean),i[1]=i[1].slice(0,h)),l=a(f.call(this,i[1].trim(),u),u),l&&i[0]===t&&!ze(l))return l;ze(l)||(l=r0(l)),l||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),l=""),m.length&&(l=m.reduce((g,y)=>this.format(g,y,r.lng,{...r,interpolationkey:i[1].trim()}),l.trim())),t=t.replace(i[0],l),this.regexp.lastIndex=0}return t}}const uN=e=>{let t=e.toLowerCase().trim();const a={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?a.currency||(a.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?a.range||(a.range=i.trim()):i.split(";").forEach(u=>{if(u){const[f,...m]=u.split(":"),h=m.join(":").trim().replace(/^'+|'+$/g,""),g=f.trim();a[g]||(a[g]=h),h==="false"&&(a[g]=!1),h==="true"&&(a[g]=!0),isNaN(h)||(a[g]=parseInt(h,10))}})}return{formatName:t,formatOptions:a}},p0=e=>{const t={};return(a,r,i)=>{let l=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(l={...l,[i.interpolationkey]:void 0});const u=r+JSON.stringify(l);let f=t[u];return f||(f=e(Wo(r),i),t[u]=f),f(a)}},dN=e=>(t,a,r)=>e(Wo(a),r)(t);class fN{constructor(t={}){this.logger=qa.create("formatter"),this.options=t,this.init(t)}init(t,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const r=a.cacheInBuiltFormats?p0:dN;this.formats={number:r((i,l)=>{const u=new Intl.NumberFormat(i,{...l});return f=>u.format(f)}),currency:r((i,l)=>{const u=new Intl.NumberFormat(i,{...l,style:"currency"});return f=>u.format(f)}),datetime:r((i,l)=>{const u=new Intl.DateTimeFormat(i,{...l});return f=>u.format(f)}),relativetime:r((i,l)=>{const u=new Intl.RelativeTimeFormat(i,{...l});return f=>u.format(f,l.range||"day")}),list:r((i,l)=>{const u=new Intl.ListFormat(i,{...l});return f=>u.format(f)})}}add(t,a){this.formats[t.toLowerCase().trim()]=a}addCached(t,a){this.formats[t.toLowerCase().trim()]=p0(a)}format(t,a,r,i={}){const l=a.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(m=>m.indexOf(")")>-1);l[0]=[l[0],...l.splice(1,f)].join(this.formatSeparator)}return l.reduce((f,m)=>{const{formatName:h,formatOptions:g}=uN(m);if(this.formats[h]){let y=f;try{const v=i?.formatParams?.[i.interpolationkey]||{},b=v.locale||v.lng||i.locale||i.lng||r;y=this.formats[h](f,b,{...g,...i,...v})}catch(v){this.logger.warn(v)}return y}else this.logger.warn(`there was no format function for ${h}`);return f},t)}}const hN=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class mN extends Ou{constructor(t,a,r,i={}){super(),this.backend=t,this.store=a,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=qa.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(t,a,r,i){const l={},u={},f={},m={};return t.forEach(h=>{let g=!0;a.forEach(y=>{const v=`${h}|${y}`;!r.reload&&this.store.hasResourceBundle(h,y)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?u[v]===void 0&&(u[v]=!0):(this.state[v]=1,g=!1,u[v]===void 0&&(u[v]=!0),l[v]===void 0&&(l[v]=!0),m[y]===void 0&&(m[y]=!0)))}),g||(f[h]=!0)}),(Object.keys(l).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(l),pending:Object.keys(u),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(m)}}loaded(t,a,r){const i=t.split("|"),l=i[0],u=i[1];a&&this.emit("failedLoading",l,u,a),!a&&r&&this.store.addResourceBundle(l,u,r,void 0,void 0,{skipCopy:!0}),this.state[t]=a?-1:2,a&&r&&(this.state[t]=0);const f={};this.queue.forEach(m=>{W4(m.loaded,[l],u),hN(m,t),a&&m.errors.push(a),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(h=>{f[h]||(f[h]={});const g=m.loaded[h];g.length&&g.forEach(y=>{f[h][y]===void 0&&(f[h][y]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(m=>!m.done)}read(t,a,r,i=0,l=this.retryTimeout,u){if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:a,fcName:r,tried:i,wait:l,callback:u});return}this.readingCalls++;const f=(h,g)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(h&&g&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,a,r,i+1,l*2,u)},l);return}u(h,g)},m=this.backend[r].bind(this.backend);if(m.length===2){try{const h=m(t,a);h&&typeof h.then=="function"?h.then(g=>f(null,g)).catch(f):f(null,h)}catch(h){f(h)}return}return m(t,a,f)}prepareLoading(t,a,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();ze(t)&&(t=this.languageUtils.toResolveHierarchy(t)),ze(a)&&(a=[a]);const l=this.queueLoad(t,a,r,i);if(!l.toLoad.length)return l.pending.length||i(),null;l.toLoad.forEach(u=>{this.loadOne(u)})}load(t,a,r){this.prepareLoading(t,a,{},r)}reload(t,a,r){this.prepareLoading(t,a,{reload:!0},r)}loadOne(t,a=""){const r=t.split("|"),i=r[0],l=r[1];this.read(i,l,"read",void 0,void 0,(u,f)=>{u&&this.logger.warn(`${a}loading namespace ${l} for language ${i} failed`,u),!u&&f&&this.logger.log(`${a}loaded namespace ${l} for language ${i}`,f),this.loaded(t,u,f)})}saveMissing(t,a,r,i,l,u={},f=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(a)){this.logger.warn(`did not save key "${r}" as the namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const m={...u,isUpdate:l},h=this.backend.create.bind(this.backend);if(h.length<6)try{let g;h.length===5?g=h(t,a,r,i,m):g=h(t,a,r,i),g&&typeof g.then=="function"?g.then(y=>f(null,y)).catch(f):f(null,g)}catch(g){f(g)}else h(t,a,r,i,f,m)}!t||!t[0]||this.store.addResource(t[0],a,r,i)}}}const uh=()=>({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]),ze(e[1])&&(t.defaultValue=e[1]),ze(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const a=e[3]||e[2];Object.keys(a).forEach(r=>{t[r]=a[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),g0=e=>(ze(e.ns)&&(e.ns=[e.ns]),ze(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ze(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),Uc=()=>{},pN=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(a=>{typeof e[a]=="function"&&(e[a]=e[a].bind(e))})},Jb="__i18next_supportNoticeShown",gN=()=>typeof globalThis<"u"&&!!globalThis[Jb],xN=()=>{typeof globalThis<"u"&&(globalThis[Jb]=!0)},yN=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 Xo extends Ou{constructor(t={},a){if(super(),this.options=g0(t),this.services={},this.logger=qa,this.modules={external:[]},pN(this),a&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,a),this;setTimeout(()=>{this.init(t,a)},0)}}init(t={},a){this.isInitializing=!0,typeof t=="function"&&(a=t,t={}),t.defaultNS==null&&t.ns&&(ze(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=uh();this.options={...r,...this.options,...g0(t)},this.options.interpolation={...r.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=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!yN(this)&&!gN()&&(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 💙"),xN());const i=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?qa.init(i(this.modules.logger),this.options):qa.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=fN;const g=new u0(this.options);this.store=new l0(this.options.resources,this.options);const y=this.services;y.logger=qa,y.resourceStore=this.store,y.languageUtils=g,y.pluralResolver=new cN(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),h&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(y.formatter=i(h),y.formatter.init&&y.formatter.init(y,this.options),this.options.interpolation.format=y.formatter.format.bind(y.formatter)),y.interpolator=new m0(this.options),y.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},y.backendConnector=new mN(i(this.modules.backend),y.resourceStore,y,this.options),y.backendConnector.on("*",(b,...w)=>{this.emit(b,...w)}),this.modules.languageDetector&&(y.languageDetector=i(this.modules.languageDetector),y.languageDetector.init&&y.languageDetector.init(y,this.options.detection,this.options)),this.modules.i18nFormat&&(y.i18nFormat=i(this.modules.i18nFormat),y.i18nFormat.init&&y.i18nFormat.init(this)),this.translator=new pu(this.services,this.options),this.translator.on("*",(b,...w)=>{this.emit(b,...w)}),this.modules.external.forEach(b=>{b.init&&b.init(this)})}if(this.format=this.options.interpolation.format,a||(a=Uc),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=(...g)=>this.store[h](...g)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...g)=>(this.store[h](...g),this)});const f=Ro(),m=()=>{const h=(g,y)=>{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(y),a(g,y)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),f}loadResources(t,a=Uc){let r=a;const i=ze(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const l=[],u=f=>{if(!f||f==="cimode")return;this.services.languageUtils.toResolveHierarchy(f).forEach(h=>{h!=="cimode"&&l.indexOf(h)<0&&l.push(h)})};i?u(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(m=>u(m)),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),r(f)})}else r(null)}reloadResources(t,a,r){const i=Ro();return typeof t=="function"&&(r=t,t=void 0),typeof a=="function"&&(r=a,a=void 0),t||(t=this.languages),a||(a=this.options.ns),r||(r=Uc),this.services.backendConnector.reload(t,a,l=>{i.resolve(),r(l)}),i}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"&&Qb.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 a=0;a<this.languages.length;a++){const r=this.languages[a];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,a){this.isLanguageChangingTo=t;const r=Ro();this.emit("languageChanging",t);const i=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},l=(f,m)=>{m?this.isLanguageChangingTo===t&&(i(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,r.resolve((...h)=>this.t(...h)),a&&a(f,(...h)=>this.t(...h))},u=f=>{!t&&!f&&this.services.languageDetector&&(f=[]);const m=ze(f)?f:f&&f[0],h=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(ze(f)?[f]:f);h&&(this.language||i(h),this.translator.language||this.translator.changeLanguage(h),this.services.languageDetector?.cacheUserLanguage?.(h)),this.loadResources(h,g=>{l(g,h)})};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),r}getFixedT(t,a,r){const i=(l,u,...f)=>{let m;typeof u!="object"?m=this.options.overloadTranslationOptionHandler([l,u].concat(f)):m={...u},m.lng=m.lng||i.lng,m.lngs=m.lngs||i.lngs,m.ns=m.ns||i.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||r||i.keyPrefix);const h=this.options.keySeparator||".";let g;return m.keyPrefix&&Array.isArray(l)?g=l.map(y=>(typeof y=="function"&&(y=Fh(y,{...this.options,...u})),`${m.keyPrefix}${h}${y}`)):(typeof l=="function"&&(l=Fh(l,{...this.options,...u})),g=m.keyPrefix?`${m.keyPrefix}${h}${l}`:l),this.t(g,m)};return ze(t)?i.lng=t:i.lngs=t,i.ns=a,i.keyPrefix=r,i}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=a.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const u=(f,m)=>{const h=this.services.backendConnector.state[`${f}|${m}`];return h===-1||h===0||h===2};if(a.precheck){const f=a.precheck(this,u);if(f!==void 0)return f}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(r,t)&&(!i||u(l,t)))}loadNamespaces(t,a){const r=Ro();return this.options.ns?(ze(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),a&&a(i)}),r):(a&&a(),Promise.resolve())}loadLanguages(t,a){const r=Ro();ze(t)&&(t=[t]);const i=this.options.preload||[],l=t.filter(u=>i.indexOf(u)<0&&this.services.languageUtils.isSupportedCode(u));return l.length?(this.options.preload=i.concat(l),this.loadResources(u=>{r.resolve(),a&&a(u)}),r):(a&&a(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const l=i.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new u0(uh());return t.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},a){const r=new Xo(t,a);return r.createInstance=Xo.createInstance,r}cloneInstance(t={},a=Uc){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},l=new Xo(i);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)},r){const f=Object.keys(this.store.data).reduce((m,h)=>(m[h]={...this.store.data[h]},m[h]=Object.keys(m[h]).reduce((g,y)=>(g[y]={...m[h][y]},g),m[h]),m),{});l.store=new l0(f,i),l.services.resourceStore=l.store}if(t.interpolation){const m={...uh().interpolation,...this.options.interpolation,...t.interpolation},h={...i,interpolation:m};l.services.interpolator=new m0(h)}return l.translator=new pu(l.services,i),l.translator.on("*",(f,...m)=>{l.emit(f,...m)}),l.init(i,a),l.translator.options=i,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 On=Xo.createInstance();On.createInstance;On.dir;On.init;On.loadResources;On.reloadResources;On.use;On.changeLanguage;On.getFixedT;On.t;On.exists;On.setDefaultNamespace;On.hasLoadedNamespace;On.loadNamespaces;On.loadLanguages;var dh={exports:{}},$e={};var x0;function vN(){if(x0)return $e;x0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function b(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,j={};function E(L,q,re){this.props=L,this.context=q,this.refs=j,this.updater=re||w}E.prototype.isReactComponent={},E.prototype.setState=function(L,q){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,q,"setState")},E.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function R(){}R.prototype=E.prototype;function k(L,q,re){this.props=L,this.context=q,this.refs=j,this.updater=re||w}var O=k.prototype=new R;O.constructor=k,N(O,E.prototype),O.isPureReactComponent=!0;var I=Array.isArray;function B(){}var H={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function P(L,q,re){var ie=re.ref;return{$$typeof:e,type:L,key:q,ref:ie!==void 0?ie:null,props:re}}function X(L,q){return P(L.type,q,L.props)}function de(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function le(L){var q={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(re){return q[re]})}var ce=/\/+/g;function D(L,q){return typeof L=="object"&&L!==null&&L.key!=null?le(""+L.key):q.toString(36)}function F(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(B,B):(L.status="pending",L.then(function(q){L.status==="pending"&&(L.status="fulfilled",L.value=q)},function(q){L.status==="pending"&&(L.status="rejected",L.reason=q)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function A(L,q,re,ie,ge){var xe=typeof L;(xe==="undefined"||xe==="boolean")&&(L=null);var Ee=!1;if(L===null)Ee=!0;else switch(xe){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(L.$$typeof){case e:case t:Ee=!0;break;case g:return Ee=L._init,A(Ee(L._payload),q,re,ie,ge)}}if(Ee)return ge=ge(L),Ee=ie===""?"."+D(L,0):ie,I(ge)?(re="",Ee!=null&&(re=Ee.replace(ce,"$&/")+"/"),A(ge,q,re,"",function(vn){return vn})):ge!=null&&(de(ge)&&(ge=X(ge,re+(ge.key==null||L&&L.key===ge.key?"":(""+ge.key).replace(ce,"$&/")+"/")+Ee)),q.push(ge)),1;Ee=0;var Me=ie===""?".":ie+":";if(I(L))for(var qe=0;qe<L.length;qe++)ie=L[qe],xe=Me+D(ie,qe),Ee+=A(ie,q,re,xe,ge);else if(qe=b(L),typeof qe=="function")for(L=qe.call(L),qe=0;!(ie=L.next()).done;)ie=ie.value,xe=Me+D(ie,qe++),Ee+=A(ie,q,re,xe,ge);else if(xe==="object"){if(typeof L.then=="function")return A(F(L),q,re,ie,ge);throw q=String(L),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function G(L,q,re){if(L==null)return L;var ie=[],ge=0;return A(L,ie,"","",function(xe){return q.call(re,xe,ge++)}),ie}function ae(L){if(L._status===-1){var q=L._result;q=q(),q.then(function(re){(L._status===0||L._status===-1)&&(L._status=1,L._result=re)},function(re){(L._status===0||L._status===-1)&&(L._status=2,L._result=re)}),L._status===-1&&(L._status=0,L._result=q)}if(L._status===1)return L._result.default;throw L._result}var ee=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},J={map:G,forEach:function(L,q,re){G(L,function(){q.apply(this,arguments)},re)},count:function(L){var q=0;return G(L,function(){q++}),q},toArray:function(L){return G(L,function(q){return q})||[]},only:function(L){if(!de(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return $e.Activity=y,$e.Children=J,$e.Component=E,$e.Fragment=a,$e.Profiler=i,$e.PureComponent=k,$e.StrictMode=r,$e.Suspense=m,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,$e.__COMPILER_RUNTIME={__proto__:null,c:function(L){return H.H.useMemoCache(L)}},$e.cache=function(L){return function(){return L.apply(null,arguments)}},$e.cacheSignal=function(){return null},$e.cloneElement=function(L,q,re){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ie=N({},L.props),ge=L.key;if(q!=null)for(xe in q.key!==void 0&&(ge=""+q.key),q)!T.call(q,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&q.ref===void 0||(ie[xe]=q[xe]);var xe=arguments.length-2;if(xe===1)ie.children=re;else if(1<xe){for(var Ee=Array(xe),Me=0;Me<xe;Me++)Ee[Me]=arguments[Me+2];ie.children=Ee}return P(L.type,ge,ie)},$e.createContext=function(L){return L={$$typeof:u,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:l,_context:L},L},$e.createElement=function(L,q,re){var ie,ge={},xe=null;if(q!=null)for(ie in q.key!==void 0&&(xe=""+q.key),q)T.call(q,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(ge[ie]=q[ie]);var Ee=arguments.length-2;if(Ee===1)ge.children=re;else if(1<Ee){for(var Me=Array(Ee),qe=0;qe<Ee;qe++)Me[qe]=arguments[qe+2];ge.children=Me}if(L&&L.defaultProps)for(ie in Ee=L.defaultProps,Ee)ge[ie]===void 0&&(ge[ie]=Ee[ie]);return P(L,xe,ge)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(L){return{$$typeof:f,render:L}},$e.isValidElement=de,$e.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:ae}},$e.memo=function(L,q){return{$$typeof:h,type:L,compare:q===void 0?null:q}},$e.startTransition=function(L){var q=H.T,re={};H.T=re;try{var ie=L(),ge=H.S;ge!==null&&ge(re,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(B,ee)}catch(xe){ee(xe)}finally{q!==null&&re.types!==null&&(q.types=re.types),H.T=q}},$e.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},$e.use=function(L){return H.H.use(L)},$e.useActionState=function(L,q,re){return H.H.useActionState(L,q,re)},$e.useCallback=function(L,q){return H.H.useCallback(L,q)},$e.useContext=function(L){return H.H.useContext(L)},$e.useDebugValue=function(){},$e.useDeferredValue=function(L,q){return H.H.useDeferredValue(L,q)},$e.useEffect=function(L,q){return H.H.useEffect(L,q)},$e.useEffectEvent=function(L){return H.H.useEffectEvent(L)},$e.useId=function(){return H.H.useId()},$e.useImperativeHandle=function(L,q,re){return H.H.useImperativeHandle(L,q,re)},$e.useInsertionEffect=function(L,q){return H.H.useInsertionEffect(L,q)},$e.useLayoutEffect=function(L,q){return H.H.useLayoutEffect(L,q)},$e.useMemo=function(L,q){return H.H.useMemo(L,q)},$e.useOptimistic=function(L,q){return H.H.useOptimistic(L,q)},$e.useReducer=function(L,q,re){return H.H.useReducer(L,q,re)},$e.useRef=function(L){return H.H.useRef(L)},$e.useState=function(L){return H.H.useState(L)},$e.useSyncExternalStore=function(L,q,re){return H.H.useSyncExternalStore(L,q,re)},$e.useTransition=function(){return H.H.useTransition()},$e.version="19.2.4",$e}var y0;function Du(){return y0||(y0=1,dh.exports=vN()),dh.exports}var _=Du();const wi=Kb(_),bN=K4({__proto__:null,default:wi},[_]),_N=(e,t,a,r)=>{const i=[a,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);Ts(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},v0={},Wb=(e,t,a,r)=>{Ts(a)&&v0[a]||(Ts(a)&&(v0[a]=new Date),_N(e,t,a,r))},e_=(e,t)=>()=>{if(e.isInitialized)t();else{const a=()=>{setTimeout(()=>{e.off("initialized",a)},0),t()};e.on("initialized",a)}},Yh=(e,t,a)=>{e.loadNamespaces(t,e_(e,a))},b0=(e,t,a,r)=>{if(Ts(a)&&(a=[a]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Yh(e,a,r);a.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,e_(e,r))},SN=(e,t,a={})=>!t.languages||!t.languages.length?(Wb(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:a.lng,precheck:(r,i)=>{if(a.bindI18n&&a.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Ts=e=>typeof e=="string",wN=e=>typeof e=="object"&&e!==null,NN=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,jN={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},EN=e=>jN[e],CN=e=>e.replace(NN,EN);let Kh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:CN,transDefaultProps:void 0};const kN=(e={})=>{Kh={...Kh,...e}},RN=()=>Kh;let t_;const TN=e=>{t_=e},AN=()=>t_,LN={type:"3rdParty",init(e){kN(e.options.react),TN(e)}},ON=_.createContext();class DN{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var fh={exports:{}},hh={};var _0;function MN(){if(_0)return hh;_0=1;var e=Du();function t(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var a=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(y,v){var b=v(),w=r({inst:{value:b,getSnapshot:v}}),N=w[0].inst,j=w[1];return l(function(){N.value=b,N.getSnapshot=v,m(N)&&j({inst:N})},[y,b,v]),i(function(){return m(N)&&j({inst:N}),y(function(){m(N)&&j({inst:N})})},[y]),u(b),b}function m(y){var v=y.getSnapshot;y=y.value;try{var b=v();return!a(y,b)}catch{return!0}}function h(y,v){return v()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return hh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,hh}var S0;function zN(){return S0||(S0=1,fh.exports=MN()),fh.exports}var UN=zN();const $N=(e,t)=>Ts(t)?t:wN(t)&&Ts(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,HN={t:$N,ready:!1},BN=()=>()=>{},ye=(e,t={})=>{const{i18n:a}=t,{i18n:r,defaultNS:i}=_.useContext(ON)||{},l=a||r||AN();l&&!l.reportNamespaces&&(l.reportNamespaces=new DN),l||Wb(l,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const u=_.useMemo(()=>({...RN(),...l?.options?.react,...t}),[l,t]),{useSuspense:f,keyPrefix:m}=u,h=i||l?.options?.defaultNS,g=Ts(h)?[h]:h||["translation"],y=_.useMemo(()=>g,g);l?.reportNamespaces?.addUsedNamespaces?.(y);const v=_.useRef(0),b=_.useCallback(P=>{if(!l)return BN;const{bindI18n:X,bindI18nStore:de}=u,le=()=>{v.current+=1,P()};return X&&l.on(X,le),de&&l.store.on(de,le),()=>{X&&X.split(" ").forEach(ce=>l.off(ce,le)),de&&de.split(" ").forEach(ce=>l.store.off(ce,le))}},[l,u]),w=_.useRef(),N=_.useCallback(()=>{if(!l)return HN;const P=!!(l.isInitialized||l.initializedStoreOnce)&&y.every(F=>SN(F,l,u)),X=t.lng||l.language,de=v.current,le=w.current;if(le&&le.ready===P&&le.lng===X&&le.keyPrefix===m&&le.revision===de)return le;const D={t:l.getFixedT(X,u.nsMode==="fallback"?y:y[0],m),ready:P,lng:X,keyPrefix:m,revision:de};return w.current=D,D},[l,y,m,u,t.lng]),[j,E]=_.useState(0),{t:R,ready:k}=UN.useSyncExternalStore(b,N,N);_.useEffect(()=>{if(l&&!k&&!f){const P=()=>E(X=>X+1);t.lng?b0(l,t.lng,y,P):Yh(l,y,P)}},[l,t.lng,y,k,f,j]);const O=l||{},I=_.useRef(null),B=_.useRef(),H=P=>{const X=Object.getOwnPropertyDescriptors(P);X.__original&&delete X.__original;const de=Object.create(Object.getPrototypeOf(P),X);if(!Object.prototype.hasOwnProperty.call(de,"__original"))try{Object.defineProperty(de,"__original",{value:P,writable:!1,enumerable:!1,configurable:!1})}catch{}return de},T=_.useMemo(()=>{const P=O,X=P?.language;let de=P;P&&(I.current&&I.current.__original===P?B.current!==X?(de=H(P),I.current=de,B.current=X):de=I.current:(de=H(P),I.current=de,B.current=X));const le=[R,de,k];return le.t=R,le.i18n=de,le.ready=k,le},[R,O,k,O.resolvedLanguage,O.language,O.languages]);if(l&&f&&!k)throw new Promise(P=>{const X=()=>P();t.lng?b0(l,t.lng,y,X):Yh(l,y,X)});return T},{slice:IN,forEach:PN}=[];function GN(e){return PN.call(IN.call(arguments,1),t=>{if(t)for(const a in t)e[a]===void 0&&(e[a]=t[a])}),e}function VN(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(a=>a.test(e))}const w0=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,qN=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let l=`${e}=${i}`;if(r.maxAge>0){const u=r.maxAge-0;if(Number.isNaN(u))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(u)}`}if(r.domain){if(!w0.test(r.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${r.domain}`}if(r.path){if(!w0.test(r.path))throw new TypeError("option path is invalid");l+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(l+="; HttpOnly"),r.secure&&(l+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.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 r.partitioned&&(l+="; Partitioned"),l},N0={create(e,t,a,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};a&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+a*60*1e3)),r&&(i.domain=r),document.cookie=qN(e,t,i)},read(e){const t=`${e}=`,a=document.cookie.split(";");for(let r=0;r<a.length;r++){let i=a[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var FN={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return N0.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:a,cookieMinutes:r,cookieDomain:i,cookieOptions:l}=t;a&&typeof document<"u"&&N0.create(a,e,r,i,l)}},YN={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,a;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const l=r.substring(1).split("&");for(let u=0;u<l.length;u++){const f=l[u].indexOf("=");f>0&&l[u].substring(0,f)===t&&(a=l[u].substring(f+1))}}return a}},KN={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:a}=e,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const l=i.substring(1);if(t){const u=l.split("&");for(let f=0;f<u.length;f++){const m=u[f].indexOf("=");m>0&&u[f].substring(0,m)===t&&(r=u[f].substring(m+1))}}if(r)return r;if(!r&&a>-1){const u=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(u)?u[typeof a=="number"?a:0]?.replace("/",""):void 0}}}return r}};let yi=null;const j0=()=>{if(yi!==null)return yi;try{if(yi=typeof window<"u"&&window.localStorage!==null,!yi)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{yi=!1}return yi};var XN={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&j0())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:a}=t;a&&j0()&&window.localStorage.setItem(a,e)}};let vi=null;const E0=()=>{if(vi!==null)return vi;try{if(vi=typeof window<"u"&&window.sessionStorage!==null,!vi)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{vi=!1}return vi};var QN={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&E0())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:a}=t;a&&E0()&&window.sessionStorage.setItem(a,e)}},ZN={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:a,userLanguage:r,language:i}=navigator;if(a)for(let l=0;l<a.length;l++)t.push(a[l]);r&&t.push(r),i&&t.push(i)}return t.length>0?t:void 0}},JN={name:"htmlTag",lookup(e){let{htmlTag:t}=e,a;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(a=r.getAttribute("lang")),a}},WN={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const a=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof t=="number"?t:0]?.replace("/",""):void 0}},e2={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const a=typeof t=="number"?t+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[a]}};let n_=!1;try{document.cookie,n_=!0}catch{}const a_=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];n_||a_.splice(1,1);const t2=()=>({order:a_,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class r_{constructor(t){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,a)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=GN(a,this.options||{},t2()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(FN),this.addDetector(YN),this.addDetector(XN),this.addDetector(QN),this.addDetector(ZN),this.addDetector(JN),this.addDetector(WN),this.addDetector(e2),this.addDetector(KN)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,a=[];return t.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(a=a.concat(i))}}),a=a.filter(r=>r!=null&&!VN(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?a:a.length>0?a[0]:null}cacheUserLanguage(t){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;a&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||a.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}r_.type="languageDetector";const n2={"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.status.go_index":"Index","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.scan":"Scanning project","sources.import.stage.save":"Saving sources","sources.import.stage.done_suffix":"done","sources.import.stage.complete":"Import complete","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.change_detection.has_updates":"Has updates","sources.change_detection.reimport":"Re-import","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.ai":"AI suggestion","confidence.low":"Low confidence","source.field_sync":"System-derived","source.explicit":"Explicitly declared","common.empty.content_raw.title":"Content unavailable","common.empty.content_raw.description":"This content was imported by a local Daemon; the raw text was not uploaded to the server.","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","cas.index_to_cas":"Index to CAS","cas.indexed":"Indexed","cas.reindex":"Reindex","cas.indexing":"Indexing...","cas.index_success":"Indexed {{count}} file(s) to CAS","cas.index_no_change":"Content unchanged","cas.unsupported_type":"Unsupported file type ({{ext}})","cas.index_failed":"Index failed","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"},a2={"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.status.go_index":"去索引","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.scan":"扫描项目","sources.import.stage.save":"保存数据源","sources.import.stage.done_suffix":"✓","sources.import.stage.complete":"导入完成","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.change_detection.has_updates":"有更新","sources.change_detection.reimport":"重新导入","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.ai":"AI 建议","confidence.low":"低确信","source.field_sync":"系统推导","source.explicit":"显式声明","common.empty.content_raw.title":"内容不可用","common.empty.content_raw.description":"此内容由本地 Daemon 导入,原始文本未上传到服务端。","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":"关闭所有标签","cas.index_to_cas":"索引到 CAS","cas.indexed":"已索引","cas.reindex":"重索引","cas.indexing":"索引中...","cas.index_success":"已索引 {{count}} 个文件到 CAS","cas.index_no_change":"内容无变化","cas.unsupported_type":"不支持的文件类型 ({{ext}})","cas.index_failed":"索引失败","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}} 行"};On.use(r_).use(LN).init({resources:{en:{translation:n2},zh:{translation:a2}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var mh={exports:{}},To={},ph={exports:{}},gh={};var C0;function r2(){return C0||(C0=1,(function(e){function t(A,G){var ae=A.length;A.push(G);e:for(;0<ae;){var ee=ae-1>>>1,J=A[ee];if(0<i(J,G))A[ee]=G,A[ae]=J,ae=ee;else break e}}function a(A){return A.length===0?null:A[0]}function r(A){if(A.length===0)return null;var G=A[0],ae=A.pop();if(ae!==G){A[0]=ae;e:for(var ee=0,J=A.length,L=J>>>1;ee<L;){var q=2*(ee+1)-1,re=A[q],ie=q+1,ge=A[ie];if(0>i(re,ae))ie<J&&0>i(ge,re)?(A[ee]=ge,A[ie]=ae,ee=ie):(A[ee]=re,A[q]=ae,ee=q);else if(ie<J&&0>i(ge,ae))A[ee]=ge,A[ie]=ae,ee=ie;else break e}}return G}function i(A,G){var ae=A.sortIndex-G.sortIndex;return ae!==0?ae:A.id-G.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 m=[],h=[],g=1,y=null,v=3,b=!1,w=!1,N=!1,j=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function O(A){for(var G=a(h);G!==null;){if(G.callback===null)r(h);else if(G.startTime<=A)r(h),G.sortIndex=G.expirationTime,t(m,G);else break;G=a(h)}}function I(A){if(N=!1,O(A),!w)if(a(m)!==null)w=!0,B||(B=!0,le());else{var G=a(h);G!==null&&F(I,G.startTime-A)}}var B=!1,H=-1,T=5,P=-1;function X(){return j?!0:!(e.unstable_now()-P<T)}function de(){if(j=!1,B){var A=e.unstable_now();P=A;var G=!0;try{e:{w=!1,N&&(N=!1,R(H),H=-1),b=!0;var ae=v;try{t:{for(O(A),y=a(m);y!==null&&!(y.expirationTime>A&&X());){var ee=y.callback;if(typeof ee=="function"){y.callback=null,v=y.priorityLevel;var J=ee(y.expirationTime<=A);if(A=e.unstable_now(),typeof J=="function"){y.callback=J,O(A),G=!0;break t}y===a(m)&&r(m),O(A)}else r(m);y=a(m)}if(y!==null)G=!0;else{var L=a(h);L!==null&&F(I,L.startTime-A),G=!1}}break e}finally{y=null,v=ae,b=!1}G=void 0}}finally{G?le():B=!1}}}var le;if(typeof k=="function")le=function(){k(de)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,D=ce.port2;ce.port1.onmessage=de,le=function(){D.postMessage(null)}}else le=function(){E(de,0)};function F(A,G){H=E(function(){A(e.unstable_now())},G)}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(A){A.callback=null},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(A){switch(v){case 1:case 2:case 3:var G=3;break;default:G=v}var ae=v;v=G;try{return A()}finally{v=ae}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(A,G){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var ae=v;v=A;try{return G()}finally{v=ae}},e.unstable_scheduleCallback=function(A,G,ae){var ee=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?ee+ae:ee):ae=ee,A){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=ae+J,A={id:g++,callback:G,priorityLevel:A,startTime:ae,expirationTime:J,sortIndex:-1},ae>ee?(A.sortIndex=ae,t(h,A),a(m)===null&&A===a(h)&&(N?(R(H),H=-1):N=!0,F(I,ae-ee))):(A.sortIndex=J,t(m,A),w||b||(w=!0,B||(B=!0,le()))),A},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(A){var G=v;return function(){var ae=v;v=G;try{return A.apply(this,arguments)}finally{v=ae}}}})(gh)),gh}var k0;function s2(){return k0||(k0=1,ph.exports=r2()),ph.exports}var xh={exports:{}},wn={};var R0;function i2(){if(R0)return wn;R0=1;var e=Du();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(t(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(m,h,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:y==null?null:""+y,children:m,containerInfo:h,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return wn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,wn.createPortal=function(m,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(m,h,null,g)},wn.flushSync=function(m){var h=u.T,g=r.p;try{if(u.T=null,r.p=2,m)return m()}finally{u.T=h,r.p=g,r.d.f()}},wn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(m,h))},wn.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},wn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var g=h.as,y=f(g,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?r.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:b}):g==="script"&&r.d.X(m,{crossOrigin:y,integrity:v,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},wn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=f(h.as,h.crossOrigin);r.d.M(m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(m)},wn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,y=f(g,h.crossOrigin);r.d.L(m,g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},wn.preloadModule=function(m,h){if(typeof m=="string")if(h){var g=f(h.as,h.crossOrigin);r.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(m)},wn.requestFormReset=function(m){r.d.r(m)},wn.unstable_batchedUpdates=function(m,h){return m(h)},wn.useFormState=function(m,h,g){return u.H.useFormState(m,h,g)},wn.useFormStatus=function(){return u.H.useHostTransitionStatus()},wn.version="19.2.4",wn}var T0;function o2(){if(T0)return xh.exports;T0=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(),xh.exports=i2(),xh.exports}var A0;function l2(){if(A0)return To;A0=1;var e=s2(),t=Du(),a=o2();function r(n){var s="https://react.dev/errors/"+n;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)s+="&args[]="+encodeURIComponent(arguments[o])}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 i(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var s=n,o=n;if(n.alternate)for(;s.return;)s=s.return;else{n=s;do s=n,(s.flags&4098)!==0&&(o=s.return),n=s.return;while(n)}return s.tag===3?o: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 m(n){if(l(n)!==n)throw Error(r(188))}function h(n){var s=n.alternate;if(!s){if(s=l(n),s===null)throw Error(r(188));return s!==n?null:n}for(var o=n,c=s;;){var p=o.return;if(p===null)break;var x=p.alternate;if(x===null){if(c=p.return,c!==null){o=c;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===o)return m(p),n;if(x===c)return m(p),s;x=x.sibling}throw Error(r(188))}if(o.return!==c.return)o=p,c=x;else{for(var S=!1,C=p.child;C;){if(C===o){S=!0,o=p,c=x;break}if(C===c){S=!0,c=p,o=x;break}C=C.sibling}if(!S){for(C=x.child;C;){if(C===o){S=!0,o=x,c=p;break}if(C===c){S=!0,c=x,o=p;break}C=C.sibling}if(!S)throw Error(r(189))}}if(o.alternate!==c)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?n:s}function g(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n;for(n=n.child;n!==null;){if(s=g(n),s!==null)return s;n=n.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),k=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function le(n){return n===null||typeof n!="object"?null:(n=de&&n[de]||n["@@iterator"],typeof n=="function"?n:null)}var ce=Symbol.for("react.client.reference");function D(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 N:return"Fragment";case E:return"Profiler";case j:return"StrictMode";case I:return"Suspense";case B:return"SuspenseList";case P:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case k:return n.displayName||"Context";case R:return(n._context.displayName||"Context")+".Consumer";case O:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case H:return s=n.displayName||null,s!==null?s:D(n.type)||"Memo";case T:s=n._payload,n=n._init;try{return D(n(s))}catch{}}return null}var F=Array.isArray,A=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},ee=[],J=-1;function L(n){return{current:n}}function q(n){0>J||(n.current=ee[J],ee[J]=null,J--)}function re(n,s){J++,ee[J]=n.current,n.current=s}var ie=L(null),ge=L(null),xe=L(null),Ee=L(null);function Me(n,s){switch(re(xe,s),re(ge,n),re(ie,null),s.nodeType){case 9:case 11:n=(n=s.documentElement)&&(n=n.namespaceURI)?jy(n):0;break;default:if(n=s.tagName,s=s.namespaceURI)s=jy(s),n=Ey(s,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}q(ie),re(ie,n)}function qe(){q(ie),q(ge),q(xe)}function vn(n){n.memoizedState!==null&&re(Ee,n);var s=ie.current,o=Ey(s,n.type);s!==o&&(re(ge,n),re(ie,o))}function zn(n){ge.current===n&&(q(ie),q(ge)),Ee.current===n&&(q(Ee),No._currentValue=ae)}var Ht,at;function Nt(n){if(Ht===void 0)try{throw Error()}catch(o){var s=o.stack.trim().match(/\n( *(at )?)/);Ht=s&&s[1]||"",at=-1<o.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+Ht+n+at}var Un=!1;function lt(n,s){if(!n||Un)return"";Un=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(s){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(W){var Q=W}Reflect.construct(n,[],ue)}else{try{ue.call()}catch(W){Q=W}n.call(ue.prototype)}}else{try{throw Error()}catch(W){Q=W}(ue=n())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(W){if(W&&Q&&typeof W.stack=="string")return[W.stack,Q.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),S=x[0],C=x[1];if(S&&C){var z=S.split(`
|
|
5
|
+
`),K=C.split(`
|
|
6
|
+
`);for(p=c=0;c<z.length&&!z[c].includes("DetermineComponentFrameRoot");)c++;for(;p<K.length&&!K[p].includes("DetermineComponentFrameRoot");)p++;if(c===z.length||p===K.length)for(c=z.length-1,p=K.length-1;1<=c&&0<=p&&z[c]!==K[p];)p--;for(;1<=c&&0<=p;c--,p--)if(z[c]!==K[p]){if(c!==1||p!==1)do if(c--,p--,0>p||z[c]!==K[p]){var te=`
|
|
7
|
+
`+z[c].replace(" at new "," at ");return n.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",n.displayName)),te}while(1<=c&&0<=p);break}}}finally{Un=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?Nt(o):""}function hn(n,s){switch(n.tag){case 26:case 27:case 5:return Nt(n.type);case 16:return Nt("Lazy");case 13:return n.child!==s&&s!==null?Nt("Suspense Fallback"):Nt("Suspense");case 19:return Nt("SuspenseList");case 0:case 15:return lt(n.type,!1);case 11:return lt(n.type.render,!1);case 1:return lt(n.type,!0);case 31:return Nt("Activity");default:return""}}function ln(n){try{var s="",o=null;do s+=hn(n,o),o=n,n=n.return;while(n);return s}catch(c){return`
|
|
8
|
+
Error generating stack: `+c.message+`
|
|
9
|
+
`+c.stack}}var qt=Object.prototype.hasOwnProperty,bn=e.unstable_scheduleCallback,ia=e.unstable_cancelCallback,kn=e.unstable_shouldYield,Rn=e.unstable_requestPaint,jt=e.unstable_now,_n=e.unstable_getCurrentPriorityLevel,Ne=e.unstable_ImmediatePriority,He=e.unstable_UserBlockingPriority,Xe=e.unstable_NormalPriority,yt=e.unstable_LowPriority,Tt=e.unstable_IdlePriority,cn=e.log,Yn=e.unstable_setDisableYieldValue,mn=null,Bt=null;function vt(n){if(typeof cn=="function"&&Yn(n),Bt&&typeof Bt.setStrictMode=="function")try{Bt.setStrictMode(mn,n)}catch{}}var Ft=Math.clz32?Math.clz32:ct,Te=Math.log,Be=Math.LN2;function ct(n){return n>>>=0,n===0?32:31-(Te(n)/Be|0)|0}var tt=256,bt=262144,Dt=4194304;function At(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 en(n,s,o){var c=n.pendingLanes;if(c===0)return 0;var p=0,x=n.suspendedLanes,S=n.pingedLanes;n=n.warmLanes;var C=c&134217727;return C!==0?(c=C&~x,c!==0?p=At(c):(S&=C,S!==0?p=At(S):o||(o=C&~n,o!==0&&(p=At(o))))):(C=c&~x,C!==0?p=At(C):S!==0?p=At(S):o||(o=c&~n,o!==0&&(p=At(o)))),p===0?0:s!==0&&s!==p&&(s&x)===0&&(x=p&-p,o=s&-s,x>=o||x===32&&(o&4194048)!==0)?s:p}function se(n,s){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&s)===0}function be(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 Ue(){var n=Dt;return Dt<<=1,(Dt&62914560)===0&&(Dt=4194304),n}function ut(n){for(var s=[],o=0;31>o;o++)s.push(n);return s}function Pe(n,s){n.pendingLanes|=s,s!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function oa(n,s,o,c,p,x){var S=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var C=n.entanglements,z=n.expirationTimes,K=n.hiddenUpdates;for(o=S&~o;0<o;){var te=31-Ft(o),ue=1<<te;C[te]=0,z[te]=-1;var Q=K[te];if(Q!==null)for(K[te]=null,te=0;te<Q.length;te++){var W=Q[te];W!==null&&(W.lane&=-536870913)}o&=~ue}c!==0&&la(n,c,0),x!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=x&~(S&~s))}function la(n,s,o){n.pendingLanes|=s,n.suspendedLanes&=~s;var c=31-Ft(s);n.entangledLanes|=s,n.entanglements[c]=n.entanglements[c]|1073741824|o&261930}function ca(n,s){var o=n.entangledLanes|=s;for(n=n.entanglements;o;){var c=31-Ft(o),p=1<<c;p&s|n[c]&s&&(n[c]|=s),o&=~p}}function M(n,s){var o=s&-s;return o=(o&42)!==0?1:$(o),(o&(n.suspendedLanes|s))!==0?0:o}function $(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 fe(){var n=G.p;return n!==0?n:(n=window.event,n===void 0?32:Xy(n.type))}function he(n,s){var o=G.p;try{return G.p=n,s()}finally{G.p=o}}var Se=Math.random().toString(36).slice(2),pe="__reactFiber$"+Se,ve="__reactProps$"+Se,_e="__reactContainer$"+Se,ke="__reactEvents$"+Se,Ae="__reactListeners$"+Se,Ce="__reactHandles$"+Se,rt="__reactResources$"+Se,Ye="__reactMarker$"+Se;function gt(n){delete n[pe],delete n[ve],delete n[ke],delete n[Ae],delete n[Ce]}function Et(n){var s=n[pe];if(s)return s;for(var o=n.parentNode;o;){if(s=o[_e]||o[pe]){if(o=s.alternate,s.child!==null||o!==null&&o.child!==null)for(n=Oy(n);n!==null;){if(o=n[pe])return o;n=Oy(n)}return s}n=o,o=n.parentNode}return null}function Mt(n){if(n=n[pe]||n[_e]){var s=n.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return n}return null}function nt(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n.stateNode;throw Error(r(33))}function tn(n){var s=n[rt];return s||(s=n[rt]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function _t(n){n[Ye]=!0}var wr=new Set,Ra={};function un(n,s){za(n,s),za(n+"Capture",s)}function za(n,s){for(Ra[n]=s,n=0;n<s.length;n++)wr.add(s[n])}var as=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]*$"),Ua={},rs={};function zs(n){return qt.call(rs,n)?!0:qt.call(Ua,n)?!1:as.test(n)?rs[n]=!0:(Ua[n]=!0,!1)}function Ke(n,s,o){if(zs(s))if(o===null)n.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(s);return;case"boolean":var c=s.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(s);return}}n.setAttribute(s,""+o)}}function It(n,s,o){if(o===null)n.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttribute(s,""+o)}}function Sn(n,s,o,c){if(c===null)n.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(s,o,""+c)}}function Yt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Ct(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Us(n,s,o){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,s);if(!n.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,x=c.set;return Object.defineProperty(n,s,{configurable:!0,get:function(){return p.call(this)},set:function(S){o=""+S,x.call(this,S)}}),Object.defineProperty(n,s,{enumerable:c.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){n._valueTracker=null,delete n[s]}}}}function $s(n){if(!n._valueTracker){var s=Ct(n)?"checked":"value";n._valueTracker=Us(n,s,""+n[s])}}function El(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var o=s.getValue(),c="";return n&&(c=Ct(n)?n.checked?"true":"false":n.value),n=c,n!==o?(s.setValue(n),!0):!1}function Cl(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 PS=/[\n"\\]/g;function ua(n){return n.replace(PS,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function ed(n,s,o,c,p,x,S,C){n.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?n.type=S:n.removeAttribute("type"),s!=null?S==="number"?(s===0&&n.value===""||n.value!=s)&&(n.value=""+Yt(s)):n.value!==""+Yt(s)&&(n.value=""+Yt(s)):S!=="submit"&&S!=="reset"||n.removeAttribute("value"),s!=null?td(n,S,Yt(s)):o!=null?td(n,S,Yt(o)):c!=null&&n.removeAttribute("value"),p==null&&x!=null&&(n.defaultChecked=!!x),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.name=""+Yt(C):n.removeAttribute("name")}function vp(n,s,o,c,p,x,S,C){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(n.type=x),s!=null||o!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){$s(n);return}o=o!=null?""+Yt(o):"",s=s!=null?""+Yt(s):o,C||s===n.value||(n.value=s),n.defaultValue=s}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=C?n.checked:!!c,n.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(n.name=S),$s(n)}function td(n,s,o){s==="number"&&Cl(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Hs(n,s,o,c){if(n=n.options,s){s={};for(var p=0;p<o.length;p++)s["$"+o[p]]=!0;for(o=0;o<n.length;o++)p=s.hasOwnProperty("$"+n[o].value),n[o].selected!==p&&(n[o].selected=p),p&&c&&(n[o].defaultSelected=!0)}else{for(o=""+Yt(o),s=null,p=0;p<n.length;p++){if(n[p].value===o){n[p].selected=!0,c&&(n[p].defaultSelected=!0);return}s!==null||n[p].disabled||(s=n[p])}s!==null&&(s.selected=!0)}}function bp(n,s,o){if(s!=null&&(s=""+Yt(s),s!==n.value&&(n.value=s),o==null)){n.defaultValue!==s&&(n.defaultValue=s);return}n.defaultValue=o!=null?""+Yt(o):""}function _p(n,s,o,c){if(s==null){if(c!=null){if(o!=null)throw Error(r(92));if(F(c)){if(1<c.length)throw Error(r(93));c=c[0]}o=c}o==null&&(o=""),s=o}o=Yt(s),n.defaultValue=o,c=n.textContent,c===o&&c!==""&&c!==null&&(n.value=c),$s(n)}function Bs(n,s){if(s){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=s;return}}n.textContent=s}var GS=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 Sp(n,s,o){var c=s.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?c?n.setProperty(s,""):s==="float"?n.cssFloat="":n[s]="":c?n.setProperty(s,o):typeof o!="number"||o===0||GS.has(s)?s==="float"?n.cssFloat=o:n[s]=(""+o).trim():n[s]=o+"px"}function wp(n,s,o){if(s!=null&&typeof s!="object")throw Error(r(62));if(n=n.style,o!=null){for(var c in o)!o.hasOwnProperty(c)||s!=null&&s.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var p in s)c=s[p],s.hasOwnProperty(p)&&o[p]!==c&&Sp(n,p,c)}else for(var x in s)s.hasOwnProperty(x)&&Sp(n,x,s[x])}function nd(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 VS=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"]]),qS=/^[\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 qS.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Wa(){}var ad=null;function rd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Is=null,Ps=null;function Np(n){var s=Mt(n);if(s&&(n=s.stateNode)){var o=n[ve]||null;e:switch(n=s.stateNode,s.type){case"input":if(ed(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),s=o.name,o.type==="radio"&&s!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+ua(""+s)+'"][type="radio"]'),s=0;s<o.length;s++){var c=o[s];if(c!==n&&c.form===n.form){var p=c[ve]||null;if(!p)throw Error(r(90));ed(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(s=0;s<o.length;s++)c=o[s],c.form===n.form&&El(c)}break e;case"textarea":bp(n,o.value,o.defaultValue);break e;case"select":s=o.value,s!=null&&Hs(n,!!o.multiple,s,!1)}}}var sd=!1;function jp(n,s,o){if(sd)return n(s,o);sd=!0;try{var c=n(s);return c}finally{if(sd=!1,(Is!==null||Ps!==null)&&(pc(),Is&&(s=Is,n=Ps,Ps=Is=null,Np(s),n)))for(s=0;s<n.length;s++)Np(n[s])}}function Bi(n,s){var o=n.stateNode;if(o===null)return null;var c=o[ve]||null;if(c===null)return null;o=c[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":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(r(231,s,typeof o));return o}var er=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),id=!1;if(er)try{var Ii={};Object.defineProperty(Ii,"passive",{get:function(){id=!0}}),window.addEventListener("test",Ii,Ii),window.removeEventListener("test",Ii,Ii)}catch{id=!1}var Nr=null,od=null,Rl=null;function Ep(){if(Rl)return Rl;var n,s=od,o=s.length,c,p="value"in Nr?Nr.value:Nr.textContent,x=p.length;for(n=0;n<o&&s[n]===p[n];n++);var S=o-n;for(c=1;c<=S&&s[o-c]===p[x-c];c++);return Rl=p.slice(n,1<c?1-c:void 0)}function Tl(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 Al(){return!0}function Cp(){return!1}function $n(n){function s(o,c,p,x,S){this._reactName=o,this._targetInst=p,this.type=c,this.nativeEvent=x,this.target=S,this.currentTarget=null;for(var C in n)n.hasOwnProperty(C)&&(o=n[C],this[C]=o?o(x):x[C]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Al:Cp,this.isPropagationStopped=Cp,this}return y(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Al)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Al)},persist:function(){},isPersistent:Al}),s}var ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ll=$n(ss),Pi=y({},ss,{view:0,detail:0}),FS=$n(Pi),ld,cd,Gi,Ol=y({},Pi,{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!==Gi&&(Gi&&n.type==="mousemove"?(ld=n.screenX-Gi.screenX,cd=n.screenY-Gi.screenY):cd=ld=0,Gi=n),ld)},movementY:function(n){return"movementY"in n?n.movementY:cd}}),kp=$n(Ol),YS=y({},Ol,{dataTransfer:0}),KS=$n(YS),XS=y({},Pi,{relatedTarget:0}),ud=$n(XS),QS=y({},ss,{animationName:0,elapsedTime:0,pseudoElement:0}),ZS=$n(QS),JS=y({},ss,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),WS=$n(JS),ew=y({},ss,{data:0}),Rp=$n(ew),tw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nw={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"},aw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rw(n){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(n):(n=aw[n])?!!s[n]:!1}function dd(){return rw}var sw=y({},Pi,{key:function(n){if(n.key){var s=tw[n.key]||n.key;if(s!=="Unidentified")return s}return n.type==="keypress"?(n=Tl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?nw[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"?Tl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Tl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),iw=$n(sw),ow=y({},Ol,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tp=$n(ow),lw=y({},Pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dd}),cw=$n(lw),uw=y({},ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),dw=$n(uw),fw=y({},Ol,{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}),hw=$n(fw),mw=y({},ss,{newState:0,oldState:0}),pw=$n(mw),gw=[9,13,27,32],fd=er&&"CompositionEvent"in window,Vi=null;er&&"documentMode"in document&&(Vi=document.documentMode);var xw=er&&"TextEvent"in window&&!Vi,Ap=er&&(!fd||Vi&&8<Vi&&11>=Vi),Lp=" ",Op=!1;function Dp(n,s){switch(n){case"keyup":return gw.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mp(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Gs=!1;function yw(n,s){switch(n){case"compositionend":return Mp(s);case"keypress":return s.which!==32?null:(Op=!0,Lp);case"textInput":return n=s.data,n===Lp&&Op?null:n;default:return null}}function vw(n,s){if(Gs)return n==="compositionend"||!fd&&Dp(n,s)?(n=Ep(),Rl=od=Nr=null,Gs=!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 Ap&&s.locale!=="ko"?null:s.data;default:return null}}var bw={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 zp(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s==="input"?!!bw[n.type]:s==="textarea"}function Up(n,s,o,c){Is?Ps?Ps.push(c):Ps=[c]:Is=c,s=Sc(s,"onChange"),0<s.length&&(o=new Ll("onChange","change",null,o,c),n.push({event:o,listeners:s}))}var qi=null,Fi=null;function _w(n){vy(n,0)}function Dl(n){var s=nt(n);if(El(s))return n}function $p(n,s){if(n==="change")return s}var Hp=!1;if(er){var hd;if(er){var md="oninput"in document;if(!md){var Bp=document.createElement("div");Bp.setAttribute("oninput","return;"),md=typeof Bp.oninput=="function"}hd=md}else hd=!1;Hp=hd&&(!document.documentMode||9<document.documentMode)}function Ip(){qi&&(qi.detachEvent("onpropertychange",Pp),Fi=qi=null)}function Pp(n){if(n.propertyName==="value"&&Dl(Fi)){var s=[];Up(s,Fi,n,rd(n)),jp(_w,s)}}function Sw(n,s,o){n==="focusin"?(Ip(),qi=s,Fi=o,qi.attachEvent("onpropertychange",Pp)):n==="focusout"&&Ip()}function ww(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Dl(Fi)}function Nw(n,s){if(n==="click")return Dl(s)}function jw(n,s){if(n==="input"||n==="change")return Dl(s)}function Ew(n,s){return n===s&&(n!==0||1/n===1/s)||n!==n&&s!==s}var Kn=typeof Object.is=="function"?Object.is:Ew;function Yi(n,s){if(Kn(n,s))return!0;if(typeof n!="object"||n===null||typeof s!="object"||s===null)return!1;var o=Object.keys(n),c=Object.keys(s);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var p=o[c];if(!qt.call(s,p)||!Kn(n[p],s[p]))return!1}return!0}function Gp(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Vp(n,s){var o=Gp(n);n=0;for(var c;o;){if(o.nodeType===3){if(c=n+o.textContent.length,n<=s&&c>=s)return{node:o,offset:s-n};n=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Gp(o)}}function qp(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?qp(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function Fp(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var s=Cl(n.document);s instanceof n.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)n=s.contentWindow;else break;s=Cl(n.document)}return s}function pd(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 Cw=er&&"documentMode"in document&&11>=document.documentMode,Vs=null,gd=null,Ki=null,xd=!1;function Yp(n,s,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;xd||Vs==null||Vs!==Cl(c)||(c=Vs,"selectionStart"in c&&pd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Ki&&Yi(Ki,c)||(Ki=c,c=Sc(gd,"onSelect"),0<c.length&&(s=new Ll("onSelect","select",null,s,o),n.push({event:s,listeners:c}),s.target=Vs)))}function is(n,s){var o={};return o[n.toLowerCase()]=s.toLowerCase(),o["Webkit"+n]="webkit"+s,o["Moz"+n]="moz"+s,o}var qs={animationend:is("Animation","AnimationEnd"),animationiteration:is("Animation","AnimationIteration"),animationstart:is("Animation","AnimationStart"),transitionrun:is("Transition","TransitionRun"),transitionstart:is("Transition","TransitionStart"),transitioncancel:is("Transition","TransitionCancel"),transitionend:is("Transition","TransitionEnd")},yd={},Kp={};er&&(Kp=document.createElement("div").style,"AnimationEvent"in window||(delete qs.animationend.animation,delete qs.animationiteration.animation,delete qs.animationstart.animation),"TransitionEvent"in window||delete qs.transitionend.transition);function os(n){if(yd[n])return yd[n];if(!qs[n])return n;var s=qs[n],o;for(o in s)if(s.hasOwnProperty(o)&&o in Kp)return yd[n]=s[o];return n}var Xp=os("animationend"),Qp=os("animationiteration"),Zp=os("animationstart"),kw=os("transitionrun"),Rw=os("transitionstart"),Tw=os("transitioncancel"),Jp=os("transitionend"),Wp=new Map,vd="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(" ");vd.push("scrollEnd");function Ta(n,s){Wp.set(n,s),un(s,[n])}var Ml=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)},da=[],Fs=0,bd=0;function zl(){for(var n=Fs,s=bd=Fs=0;s<n;){var o=da[s];da[s++]=null;var c=da[s];da[s++]=null;var p=da[s];da[s++]=null;var x=da[s];if(da[s++]=null,c!==null&&p!==null){var S=c.pending;S===null?p.next=p:(p.next=S.next,S.next=p),c.pending=p}x!==0&&eg(o,p,x)}}function Ul(n,s,o,c){da[Fs++]=n,da[Fs++]=s,da[Fs++]=o,da[Fs++]=c,bd|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function _d(n,s,o,c){return Ul(n,s,o,c),$l(n)}function ls(n,s){return Ul(n,null,null,s),$l(n)}function eg(n,s,o){n.lanes|=o;var c=n.alternate;c!==null&&(c.lanes|=o);for(var p=!1,x=n.return;x!==null;)x.childLanes|=o,c=x.alternate,c!==null&&(c.childLanes|=o),x.tag===22&&(n=x.stateNode,n===null||n._visibility&1||(p=!0)),n=x,x=x.return;return n.tag===3?(x=n.stateNode,p&&s!==null&&(p=31-Ft(o),n=x.hiddenUpdates,c=n[p],c===null?n[p]=[s]:c.push(s),s.lane=o|536870912),x):null}function $l(n){if(50<xo)throw xo=0,Af=null,Error(r(185));for(var s=n.return;s!==null;)n=s,s=n.return;return n.tag===3?n.stateNode:null}var Ys={};function Aw(n,s,o,c){this.tag=n,this.key=o,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=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(n,s,o,c){return new Aw(n,s,o,c)}function Sd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function tr(n,s){var o=n.alternate;return o===null?(o=Xn(n.tag,s,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=s,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,s=n.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function tg(n,s){n.flags&=65011714;var o=n.alternate;return o===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=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,s=o.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),n}function Hl(n,s,o,c,p,x){var S=0;if(c=n,typeof n=="function")Sd(n)&&(S=1);else if(typeof n=="string")S=z4(n,o,ie.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case P:return n=Xn(31,o,s,p),n.elementType=P,n.lanes=x,n;case N:return cs(o.children,p,x,s);case j:S=8,p|=24;break;case E:return n=Xn(12,o,s,p|2),n.elementType=E,n.lanes=x,n;case I:return n=Xn(13,o,s,p),n.elementType=I,n.lanes=x,n;case B:return n=Xn(19,o,s,p),n.elementType=B,n.lanes=x,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case k:S=10;break e;case R:S=9;break e;case O:S=11;break e;case H:S=14;break e;case T:S=16,c=null;break e}S=29,o=Error(r(130,n===null?"null":typeof n,"")),c=null}return s=Xn(S,o,s,p),s.elementType=n,s.type=c,s.lanes=x,s}function cs(n,s,o,c){return n=Xn(7,n,c,s),n.lanes=o,n}function wd(n,s,o){return n=Xn(6,n,null,s),n.lanes=o,n}function ng(n){var s=Xn(18,null,null,0);return s.stateNode=n,s}function Nd(n,s,o){return s=Xn(4,n.children!==null?n.children:[],n.key,s),s.lanes=o,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}var ag=new WeakMap;function fa(n,s){if(typeof n=="object"&&n!==null){var o=ag.get(n);return o!==void 0?o:(s={value:n,source:s,stack:ln(s)},ag.set(n,s),s)}return{value:n,source:s,stack:ln(s)}}var Ks=[],Xs=0,Bl=null,Xi=0,ha=[],ma=0,jr=null,$a=1,Ha="";function nr(n,s){Ks[Xs++]=Xi,Ks[Xs++]=Bl,Bl=n,Xi=s}function rg(n,s,o){ha[ma++]=$a,ha[ma++]=Ha,ha[ma++]=jr,jr=n;var c=$a;n=Ha;var p=32-Ft(c)-1;c&=~(1<<p),o+=1;var x=32-Ft(s)+p;if(30<x){var S=p-p%5;x=(c&(1<<S)-1).toString(32),c>>=S,p-=S,$a=1<<32-Ft(s)+p|o<<p|c,Ha=x+n}else $a=1<<x|o<<p|c,Ha=n}function jd(n){n.return!==null&&(nr(n,1),rg(n,1,0))}function Ed(n){for(;n===Bl;)Bl=Ks[--Xs],Ks[Xs]=null,Xi=Ks[--Xs],Ks[Xs]=null;for(;n===jr;)jr=ha[--ma],ha[ma]=null,Ha=ha[--ma],ha[ma]=null,$a=ha[--ma],ha[ma]=null}function sg(n,s){ha[ma++]=$a,ha[ma++]=Ha,ha[ma++]=jr,$a=s.id,Ha=s.overflow,jr=n}var pn=null,kt=null,et=!1,Er=null,pa=!1,Cd=Error(r(519));function Cr(n){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qi(fa(s,n)),Cd}function ig(n){var s=n.stateNode,o=n.type,c=n.memoizedProps;switch(s[pe]=n,s[ve]=c,o){case"dialog":Ze("cancel",s),Ze("close",s);break;case"iframe":case"object":case"embed":Ze("load",s);break;case"video":case"audio":for(o=0;o<vo.length;o++)Ze(vo[o],s);break;case"source":Ze("error",s);break;case"img":case"image":case"link":Ze("error",s),Ze("load",s);break;case"details":Ze("toggle",s);break;case"input":Ze("invalid",s),vp(s,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ze("invalid",s);break;case"textarea":Ze("invalid",s),_p(s,c.value,c.defaultValue,c.children)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||s.textContent===""+o||c.suppressHydrationWarning===!0||wy(s.textContent,o)?(c.popover!=null&&(Ze("beforetoggle",s),Ze("toggle",s)),c.onScroll!=null&&Ze("scroll",s),c.onScrollEnd!=null&&Ze("scrollend",s),c.onClick!=null&&(s.onclick=Wa),s=!0):s=!1,s||Cr(n,!0)}function og(n){for(pn=n.return;pn;)switch(pn.tag){case 5:case 31:case 13:pa=!1;return;case 27:case 3:pa=!0;return;default:pn=pn.return}}function Qs(n){if(n!==pn)return!1;if(!et)return og(n),et=!0,!1;var s=n.tag,o;if((o=s!==3&&s!==27)&&((o=s===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||Ff(n.type,n.memoizedProps)),o=!o),o&&kt&&Cr(n),og(n),s===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));kt=Ly(n)}else if(s===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));kt=Ly(n)}else s===27?(s=kt,Ir(n.type)?(n=Zf,Zf=null,kt=n):kt=s):kt=pn?xa(n.stateNode.nextSibling):null;return!0}function us(){kt=pn=null,et=!1}function kd(){var n=Er;return n!==null&&(Pn===null?Pn=n:Pn.push.apply(Pn,n),Er=null),n}function Qi(n){Er===null?Er=[n]:Er.push(n)}var Rd=L(null),ds=null,ar=null;function kr(n,s,o){re(Rd,s._currentValue),s._currentValue=o}function rr(n){n._currentValue=Rd.current,q(Rd)}function Td(n,s,o){for(;n!==null;){var c=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),n===o)break;n=n.return}}function Ad(n,s,o,c){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var x=p.dependencies;if(x!==null){var S=p.child;x=x.firstContext;e:for(;x!==null;){var C=x;x=p;for(var z=0;z<s.length;z++)if(C.context===s[z]){x.lanes|=o,C=x.alternate,C!==null&&(C.lanes|=o),Td(x.return,o,n),c||(S=null);break e}x=C.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(r(341));S.lanes|=o,x=S.alternate,x!==null&&(x.lanes|=o),Td(S,o,n),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===n){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function Zs(n,s,o,c){n=null;for(var p=s,x=!1;p!==null;){if(!x){if((p.flags&524288)!==0)x=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(r(387));if(S=S.memoizedProps,S!==null){var C=p.type;Kn(p.pendingProps.value,S.value)||(n!==null?n.push(C):n=[C])}}else if(p===Ee.current){if(S=p.alternate,S===null)throw Error(r(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(No):n=[No])}p=p.return}n!==null&&Ad(s,n,o,c),s.flags|=262144}function Il(n){for(n=n.firstContext;n!==null;){if(!Kn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function fs(n){ds=n,ar=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function gn(n){return lg(ds,n)}function Pl(n,s){return ds===null&&fs(n),lg(n,s)}function lg(n,s){var o=s._currentValue;if(s={context:s,memoizedValue:o,next:null},ar===null){if(n===null)throw Error(r(308));ar=s,n.dependencies={lanes:0,firstContext:s},n.flags|=524288}else ar=ar.next=s;return o}var Lw=typeof AbortController<"u"?AbortController:function(){var n=[],s=this.signal={aborted:!1,addEventListener:function(o,c){n.push(c)}};this.abort=function(){s.aborted=!0,n.forEach(function(o){return o()})}},Ow=e.unstable_scheduleCallback,Dw=e.unstable_NormalPriority,Kt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ld(){return{controller:new Lw,data:new Map,refCount:0}}function Zi(n){n.refCount--,n.refCount===0&&Ow(Dw,function(){n.controller.abort()})}var Ji=null,Od=0,Js=0,Ws=null;function Mw(n,s){if(Ji===null){var o=Ji=[];Od=0,Js=Uf(),Ws={status:"pending",value:void 0,then:function(c){o.push(c)}}}return Od++,s.then(cg,cg),s}function cg(){if(--Od===0&&Ji!==null){Ws!==null&&(Ws.status="fulfilled");var n=Ji;Ji=null,Js=0,Ws=null;for(var s=0;s<n.length;s++)(0,n[s])()}}function zw(n,s){var o=[],c={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return n.then(function(){c.status="fulfilled",c.value=s;for(var p=0;p<o.length;p++)(0,o[p])(s)},function(p){for(c.status="rejected",c.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),c}var ug=A.S;A.S=function(n,s){Yx=jt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&Mw(n,s),ug!==null&&ug(n,s)};var hs=L(null);function Dd(){var n=hs.current;return n!==null?n:xt.pooledCache}function Gl(n,s){s===null?re(hs,hs.current):re(hs,s.pool)}function dg(){var n=Dd();return n===null?null:{parent:Kt._currentValue,pool:n}}var ei=Error(r(460)),Md=Error(r(474)),Vl=Error(r(542)),ql={then:function(){}};function fg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function hg(n,s,o){switch(o=n[o],o===void 0?n.push(s):o!==s&&(s.then(Wa,Wa),s=o),s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,pg(n),n;default:if(typeof s.status=="string")s.then(Wa,Wa);else{if(n=xt,n!==null&&100<n.shellSuspendCounter)throw Error(r(482));n=s,n.status="pending",n.then(function(c){if(s.status==="pending"){var p=s;p.status="fulfilled",p.value=c}},function(c){if(s.status==="pending"){var p=s;p.status="rejected",p.reason=c}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,pg(n),n}throw ps=s,ei}}function ms(n){try{var s=n._init;return s(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(ps=o,ei):o}}var ps=null;function mg(){if(ps===null)throw Error(r(459));var n=ps;return ps=null,n}function pg(n){if(n===ei||n===Vl)throw Error(r(483))}var ti=null,Wi=0;function Fl(n){var s=Wi;return Wi+=1,ti===null&&(ti=[]),hg(ti,n,s)}function eo(n,s){s=s.props.ref,n.ref=s!==void 0?s:null}function Yl(n,s){throw s.$$typeof===v?Error(r(525)):(n=Object.prototype.toString.call(s),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":n)))}function gg(n){function s(V,U){if(n){var Y=V.deletions;Y===null?(V.deletions=[U],V.flags|=16):Y.push(U)}}function o(V,U){if(!n)return null;for(;U!==null;)s(V,U),U=U.sibling;return null}function c(V){for(var U=new Map;V!==null;)V.key!==null?U.set(V.key,V):U.set(V.index,V),V=V.sibling;return U}function p(V,U){return V=tr(V,U),V.index=0,V.sibling=null,V}function x(V,U,Y){return V.index=Y,n?(Y=V.alternate,Y!==null?(Y=Y.index,Y<U?(V.flags|=67108866,U):Y):(V.flags|=67108866,U)):(V.flags|=1048576,U)}function S(V){return n&&V.alternate===null&&(V.flags|=67108866),V}function C(V,U,Y,oe){return U===null||U.tag!==6?(U=wd(Y,V.mode,oe),U.return=V,U):(U=p(U,Y),U.return=V,U)}function z(V,U,Y,oe){var Re=Y.type;return Re===N?te(V,U,Y.props.children,oe,Y.key):U!==null&&(U.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===T&&ms(Re)===U.type)?(U=p(U,Y.props),eo(U,Y),U.return=V,U):(U=Hl(Y.type,Y.key,Y.props,null,V.mode,oe),eo(U,Y),U.return=V,U)}function K(V,U,Y,oe){return U===null||U.tag!==4||U.stateNode.containerInfo!==Y.containerInfo||U.stateNode.implementation!==Y.implementation?(U=Nd(Y,V.mode,oe),U.return=V,U):(U=p(U,Y.children||[]),U.return=V,U)}function te(V,U,Y,oe,Re){return U===null||U.tag!==7?(U=cs(Y,V.mode,oe,Re),U.return=V,U):(U=p(U,Y),U.return=V,U)}function ue(V,U,Y){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=wd(""+U,V.mode,Y),U.return=V,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case b:return Y=Hl(U.type,U.key,U.props,null,V.mode,Y),eo(Y,U),Y.return=V,Y;case w:return U=Nd(U,V.mode,Y),U.return=V,U;case T:return U=ms(U),ue(V,U,Y)}if(F(U)||le(U))return U=cs(U,V.mode,Y,null),U.return=V,U;if(typeof U.then=="function")return ue(V,Fl(U),Y);if(U.$$typeof===k)return ue(V,Pl(V,U),Y);Yl(V,U)}return null}function Q(V,U,Y,oe){var Re=U!==null?U.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Re!==null?null:C(V,U,""+Y,oe);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case b:return Y.key===Re?z(V,U,Y,oe):null;case w:return Y.key===Re?K(V,U,Y,oe):null;case T:return Y=ms(Y),Q(V,U,Y,oe)}if(F(Y)||le(Y))return Re!==null?null:te(V,U,Y,oe,null);if(typeof Y.then=="function")return Q(V,U,Fl(Y),oe);if(Y.$$typeof===k)return Q(V,U,Pl(V,Y),oe);Yl(V,Y)}return null}function W(V,U,Y,oe,Re){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return V=V.get(Y)||null,C(U,V,""+oe,Re);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return V=V.get(oe.key===null?Y:oe.key)||null,z(U,V,oe,Re);case w:return V=V.get(oe.key===null?Y:oe.key)||null,K(U,V,oe,Re);case T:return oe=ms(oe),W(V,U,Y,oe,Re)}if(F(oe)||le(oe))return V=V.get(Y)||null,te(U,V,oe,Re,null);if(typeof oe.then=="function")return W(V,U,Y,Fl(oe),Re);if(oe.$$typeof===k)return W(V,U,Y,Pl(U,oe),Re);Yl(U,oe)}return null}function we(V,U,Y,oe){for(var Re=null,st=null,je=U,Ge=U=0,We=null;je!==null&&Ge<Y.length;Ge++){je.index>Ge?(We=je,je=null):We=je.sibling;var it=Q(V,je,Y[Ge],oe);if(it===null){je===null&&(je=We);break}n&&je&&it.alternate===null&&s(V,je),U=x(it,U,Ge),st===null?Re=it:st.sibling=it,st=it,je=We}if(Ge===Y.length)return o(V,je),et&&nr(V,Ge),Re;if(je===null){for(;Ge<Y.length;Ge++)je=ue(V,Y[Ge],oe),je!==null&&(U=x(je,U,Ge),st===null?Re=je:st.sibling=je,st=je);return et&&nr(V,Ge),Re}for(je=c(je);Ge<Y.length;Ge++)We=W(je,V,Ge,Y[Ge],oe),We!==null&&(n&&We.alternate!==null&&je.delete(We.key===null?Ge:We.key),U=x(We,U,Ge),st===null?Re=We:st.sibling=We,st=We);return n&&je.forEach(function(Fr){return s(V,Fr)}),et&&nr(V,Ge),Re}function Le(V,U,Y,oe){if(Y==null)throw Error(r(151));for(var Re=null,st=null,je=U,Ge=U=0,We=null,it=Y.next();je!==null&&!it.done;Ge++,it=Y.next()){je.index>Ge?(We=je,je=null):We=je.sibling;var Fr=Q(V,je,it.value,oe);if(Fr===null){je===null&&(je=We);break}n&&je&&Fr.alternate===null&&s(V,je),U=x(Fr,U,Ge),st===null?Re=Fr:st.sibling=Fr,st=Fr,je=We}if(it.done)return o(V,je),et&&nr(V,Ge),Re;if(je===null){for(;!it.done;Ge++,it=Y.next())it=ue(V,it.value,oe),it!==null&&(U=x(it,U,Ge),st===null?Re=it:st.sibling=it,st=it);return et&&nr(V,Ge),Re}for(je=c(je);!it.done;Ge++,it=Y.next())it=W(je,V,Ge,it.value,oe),it!==null&&(n&&it.alternate!==null&&je.delete(it.key===null?Ge:it.key),U=x(it,U,Ge),st===null?Re=it:st.sibling=it,st=it);return n&&je.forEach(function(Y4){return s(V,Y4)}),et&&nr(V,Ge),Re}function pt(V,U,Y,oe){if(typeof Y=="object"&&Y!==null&&Y.type===N&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case b:e:{for(var Re=Y.key;U!==null;){if(U.key===Re){if(Re=Y.type,Re===N){if(U.tag===7){o(V,U.sibling),oe=p(U,Y.props.children),oe.return=V,V=oe;break e}}else if(U.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===T&&ms(Re)===U.type){o(V,U.sibling),oe=p(U,Y.props),eo(oe,Y),oe.return=V,V=oe;break e}o(V,U);break}else s(V,U);U=U.sibling}Y.type===N?(oe=cs(Y.props.children,V.mode,oe,Y.key),oe.return=V,V=oe):(oe=Hl(Y.type,Y.key,Y.props,null,V.mode,oe),eo(oe,Y),oe.return=V,V=oe)}return S(V);case w:e:{for(Re=Y.key;U!==null;){if(U.key===Re)if(U.tag===4&&U.stateNode.containerInfo===Y.containerInfo&&U.stateNode.implementation===Y.implementation){o(V,U.sibling),oe=p(U,Y.children||[]),oe.return=V,V=oe;break e}else{o(V,U);break}else s(V,U);U=U.sibling}oe=Nd(Y,V.mode,oe),oe.return=V,V=oe}return S(V);case T:return Y=ms(Y),pt(V,U,Y,oe)}if(F(Y))return we(V,U,Y,oe);if(le(Y)){if(Re=le(Y),typeof Re!="function")throw Error(r(150));return Y=Re.call(Y),Le(V,U,Y,oe)}if(typeof Y.then=="function")return pt(V,U,Fl(Y),oe);if(Y.$$typeof===k)return pt(V,U,Pl(V,Y),oe);Yl(V,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,U!==null&&U.tag===6?(o(V,U.sibling),oe=p(U,Y),oe.return=V,V=oe):(o(V,U),oe=wd(Y,V.mode,oe),oe.return=V,V=oe),S(V)):o(V,U)}return function(V,U,Y,oe){try{Wi=0;var Re=pt(V,U,Y,oe);return ti=null,Re}catch(je){if(je===ei||je===Vl)throw je;var st=Xn(29,je,null,V.mode);return st.lanes=oe,st.return=V,st}}}var gs=gg(!0),xg=gg(!1),Rr=!1;function zd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ud(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 Tr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Ar(n,s,o){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(ot&2)!==0){var p=c.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),c.pending=s,s=$l(n),eg(n,null,o),s}return Ul(n,c,s,o),$l(n)}function to(n,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194048)!==0)){var c=s.lanes;c&=n.pendingLanes,o|=c,s.lanes=o,ca(n,o)}}function $d(n,s){var o=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var p=null,x=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};x===null?p=x=S:x=x.next=S,o=o.next}while(o!==null);x===null?p=x=s:x=x.next=s}else p=x=s;o={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=s:n.next=s,o.lastBaseUpdate=s}var Hd=!1;function no(){if(Hd){var n=Ws;if(n!==null)throw n}}function ao(n,s,o,c){Hd=!1;var p=n.updateQueue;Rr=!1;var x=p.firstBaseUpdate,S=p.lastBaseUpdate,C=p.shared.pending;if(C!==null){p.shared.pending=null;var z=C,K=z.next;z.next=null,S===null?x=K:S.next=K,S=z;var te=n.alternate;te!==null&&(te=te.updateQueue,C=te.lastBaseUpdate,C!==S&&(C===null?te.firstBaseUpdate=K:C.next=K,te.lastBaseUpdate=z))}if(x!==null){var ue=p.baseState;S=0,te=K=z=null,C=x;do{var Q=C.lane&-536870913,W=Q!==C.lane;if(W?(Je&Q)===Q:(c&Q)===Q){Q!==0&&Q===Js&&(Hd=!0),te!==null&&(te=te.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var we=n,Le=C;Q=s;var pt=o;switch(Le.tag){case 1:if(we=Le.payload,typeof we=="function"){ue=we.call(pt,ue,Q);break e}ue=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Le.payload,Q=typeof we=="function"?we.call(pt,ue,Q):we,Q==null)break e;ue=y({},ue,Q);break e;case 2:Rr=!0}}Q=C.callback,Q!==null&&(n.flags|=64,W&&(n.flags|=8192),W=p.callbacks,W===null?p.callbacks=[Q]:W.push(Q))}else W={lane:Q,tag:C.tag,payload:C.payload,callback:C.callback,next:null},te===null?(K=te=W,z=ue):te=te.next=W,S|=Q;if(C=C.next,C===null){if(C=p.shared.pending,C===null)break;W=C,C=W.next,W.next=null,p.lastBaseUpdate=W,p.shared.pending=null}}while(!0);te===null&&(z=ue),p.baseState=z,p.firstBaseUpdate=K,p.lastBaseUpdate=te,x===null&&(p.shared.lanes=0),zr|=S,n.lanes=S,n.memoizedState=ue}}function yg(n,s){if(typeof n!="function")throw Error(r(191,n));n.call(s)}function vg(n,s){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)yg(o[n],s)}var ni=L(null),Kl=L(0);function bg(n,s){n=hr,re(Kl,n),re(ni,s),hr=n|s.baseLanes}function Bd(){re(Kl,hr),re(ni,ni.current)}function Id(){hr=Kl.current,q(ni),q(Kl)}var Qn=L(null),ga=null;function Lr(n){var s=n.alternate;re(Pt,Pt.current&1),re(Qn,n),ga===null&&(s===null||ni.current!==null||s.memoizedState!==null)&&(ga=n)}function Pd(n){re(Pt,Pt.current),re(Qn,n),ga===null&&(ga=n)}function _g(n){n.tag===22?(re(Pt,Pt.current),re(Qn,n),ga===null&&(ga=n)):Or()}function Or(){re(Pt,Pt.current),re(Qn,Qn.current)}function Zn(n){q(Qn),ga===n&&(ga=null),q(Pt)}var Pt=L(0);function Xl(n){for(var s=n;s!==null;){if(s.tag===13){var o=s.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Xf(o)||Qf(o)))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 sr=0,Ie=null,ht=null,Xt=null,Ql=!1,ai=!1,xs=!1,Zl=0,ro=0,ri=null,Uw=0;function zt(){throw Error(r(321))}function Gd(n,s){if(s===null)return!1;for(var o=0;o<s.length&&o<n.length;o++)if(!Kn(n[o],s[o]))return!1;return!0}function Vd(n,s,o,c,p,x){return sr=x,Ie=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,A.H=n===null||n.memoizedState===null?rx:sf,xs=!1,x=o(c,p),xs=!1,ai&&(x=wg(s,o,c,p)),Sg(n),x}function Sg(n){A.H=oo;var s=ht!==null&&ht.next!==null;if(sr=0,Xt=ht=Ie=null,Ql=!1,ro=0,ri=null,s)throw Error(r(300));n===null||Qt||(n=n.dependencies,n!==null&&Il(n)&&(Qt=!0))}function wg(n,s,o,c){Ie=n;var p=0;do{if(ai&&(ri=null),ro=0,ai=!1,25<=p)throw Error(r(301));if(p+=1,Xt=ht=null,n.updateQueue!=null){var x=n.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}A.H=sx,x=s(o,c)}while(ai);return x}function $w(){var n=A.H,s=n.useState()[0];return s=typeof s.then=="function"?so(s):s,n=n.useState()[0],(ht!==null?ht.memoizedState:null)!==n&&(Ie.flags|=1024),s}function qd(){var n=Zl!==0;return Zl=0,n}function Fd(n,s,o){s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~o}function Yd(n){if(Ql){for(n=n.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}Ql=!1}sr=0,Xt=ht=Ie=null,ai=!1,ro=Zl=0,ri=null}function Tn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Ie.memoizedState=Xt=n:Xt=Xt.next=n,Xt}function Gt(){if(ht===null){var n=Ie.alternate;n=n!==null?n.memoizedState:null}else n=ht.next;var s=Xt===null?Ie.memoizedState:Xt.next;if(s!==null)Xt=s,ht=n;else{if(n===null)throw Ie.alternate===null?Error(r(467)):Error(r(310));ht=n,n={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},Xt===null?Ie.memoizedState=Xt=n:Xt=Xt.next=n}return Xt}function Jl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function so(n){var s=ro;return ro+=1,ri===null&&(ri=[]),n=hg(ri,n,s),s=Ie,(Xt===null?s.memoizedState:Xt.next)===null&&(s=s.alternate,A.H=s===null||s.memoizedState===null?rx:sf),n}function Wl(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return so(n);if(n.$$typeof===k)return gn(n)}throw Error(r(438,String(n)))}function Kd(n){var s=null,o=Ie.updateQueue;if(o!==null&&(s=o.memoCache),s==null){var c=Ie.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(s={data:c.data.map(function(p){return p.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),o===null&&(o=Jl(),Ie.updateQueue=o),o.memoCache=s,o=s.data[s.index],o===void 0)for(o=s.data[s.index]=Array(n),c=0;c<n;c++)o[c]=X;return s.index++,o}function ir(n,s){return typeof s=="function"?s(n):s}function ec(n){var s=Gt();return Xd(s,ht,n)}function Xd(n,s,o){var c=n.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=o;var p=n.baseQueue,x=c.pending;if(x!==null){if(p!==null){var S=p.next;p.next=x.next,x.next=S}s.baseQueue=p=x,c.pending=null}if(x=n.baseState,p===null)n.memoizedState=x;else{s=p.next;var C=S=null,z=null,K=s,te=!1;do{var ue=K.lane&-536870913;if(ue!==K.lane?(Je&ue)===ue:(sr&ue)===ue){var Q=K.revertLane;if(Q===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ue===Js&&(te=!0);else if((sr&Q)===Q){K=K.next,Q===Js&&(te=!0);continue}else ue={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},z===null?(C=z=ue,S=x):z=z.next=ue,Ie.lanes|=Q,zr|=Q;ue=K.action,xs&&o(x,ue),x=K.hasEagerState?K.eagerState:o(x,ue)}else Q={lane:ue,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},z===null?(C=z=Q,S=x):z=z.next=Q,Ie.lanes|=ue,zr|=ue;K=K.next}while(K!==null&&K!==s);if(z===null?S=x:z.next=C,!Kn(x,n.memoizedState)&&(Qt=!0,te&&(o=Ws,o!==null)))throw o;n.memoizedState=x,n.baseState=S,n.baseQueue=z,c.lastRenderedState=x}return p===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function Qd(n){var s=Gt(),o=s.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=n;var c=o.dispatch,p=o.pending,x=s.memoizedState;if(p!==null){o.pending=null;var S=p=p.next;do x=n(x,S.action),S=S.next;while(S!==p);Kn(x,s.memoizedState)||(Qt=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),o.lastRenderedState=x}return[x,c]}function Ng(n,s,o){var c=Ie,p=Gt(),x=et;if(x){if(o===void 0)throw Error(r(407));o=o()}else o=s();var S=!Kn((ht||p).memoizedState,o);if(S&&(p.memoizedState=o,Qt=!0),p=p.queue,Wd(Cg.bind(null,c,p,n),[n]),p.getSnapshot!==s||S||Xt!==null&&Xt.memoizedState.tag&1){if(c.flags|=2048,si(9,{destroy:void 0},Eg.bind(null,c,p,o,s),null),xt===null)throw Error(r(349));x||(sr&127)!==0||jg(c,s,o)}return o}function jg(n,s,o){n.flags|=16384,n={getSnapshot:s,value:o},s=Ie.updateQueue,s===null?(s=Jl(),Ie.updateQueue=s,s.stores=[n]):(o=s.stores,o===null?s.stores=[n]:o.push(n))}function Eg(n,s,o,c){s.value=o,s.getSnapshot=c,kg(s)&&Rg(n)}function Cg(n,s,o){return o(function(){kg(s)&&Rg(n)})}function kg(n){var s=n.getSnapshot;n=n.value;try{var o=s();return!Kn(n,o)}catch{return!0}}function Rg(n){var s=ls(n,2);s!==null&&Gn(s,n,2)}function Zd(n){var s=Tn();if(typeof n=="function"){var o=n;if(n=o(),xs){vt(!0);try{o()}finally{vt(!1)}}}return s.memoizedState=s.baseState=n,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:n},s}function Tg(n,s,o,c){return n.baseState=o,Xd(n,ht,typeof c=="function"?c:ir)}function Hw(n,s,o,c,p){if(ac(n))throw Error(r(485));if(n=s.action,n!==null){var x={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){x.listeners.push(S)}};A.T!==null?o(!0):x.isTransition=!1,c(x),o=s.pending,o===null?(x.next=s.pending=x,Ag(s,x)):(x.next=o.next,s.pending=o.next=x)}}function Ag(n,s){var o=s.action,c=s.payload,p=n.state;if(s.isTransition){var x=A.T,S={};A.T=S;try{var C=o(p,c),z=A.S;z!==null&&z(S,C),Lg(n,s,C)}catch(K){Jd(n,s,K)}finally{x!==null&&S.types!==null&&(x.types=S.types),A.T=x}}else try{x=o(p,c),Lg(n,s,x)}catch(K){Jd(n,s,K)}}function Lg(n,s,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Og(n,s,c)},function(c){return Jd(n,s,c)}):Og(n,s,o)}function Og(n,s,o){s.status="fulfilled",s.value=o,Dg(s),n.state=o,s=n.pending,s!==null&&(o=s.next,o===s?n.pending=null:(o=o.next,s.next=o,Ag(n,o)))}function Jd(n,s,o){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do s.status="rejected",s.reason=o,Dg(s),s=s.next;while(s!==c)}n.action=null}function Dg(n){n=n.listeners;for(var s=0;s<n.length;s++)(0,n[s])()}function Mg(n,s){return s}function zg(n,s){if(et){var o=xt.formState;if(o!==null){e:{var c=Ie;if(et){if(kt){t:{for(var p=kt,x=pa;p.nodeType!==8;){if(!x){p=null;break t}if(p=xa(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){kt=xa(p.nextSibling),c=p.data==="F!";break e}}Cr(c)}c=!1}c&&(s=o[0])}}return o=Tn(),o.memoizedState=o.baseState=s,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mg,lastRenderedState:s},o.queue=c,o=tx.bind(null,Ie,c),c.dispatch=o,c=Zd(!1),x=rf.bind(null,Ie,!1,c.queue),c=Tn(),p={state:s,dispatch:null,action:n,pending:null},c.queue=p,o=Hw.bind(null,Ie,p,x,o),p.dispatch=o,c.memoizedState=n,[s,o,!1]}function Ug(n){var s=Gt();return $g(s,ht,n)}function $g(n,s,o){if(s=Xd(n,s,Mg)[0],n=ec(ir)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var c=so(s)}catch(S){throw S===ei?Vl:S}else c=s;s=Gt();var p=s.queue,x=p.dispatch;return o!==s.memoizedState&&(Ie.flags|=2048,si(9,{destroy:void 0},Bw.bind(null,p,o),null)),[c,x,n]}function Bw(n,s){n.action=s}function Hg(n){var s=Gt(),o=ht;if(o!==null)return $g(s,o,n);Gt(),s=s.memoizedState,o=Gt();var c=o.queue.dispatch;return o.memoizedState=n,[s,c,!1]}function si(n,s,o,c){return n={tag:n,create:o,deps:c,inst:s,next:null},s=Ie.updateQueue,s===null&&(s=Jl(),Ie.updateQueue=s),o=s.lastEffect,o===null?s.lastEffect=n.next=n:(c=o.next,o.next=n,n.next=c,s.lastEffect=n),n}function Bg(){return Gt().memoizedState}function tc(n,s,o,c){var p=Tn();Ie.flags|=n,p.memoizedState=si(1|s,{destroy:void 0},o,c===void 0?null:c)}function nc(n,s,o,c){var p=Gt();c=c===void 0?null:c;var x=p.memoizedState.inst;ht!==null&&c!==null&&Gd(c,ht.memoizedState.deps)?p.memoizedState=si(s,x,o,c):(Ie.flags|=n,p.memoizedState=si(1|s,x,o,c))}function Ig(n,s){tc(8390656,8,n,s)}function Wd(n,s){nc(2048,8,n,s)}function Iw(n){Ie.flags|=4;var s=Ie.updateQueue;if(s===null)s=Jl(),Ie.updateQueue=s,s.events=[n];else{var o=s.events;o===null?s.events=[n]:o.push(n)}}function Pg(n){var s=Gt().memoizedState;return Iw({ref:s,nextImpl:n}),function(){if((ot&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function Gg(n,s){return nc(4,2,n,s)}function Vg(n,s){return nc(4,4,n,s)}function qg(n,s){if(typeof s=="function"){n=n();var o=s(n);return function(){typeof o=="function"?o():s(null)}}if(s!=null)return n=n(),s.current=n,function(){s.current=null}}function Fg(n,s,o){o=o!=null?o.concat([n]):null,nc(4,4,qg.bind(null,s,n),o)}function ef(){}function Yg(n,s){var o=Gt();s=s===void 0?null:s;var c=o.memoizedState;return s!==null&&Gd(s,c[1])?c[0]:(o.memoizedState=[n,s],n)}function Kg(n,s){var o=Gt();s=s===void 0?null:s;var c=o.memoizedState;if(s!==null&&Gd(s,c[1]))return c[0];if(c=n(),xs){vt(!0);try{n()}finally{vt(!1)}}return o.memoizedState=[c,s],c}function tf(n,s,o){return o===void 0||(sr&1073741824)!==0&&(Je&261930)===0?n.memoizedState=s:(n.memoizedState=o,n=Xx(),Ie.lanes|=n,zr|=n,o)}function Xg(n,s,o,c){return Kn(o,s)?o:ni.current!==null?(n=tf(n,o,c),Kn(n,s)||(Qt=!0),n):(sr&42)===0||(sr&1073741824)!==0&&(Je&261930)===0?(Qt=!0,n.memoizedState=o):(n=Xx(),Ie.lanes|=n,zr|=n,s)}function Qg(n,s,o,c,p){var x=G.p;G.p=x!==0&&8>x?x:8;var S=A.T,C={};A.T=C,rf(n,!1,s,o);try{var z=p(),K=A.S;if(K!==null&&K(C,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var te=zw(z,c);io(n,s,te,ea(n))}else io(n,s,c,ea(n))}catch(ue){io(n,s,{then:function(){},status:"rejected",reason:ue},ea())}finally{G.p=x,S!==null&&C.types!==null&&(S.types=C.types),A.T=S}}function Pw(){}function nf(n,s,o,c){if(n.tag!==5)throw Error(r(476));var p=Zg(n).queue;Qg(n,p,s,ae,o===null?Pw:function(){return Jg(n),o(c)})}function Zg(n){var s=n.memoizedState;if(s!==null)return s;s={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:ae},next:null};var o={};return s.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:o},next:null},n.memoizedState=s,n=n.alternate,n!==null&&(n.memoizedState=s),s}function Jg(n){var s=Zg(n);s.next===null&&(s=n.alternate.memoizedState),io(n,s.next.queue,{},ea())}function af(){return gn(No)}function Wg(){return Gt().memoizedState}function ex(){return Gt().memoizedState}function Gw(n){for(var s=n.return;s!==null;){switch(s.tag){case 24:case 3:var o=ea();n=Tr(o);var c=Ar(s,n,o);c!==null&&(Gn(c,s,o),to(c,s,o)),s={cache:Ld()},n.payload=s;return}s=s.return}}function Vw(n,s,o){var c=ea();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ac(n)?nx(s,o):(o=_d(n,s,o,c),o!==null&&(Gn(o,n,c),ax(o,s,c)))}function tx(n,s,o){var c=ea();io(n,s,o,c)}function io(n,s,o,c){var p={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(ac(n))nx(s,p);else{var x=n.alternate;if(n.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var S=s.lastRenderedState,C=x(S,o);if(p.hasEagerState=!0,p.eagerState=C,Kn(C,S))return Ul(n,s,p,0),xt===null&&zl(),!1}catch{}if(o=_d(n,s,p,c),o!==null)return Gn(o,n,c),ax(o,s,c),!0}return!1}function rf(n,s,o,c){if(c={lane:2,revertLane:Uf(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},ac(n)){if(s)throw Error(r(479))}else s=_d(n,o,c,2),s!==null&&Gn(s,n,2)}function ac(n){var s=n.alternate;return n===Ie||s!==null&&s===Ie}function nx(n,s){ai=Ql=!0;var o=n.pending;o===null?s.next=s:(s.next=o.next,o.next=s),n.pending=s}function ax(n,s,o){if((o&4194048)!==0){var c=s.lanes;c&=n.pendingLanes,o|=c,s.lanes=o,ca(n,o)}}var oo={readContext:gn,use:Wl,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt};oo.useEffectEvent=zt;var rx={readContext:gn,use:Wl,useCallback:function(n,s){return Tn().memoizedState=[n,s===void 0?null:s],n},useContext:gn,useEffect:Ig,useImperativeHandle:function(n,s,o){o=o!=null?o.concat([n]):null,tc(4194308,4,qg.bind(null,s,n),o)},useLayoutEffect:function(n,s){return tc(4194308,4,n,s)},useInsertionEffect:function(n,s){tc(4,2,n,s)},useMemo:function(n,s){var o=Tn();s=s===void 0?null:s;var c=n();if(xs){vt(!0);try{n()}finally{vt(!1)}}return o.memoizedState=[c,s],c},useReducer:function(n,s,o){var c=Tn();if(o!==void 0){var p=o(s);if(xs){vt(!0);try{o(s)}finally{vt(!1)}}}else p=s;return c.memoizedState=c.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},c.queue=n,n=n.dispatch=Vw.bind(null,Ie,n),[c.memoizedState,n]},useRef:function(n){var s=Tn();return n={current:n},s.memoizedState=n},useState:function(n){n=Zd(n);var s=n.queue,o=tx.bind(null,Ie,s);return s.dispatch=o,[n.memoizedState,o]},useDebugValue:ef,useDeferredValue:function(n,s){var o=Tn();return tf(o,n,s)},useTransition:function(){var n=Zd(!1);return n=Qg.bind(null,Ie,n.queue,!0,!1),Tn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,s,o){var c=Ie,p=Tn();if(et){if(o===void 0)throw Error(r(407));o=o()}else{if(o=s(),xt===null)throw Error(r(349));(Je&127)!==0||jg(c,s,o)}p.memoizedState=o;var x={value:o,getSnapshot:s};return p.queue=x,Ig(Cg.bind(null,c,x,n),[n]),c.flags|=2048,si(9,{destroy:void 0},Eg.bind(null,c,x,o,s),null),o},useId:function(){var n=Tn(),s=xt.identifierPrefix;if(et){var o=Ha,c=$a;o=(c&~(1<<32-Ft(c)-1)).toString(32)+o,s="_"+s+"R_"+o,o=Zl++,0<o&&(s+="H"+o.toString(32)),s+="_"}else o=Uw++,s="_"+s+"r_"+o.toString(32)+"_";return n.memoizedState=s},useHostTransitionStatus:af,useFormState:zg,useActionState:zg,useOptimistic:function(n){var s=Tn();s.memoizedState=s.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=o,s=rf.bind(null,Ie,!0,o),o.dispatch=s,[n,s]},useMemoCache:Kd,useCacheRefresh:function(){return Tn().memoizedState=Gw.bind(null,Ie)},useEffectEvent:function(n){var s=Tn(),o={impl:n};return s.memoizedState=o,function(){if((ot&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},sf={readContext:gn,use:Wl,useCallback:Yg,useContext:gn,useEffect:Wd,useImperativeHandle:Fg,useInsertionEffect:Gg,useLayoutEffect:Vg,useMemo:Kg,useReducer:ec,useRef:Bg,useState:function(){return ec(ir)},useDebugValue:ef,useDeferredValue:function(n,s){var o=Gt();return Xg(o,ht.memoizedState,n,s)},useTransition:function(){var n=ec(ir)[0],s=Gt().memoizedState;return[typeof n=="boolean"?n:so(n),s]},useSyncExternalStore:Ng,useId:Wg,useHostTransitionStatus:af,useFormState:Ug,useActionState:Ug,useOptimistic:function(n,s){var o=Gt();return Tg(o,ht,n,s)},useMemoCache:Kd,useCacheRefresh:ex};sf.useEffectEvent=Pg;var sx={readContext:gn,use:Wl,useCallback:Yg,useContext:gn,useEffect:Wd,useImperativeHandle:Fg,useInsertionEffect:Gg,useLayoutEffect:Vg,useMemo:Kg,useReducer:Qd,useRef:Bg,useState:function(){return Qd(ir)},useDebugValue:ef,useDeferredValue:function(n,s){var o=Gt();return ht===null?tf(o,n,s):Xg(o,ht.memoizedState,n,s)},useTransition:function(){var n=Qd(ir)[0],s=Gt().memoizedState;return[typeof n=="boolean"?n:so(n),s]},useSyncExternalStore:Ng,useId:Wg,useHostTransitionStatus:af,useFormState:Hg,useActionState:Hg,useOptimistic:function(n,s){var o=Gt();return ht!==null?Tg(o,ht,n,s):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:Kd,useCacheRefresh:ex};sx.useEffectEvent=Pg;function of(n,s,o,c){s=n.memoizedState,o=o(c,s),o=o==null?s:y({},s,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var lf={enqueueSetState:function(n,s,o){n=n._reactInternals;var c=ea(),p=Tr(c);p.payload=s,o!=null&&(p.callback=o),s=Ar(n,p,c),s!==null&&(Gn(s,n,c),to(s,n,c))},enqueueReplaceState:function(n,s,o){n=n._reactInternals;var c=ea(),p=Tr(c);p.tag=1,p.payload=s,o!=null&&(p.callback=o),s=Ar(n,p,c),s!==null&&(Gn(s,n,c),to(s,n,c))},enqueueForceUpdate:function(n,s){n=n._reactInternals;var o=ea(),c=Tr(o);c.tag=2,s!=null&&(c.callback=s),s=Ar(n,c,o),s!==null&&(Gn(s,n,o),to(s,n,o))}};function ix(n,s,o,c,p,x,S){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,x,S):s.prototype&&s.prototype.isPureReactComponent?!Yi(o,c)||!Yi(p,x):!0}function ox(n,s,o,c){n=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(o,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(o,c),s.state!==n&&lf.enqueueReplaceState(s,s.state,null)}function ys(n,s){var o=s;if("ref"in s){o={};for(var c in s)c!=="ref"&&(o[c]=s[c])}if(n=n.defaultProps){o===s&&(o=y({},o));for(var p in n)o[p]===void 0&&(o[p]=n[p])}return o}function lx(n){Ml(n)}function cx(n){console.error(n)}function ux(n){Ml(n)}function rc(n,s){try{var o=n.onUncaughtError;o(s.value,{componentStack:s.stack})}catch(c){setTimeout(function(){throw c})}}function dx(n,s,o){try{var c=n.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function cf(n,s,o){return o=Tr(o),o.tag=3,o.payload={element:null},o.callback=function(){rc(n,s)},o}function fx(n){return n=Tr(n),n.tag=3,n}function hx(n,s,o,c){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var x=c.value;n.payload=function(){return p(x)},n.callback=function(){dx(s,o,c)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(n.callback=function(){dx(s,o,c),typeof p!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var C=c.stack;this.componentDidCatch(c.value,{componentStack:C!==null?C:""})})}function qw(n,s,o,c,p){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(s=o.alternate,s!==null&&Zs(s,o,p,!0),o=Qn.current,o!==null){switch(o.tag){case 31:case 13:return ga===null?gc():o.alternate===null&&Ut===0&&(Ut=3),o.flags&=-257,o.flags|=65536,o.lanes=p,c===ql?o.flags|=16384:(s=o.updateQueue,s===null?o.updateQueue=new Set([c]):s.add(c),Df(n,c,p)),!1;case 22:return o.flags|=65536,c===ql?o.flags|=16384:(s=o.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=s):(o=s.retryQueue,o===null?s.retryQueue=new Set([c]):o.add(c)),Df(n,c,p)),!1}throw Error(r(435,o.tag))}return Df(n,c,p),gc(),!1}if(et)return s=Qn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=p,c!==Cd&&(n=Error(r(422),{cause:c}),Qi(fa(n,o)))):(c!==Cd&&(s=Error(r(423),{cause:c}),Qi(fa(s,o))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,c=fa(c,o),p=cf(n.stateNode,c,p),$d(n,p),Ut!==4&&(Ut=2)),!1;var x=Error(r(520),{cause:c});if(x=fa(x,o),go===null?go=[x]:go.push(x),Ut!==4&&(Ut=2),s===null)return!0;c=fa(c,o),o=s;do{switch(o.tag){case 3:return o.flags|=65536,n=p&-p,o.lanes|=n,n=cf(o.stateNode,c,n),$d(o,n),!1;case 1:if(s=o.type,x=o.stateNode,(o.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Ur===null||!Ur.has(x))))return o.flags|=65536,p&=-p,o.lanes|=p,p=fx(p),hx(p,n,o,c),$d(o,p),!1}o=o.return}while(o!==null);return!1}var uf=Error(r(461)),Qt=!1;function xn(n,s,o,c){s.child=n===null?xg(s,null,o,c):gs(s,n.child,o,c)}function mx(n,s,o,c,p){o=o.render;var x=s.ref;if("ref"in c){var S={};for(var C in c)C!=="ref"&&(S[C]=c[C])}else S=c;return fs(s),c=Vd(n,s,o,S,x,p),C=qd(),n!==null&&!Qt?(Fd(n,s,p),or(n,s,p)):(et&&C&&jd(s),s.flags|=1,xn(n,s,c,p),s.child)}function px(n,s,o,c,p){if(n===null){var x=o.type;return typeof x=="function"&&!Sd(x)&&x.defaultProps===void 0&&o.compare===null?(s.tag=15,s.type=x,gx(n,s,x,c,p)):(n=Hl(o.type,null,c,s,s.mode,p),n.ref=s.ref,n.return=s,s.child=n)}if(x=n.child,!yf(n,p)){var S=x.memoizedProps;if(o=o.compare,o=o!==null?o:Yi,o(S,c)&&n.ref===s.ref)return or(n,s,p)}return s.flags|=1,n=tr(x,c),n.ref=s.ref,n.return=s,s.child=n}function gx(n,s,o,c,p){if(n!==null){var x=n.memoizedProps;if(Yi(x,c)&&n.ref===s.ref)if(Qt=!1,s.pendingProps=c=x,yf(n,p))(n.flags&131072)!==0&&(Qt=!0);else return s.lanes=n.lanes,or(n,s,p)}return df(n,s,o,c,p)}function xx(n,s,o,c){var p=c.children,x=n!==null?n.memoizedState:null;if(n===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|o:o,n!==null){for(c=s.child=n.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~x}else c=0,s.child=null;return yx(n,s,x,o,c)}if((o&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},n!==null&&Gl(s,x!==null?x.cachePool:null),x!==null?bg(s,x):Bd(),_g(s);else return c=s.lanes=536870912,yx(n,s,x!==null?x.baseLanes|o:o,o,c)}else x!==null?(Gl(s,x.cachePool),bg(s,x),Or(),s.memoizedState=null):(n!==null&&Gl(s,null),Bd(),Or());return xn(n,s,p,o),s.child}function lo(n,s){return n!==null&&n.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function yx(n,s,o,c,p){var x=Dd();return x=x===null?null:{parent:Kt._currentValue,pool:x},s.memoizedState={baseLanes:o,cachePool:x},n!==null&&Gl(s,null),Bd(),_g(s),n!==null&&Zs(n,s,c,!0),s.childLanes=p,null}function sc(n,s){return s=oc({mode:s.mode,children:s.children},n.mode),s.ref=n.ref,n.child=s,s.return=n,s}function vx(n,s,o){return gs(s,n.child,null,o),n=sc(s,s.pendingProps),n.flags|=2,Zn(s),s.memoizedState=null,n}function Fw(n,s,o){var c=s.pendingProps,p=(s.flags&128)!==0;if(s.flags&=-129,n===null){if(et){if(c.mode==="hidden")return n=sc(s,c),s.lanes=536870912,lo(null,n);if(Pd(s),(n=kt)?(n=Ay(n,pa),n=n!==null&&n.data==="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:jr!==null?{id:$a,overflow:Ha}:null,retryLane:536870912,hydrationErrors:null},o=ng(n),o.return=s,s.child=o,pn=s,kt=null)):n=null,n===null)throw Cr(s);return s.lanes=536870912,null}return sc(s,c)}var x=n.memoizedState;if(x!==null){var S=x.dehydrated;if(Pd(s),p)if(s.flags&256)s.flags&=-257,s=vx(n,s,o);else if(s.memoizedState!==null)s.child=n.child,s.flags|=128,s=null;else throw Error(r(558));else if(Qt||Zs(n,s,o,!1),p=(o&n.childLanes)!==0,Qt||p){if(c=xt,c!==null&&(S=M(c,o),S!==0&&S!==x.retryLane))throw x.retryLane=S,ls(n,S),Gn(c,n,S),uf;gc(),s=vx(n,s,o)}else n=x.treeContext,kt=xa(S.nextSibling),pn=s,et=!0,Er=null,pa=!1,n!==null&&sg(s,n),s=sc(s,c),s.flags|=4096;return s}return n=tr(n.child,{mode:c.mode,children:c.children}),n.ref=s.ref,s.child=n,n.return=s,n}function ic(n,s){var o=s.ref;if(o===null)n!==null&&n.ref!==null&&(s.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(r(284));(n===null||n.ref!==o)&&(s.flags|=4194816)}}function df(n,s,o,c,p){return fs(s),o=Vd(n,s,o,c,void 0,p),c=qd(),n!==null&&!Qt?(Fd(n,s,p),or(n,s,p)):(et&&c&&jd(s),s.flags|=1,xn(n,s,o,p),s.child)}function bx(n,s,o,c,p,x){return fs(s),s.updateQueue=null,o=wg(s,c,o,p),Sg(n),c=qd(),n!==null&&!Qt?(Fd(n,s,x),or(n,s,x)):(et&&c&&jd(s),s.flags|=1,xn(n,s,o,x),s.child)}function _x(n,s,o,c,p){if(fs(s),s.stateNode===null){var x=Ys,S=o.contextType;typeof S=="object"&&S!==null&&(x=gn(S)),x=new o(c,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=lf,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=c,x.state=s.memoizedState,x.refs={},zd(s),S=o.contextType,x.context=typeof S=="object"&&S!==null?gn(S):Ys,x.state=s.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(of(s,o,S,c),x.state=s.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(S=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),S!==x.state&&lf.enqueueReplaceState(x,x.state,null),ao(s,c,x,p),no(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),c=!0}else if(n===null){x=s.stateNode;var C=s.memoizedProps,z=ys(o,C);x.props=z;var K=x.context,te=o.contextType;S=Ys,typeof te=="object"&&te!==null&&(S=gn(te));var ue=o.getDerivedStateFromProps;te=typeof ue=="function"||typeof x.getSnapshotBeforeUpdate=="function",C=s.pendingProps!==C,te||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(C||K!==S)&&ox(s,x,c,S),Rr=!1;var Q=s.memoizedState;x.state=Q,ao(s,c,x,p),no(),K=s.memoizedState,C||Q!==K||Rr?(typeof ue=="function"&&(of(s,o,ue,c),K=s.memoizedState),(z=Rr||ix(s,o,z,c,Q,K,S))?(te||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=K),x.props=c,x.state=K,x.context=S,c=z):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{x=s.stateNode,Ud(n,s),S=s.memoizedProps,te=ys(o,S),x.props=te,ue=s.pendingProps,Q=x.context,K=o.contextType,z=Ys,typeof K=="object"&&K!==null&&(z=gn(K)),C=o.getDerivedStateFromProps,(K=typeof C=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(S!==ue||Q!==z)&&ox(s,x,c,z),Rr=!1,Q=s.memoizedState,x.state=Q,ao(s,c,x,p),no();var W=s.memoizedState;S!==ue||Q!==W||Rr||n!==null&&n.dependencies!==null&&Il(n.dependencies)?(typeof C=="function"&&(of(s,o,C,c),W=s.memoizedState),(te=Rr||ix(s,o,te,c,Q,W,z)||n!==null&&n.dependencies!==null&&Il(n.dependencies))?(K||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,W,z),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,W,z)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||S===n.memoizedProps&&Q===n.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&Q===n.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=W),x.props=c,x.state=W,x.context=z,c=te):(typeof x.componentDidUpdate!="function"||S===n.memoizedProps&&Q===n.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&Q===n.memoizedState||(s.flags|=1024),c=!1)}return x=c,ic(n,s),c=(s.flags&128)!==0,x||c?(x=s.stateNode,o=c&&typeof o.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,n!==null&&c?(s.child=gs(s,n.child,null,p),s.child=gs(s,null,o,p)):xn(n,s,o,p),s.memoizedState=x.state,n=s.child):n=or(n,s,p),n}function Sx(n,s,o,c){return us(),s.flags|=256,xn(n,s,o,c),s.child}var ff={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hf(n){return{baseLanes:n,cachePool:dg()}}function mf(n,s,o){return n=n!==null?n.childLanes&~o:0,s&&(n|=Wn),n}function wx(n,s,o){var c=s.pendingProps,p=!1,x=(s.flags&128)!==0,S;if((S=x)||(S=n!==null&&n.memoizedState===null?!1:(Pt.current&2)!==0),S&&(p=!0,s.flags&=-129),S=(s.flags&32)!==0,s.flags&=-33,n===null){if(et){if(p?Lr(s):Or(),(n=kt)?(n=Ay(n,pa),n=n!==null&&n.data!=="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:jr!==null?{id:$a,overflow:Ha}:null,retryLane:536870912,hydrationErrors:null},o=ng(n),o.return=s,s.child=o,pn=s,kt=null)):n=null,n===null)throw Cr(s);return Qf(n)?s.lanes=32:s.lanes=536870912,null}var C=c.children;return c=c.fallback,p?(Or(),p=s.mode,C=oc({mode:"hidden",children:C},p),c=cs(c,p,o,null),C.return=s,c.return=s,C.sibling=c,s.child=C,c=s.child,c.memoizedState=hf(o),c.childLanes=mf(n,S,o),s.memoizedState=ff,lo(null,c)):(Lr(s),pf(s,C))}var z=n.memoizedState;if(z!==null&&(C=z.dehydrated,C!==null)){if(x)s.flags&256?(Lr(s),s.flags&=-257,s=gf(n,s,o)):s.memoizedState!==null?(Or(),s.child=n.child,s.flags|=128,s=null):(Or(),C=c.fallback,p=s.mode,c=oc({mode:"visible",children:c.children},p),C=cs(C,p,o,null),C.flags|=2,c.return=s,C.return=s,c.sibling=C,s.child=c,gs(s,n.child,null,o),c=s.child,c.memoizedState=hf(o),c.childLanes=mf(n,S,o),s.memoizedState=ff,s=lo(null,c));else if(Lr(s),Qf(C)){if(S=C.nextSibling&&C.nextSibling.dataset,S)var K=S.dgst;S=K,c=Error(r(419)),c.stack="",c.digest=S,Qi({value:c,source:null,stack:null}),s=gf(n,s,o)}else if(Qt||Zs(n,s,o,!1),S=(o&n.childLanes)!==0,Qt||S){if(S=xt,S!==null&&(c=M(S,o),c!==0&&c!==z.retryLane))throw z.retryLane=c,ls(n,c),Gn(S,n,c),uf;Xf(C)||gc(),s=gf(n,s,o)}else Xf(C)?(s.flags|=192,s.child=n.child,s=null):(n=z.treeContext,kt=xa(C.nextSibling),pn=s,et=!0,Er=null,pa=!1,n!==null&&sg(s,n),s=pf(s,c.children),s.flags|=4096);return s}return p?(Or(),C=c.fallback,p=s.mode,z=n.child,K=z.sibling,c=tr(z,{mode:"hidden",children:c.children}),c.subtreeFlags=z.subtreeFlags&65011712,K!==null?C=tr(K,C):(C=cs(C,p,o,null),C.flags|=2),C.return=s,c.return=s,c.sibling=C,s.child=c,lo(null,c),c=s.child,C=n.child.memoizedState,C===null?C=hf(o):(p=C.cachePool,p!==null?(z=Kt._currentValue,p=p.parent!==z?{parent:z,pool:z}:p):p=dg(),C={baseLanes:C.baseLanes|o,cachePool:p}),c.memoizedState=C,c.childLanes=mf(n,S,o),s.memoizedState=ff,lo(n.child,c)):(Lr(s),o=n.child,n=o.sibling,o=tr(o,{mode:"visible",children:c.children}),o.return=s,o.sibling=null,n!==null&&(S=s.deletions,S===null?(s.deletions=[n],s.flags|=16):S.push(n)),s.child=o,s.memoizedState=null,o)}function pf(n,s){return s=oc({mode:"visible",children:s},n.mode),s.return=n,n.child=s}function oc(n,s){return n=Xn(22,n,null,s),n.lanes=0,n}function gf(n,s,o){return gs(s,n.child,null,o),n=pf(s,s.pendingProps.children),n.flags|=2,s.memoizedState=null,n}function Nx(n,s,o){n.lanes|=s;var c=n.alternate;c!==null&&(c.lanes|=s),Td(n.return,s,o)}function xf(n,s,o,c,p,x){var S=n.memoizedState;S===null?n.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:p,treeForkCount:x}:(S.isBackwards=s,S.rendering=null,S.renderingStartTime=0,S.last=c,S.tail=o,S.tailMode=p,S.treeForkCount=x)}function jx(n,s,o){var c=s.pendingProps,p=c.revealOrder,x=c.tail;c=c.children;var S=Pt.current,C=(S&2)!==0;if(C?(S=S&1|2,s.flags|=128):S&=1,re(Pt,S),xn(n,s,c,o),c=et?Xi:0,!C&&n!==null&&(n.flags&128)!==0)e:for(n=s.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Nx(n,o,s);else if(n.tag===19)Nx(n,o,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(p){case"forwards":for(o=s.child,p=null;o!==null;)n=o.alternate,n!==null&&Xl(n)===null&&(p=o),o=o.sibling;o=p,o===null?(p=s.child,s.child=null):(p=o.sibling,o.sibling=null),xf(s,!1,p,o,x,c);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=s.child,s.child=null;p!==null;){if(n=p.alternate,n!==null&&Xl(n)===null){s.child=p;break}n=p.sibling,p.sibling=o,o=p,p=n}xf(s,!0,o,null,x,c);break;case"together":xf(s,!1,null,null,void 0,c);break;default:s.memoizedState=null}return s.child}function or(n,s,o){if(n!==null&&(s.dependencies=n.dependencies),zr|=s.lanes,(o&s.childLanes)===0)if(n!==null){if(Zs(n,s,o,!1),(o&s.childLanes)===0)return null}else return null;if(n!==null&&s.child!==n.child)throw Error(r(153));if(s.child!==null){for(n=s.child,o=tr(n,n.pendingProps),s.child=o,o.return=s;n.sibling!==null;)n=n.sibling,o=o.sibling=tr(n,n.pendingProps),o.return=s;o.sibling=null}return s.child}function yf(n,s){return(n.lanes&s)!==0?!0:(n=n.dependencies,!!(n!==null&&Il(n)))}function Yw(n,s,o){switch(s.tag){case 3:Me(s,s.stateNode.containerInfo),kr(s,Kt,n.memoizedState.cache),us();break;case 27:case 5:vn(s);break;case 4:Me(s,s.stateNode.containerInfo);break;case 10:kr(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Pd(s),null;break;case 13:var c=s.memoizedState;if(c!==null)return c.dehydrated!==null?(Lr(s),s.flags|=128,null):(o&s.child.childLanes)!==0?wx(n,s,o):(Lr(s),n=or(n,s,o),n!==null?n.sibling:null);Lr(s);break;case 19:var p=(n.flags&128)!==0;if(c=(o&s.childLanes)!==0,c||(Zs(n,s,o,!1),c=(o&s.childLanes)!==0),p){if(c)return jx(n,s,o);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),re(Pt,Pt.current),c)break;return null;case 22:return s.lanes=0,xx(n,s,o,s.pendingProps);case 24:kr(s,Kt,n.memoizedState.cache)}return or(n,s,o)}function Ex(n,s,o){if(n!==null)if(n.memoizedProps!==s.pendingProps)Qt=!0;else{if(!yf(n,o)&&(s.flags&128)===0)return Qt=!1,Yw(n,s,o);Qt=(n.flags&131072)!==0}else Qt=!1,et&&(s.flags&1048576)!==0&&rg(s,Xi,s.index);switch(s.lanes=0,s.tag){case 16:e:{var c=s.pendingProps;if(n=ms(s.elementType),s.type=n,typeof n=="function")Sd(n)?(c=ys(n,c),s.tag=1,s=_x(null,s,n,c,o)):(s.tag=0,s=df(null,s,n,c,o));else{if(n!=null){var p=n.$$typeof;if(p===O){s.tag=11,s=mx(null,s,n,c,o);break e}else if(p===H){s.tag=14,s=px(null,s,n,c,o);break e}}throw s=D(n)||n,Error(r(306,s,""))}}return s;case 0:return df(n,s,s.type,s.pendingProps,o);case 1:return c=s.type,p=ys(c,s.pendingProps),_x(n,s,c,p,o);case 3:e:{if(Me(s,s.stateNode.containerInfo),n===null)throw Error(r(387));c=s.pendingProps;var x=s.memoizedState;p=x.element,Ud(n,s),ao(s,c,null,o);var S=s.memoizedState;if(c=S.cache,kr(s,Kt,c),c!==x.cache&&Ad(s,[Kt],o,!0),no(),c=S.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:S.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=Sx(n,s,c,o);break e}else if(c!==p){p=fa(Error(r(424)),s),Qi(p),s=Sx(n,s,c,o);break e}else for(n=s.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,kt=xa(n.firstChild),pn=s,et=!0,Er=null,pa=!0,o=xg(s,null,c,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(us(),c===p){s=or(n,s,o);break e}xn(n,s,c,o)}s=s.child}return s;case 26:return ic(n,s),n===null?(o=Uy(s.type,null,s.pendingProps,null))?s.memoizedState=o:et||(o=s.type,n=s.pendingProps,c=wc(xe.current).createElement(o),c[pe]=s,c[ve]=n,yn(c,o,n),_t(c),s.stateNode=c):s.memoizedState=Uy(s.type,n.memoizedProps,s.pendingProps,n.memoizedState),null;case 27:return vn(s),n===null&&et&&(c=s.stateNode=Dy(s.type,s.pendingProps,xe.current),pn=s,pa=!0,p=kt,Ir(s.type)?(Zf=p,kt=xa(c.firstChild)):kt=p),xn(n,s,s.pendingProps.children,o),ic(n,s),n===null&&(s.flags|=4194304),s.child;case 5:return n===null&&et&&((p=c=kt)&&(c=w4(c,s.type,s.pendingProps,pa),c!==null?(s.stateNode=c,pn=s,kt=xa(c.firstChild),pa=!1,p=!0):p=!1),p||Cr(s)),vn(s),p=s.type,x=s.pendingProps,S=n!==null?n.memoizedProps:null,c=x.children,Ff(p,x)?c=null:S!==null&&Ff(p,S)&&(s.flags|=32),s.memoizedState!==null&&(p=Vd(n,s,$w,null,null,o),No._currentValue=p),ic(n,s),xn(n,s,c,o),s.child;case 6:return n===null&&et&&((n=o=kt)&&(o=N4(o,s.pendingProps,pa),o!==null?(s.stateNode=o,pn=s,kt=null,n=!0):n=!1),n||Cr(s)),null;case 13:return wx(n,s,o);case 4:return Me(s,s.stateNode.containerInfo),c=s.pendingProps,n===null?s.child=gs(s,null,c,o):xn(n,s,c,o),s.child;case 11:return mx(n,s,s.type,s.pendingProps,o);case 7:return xn(n,s,s.pendingProps,o),s.child;case 8:return xn(n,s,s.pendingProps.children,o),s.child;case 12:return xn(n,s,s.pendingProps.children,o),s.child;case 10:return c=s.pendingProps,kr(s,s.type,c.value),xn(n,s,c.children,o),s.child;case 9:return p=s.type._context,c=s.pendingProps.children,fs(s),p=gn(p),c=c(p),s.flags|=1,xn(n,s,c,o),s.child;case 14:return px(n,s,s.type,s.pendingProps,o);case 15:return gx(n,s,s.type,s.pendingProps,o);case 19:return jx(n,s,o);case 31:return Fw(n,s,o);case 22:return xx(n,s,o,s.pendingProps);case 24:return fs(s),c=gn(Kt),n===null?(p=Dd(),p===null&&(p=xt,x=Ld(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=o),p=x),s.memoizedState={parent:c,cache:p},zd(s),kr(s,Kt,p)):((n.lanes&o)!==0&&(Ud(n,s),ao(s,null,null,o),no()),p=n.memoizedState,x=s.memoizedState,p.parent!==c?(p={parent:c,cache:c},s.memoizedState=p,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=p),kr(s,Kt,c)):(c=x.cache,kr(s,Kt,c),c!==p.cache&&Ad(s,[Kt],o,!0))),xn(n,s,s.pendingProps.children,o),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function lr(n){n.flags|=4}function vf(n,s,o,c,p){if((s=(n.mode&32)!==0)&&(s=!1),s){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(Wx())n.flags|=8192;else throw ps=ql,Md}else n.flags&=-16777217}function Cx(n,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Py(s))if(Wx())n.flags|=8192;else throw ps=ql,Md}function lc(n,s){s!==null&&(n.flags|=4),n.flags&16384&&(s=n.tag!==22?Ue():536870912,n.lanes|=s,ci|=s)}function co(n,s){if(!et)switch(n.tailMode){case"hidden":s=n.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?s||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function Rt(n){var s=n.alternate!==null&&n.alternate.child===n.child,o=0,c=0;if(s)for(var p=n.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=c,n.childLanes=o,s}function Kw(n,s,o){var c=s.pendingProps;switch(Ed(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(s),null;case 1:return Rt(s),null;case 3:return o=s.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),rr(Kt),qe(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(Qs(s)?lr(s):n===null||n.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,kd())),Rt(s),null;case 26:var p=s.type,x=s.memoizedState;return n===null?(lr(s),x!==null?(Rt(s),Cx(s,x)):(Rt(s),vf(s,p,null,c,o))):x?x!==n.memoizedState?(lr(s),Rt(s),Cx(s,x)):(Rt(s),s.flags&=-16777217):(n=n.memoizedProps,n!==c&&lr(s),Rt(s),vf(s,p,n,c,o)),null;case 27:if(zn(s),o=xe.current,p=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==c&&lr(s);else{if(!c){if(s.stateNode===null)throw Error(r(166));return Rt(s),null}n=ie.current,Qs(s)?ig(s):(n=Dy(p,c,o),s.stateNode=n,lr(s))}return Rt(s),null;case 5:if(zn(s),p=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==c&&lr(s);else{if(!c){if(s.stateNode===null)throw Error(r(166));return Rt(s),null}if(x=ie.current,Qs(s))ig(s);else{var S=wc(xe.current);switch(x){case 1:x=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:x=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":x=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":x=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":x=S.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?S.createElement("select",{is:c.is}):S.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?S.createElement(p,{is:c.is}):S.createElement(p)}}x[pe]=s,x[ve]=c;e:for(S=s.child;S!==null;){if(S.tag===5||S.tag===6)x.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===s)break e;for(;S.sibling===null;){if(S.return===null||S.return===s)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}s.stateNode=x;e:switch(yn(x,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&lr(s)}}return Rt(s),vf(s,s.type,n===null?null:n.memoizedProps,s.pendingProps,o),null;case 6:if(n&&s.stateNode!=null)n.memoizedProps!==c&&lr(s);else{if(typeof c!="string"&&s.stateNode===null)throw Error(r(166));if(n=xe.current,Qs(s)){if(n=s.stateNode,o=s.memoizedProps,c=null,p=pn,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}n[pe]=s,n=!!(n.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||wy(n.nodeValue,o)),n||Cr(s,!0)}else n=wc(n).createTextNode(c),n[pe]=s,s.stateNode=n}return Rt(s),null;case 31:if(o=s.memoizedState,n===null||n.memoizedState!==null){if(c=Qs(s),o!==null){if(n===null){if(!c)throw Error(r(318));if(n=s.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(557));n[pe]=s}else us(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Rt(s),n=!1}else o=kd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return s.flags&256?(Zn(s),s):(Zn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Rt(s),null;case 13:if(c=s.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=Qs(s),c!==null&&c.dehydrated!==null){if(n===null){if(!p)throw Error(r(318));if(p=s.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[pe]=s}else us(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Rt(s),p=!1}else p=kd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return s.flags&256?(Zn(s),s):(Zn(s),null)}return Zn(s),(s.flags&128)!==0?(s.lanes=o,s):(o=c!==null,n=n!==null&&n.memoizedState!==null,o&&(c=s.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==p&&(c.flags|=2048)),o!==n&&o&&(s.child.flags|=8192),lc(s,s.updateQueue),Rt(s),null);case 4:return qe(),n===null&&If(s.stateNode.containerInfo),Rt(s),null;case 10:return rr(s.type),Rt(s),null;case 19:if(q(Pt),c=s.memoizedState,c===null)return Rt(s),null;if(p=(s.flags&128)!==0,x=c.rendering,x===null)if(p)co(c,!1);else{if(Ut!==0||n!==null&&(n.flags&128)!==0)for(n=s.child;n!==null;){if(x=Xl(n),x!==null){for(s.flags|=128,co(c,!1),n=x.updateQueue,s.updateQueue=n,lc(s,n),s.subtreeFlags=0,n=o,o=s.child;o!==null;)tg(o,n),o=o.sibling;return re(Pt,Pt.current&1|2),et&&nr(s,c.treeForkCount),s.child}n=n.sibling}c.tail!==null&&jt()>hc&&(s.flags|=128,p=!0,co(c,!1),s.lanes=4194304)}else{if(!p)if(n=Xl(x),n!==null){if(s.flags|=128,p=!0,n=n.updateQueue,s.updateQueue=n,lc(s,n),co(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!et)return Rt(s),null}else 2*jt()-c.renderingStartTime>hc&&o!==536870912&&(s.flags|=128,p=!0,co(c,!1),s.lanes=4194304);c.isBackwards?(x.sibling=s.child,s.child=x):(n=c.last,n!==null?n.sibling=x:s.child=x,c.last=x)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=jt(),n.sibling=null,o=Pt.current,re(Pt,p?o&1|2:o&1),et&&nr(s,c.treeForkCount),n):(Rt(s),null);case 22:case 23:return Zn(s),Id(),c=s.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(s.flags|=8192):c&&(s.flags|=8192),c?(o&536870912)!==0&&(s.flags&128)===0&&(Rt(s),s.subtreeFlags&6&&(s.flags|=8192)):Rt(s),o=s.updateQueue,o!==null&&lc(s,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048),n!==null&&q(hs),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),rr(Kt),Rt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function Xw(n,s){switch(Ed(s),s.tag){case 1:return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return rr(Kt),qe(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 26:case 27:case 5:return zn(s),null;case 31:if(s.memoizedState!==null){if(Zn(s),s.alternate===null)throw Error(r(340));us()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 13:if(Zn(s),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(r(340));us()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return q(Pt),null;case 4:return qe(),null;case 10:return rr(s.type),null;case 22:case 23:return Zn(s),Id(),n!==null&&q(hs),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 24:return rr(Kt),null;case 25:return null;default:return null}}function kx(n,s){switch(Ed(s),s.tag){case 3:rr(Kt),qe();break;case 26:case 27:case 5:zn(s);break;case 4:qe();break;case 31:s.memoizedState!==null&&Zn(s);break;case 13:Zn(s);break;case 19:q(Pt);break;case 10:rr(s.type);break;case 22:case 23:Zn(s),Id(),n!==null&&q(hs);break;case 24:rr(Kt)}}function uo(n,s){try{var o=s.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var p=c.next;o=p;do{if((o.tag&n)===n){c=void 0;var x=o.create,S=o.inst;c=x(),S.destroy=c}o=o.next}while(o!==p)}}catch(C){ft(s,s.return,C)}}function Dr(n,s,o){try{var c=s.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var x=p.next;c=x;do{if((c.tag&n)===n){var S=c.inst,C=S.destroy;if(C!==void 0){S.destroy=void 0,p=s;var z=o,K=C;try{K()}catch(te){ft(p,z,te)}}}c=c.next}while(c!==x)}}catch(te){ft(s,s.return,te)}}function Rx(n){var s=n.updateQueue;if(s!==null){var o=n.stateNode;try{vg(s,o)}catch(c){ft(n,n.return,c)}}}function Tx(n,s,o){o.props=ys(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(c){ft(n,s,c)}}function fo(n,s){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof o=="function"?n.refCleanup=o(c):o.current=c}}catch(p){ft(n,s,p)}}function Ba(n,s){var o=n.ref,c=n.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(p){ft(n,s,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){ft(n,s,p)}else o.current=null}function Ax(n){var s=n.type,o=n.memoizedProps,c=n.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":o.autoFocus&&c.focus();break e;case"img":o.src?c.src=o.src:o.srcSet&&(c.srcset=o.srcSet)}}catch(p){ft(n,n.return,p)}}function bf(n,s,o){try{var c=n.stateNode;x4(c,n.type,o,s),c[ve]=s}catch(p){ft(n,n.return,p)}}function Lx(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Ir(n.type)||n.tag===4}function _f(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Lx(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&&Ir(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 Sf(n,s,o){var c=n.tag;if(c===5||c===6)n=n.stateNode,s?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,s):(s=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,s.appendChild(n),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=Wa));else if(c!==4&&(c===27&&Ir(n.type)&&(o=n.stateNode,s=null),n=n.child,n!==null))for(Sf(n,s,o),n=n.sibling;n!==null;)Sf(n,s,o),n=n.sibling}function cc(n,s,o){var c=n.tag;if(c===5||c===6)n=n.stateNode,s?o.insertBefore(n,s):o.appendChild(n);else if(c!==4&&(c===27&&Ir(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(cc(n,s,o),n=n.sibling;n!==null;)cc(n,s,o),n=n.sibling}function Ox(n){var s=n.stateNode,o=n.memoizedProps;try{for(var c=n.type,p=s.attributes;p.length;)s.removeAttributeNode(p[0]);yn(s,c,o),s[pe]=n,s[ve]=o}catch(x){ft(n,n.return,x)}}var cr=!1,Zt=!1,wf=!1,Dx=typeof WeakSet=="function"?WeakSet:Set,dn=null;function Qw(n,s){if(n=n.containerInfo,Vf=Tc,n=Fp(n),pd(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var p=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{o.nodeType,x.nodeType}catch{o=null;break e}var S=0,C=-1,z=-1,K=0,te=0,ue=n,Q=null;t:for(;;){for(var W;ue!==o||p!==0&&ue.nodeType!==3||(C=S+p),ue!==x||c!==0&&ue.nodeType!==3||(z=S+c),ue.nodeType===3&&(S+=ue.nodeValue.length),(W=ue.firstChild)!==null;)Q=ue,ue=W;for(;;){if(ue===n)break t;if(Q===o&&++K===p&&(C=S),Q===x&&++te===c&&(z=S),(W=ue.nextSibling)!==null)break;ue=Q,Q=ue.parentNode}ue=W}o=C===-1||z===-1?null:{start:C,end:z}}else o=null}o=o||{start:0,end:0}}else o=null;for(qf={focusedElem:n,selectionRange:o},Tc=!1,dn=s;dn!==null;)if(s=dn,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,dn=n;else for(;dn!==null;){switch(s=dn,x=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(o=0;o<n.length;o++)p=n[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&x!==null){n=void 0,o=s,p=x.memoizedProps,x=x.memoizedState,c=o.stateNode;try{var we=ys(o.type,p);n=c.getSnapshotBeforeUpdate(we,x),c.__reactInternalSnapshotBeforeUpdate=n}catch(Le){ft(o,o.return,Le)}}break;case 3:if((n&1024)!==0){if(n=s.stateNode.containerInfo,o=n.nodeType,o===9)Kf(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Kf(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(r(163))}if(n=s.sibling,n!==null){n.return=s.return,dn=n;break}dn=s.return}}function Mx(n,s,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:dr(n,o),c&4&&uo(5,o);break;case 1:if(dr(n,o),c&4)if(n=o.stateNode,s===null)try{n.componentDidMount()}catch(S){ft(o,o.return,S)}else{var p=ys(o.type,s.memoizedProps);s=s.memoizedState;try{n.componentDidUpdate(p,s,n.__reactInternalSnapshotBeforeUpdate)}catch(S){ft(o,o.return,S)}}c&64&&Rx(o),c&512&&fo(o,o.return);break;case 3:if(dr(n,o),c&64&&(n=o.updateQueue,n!==null)){if(s=null,o.child!==null)switch(o.child.tag){case 27:case 5:s=o.child.stateNode;break;case 1:s=o.child.stateNode}try{vg(n,s)}catch(S){ft(o,o.return,S)}}break;case 27:s===null&&c&4&&Ox(o);case 26:case 5:dr(n,o),s===null&&c&4&&Ax(o),c&512&&fo(o,o.return);break;case 12:dr(n,o);break;case 31:dr(n,o),c&4&&$x(n,o);break;case 13:dr(n,o),c&4&&Hx(n,o),c&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=s4.bind(null,o),j4(n,o))));break;case 22:if(c=o.memoizedState!==null||cr,!c){s=s!==null&&s.memoizedState!==null||Zt,p=cr;var x=Zt;cr=c,(Zt=s)&&!x?fr(n,o,(o.subtreeFlags&8772)!==0):dr(n,o),cr=p,Zt=x}break;case 30:break;default:dr(n,o)}}function zx(n){var s=n.alternate;s!==null&&(n.alternate=null,zx(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&>(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 Lt=null,Hn=!1;function ur(n,s,o){for(o=o.child;o!==null;)Ux(n,s,o),o=o.sibling}function Ux(n,s,o){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(mn,o)}catch{}switch(o.tag){case 26:Zt||Ba(o,s),ur(n,s,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Zt||Ba(o,s);var c=Lt,p=Hn;Ir(o.type)&&(Lt=o.stateNode,Hn=!1),ur(n,s,o),_o(o.stateNode),Lt=c,Hn=p;break;case 5:Zt||Ba(o,s);case 6:if(c=Lt,p=Hn,Lt=null,ur(n,s,o),Lt=c,Hn=p,Lt!==null)if(Hn)try{(Lt.nodeType===9?Lt.body:Lt.nodeName==="HTML"?Lt.ownerDocument.body:Lt).removeChild(o.stateNode)}catch(x){ft(o,s,x)}else try{Lt.removeChild(o.stateNode)}catch(x){ft(o,s,x)}break;case 18:Lt!==null&&(Hn?(n=Lt,Ry(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),xi(n)):Ry(Lt,o.stateNode));break;case 4:c=Lt,p=Hn,Lt=o.stateNode.containerInfo,Hn=!0,ur(n,s,o),Lt=c,Hn=p;break;case 0:case 11:case 14:case 15:Dr(2,o,s),Zt||Dr(4,o,s),ur(n,s,o);break;case 1:Zt||(Ba(o,s),c=o.stateNode,typeof c.componentWillUnmount=="function"&&Tx(o,s,c)),ur(n,s,o);break;case 21:ur(n,s,o);break;case 22:Zt=(c=Zt)||o.memoizedState!==null,ur(n,s,o),Zt=c;break;default:ur(n,s,o)}}function $x(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{xi(n)}catch(o){ft(s,s.return,o)}}}function Hx(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{xi(n)}catch(o){ft(s,s.return,o)}}function Zw(n){switch(n.tag){case 31:case 13:case 19:var s=n.stateNode;return s===null&&(s=n.stateNode=new Dx),s;case 22:return n=n.stateNode,s=n._retryCache,s===null&&(s=n._retryCache=new Dx),s;default:throw Error(r(435,n.tag))}}function uc(n,s){var o=Zw(n);s.forEach(function(c){if(!o.has(c)){o.add(c);var p=i4.bind(null,n,c);c.then(p,p)}})}function Bn(n,s){var o=s.deletions;if(o!==null)for(var c=0;c<o.length;c++){var p=o[c],x=n,S=s,C=S;e:for(;C!==null;){switch(C.tag){case 27:if(Ir(C.type)){Lt=C.stateNode,Hn=!1;break e}break;case 5:Lt=C.stateNode,Hn=!1;break e;case 3:case 4:Lt=C.stateNode.containerInfo,Hn=!0;break e}C=C.return}if(Lt===null)throw Error(r(160));Ux(x,S,p),Lt=null,Hn=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Bx(s,n),s=s.sibling}var Aa=null;function Bx(n,s){var o=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Bn(s,n),In(n),c&4&&(Dr(3,n,n.return),uo(3,n),Dr(5,n,n.return));break;case 1:Bn(s,n),In(n),c&512&&(Zt||o===null||Ba(o,o.return)),c&64&&cr&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var p=Aa;if(Bn(s,n),In(n),c&512&&(Zt||o===null||Ba(o,o.return)),c&4){var x=o!==null?o.memoizedState:null;if(c=n.memoizedState,o===null)if(c===null)if(n.stateNode===null){e:{c=n.type,o=n.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":x=p.getElementsByTagName("title")[0],(!x||x[Ye]||x[pe]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(c),p.head.insertBefore(x,p.querySelector("head > title"))),yn(x,c,o),x[pe]=n,_t(x),c=x;break e;case"link":var S=By("link","href",p).get(c+(o.href||""));if(S){for(var C=0;C<S.length;C++)if(x=S[C],x.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&x.getAttribute("rel")===(o.rel==null?null:o.rel)&&x.getAttribute("title")===(o.title==null?null:o.title)&&x.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){S.splice(C,1);break t}}x=p.createElement(c),yn(x,c,o),p.head.appendChild(x);break;case"meta":if(S=By("meta","content",p).get(c+(o.content||""))){for(C=0;C<S.length;C++)if(x=S[C],x.getAttribute("content")===(o.content==null?null:""+o.content)&&x.getAttribute("name")===(o.name==null?null:o.name)&&x.getAttribute("property")===(o.property==null?null:o.property)&&x.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&x.getAttribute("charset")===(o.charSet==null?null:o.charSet)){S.splice(C,1);break t}}x=p.createElement(c),yn(x,c,o),p.head.appendChild(x);break;default:throw Error(r(468,c))}x[pe]=n,_t(x),c=x}n.stateNode=c}else Iy(p,n.type,n.stateNode);else n.stateNode=Hy(p,c,n.memoizedProps);else x!==c?(x===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):x.count--,c===null?Iy(p,n.type,n.stateNode):Hy(p,c,n.memoizedProps)):c===null&&n.stateNode!==null&&bf(n,n.memoizedProps,o.memoizedProps)}break;case 27:Bn(s,n),In(n),c&512&&(Zt||o===null||Ba(o,o.return)),o!==null&&c&4&&bf(n,n.memoizedProps,o.memoizedProps);break;case 5:if(Bn(s,n),In(n),c&512&&(Zt||o===null||Ba(o,o.return)),n.flags&32){p=n.stateNode;try{Bs(p,"")}catch(we){ft(n,n.return,we)}}c&4&&n.stateNode!=null&&(p=n.memoizedProps,bf(n,p,o!==null?o.memoizedProps:p)),c&1024&&(wf=!0);break;case 6:if(Bn(s,n),In(n),c&4){if(n.stateNode===null)throw Error(r(162));c=n.memoizedProps,o=n.stateNode;try{o.nodeValue=c}catch(we){ft(n,n.return,we)}}break;case 3:if(Ec=null,p=Aa,Aa=Nc(s.containerInfo),Bn(s,n),Aa=p,In(n),c&4&&o!==null&&o.memoizedState.isDehydrated)try{xi(s.containerInfo)}catch(we){ft(n,n.return,we)}wf&&(wf=!1,Ix(n));break;case 4:c=Aa,Aa=Nc(n.stateNode.containerInfo),Bn(s,n),In(n),Aa=c;break;case 12:Bn(s,n),In(n);break;case 31:Bn(s,n),In(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,uc(n,c)));break;case 13:Bn(s,n),In(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(fc=jt()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,uc(n,c)));break;case 22:p=n.memoizedState!==null;var z=o!==null&&o.memoizedState!==null,K=cr,te=Zt;if(cr=K||p,Zt=te||z,Bn(s,n),Zt=te,cr=K,In(n),c&8192)e:for(s=n.stateNode,s._visibility=p?s._visibility&-2:s._visibility|1,p&&(o===null||z||cr||Zt||vs(n)),o=null,s=n;;){if(s.tag===5||s.tag===26){if(o===null){z=o=s;try{if(x=z.stateNode,p)S=x.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{C=z.stateNode;var ue=z.memoizedProps.style,Q=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;C.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(we){ft(z,z.return,we)}}}else if(s.tag===6){if(o===null){z=s;try{z.stateNode.nodeValue=p?"":z.memoizedProps}catch(we){ft(z,z.return,we)}}}else if(s.tag===18){if(o===null){z=s;try{var W=z.stateNode;p?Ty(W,!0):Ty(z.stateNode,!1)}catch(we){ft(z,z.return,we)}}}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;o===s&&(o=null),s=s.return}o===s&&(o=null),s.sibling.return=s.return,s=s.sibling}c&4&&(c=n.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,uc(n,o))));break;case 19:Bn(s,n),In(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,uc(n,c)));break;case 30:break;case 21:break;default:Bn(s,n),In(n)}}function In(n){var s=n.flags;if(s&2){try{for(var o,c=n.return;c!==null;){if(Lx(c)){o=c;break}c=c.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var p=o.stateNode,x=_f(n);cc(n,x,p);break;case 5:var S=o.stateNode;o.flags&32&&(Bs(S,""),o.flags&=-33);var C=_f(n);cc(n,C,S);break;case 3:case 4:var z=o.stateNode.containerInfo,K=_f(n);Sf(n,K,z);break;default:throw Error(r(161))}}catch(te){ft(n,n.return,te)}n.flags&=-3}s&4096&&(n.flags&=-4097)}function Ix(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var s=n;Ix(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),n=n.sibling}}function dr(n,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Mx(n,s.alternate,s),s=s.sibling}function vs(n){for(n=n.child;n!==null;){var s=n;switch(s.tag){case 0:case 11:case 14:case 15:Dr(4,s,s.return),vs(s);break;case 1:Ba(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&Tx(s,s.return,o),vs(s);break;case 27:_o(s.stateNode);case 26:case 5:Ba(s,s.return),vs(s);break;case 22:s.memoizedState===null&&vs(s);break;case 30:vs(s);break;default:vs(s)}n=n.sibling}}function fr(n,s,o){for(o=o&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var c=s.alternate,p=n,x=s,S=x.flags;switch(x.tag){case 0:case 11:case 15:fr(p,x,o),uo(4,x);break;case 1:if(fr(p,x,o),c=x,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(K){ft(c,c.return,K)}if(c=x,p=c.updateQueue,p!==null){var C=c.stateNode;try{var z=p.shared.hiddenCallbacks;if(z!==null)for(p.shared.hiddenCallbacks=null,p=0;p<z.length;p++)yg(z[p],C)}catch(K){ft(c,c.return,K)}}o&&S&64&&Rx(x),fo(x,x.return);break;case 27:Ox(x);case 26:case 5:fr(p,x,o),o&&c===null&&S&4&&Ax(x),fo(x,x.return);break;case 12:fr(p,x,o);break;case 31:fr(p,x,o),o&&S&4&&$x(p,x);break;case 13:fr(p,x,o),o&&S&4&&Hx(p,x);break;case 22:x.memoizedState===null&&fr(p,x,o),fo(x,x.return);break;case 30:break;default:fr(p,x,o)}s=s.sibling}}function Nf(n,s){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&Zi(o))}function jf(n,s){n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&Zi(n))}function La(n,s,o,c){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Px(n,s,o,c),s=s.sibling}function Px(n,s,o,c){var p=s.flags;switch(s.tag){case 0:case 11:case 15:La(n,s,o,c),p&2048&&uo(9,s);break;case 1:La(n,s,o,c);break;case 3:La(n,s,o,c),p&2048&&(n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&Zi(n)));break;case 12:if(p&2048){La(n,s,o,c),n=s.stateNode;try{var x=s.memoizedProps,S=x.id,C=x.onPostCommit;typeof C=="function"&&C(S,s.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(z){ft(s,s.return,z)}}else La(n,s,o,c);break;case 31:La(n,s,o,c);break;case 13:La(n,s,o,c);break;case 23:break;case 22:x=s.stateNode,S=s.alternate,s.memoizedState!==null?x._visibility&2?La(n,s,o,c):ho(n,s):x._visibility&2?La(n,s,o,c):(x._visibility|=2,ii(n,s,o,c,(s.subtreeFlags&10256)!==0||!1)),p&2048&&Nf(S,s);break;case 24:La(n,s,o,c),p&2048&&jf(s.alternate,s);break;default:La(n,s,o,c)}}function ii(n,s,o,c,p){for(p=p&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=n,S=s,C=o,z=c,K=S.flags;switch(S.tag){case 0:case 11:case 15:ii(x,S,C,z,p),uo(8,S);break;case 23:break;case 22:var te=S.stateNode;S.memoizedState!==null?te._visibility&2?ii(x,S,C,z,p):ho(x,S):(te._visibility|=2,ii(x,S,C,z,p)),p&&K&2048&&Nf(S.alternate,S);break;case 24:ii(x,S,C,z,p),p&&K&2048&&jf(S.alternate,S);break;default:ii(x,S,C,z,p)}s=s.sibling}}function ho(n,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var o=n,c=s,p=c.flags;switch(c.tag){case 22:ho(o,c),p&2048&&Nf(c.alternate,c);break;case 24:ho(o,c),p&2048&&jf(c.alternate,c);break;default:ho(o,c)}s=s.sibling}}var mo=8192;function oi(n,s,o){if(n.subtreeFlags&mo)for(n=n.child;n!==null;)Gx(n,s,o),n=n.sibling}function Gx(n,s,o){switch(n.tag){case 26:oi(n,s,o),n.flags&mo&&n.memoizedState!==null&&U4(o,Aa,n.memoizedState,n.memoizedProps);break;case 5:oi(n,s,o);break;case 3:case 4:var c=Aa;Aa=Nc(n.stateNode.containerInfo),oi(n,s,o),Aa=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=mo,mo=16777216,oi(n,s,o),mo=c):oi(n,s,o));break;default:oi(n,s,o)}}function Vx(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 po(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var c=s[o];dn=c,Fx(c,n)}Vx(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)qx(n),n=n.sibling}function qx(n){switch(n.tag){case 0:case 11:case 15:po(n),n.flags&2048&&Dr(9,n,n.return);break;case 3:po(n);break;case 12:po(n);break;case 22:var s=n.stateNode;n.memoizedState!==null&&s._visibility&2&&(n.return===null||n.return.tag!==13)?(s._visibility&=-3,dc(n)):po(n);break;default:po(n)}}function dc(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var c=s[o];dn=c,Fx(c,n)}Vx(n)}for(n=n.child;n!==null;){switch(s=n,s.tag){case 0:case 11:case 15:Dr(8,s,s.return),dc(s);break;case 22:o=s.stateNode,o._visibility&2&&(o._visibility&=-3,dc(s));break;default:dc(s)}n=n.sibling}}function Fx(n,s){for(;dn!==null;){var o=dn;switch(o.tag){case 0:case 11:case 15:Dr(8,o,s);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var c=o.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Zi(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,dn=c;else e:for(o=n;dn!==null;){c=dn;var p=c.sibling,x=c.return;if(zx(c),c===o){dn=null;break e}if(p!==null){p.return=x,dn=p;break e}dn=x}}}var Jw={getCacheForType:function(n){var s=gn(Kt),o=s.data.get(n);return o===void 0&&(o=n(),s.data.set(n,o)),o},cacheSignal:function(){return gn(Kt).controller.signal}},Ww=typeof WeakMap=="function"?WeakMap:Map,ot=0,xt=null,Qe=null,Je=0,dt=0,Jn=null,Mr=!1,li=!1,Ef=!1,hr=0,Ut=0,zr=0,bs=0,Cf=0,Wn=0,ci=0,go=null,Pn=null,kf=!1,fc=0,Yx=0,hc=1/0,mc=null,Ur=null,nn=0,$r=null,ui=null,mr=0,Rf=0,Tf=null,Kx=null,xo=0,Af=null;function ea(){return(ot&2)!==0&&Je!==0?Je&-Je:A.T!==null?Uf():fe()}function Xx(){if(Wn===0)if((Je&536870912)===0||et){var n=bt;bt<<=1,(bt&3932160)===0&&(bt=262144),Wn=n}else Wn=536870912;return n=Qn.current,n!==null&&(n.flags|=32),Wn}function Gn(n,s,o){(n===xt&&(dt===2||dt===9)||n.cancelPendingCommit!==null)&&(di(n,0),Hr(n,Je,Wn,!1)),Pe(n,o),((ot&2)===0||n!==xt)&&(n===xt&&((ot&2)===0&&(bs|=o),Ut===4&&Hr(n,Je,Wn,!1)),Ia(n))}function Qx(n,s,o){if((ot&6)!==0)throw Error(r(327));var c=!o&&(s&127)===0&&(s&n.expiredLanes)===0||se(n,s),p=c?n4(n,s):Of(n,s,!0),x=c;do{if(p===0){li&&!c&&Hr(n,s,0,!1);break}else{if(o=n.current.alternate,x&&!e4(o)){p=Of(n,s,!1),x=!1;continue}if(p===2){if(x=s,n.errorRecoveryDisabledLanes&x)var S=0;else S=n.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){s=S;e:{var C=n;p=go;var z=C.current.memoizedState.isDehydrated;if(z&&(di(C,S).flags|=256),S=Of(C,S,!1),S!==2){if(Ef&&!z){C.errorRecoveryDisabledLanes|=x,bs|=x,p=4;break e}x=Pn,Pn=p,x!==null&&(Pn===null?Pn=x:Pn.push.apply(Pn,x))}p=S}if(x=!1,p!==2)continue}}if(p===1){di(n,0),Hr(n,s,0,!0);break}e:{switch(c=n,x=p,x){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:Hr(c,s,Wn,!Mr);break e;case 2:Pn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(p=fc+300-jt(),10<p)){if(Hr(c,s,Wn,!Mr),en(c,0,!0)!==0)break e;mr=s,c.timeoutHandle=Cy(Zx.bind(null,c,o,Pn,mc,kf,s,Wn,bs,ci,Mr,x,"Throttled",-0,0),p);break e}Zx(c,o,Pn,mc,kf,s,Wn,bs,ci,Mr,x,null,-0,0)}}break}while(!0);Ia(n)}function Zx(n,s,o,c,p,x,S,C,z,K,te,ue,Q,W){if(n.timeoutHandle=-1,ue=s.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wa},Gx(s,x,ue);var we=(x&62914560)===x?fc-jt():(x&4194048)===x?Yx-jt():0;if(we=$4(ue,we),we!==null){mr=x,n.cancelPendingCommit=we(sy.bind(null,n,s,x,o,c,p,S,C,z,te,ue,null,Q,W)),Hr(n,x,S,!K);return}}sy(n,s,x,o,c,p,S,C,z)}function e4(n){for(var s=n;;){var o=s.tag;if((o===0||o===11||o===15)&&s.flags&16384&&(o=s.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var p=o[c],x=p.getSnapshot;p=p.value;try{if(!Kn(x(),p))return!1}catch{return!1}}if(o=s.child,s.subtreeFlags&16384&&o!==null)o.return=s,s=o;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 Hr(n,s,o,c){s&=~Cf,s&=~bs,n.suspendedLanes|=s,n.pingedLanes&=~s,c&&(n.warmLanes|=s),c=n.expirationTimes;for(var p=s;0<p;){var x=31-Ft(p),S=1<<x;c[x]=-1,p&=~S}o!==0&&la(n,o,s)}function pc(){return(ot&6)===0?(yo(0),!1):!0}function Lf(){if(Qe!==null){if(dt===0)var n=Qe.return;else n=Qe,ar=ds=null,Yd(n),ti=null,Wi=0,n=Qe;for(;n!==null;)kx(n.alternate,n),n=n.return;Qe=null}}function di(n,s){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,b4(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),mr=0,Lf(),xt=n,Qe=o=tr(n.current,null),Je=s,dt=0,Jn=null,Mr=!1,li=se(n,s),Ef=!1,ci=Wn=Cf=bs=zr=Ut=0,Pn=go=null,kf=!1,(s&8)!==0&&(s|=s&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=s;0<c;){var p=31-Ft(c),x=1<<p;s|=n[p],c&=~x}return hr=s,zl(),o}function Jx(n,s){Ie=null,A.H=oo,s===ei||s===Vl?(s=mg(),dt=3):s===Md?(s=mg(),dt=4):dt=s===uf?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Jn=s,Qe===null&&(Ut=1,rc(n,fa(s,n.current)))}function Wx(){var n=Qn.current;return n===null?!0:(Je&4194048)===Je?ga===null:(Je&62914560)===Je||(Je&536870912)!==0?n===ga:!1}function ey(){var n=A.H;return A.H=oo,n===null?oo:n}function ty(){var n=A.A;return A.A=Jw,n}function gc(){Ut=4,Mr||(Je&4194048)!==Je&&Qn.current!==null||(li=!0),(zr&134217727)===0&&(bs&134217727)===0||xt===null||Hr(xt,Je,Wn,!1)}function Of(n,s,o){var c=ot;ot|=2;var p=ey(),x=ty();(xt!==n||Je!==s)&&(mc=null,di(n,s)),s=!1;var S=Ut;e:do try{if(dt!==0&&Qe!==null){var C=Qe,z=Jn;switch(dt){case 8:Lf(),S=6;break e;case 3:case 2:case 9:case 6:Qn.current===null&&(s=!0);var K=dt;if(dt=0,Jn=null,fi(n,C,z,K),o&&li){S=0;break e}break;default:K=dt,dt=0,Jn=null,fi(n,C,z,K)}}t4(),S=Ut;break}catch(te){Jx(n,te)}while(!0);return s&&n.shellSuspendCounter++,ar=ds=null,ot=c,A.H=p,A.A=x,Qe===null&&(xt=null,Je=0,zl()),S}function t4(){for(;Qe!==null;)ny(Qe)}function n4(n,s){var o=ot;ot|=2;var c=ey(),p=ty();xt!==n||Je!==s?(mc=null,hc=jt()+500,di(n,s)):li=se(n,s);e:do try{if(dt!==0&&Qe!==null){s=Qe;var x=Jn;t:switch(dt){case 1:dt=0,Jn=null,fi(n,s,x,1);break;case 2:case 9:if(fg(x)){dt=0,Jn=null,ay(s);break}s=function(){dt!==2&&dt!==9||xt!==n||(dt=7),Ia(n)},x.then(s,s);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:fg(x)?(dt=0,Jn=null,ay(s)):(dt=0,Jn=null,fi(n,s,x,7));break;case 5:var S=null;switch(Qe.tag){case 26:S=Qe.memoizedState;case 5:case 27:var C=Qe;if(S?Py(S):C.stateNode.complete){dt=0,Jn=null;var z=C.sibling;if(z!==null)Qe=z;else{var K=C.return;K!==null?(Qe=K,xc(K)):Qe=null}break t}}dt=0,Jn=null,fi(n,s,x,5);break;case 6:dt=0,Jn=null,fi(n,s,x,6);break;case 8:Lf(),Ut=6;break e;default:throw Error(r(462))}}a4();break}catch(te){Jx(n,te)}while(!0);return ar=ds=null,A.H=c,A.A=p,ot=o,Qe!==null?0:(xt=null,Je=0,zl(),Ut)}function a4(){for(;Qe!==null&&!kn();)ny(Qe)}function ny(n){var s=Ex(n.alternate,n,hr);n.memoizedProps=n.pendingProps,s===null?xc(n):Qe=s}function ay(n){var s=n,o=s.alternate;switch(s.tag){case 15:case 0:s=bx(o,s,s.pendingProps,s.type,void 0,Je);break;case 11:s=bx(o,s,s.pendingProps,s.type.render,s.ref,Je);break;case 5:Yd(s);default:kx(o,s),s=Qe=tg(s,hr),s=Ex(o,s,hr)}n.memoizedProps=n.pendingProps,s===null?xc(n):Qe=s}function fi(n,s,o,c){ar=ds=null,Yd(s),ti=null,Wi=0;var p=s.return;try{if(qw(n,p,s,o,Je)){Ut=1,rc(n,fa(o,n.current)),Qe=null;return}}catch(x){if(p!==null)throw Qe=p,x;Ut=1,rc(n,fa(o,n.current)),Qe=null;return}s.flags&32768?(et||c===1?n=!0:li||(Je&536870912)!==0?n=!1:(Mr=n=!0,(c===2||c===9||c===3||c===6)&&(c=Qn.current,c!==null&&c.tag===13&&(c.flags|=16384))),ry(s,n)):xc(s)}function xc(n){var s=n;do{if((s.flags&32768)!==0){ry(s,Mr);return}n=s.return;var o=Kw(s.alternate,s,hr);if(o!==null){Qe=o;return}if(s=s.sibling,s!==null){Qe=s;return}Qe=s=n}while(s!==null);Ut===0&&(Ut=5)}function ry(n,s){do{var o=Xw(n.alternate,n);if(o!==null){o.flags&=32767,Qe=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!s&&(n=n.sibling,n!==null)){Qe=n;return}Qe=n=o}while(n!==null);Ut=6,Qe=null}function sy(n,s,o,c,p,x,S,C,z){n.cancelPendingCommit=null;do yc();while(nn!==0);if((ot&6)!==0)throw Error(r(327));if(s!==null){if(s===n.current)throw Error(r(177));if(x=s.lanes|s.childLanes,x|=bd,oa(n,o,x,S,C,z),n===xt&&(Qe=xt=null,Je=0),ui=s,$r=n,mr=o,Rf=x,Tf=p,Kx=c,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,o4(Xe,function(){return uy(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||c){c=A.T,A.T=null,p=G.p,G.p=2,S=ot,ot|=4;try{Qw(n,s,o)}finally{ot=S,G.p=p,A.T=c}}nn=1,iy(),oy(),ly()}}function iy(){if(nn===1){nn=0;var n=$r,s=ui,o=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||o){o=A.T,A.T=null;var c=G.p;G.p=2;var p=ot;ot|=4;try{Bx(s,n);var x=qf,S=Fp(n.containerInfo),C=x.focusedElem,z=x.selectionRange;if(S!==C&&C&&C.ownerDocument&&qp(C.ownerDocument.documentElement,C)){if(z!==null&&pd(C)){var K=z.start,te=z.end;if(te===void 0&&(te=K),"selectionStart"in C)C.selectionStart=K,C.selectionEnd=Math.min(te,C.value.length);else{var ue=C.ownerDocument||document,Q=ue&&ue.defaultView||window;if(Q.getSelection){var W=Q.getSelection(),we=C.textContent.length,Le=Math.min(z.start,we),pt=z.end===void 0?Le:Math.min(z.end,we);!W.extend&&Le>pt&&(S=pt,pt=Le,Le=S);var V=Vp(C,Le),U=Vp(C,pt);if(V&&U&&(W.rangeCount!==1||W.anchorNode!==V.node||W.anchorOffset!==V.offset||W.focusNode!==U.node||W.focusOffset!==U.offset)){var Y=ue.createRange();Y.setStart(V.node,V.offset),W.removeAllRanges(),Le>pt?(W.addRange(Y),W.extend(U.node,U.offset)):(Y.setEnd(U.node,U.offset),W.addRange(Y))}}}}for(ue=[],W=C;W=W.parentNode;)W.nodeType===1&&ue.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<ue.length;C++){var oe=ue[C];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Tc=!!Vf,qf=Vf=null}finally{ot=p,G.p=c,A.T=o}}n.current=s,nn=2}}function oy(){if(nn===2){nn=0;var n=$r,s=ui,o=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||o){o=A.T,A.T=null;var c=G.p;G.p=2;var p=ot;ot|=4;try{Mx(n,s.alternate,s)}finally{ot=p,G.p=c,A.T=o}}nn=3}}function ly(){if(nn===4||nn===3){nn=0,Rn();var n=$r,s=ui,o=mr,c=Kx;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?nn=5:(nn=0,ui=$r=null,cy(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(Ur=null),Z(o),s=s.stateNode,Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(mn,s,void 0,(s.current.flags&128)===128)}catch{}if(c!==null){s=A.T,p=G.p,G.p=2,A.T=null;try{for(var x=n.onRecoverableError,S=0;S<c.length;S++){var C=c[S];x(C.value,{componentStack:C.stack})}}finally{A.T=s,G.p=p}}(mr&3)!==0&&yc(),Ia(n),p=n.pendingLanes,(o&261930)!==0&&(p&42)!==0?n===Af?xo++:(xo=0,Af=n):xo=0,yo(0)}}function cy(n,s){(n.pooledCacheLanes&=s)===0&&(s=n.pooledCache,s!=null&&(n.pooledCache=null,Zi(s)))}function yc(){return iy(),oy(),ly(),uy()}function uy(){if(nn!==5)return!1;var n=$r,s=Rf;Rf=0;var o=Z(mr),c=A.T,p=G.p;try{G.p=32>o?32:o,A.T=null,o=Tf,Tf=null;var x=$r,S=mr;if(nn=0,ui=$r=null,mr=0,(ot&6)!==0)throw Error(r(331));var C=ot;if(ot|=4,qx(x.current),Px(x,x.current,S,o),ot=C,yo(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(mn,x)}catch{}return!0}finally{G.p=p,A.T=c,cy(n,s)}}function dy(n,s,o){s=fa(o,s),s=cf(n.stateNode,s,2),n=Ar(n,s,2),n!==null&&(Pe(n,2),Ia(n))}function ft(n,s,o){if(n.tag===3)dy(n,n,o);else for(;s!==null;){if(s.tag===3){dy(s,n,o);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ur===null||!Ur.has(c))){n=fa(o,n),o=fx(2),c=Ar(s,o,2),c!==null&&(hx(o,c,s,n),Pe(c,2),Ia(c));break}}s=s.return}}function Df(n,s,o){var c=n.pingCache;if(c===null){c=n.pingCache=new Ww;var p=new Set;c.set(s,p)}else p=c.get(s),p===void 0&&(p=new Set,c.set(s,p));p.has(o)||(Ef=!0,p.add(o),n=r4.bind(null,n,s,o),s.then(n,n))}function r4(n,s,o){var c=n.pingCache;c!==null&&c.delete(s),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,xt===n&&(Je&o)===o&&(Ut===4||Ut===3&&(Je&62914560)===Je&&300>jt()-fc?(ot&2)===0&&di(n,0):Cf|=o,ci===Je&&(ci=0)),Ia(n)}function fy(n,s){s===0&&(s=Ue()),n=ls(n,s),n!==null&&(Pe(n,s),Ia(n))}function s4(n){var s=n.memoizedState,o=0;s!==null&&(o=s.retryLane),fy(n,o)}function i4(n,s){var o=0;switch(n.tag){case 31:case 13:var c=n.stateNode,p=n.memoizedState;p!==null&&(o=p.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(s),fy(n,o)}function o4(n,s){return bn(n,s)}var vc=null,hi=null,Mf=!1,bc=!1,zf=!1,Br=0;function Ia(n){n!==hi&&n.next===null&&(hi===null?vc=hi=n:hi=hi.next=n),bc=!0,Mf||(Mf=!0,c4())}function yo(n,s){if(!zf&&bc){zf=!0;do for(var o=!1,c=vc;c!==null;){if(n!==0){var p=c.pendingLanes;if(p===0)var x=0;else{var S=c.suspendedLanes,C=c.pingedLanes;x=(1<<31-Ft(42|n)+1)-1,x&=p&~(S&~C),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(o=!0,gy(c,x))}else x=Je,x=en(c,c===xt?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||se(c,x)||(o=!0,gy(c,x));c=c.next}while(o);zf=!1}}function l4(){hy()}function hy(){bc=Mf=!1;var n=0;Br!==0&&v4()&&(n=Br);for(var s=jt(),o=null,c=vc;c!==null;){var p=c.next,x=my(c,s);x===0?(c.next=null,o===null?vc=p:o.next=p,p===null&&(hi=o)):(o=c,(n!==0||(x&3)!==0)&&(bc=!0)),c=p}nn!==0&&nn!==5||yo(n),Br!==0&&(Br=0)}function my(n,s){for(var o=n.suspendedLanes,c=n.pingedLanes,p=n.expirationTimes,x=n.pendingLanes&-62914561;0<x;){var S=31-Ft(x),C=1<<S,z=p[S];z===-1?((C&o)===0||(C&c)!==0)&&(p[S]=be(C,s)):z<=s&&(n.expiredLanes|=C),x&=~C}if(s=xt,o=Je,o=en(n,n===s?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,o===0||n===s&&(dt===2||dt===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&ia(c),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||se(n,o)){if(s=o&-o,s===n.callbackPriority)return s;switch(c!==null&&ia(c),Z(o)){case 2:case 8:o=He;break;case 32:o=Xe;break;case 268435456:o=Tt;break;default:o=Xe}return c=py.bind(null,n),o=bn(o,c),n.callbackPriority=s,n.callbackNode=o,s}return c!==null&&c!==null&&ia(c),n.callbackPriority=2,n.callbackNode=null,2}function py(n,s){if(nn!==0&&nn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(yc()&&n.callbackNode!==o)return null;var c=Je;return c=en(n,n===xt?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(Qx(n,c,s),my(n,jt()),n.callbackNode!=null&&n.callbackNode===o?py.bind(null,n):null)}function gy(n,s){if(yc())return null;Qx(n,s,!0)}function c4(){_4(function(){(ot&6)!==0?bn(Ne,l4):hy()})}function Uf(){if(Br===0){var n=Js;n===0&&(n=tt,tt<<=1,(tt&261888)===0&&(tt=256)),Br=n}return Br}function xy(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:kl(""+n)}function yy(n,s){var o=s.ownerDocument.createElement("input");return o.name=s.name,o.value=s.value,n.id&&o.setAttribute("form",n.id),s.parentNode.insertBefore(o,s),n=new FormData(n),o.parentNode.removeChild(o),n}function u4(n,s,o,c,p){if(s==="submit"&&o&&o.stateNode===p){var x=xy((p[ve]||null).action),S=c.submitter;S&&(s=(s=S[ve]||null)?xy(s.formAction):S.getAttribute("formAction"),s!==null&&(x=s,S=null));var C=new Ll("action","action",null,c,p);n.push({event:C,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Br!==0){var z=S?yy(p,S):new FormData(p);nf(o,{pending:!0,data:z,method:p.method,action:x},null,z)}}else typeof x=="function"&&(C.preventDefault(),z=S?yy(p,S):new FormData(p),nf(o,{pending:!0,data:z,method:p.method,action:x},x,z))},currentTarget:p}]})}}for(var $f=0;$f<vd.length;$f++){var Hf=vd[$f],d4=Hf.toLowerCase(),f4=Hf[0].toUpperCase()+Hf.slice(1);Ta(d4,"on"+f4)}Ta(Xp,"onAnimationEnd"),Ta(Qp,"onAnimationIteration"),Ta(Zp,"onAnimationStart"),Ta("dblclick","onDoubleClick"),Ta("focusin","onFocus"),Ta("focusout","onBlur"),Ta(kw,"onTransitionRun"),Ta(Rw,"onTransitionStart"),Ta(Tw,"onTransitionCancel"),Ta(Jp,"onTransitionEnd"),za("onMouseEnter",["mouseout","mouseover"]),za("onMouseLeave",["mouseout","mouseover"]),za("onPointerEnter",["pointerout","pointerover"]),za("onPointerLeave",["pointerout","pointerover"]),un("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),un("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),un("onBeforeInput",["compositionend","keypress","textInput","paste"]),un("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),un("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),un("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="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(" "),h4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vo));function vy(n,s){s=(s&4)!==0;for(var o=0;o<n.length;o++){var c=n[o],p=c.event;c=c.listeners;e:{var x=void 0;if(s)for(var S=c.length-1;0<=S;S--){var C=c[S],z=C.instance,K=C.currentTarget;if(C=C.listener,z!==x&&p.isPropagationStopped())break e;x=C,p.currentTarget=K;try{x(p)}catch(te){Ml(te)}p.currentTarget=null,x=z}else for(S=0;S<c.length;S++){if(C=c[S],z=C.instance,K=C.currentTarget,C=C.listener,z!==x&&p.isPropagationStopped())break e;x=C,p.currentTarget=K;try{x(p)}catch(te){Ml(te)}p.currentTarget=null,x=z}}}}function Ze(n,s){var o=s[ke];o===void 0&&(o=s[ke]=new Set);var c=n+"__bubble";o.has(c)||(by(s,n,2,!1),o.add(c))}function Bf(n,s,o){var c=0;s&&(c|=4),by(o,n,c,s)}var _c="_reactListening"+Math.random().toString(36).slice(2);function If(n){if(!n[_c]){n[_c]=!0,wr.forEach(function(o){o!=="selectionchange"&&(h4.has(o)||Bf(o,!1,n),Bf(o,!0,n))});var s=n.nodeType===9?n:n.ownerDocument;s===null||s[_c]||(s[_c]=!0,Bf("selectionchange",!1,s))}}function by(n,s,o,c){switch(Xy(s)){case 2:var p=I4;break;case 8:p=P4;break;default:p=nh}o=p.bind(null,s,o,n),p=void 0,!id||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(p=!0),c?p!==void 0?n.addEventListener(s,o,{capture:!0,passive:p}):n.addEventListener(s,o,!0):p!==void 0?n.addEventListener(s,o,{passive:p}):n.addEventListener(s,o,!1)}function Pf(n,s,o,c,p){var x=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var C=c.stateNode.containerInfo;if(C===p)break;if(S===4)for(S=c.return;S!==null;){var z=S.tag;if((z===3||z===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;C!==null;){if(S=Et(C),S===null)return;if(z=S.tag,z===5||z===6||z===26||z===27){c=x=S;continue e}C=C.parentNode}}c=c.return}jp(function(){var K=x,te=rd(o),ue=[];e:{var Q=Wp.get(n);if(Q!==void 0){var W=Ll,we=n;switch(n){case"keypress":if(Tl(o)===0)break e;case"keydown":case"keyup":W=iw;break;case"focusin":we="focus",W=ud;break;case"focusout":we="blur",W=ud;break;case"beforeblur":case"afterblur":W=ud;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":W=kp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=KS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=cw;break;case Xp:case Qp:case Zp:W=ZS;break;case Jp:W=dw;break;case"scroll":case"scrollend":W=FS;break;case"wheel":W=hw;break;case"copy":case"cut":case"paste":W=WS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=Tp;break;case"toggle":case"beforetoggle":W=pw}var Le=(s&4)!==0,pt=!Le&&(n==="scroll"||n==="scrollend"),V=Le?Q!==null?Q+"Capture":null:Q;Le=[];for(var U=K,Y;U!==null;){var oe=U;if(Y=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Y===null||V===null||(oe=Bi(U,V),oe!=null&&Le.push(bo(U,oe,Y))),pt)break;U=U.return}0<Le.length&&(Q=new W(Q,we,null,o,te),ue.push({event:Q,listeners:Le}))}}if((s&7)===0){e:{if(Q=n==="mouseover"||n==="pointerover",W=n==="mouseout"||n==="pointerout",Q&&o!==ad&&(we=o.relatedTarget||o.fromElement)&&(Et(we)||we[_e]))break e;if((W||Q)&&(Q=te.window===te?te:(Q=te.ownerDocument)?Q.defaultView||Q.parentWindow:window,W?(we=o.relatedTarget||o.toElement,W=K,we=we?Et(we):null,we!==null&&(pt=l(we),Le=we.tag,we!==pt||Le!==5&&Le!==27&&Le!==6)&&(we=null)):(W=null,we=K),W!==we)){if(Le=kp,oe="onMouseLeave",V="onMouseEnter",U="mouse",(n==="pointerout"||n==="pointerover")&&(Le=Tp,oe="onPointerLeave",V="onPointerEnter",U="pointer"),pt=W==null?Q:nt(W),Y=we==null?Q:nt(we),Q=new Le(oe,U+"leave",W,o,te),Q.target=pt,Q.relatedTarget=Y,oe=null,Et(te)===K&&(Le=new Le(V,U+"enter",we,o,te),Le.target=Y,Le.relatedTarget=pt,oe=Le),pt=oe,W&&we)t:{for(Le=m4,V=W,U=we,Y=0,oe=V;oe;oe=Le(oe))Y++;oe=0;for(var Re=U;Re;Re=Le(Re))oe++;for(;0<Y-oe;)V=Le(V),Y--;for(;0<oe-Y;)U=Le(U),oe--;for(;Y--;){if(V===U||U!==null&&V===U.alternate){Le=V;break t}V=Le(V),U=Le(U)}Le=null}else Le=null;W!==null&&_y(ue,Q,W,Le,!1),we!==null&&pt!==null&&_y(ue,pt,we,Le,!0)}}e:{if(Q=K?nt(K):window,W=Q.nodeName&&Q.nodeName.toLowerCase(),W==="select"||W==="input"&&Q.type==="file")var st=$p;else if(zp(Q))if(Hp)st=jw;else{st=ww;var je=Sw}else W=Q.nodeName,!W||W.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?K&&nd(K.elementType)&&(st=$p):st=Nw;if(st&&(st=st(n,K))){Up(ue,st,o,te);break e}je&&je(n,Q,K),n==="focusout"&&K&&Q.type==="number"&&K.memoizedProps.value!=null&&td(Q,"number",Q.value)}switch(je=K?nt(K):window,n){case"focusin":(zp(je)||je.contentEditable==="true")&&(Vs=je,gd=K,Ki=null);break;case"focusout":Ki=gd=Vs=null;break;case"mousedown":xd=!0;break;case"contextmenu":case"mouseup":case"dragend":xd=!1,Yp(ue,o,te);break;case"selectionchange":if(Cw)break;case"keydown":case"keyup":Yp(ue,o,te)}var Ge;if(fd)e:{switch(n){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else Gs?Dp(n,o)&&(We="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(We="onCompositionStart");We&&(Ap&&o.locale!=="ko"&&(Gs||We!=="onCompositionStart"?We==="onCompositionEnd"&&Gs&&(Ge=Ep()):(Nr=te,od="value"in Nr?Nr.value:Nr.textContent,Gs=!0)),je=Sc(K,We),0<je.length&&(We=new Rp(We,n,null,o,te),ue.push({event:We,listeners:je}),Ge?We.data=Ge:(Ge=Mp(o),Ge!==null&&(We.data=Ge)))),(Ge=xw?yw(n,o):vw(n,o))&&(We=Sc(K,"onBeforeInput"),0<We.length&&(je=new Rp("onBeforeInput","beforeinput",null,o,te),ue.push({event:je,listeners:We}),je.data=Ge)),u4(ue,n,K,o,te)}vy(ue,s)})}function bo(n,s,o){return{instance:n,listener:s,currentTarget:o}}function Sc(n,s){for(var o=s+"Capture",c=[];n!==null;){var p=n,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=Bi(n,o),p!=null&&c.unshift(bo(n,p,x)),p=Bi(n,s),p!=null&&c.push(bo(n,p,x))),n.tag===3)return c;n=n.return}return[]}function m4(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function _y(n,s,o,c,p){for(var x=s._reactName,S=[];o!==null&&o!==c;){var C=o,z=C.alternate,K=C.stateNode;if(C=C.tag,z!==null&&z===c)break;C!==5&&C!==26&&C!==27||K===null||(z=K,p?(K=Bi(o,x),K!=null&&S.unshift(bo(o,K,z))):p||(K=Bi(o,x),K!=null&&S.push(bo(o,K,z)))),o=o.return}S.length!==0&&n.push({event:s,listeners:S})}var p4=/\r\n?/g,g4=/\u0000|\uFFFD/g;function Sy(n){return(typeof n=="string"?n:""+n).replace(p4,`
|
|
10
|
+
`).replace(g4,"")}function wy(n,s){return s=Sy(s),Sy(n)===s}function mt(n,s,o,c,p,x){switch(o){case"children":typeof c=="string"?s==="body"||s==="textarea"&&c===""||Bs(n,c):(typeof c=="number"||typeof c=="bigint")&&s!=="body"&&Bs(n,""+c);break;case"className":It(n,"class",c);break;case"tabIndex":It(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":It(n,o,c);break;case"style":wp(n,c,x);break;case"data":if(s!=="object"){It(n,"data",c);break}case"src":case"href":if(c===""&&(s!=="a"||o!=="href")){n.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(o);break}c=kl(""+c),n.setAttribute(o,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(o,"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 x=="function"&&(o==="formAction"?(s!=="input"&&mt(n,s,"name",p.name,p,null),mt(n,s,"formEncType",p.formEncType,p,null),mt(n,s,"formMethod",p.formMethod,p,null),mt(n,s,"formTarget",p.formTarget,p,null)):(mt(n,s,"encType",p.encType,p,null),mt(n,s,"method",p.method,p,null),mt(n,s,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(o);break}c=kl(""+c),n.setAttribute(o,c);break;case"onClick":c!=null&&(n.onclick=Wa);break;case"onScroll":c!=null&&Ze("scroll",n);break;case"onScrollEnd":c!=null&&Ze("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(r(60));n.innerHTML=o}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}o=kl(""+c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,""+c):n.removeAttribute(o);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":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":c===!0?n.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,c):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(o,c):n.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(o):n.setAttribute(o,c);break;case"popover":Ze("beforetoggle",n),Ze("toggle",n),Ke(n,"popover",c);break;case"xlinkActuate":Sn(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Sn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Sn(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Sn(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Sn(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Sn(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Sn(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Sn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Sn(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Ke(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=VS.get(o)||o,Ke(n,o,c))}}function Gf(n,s,o,c,p,x){switch(o){case"style":wp(n,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(r(60));n.innerHTML=o}}break;case"children":typeof c=="string"?Bs(n,c):(typeof c=="number"||typeof c=="bigint")&&Bs(n,""+c);break;case"onScroll":c!=null&&Ze("scroll",n);break;case"onScrollEnd":c!=null&&Ze("scrollend",n);break;case"onClick":c!=null&&(n.onclick=Wa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ra.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),s=o.slice(2,p?o.length-7:void 0),x=n[ve]||null,x=x!=null?x[o]:null,typeof x=="function"&&n.removeEventListener(s,x,p),typeof c=="function")){typeof x!="function"&&x!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(s,c,p);break e}o in n?n[o]=c:c===!0?n.setAttribute(o,""):Ke(n,o,c)}}}function yn(n,s,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",n),Ze("load",n);var c=!1,p=!1,x;for(x in o)if(o.hasOwnProperty(x)){var S=o[x];if(S!=null)switch(x){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:mt(n,s,x,S,o,null)}}p&&mt(n,s,"srcSet",o.srcSet,o,null),c&&mt(n,s,"src",o.src,o,null);return;case"input":Ze("invalid",n);var C=x=S=p=null,z=null,K=null;for(c in o)if(o.hasOwnProperty(c)){var te=o[c];if(te!=null)switch(c){case"name":p=te;break;case"type":S=te;break;case"checked":z=te;break;case"defaultChecked":K=te;break;case"value":x=te;break;case"defaultValue":C=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,s));break;default:mt(n,s,c,te,o,null)}}vp(n,x,C,z,K,S,p,!1);return;case"select":Ze("invalid",n),c=S=x=null;for(p in o)if(o.hasOwnProperty(p)&&(C=o[p],C!=null))switch(p){case"value":x=C;break;case"defaultValue":S=C;break;case"multiple":c=C;default:mt(n,s,p,C,o,null)}s=x,o=S,n.multiple=!!c,s!=null?Hs(n,!!c,s,!1):o!=null&&Hs(n,!!c,o,!0);return;case"textarea":Ze("invalid",n),x=p=c=null;for(S in o)if(o.hasOwnProperty(S)&&(C=o[S],C!=null))switch(S){case"value":c=C;break;case"defaultValue":p=C;break;case"children":x=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(r(91));break;default:mt(n,s,S,C,o,null)}_p(n,c,p,x);return;case"option":for(z in o)o.hasOwnProperty(z)&&(c=o[z],c!=null)&&(z==="selected"?n.selected=c&&typeof c!="function"&&typeof c!="symbol":mt(n,s,z,c,o,null));return;case"dialog":Ze("beforetoggle",n),Ze("toggle",n),Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":Ze("load",n);break;case"video":case"audio":for(c=0;c<vo.length;c++)Ze(vo[c],n);break;case"image":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"embed":case"source":case"link":Ze("error",n),Ze("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(K in o)if(o.hasOwnProperty(K)&&(c=o[K],c!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:mt(n,s,K,c,o,null)}return;default:if(nd(s)){for(te in o)o.hasOwnProperty(te)&&(c=o[te],c!==void 0&&Gf(n,s,te,c,o,void 0));return}}for(C in o)o.hasOwnProperty(C)&&(c=o[C],c!=null&&mt(n,s,C,c,o,null))}function x4(n,s,o,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,x=null,S=null,C=null,z=null,K=null,te=null;for(W in o){var ue=o[W];if(o.hasOwnProperty(W)&&ue!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":z=ue;default:c.hasOwnProperty(W)||mt(n,s,W,null,c,ue)}}for(var Q in c){var W=c[Q];if(ue=o[Q],c.hasOwnProperty(Q)&&(W!=null||ue!=null))switch(Q){case"type":x=W;break;case"name":p=W;break;case"checked":K=W;break;case"defaultChecked":te=W;break;case"value":S=W;break;case"defaultValue":C=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,s));break;default:W!==ue&&mt(n,s,Q,W,c,ue)}}ed(n,S,C,z,K,te,x,p);return;case"select":W=S=C=Q=null;for(x in o)if(z=o[x],o.hasOwnProperty(x)&&z!=null)switch(x){case"value":break;case"multiple":W=z;default:c.hasOwnProperty(x)||mt(n,s,x,null,c,z)}for(p in c)if(x=c[p],z=o[p],c.hasOwnProperty(p)&&(x!=null||z!=null))switch(p){case"value":Q=x;break;case"defaultValue":C=x;break;case"multiple":S=x;default:x!==z&&mt(n,s,p,x,c,z)}s=C,o=S,c=W,Q!=null?Hs(n,!!o,Q,!1):!!c!=!!o&&(s!=null?Hs(n,!!o,s,!0):Hs(n,!!o,o?[]:"",!1));return;case"textarea":W=Q=null;for(C in o)if(p=o[C],o.hasOwnProperty(C)&&p!=null&&!c.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:mt(n,s,C,null,c,p)}for(S in c)if(p=c[S],x=o[S],c.hasOwnProperty(S)&&(p!=null||x!=null))switch(S){case"value":Q=p;break;case"defaultValue":W=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:p!==x&&mt(n,s,S,p,c,x)}bp(n,Q,W);return;case"option":for(var we in o)Q=o[we],o.hasOwnProperty(we)&&Q!=null&&!c.hasOwnProperty(we)&&(we==="selected"?n.selected=!1:mt(n,s,we,null,c,Q));for(z in c)Q=c[z],W=o[z],c.hasOwnProperty(z)&&Q!==W&&(Q!=null||W!=null)&&(z==="selected"?n.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":mt(n,s,z,Q,c,W));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 Le in o)Q=o[Le],o.hasOwnProperty(Le)&&Q!=null&&!c.hasOwnProperty(Le)&&mt(n,s,Le,null,c,Q);for(K in c)if(Q=c[K],W=o[K],c.hasOwnProperty(K)&&Q!==W&&(Q!=null||W!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,s));break;default:mt(n,s,K,Q,c,W)}return;default:if(nd(s)){for(var pt in o)Q=o[pt],o.hasOwnProperty(pt)&&Q!==void 0&&!c.hasOwnProperty(pt)&&Gf(n,s,pt,void 0,c,Q);for(te in c)Q=c[te],W=o[te],!c.hasOwnProperty(te)||Q===W||Q===void 0&&W===void 0||Gf(n,s,te,Q,c,W);return}}for(var V in o)Q=o[V],o.hasOwnProperty(V)&&Q!=null&&!c.hasOwnProperty(V)&&mt(n,s,V,null,c,Q);for(ue in c)Q=c[ue],W=o[ue],!c.hasOwnProperty(ue)||Q===W||Q==null&&W==null||mt(n,s,ue,Q,c,W)}function Ny(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function y4(){if(typeof performance.getEntriesByType=="function"){for(var n=0,s=0,o=performance.getEntriesByType("resource"),c=0;c<o.length;c++){var p=o[c],x=p.transferSize,S=p.initiatorType,C=p.duration;if(x&&C&&Ny(S)){for(S=0,C=p.responseEnd,c+=1;c<o.length;c++){var z=o[c],K=z.startTime;if(K>C)break;var te=z.transferSize,ue=z.initiatorType;te&&Ny(ue)&&(z=z.responseEnd,S+=te*(z<C?1:(C-K)/(z-K)))}if(--c,s+=8*(x+S)/(p.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 Vf=null,qf=null;function wc(n){return n.nodeType===9?n:n.ownerDocument}function jy(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 Ey(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 Ff(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 Yf=null;function v4(){var n=window.event;return n&&n.type==="popstate"?n===Yf?!1:(Yf=n,!0):(Yf=null,!1)}var Cy=typeof setTimeout=="function"?setTimeout:void 0,b4=typeof clearTimeout=="function"?clearTimeout:void 0,ky=typeof Promise=="function"?Promise:void 0,_4=typeof queueMicrotask=="function"?queueMicrotask:typeof ky<"u"?function(n){return ky.resolve(null).then(n).catch(S4)}:Cy;function S4(n){setTimeout(function(){throw n})}function Ir(n){return n==="head"}function Ry(n,s){var o=s,c=0;do{var p=o.nextSibling;if(n.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(c===0){n.removeChild(p),xi(s);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")_o(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,_o(o);for(var x=o.firstChild;x;){var S=x.nextSibling,C=x.nodeName;x[Ye]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&x.rel.toLowerCase()==="stylesheet"||o.removeChild(x),x=S}}else o==="body"&&_o(n.ownerDocument.body);o=p}while(o);xi(s)}function Ty(n,s){var o=n;n=0;do{var c=o.nextSibling;if(o.nodeType===1?s?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(s?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),c&&c.nodeType===8)if(o=c.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=c}while(o)}function Kf(n){var s=n.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var o=s;switch(s=s.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Kf(o),gt(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function w4(n,s,o,c){for(;n.nodeType===1;){var p=o;if(n.nodeName.toLowerCase()!==s.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[Ye])switch(s){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(x=n.getAttribute("rel"),x==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(x!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(x=n.getAttribute("src"),(x!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&x&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(s==="input"&&n.type==="hidden"){var x=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===x)return n}else return n;if(n=xa(n.nextSibling),n===null)break}return null}function N4(n,s,o){if(s==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=xa(n.nextSibling),n===null))return null;return n}function Ay(n,s){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=xa(n.nextSibling),n===null))return null;return n}function Xf(n){return n.data==="$?"||n.data==="$~"}function Qf(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function j4(n,s){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=s;else if(n.data!=="$?"||o.readyState!=="loading")s();else{var c=function(){s(),o.removeEventListener("DOMContentLoaded",c)};o.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function xa(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 Zf=null;function Ly(n){n=n.nextSibling;for(var s=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(s===0)return xa(n.nextSibling);s--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||s++}n=n.nextSibling}return null}function Oy(n){n=n.previousSibling;for(var s=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(s===0)return n;s--}else o!=="/$"&&o!=="/&"||s++}n=n.previousSibling}return null}function Dy(n,s,o){switch(s=wc(o),n){case"html":if(n=s.documentElement,!n)throw Error(r(452));return n;case"head":if(n=s.head,!n)throw Error(r(453));return n;case"body":if(n=s.body,!n)throw Error(r(454));return n;default:throw Error(r(451))}}function _o(n){for(var s=n.attributes;s.length;)n.removeAttributeNode(s[0]);gt(n)}var ya=new Map,My=new Set;function Nc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var pr=G.d;G.d={f:E4,r:C4,D:k4,C:R4,L:T4,m:A4,X:O4,S:L4,M:D4};function E4(){var n=pr.f(),s=pc();return n||s}function C4(n){var s=Mt(n);s!==null&&s.tag===5&&s.type==="form"?Jg(s):pr.r(n)}var mi=typeof document>"u"?null:document;function zy(n,s,o){var c=mi;if(c&&typeof s=="string"&&s){var p=ua(s);p='link[rel="'+n+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),My.has(p)||(My.add(p),n={rel:n,crossOrigin:o,href:s},c.querySelector(p)===null&&(s=c.createElement("link"),yn(s,"link",n),_t(s),c.head.appendChild(s)))}}function k4(n){pr.D(n),zy("dns-prefetch",n,null)}function R4(n,s){pr.C(n,s),zy("preconnect",n,s)}function T4(n,s,o){pr.L(n,s,o);var c=mi;if(c&&n&&s){var p='link[rel="preload"][as="'+ua(s)+'"]';s==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+ua(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+ua(o.imageSizes)+'"]')):p+='[href="'+ua(n)+'"]';var x=p;switch(s){case"style":x=pi(n);break;case"script":x=gi(n)}ya.has(x)||(n=y({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:n,as:s},o),ya.set(x,n),c.querySelector(p)!==null||s==="style"&&c.querySelector(So(x))||s==="script"&&c.querySelector(wo(x))||(s=c.createElement("link"),yn(s,"link",n),_t(s),c.head.appendChild(s)))}}function A4(n,s){pr.m(n,s);var o=mi;if(o&&n){var c=s&&typeof s.as=="string"?s.as:"script",p='link[rel="modulepreload"][as="'+ua(c)+'"][href="'+ua(n)+'"]',x=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=gi(n)}if(!ya.has(x)&&(n=y({rel:"modulepreload",href:n},s),ya.set(x,n),o.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(wo(x)))return}c=o.createElement("link"),yn(c,"link",n),_t(c),o.head.appendChild(c)}}}function L4(n,s,o){pr.S(n,s,o);var c=mi;if(c&&n){var p=tn(c).hoistableStyles,x=pi(n);s=s||"default";var S=p.get(x);if(!S){var C={loading:0,preload:null};if(S=c.querySelector(So(x)))C.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":s},o),(o=ya.get(x))&&Jf(n,o);var z=S=c.createElement("link");_t(z),yn(z,"link",n),z._p=new Promise(function(K,te){z.onload=K,z.onerror=te}),z.addEventListener("load",function(){C.loading|=1}),z.addEventListener("error",function(){C.loading|=2}),C.loading|=4,jc(S,s,c)}S={type:"stylesheet",instance:S,count:1,state:C},p.set(x,S)}}}function O4(n,s){pr.X(n,s);var o=mi;if(o&&n){var c=tn(o).hoistableScripts,p=gi(n),x=c.get(p);x||(x=o.querySelector(wo(p)),x||(n=y({src:n,async:!0},s),(s=ya.get(p))&&Wf(n,s),x=o.createElement("script"),_t(x),yn(x,"link",n),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function D4(n,s){pr.M(n,s);var o=mi;if(o&&n){var c=tn(o).hoistableScripts,p=gi(n),x=c.get(p);x||(x=o.querySelector(wo(p)),x||(n=y({src:n,async:!0,type:"module"},s),(s=ya.get(p))&&Wf(n,s),x=o.createElement("script"),_t(x),yn(x,"link",n),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function Uy(n,s,o,c){var p=(p=xe.current)?Nc(p):null;if(!p)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(s=pi(o.href),o=tn(p).hoistableStyles,c=o.get(s),c||(c={type:"style",instance:null,count:0,state:null},o.set(s,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=pi(o.href);var x=tn(p).hoistableStyles,S=x.get(n);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(n,S),(x=p.querySelector(So(n)))&&!x._p&&(S.instance=x,S.state.loading=5),ya.has(n)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},ya.set(n,o),x||M4(p,n,o,S.state))),s&&c===null)throw Error(r(528,""));return S}if(s&&c!==null)throw Error(r(529,""));return null;case"script":return s=o.async,o=o.src,typeof o=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=gi(o),o=tn(p).hoistableScripts,c=o.get(s),c||(c={type:"script",instance:null,count:0,state:null},o.set(s,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,n))}}function pi(n){return'href="'+ua(n)+'"'}function So(n){return'link[rel="stylesheet"]['+n+"]"}function $y(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function M4(n,s,o,c){n.querySelector('link[rel="preload"][as="style"]['+s+"]")?c.loading=1:(s=n.createElement("link"),c.preload=s,s.addEventListener("load",function(){return c.loading|=1}),s.addEventListener("error",function(){return c.loading|=2}),yn(s,"link",o),_t(s),n.head.appendChild(s))}function gi(n){return'[src="'+ua(n)+'"]'}function wo(n){return"script[async]"+n}function Hy(n,s,o){if(s.count++,s.instance===null)switch(s.type){case"style":var c=n.querySelector('style[data-href~="'+ua(o.href)+'"]');if(c)return s.instance=c,_t(c),c;var p=y({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),_t(c),yn(c,"style",p),jc(c,o.precedence,n),s.instance=c;case"stylesheet":p=pi(o.href);var x=n.querySelector(So(p));if(x)return s.state.loading|=4,s.instance=x,_t(x),x;c=$y(o),(p=ya.get(p))&&Jf(c,p),x=(n.ownerDocument||n).createElement("link"),_t(x);var S=x;return S._p=new Promise(function(C,z){S.onload=C,S.onerror=z}),yn(x,"link",c),s.state.loading|=4,jc(x,o.precedence,n),s.instance=x;case"script":return x=gi(o.src),(p=n.querySelector(wo(x)))?(s.instance=p,_t(p),p):(c=o,(p=ya.get(x))&&(c=y({},o),Wf(c,p)),n=n.ownerDocument||n,p=n.createElement("script"),_t(p),yn(p,"link",c),n.head.appendChild(p),s.instance=p);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(c=s.instance,s.state.loading|=4,jc(c,o.precedence,n));return s.instance}function jc(n,s,o){for(var c=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,x=p,S=0;S<c.length;S++){var C=c[S];if(C.dataset.precedence===s)x=C;else if(x!==p)break}x?x.parentNode.insertBefore(n,x.nextSibling):(s=o.nodeType===9?o.head:o,s.insertBefore(n,s.firstChild))}function Jf(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.title==null&&(n.title=s.title)}function Wf(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.integrity==null&&(n.integrity=s.integrity)}var Ec=null;function By(n,s,o){if(Ec===null){var c=new Map,p=Ec=new Map;p.set(o,c)}else p=Ec,c=p.get(o),c||(c=new Map,p.set(o,c));if(c.has(n))return c;for(c.set(n,null),o=o.getElementsByTagName(n),p=0;p<o.length;p++){var x=o[p];if(!(x[Ye]||x[pe]||n==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var S=x.getAttribute(s)||"";S=n+S;var C=c.get(S);C?C.push(x):c.set(S,[x])}}return c}function Iy(n,s,o){n=n.ownerDocument||n,n.head.insertBefore(o,s==="title"?n.querySelector("head > title"):null)}function z4(n,s,o){if(o===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 Py(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function U4(n,s,o,c){if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=pi(c.href),x=s.querySelector(So(p));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(n.count++,n=Cc.bind(n),s.then(n,n)),o.state.loading|=4,o.instance=x,_t(x);return}x=s.ownerDocument||s,c=$y(c),(p=ya.get(p))&&Jf(c,p),x=x.createElement("link"),_t(x);var S=x;S._p=new Promise(function(C,z){S.onload=C,S.onerror=z}),yn(x,"link",c),o.instance=x}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,s),(s=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=Cc.bind(n),s.addEventListener("load",o),s.addEventListener("error",o))}}var eh=0;function $4(n,s){return n.stylesheets&&n.count===0&&Rc(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var c=setTimeout(function(){if(n.stylesheets&&Rc(n,n.stylesheets),n.unsuspend){var x=n.unsuspend;n.unsuspend=null,x()}},6e4+s);0<n.imgBytes&&eh===0&&(eh=62500*y4());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Rc(n,n.stylesheets),n.unsuspend)){var x=n.unsuspend;n.unsuspend=null,x()}},(n.imgBytes>eh?50:800)+s);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Cc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Rc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var kc=null;function Rc(n,s){n.stylesheets=null,n.unsuspend!==null&&(n.count++,kc=new Map,s.forEach(H4,n),kc=null,Cc.call(n))}function H4(n,s){if(!(s.state.loading&4)){var o=kc.get(n);if(o)var c=o.get(null);else{o=new Map,kc.set(n,o);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var S=p[x];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(o.set(S.dataset.precedence,S),c=S)}c&&o.set(null,c)}p=s.instance,S=p.getAttribute("data-precedence"),x=o.get(S)||c,x===c&&o.set(null,p),o.set(S,p),this.count++,c=Cc.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),x?x.parentNode.insertBefore(p,x.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),s.state.loading|=4}}var No={$$typeof:k,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function B4(n,s,o,c,p,x,S,C,z){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=ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ut(0),this.hiddenUpdates=ut(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function Gy(n,s,o,c,p,x,S,C,z,K,te,ue){return n=new B4(n,s,o,S,z,K,te,ue,C),s=1,x===!0&&(s|=24),x=Xn(3,null,null,s),n.current=x,x.stateNode=n,s=Ld(),s.refCount++,n.pooledCache=s,s.refCount++,x.memoizedState={element:c,isDehydrated:o,cache:s},zd(x),n}function Vy(n){return n?(n=Ys,n):Ys}function qy(n,s,o,c,p,x){p=Vy(p),c.context===null?c.context=p:c.pendingContext=p,c=Tr(s),c.payload={element:o},x=x===void 0?null:x,x!==null&&(c.callback=x),o=Ar(n,c,s),o!==null&&(Gn(o,n,s),to(o,n,s))}function Fy(n,s){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<s?o:s}}function th(n,s){Fy(n,s),(n=n.alternate)&&Fy(n,s)}function Yy(n){if(n.tag===13||n.tag===31){var s=ls(n,67108864);s!==null&&Gn(s,n,67108864),th(n,67108864)}}function Ky(n){if(n.tag===13||n.tag===31){var s=ea();s=$(s);var o=ls(n,s);o!==null&&Gn(o,n,s),th(n,s)}}var Tc=!0;function I4(n,s,o,c){var p=A.T;A.T=null;var x=G.p;try{G.p=2,nh(n,s,o,c)}finally{G.p=x,A.T=p}}function P4(n,s,o,c){var p=A.T;A.T=null;var x=G.p;try{G.p=8,nh(n,s,o,c)}finally{G.p=x,A.T=p}}function nh(n,s,o,c){if(Tc){var p=ah(c);if(p===null)Pf(n,s,c,Ac,o),Qy(n,c);else if(V4(p,n,s,o,c))c.stopPropagation();else if(Qy(n,c),s&4&&-1<G4.indexOf(n)){for(;p!==null;){var x=Mt(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var S=At(x.pendingLanes);if(S!==0){var C=x;for(C.pendingLanes|=2,C.entangledLanes|=2;S;){var z=1<<31-Ft(S);C.entanglements[1]|=z,S&=~z}Ia(x),(ot&6)===0&&(hc=jt()+500,yo(0))}}break;case 31:case 13:C=ls(x,2),C!==null&&Gn(C,x,2),pc(),th(x,2)}if(x=ah(c),x===null&&Pf(n,s,c,Ac,o),x===p)break;p=x}p!==null&&c.stopPropagation()}else Pf(n,s,c,null,o)}}function ah(n){return n=rd(n),rh(n)}var Ac=null;function rh(n){if(Ac=null,n=Et(n),n!==null){var s=l(n);if(s===null)n=null;else{var o=s.tag;if(o===13){if(n=u(s),n!==null)return n;n=null}else if(o===31){if(n=f(s),n!==null)return n;n=null}else if(o===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;n=null}else s!==n&&(n=null)}}return Ac=n,null}function Xy(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(_n()){case Ne:return 2;case He:return 8;case Xe:case yt:return 32;case Tt:return 268435456;default:return 32}default:return 32}}var sh=!1,Pr=null,Gr=null,Vr=null,jo=new Map,Eo=new Map,qr=[],G4="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 Qy(n,s){switch(n){case"focusin":case"focusout":Pr=null;break;case"dragenter":case"dragleave":Gr=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":jo.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Eo.delete(s.pointerId)}}function Co(n,s,o,c,p,x){return n===null||n.nativeEvent!==x?(n={blockedOn:s,domEventName:o,eventSystemFlags:c,nativeEvent:x,targetContainers:[p]},s!==null&&(s=Mt(s),s!==null&&Yy(s)),n):(n.eventSystemFlags|=c,s=n.targetContainers,p!==null&&s.indexOf(p)===-1&&s.push(p),n)}function V4(n,s,o,c,p){switch(s){case"focusin":return Pr=Co(Pr,n,s,o,c,p),!0;case"dragenter":return Gr=Co(Gr,n,s,o,c,p),!0;case"mouseover":return Vr=Co(Vr,n,s,o,c,p),!0;case"pointerover":var x=p.pointerId;return jo.set(x,Co(jo.get(x)||null,n,s,o,c,p)),!0;case"gotpointercapture":return x=p.pointerId,Eo.set(x,Co(Eo.get(x)||null,n,s,o,c,p)),!0}return!1}function Zy(n){var s=Et(n.target);if(s!==null){var o=l(s);if(o!==null){if(s=o.tag,s===13){if(s=u(o),s!==null){n.blockedOn=s,he(n.priority,function(){Ky(o)});return}}else if(s===31){if(s=f(o),s!==null){n.blockedOn=s,he(n.priority,function(){Ky(o)});return}}else if(s===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Lc(n){if(n.blockedOn!==null)return!1;for(var s=n.targetContainers;0<s.length;){var o=ah(n.nativeEvent);if(o===null){o=n.nativeEvent;var c=new o.constructor(o.type,o);ad=c,o.target.dispatchEvent(c),ad=null}else return s=Mt(o),s!==null&&Yy(s),n.blockedOn=o,!1;s.shift()}return!0}function Jy(n,s,o){Lc(n)&&o.delete(s)}function q4(){sh=!1,Pr!==null&&Lc(Pr)&&(Pr=null),Gr!==null&&Lc(Gr)&&(Gr=null),Vr!==null&&Lc(Vr)&&(Vr=null),jo.forEach(Jy),Eo.forEach(Jy)}function Oc(n,s){n.blockedOn===s&&(n.blockedOn=null,sh||(sh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,q4)))}var Dc=null;function Wy(n){Dc!==n&&(Dc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Dc===n&&(Dc=null);for(var s=0;s<n.length;s+=3){var o=n[s],c=n[s+1],p=n[s+2];if(typeof c!="function"){if(rh(c||o)===null)continue;break}var x=Mt(o);x!==null&&(n.splice(s,3),s-=3,nf(x,{pending:!0,data:p,method:o.method,action:c},c,p))}}))}function xi(n){function s(z){return Oc(z,n)}Pr!==null&&Oc(Pr,n),Gr!==null&&Oc(Gr,n),Vr!==null&&Oc(Vr,n),jo.forEach(s),Eo.forEach(s);for(var o=0;o<qr.length;o++){var c=qr[o];c.blockedOn===n&&(c.blockedOn=null)}for(;0<qr.length&&(o=qr[0],o.blockedOn===null);)Zy(o),o.blockedOn===null&&qr.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var p=o[c],x=o[c+1],S=p[ve]||null;if(typeof x=="function")S||Wy(o);else if(S){var C=null;if(x&&x.hasAttribute("formAction")){if(p=x,S=x[ve]||null)C=S.formAction;else if(rh(p)!==null)continue}else C=S.action;typeof C=="function"?o[c+1]=C:(o.splice(c,3),c-=3),Wy(o)}}}function e0(){function n(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function s(){p!==null&&(p(),p=null),c||setTimeout(o,20)}function o(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(o,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),p!==null&&(p(),p=null)}}}function ih(n){this._internalRoot=n}Mc.prototype.render=ih.prototype.render=function(n){var s=this._internalRoot;if(s===null)throw Error(r(409));var o=s.current,c=ea();qy(o,c,n,s,null,null)},Mc.prototype.unmount=ih.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var s=n.containerInfo;qy(n.current,2,null,n,null,null),pc(),s[_e]=null}};function Mc(n){this._internalRoot=n}Mc.prototype.unstable_scheduleHydration=function(n){if(n){var s=fe();n={blockedOn:null,target:n,priority:s};for(var o=0;o<qr.length&&s!==0&&s<qr[o].priority;o++);qr.splice(o,0,n),o===0&&Zy(n)}};var t0=t.version;if(t0!=="19.2.4")throw Error(r(527,t0,"19.2.4"));G.findDOMNode=function(n){var s=n._reactInternals;if(s===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=h(s),n=n!==null?g(n):null,n=n===null?null:n.stateNode,n};var F4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zc.isDisabled&&zc.supportsFiber)try{mn=zc.inject(F4),Bt=zc}catch{}}return To.createRoot=function(n,s){if(!i(n))throw Error(r(299));var o=!1,c="",p=lx,x=cx,S=ux;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(S=s.onRecoverableError)),s=Gy(n,1,!1,null,null,o,c,null,p,x,S,e0),n[_e]=s.current,If(n),new ih(s)},To.hydrateRoot=function(n,s,o){if(!i(n))throw Error(r(299));var c=!1,p="",x=lx,S=cx,C=ux,z=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(x=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(C=o.onRecoverableError),o.formState!==void 0&&(z=o.formState)),s=Gy(n,1,!0,s,o??null,c,p,z,x,S,C,e0),s.context=Vy(null),o=s.current,c=ea(),c=$(c),p=Tr(c),p.callback=null,Ar(o,p,c),o=c,s.current.lanes=o,Pe(s,o),Ia(s),n[_e]=s.current,If(n),new Mc(s)},To.version="19.2.4",To}var L0;function c2(){if(L0)return mh.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(),mh.exports=l2(),mh.exports}var u2=c2();var s_=e=>{throw TypeError(e)},d2=(e,t,a)=>t.has(e)||s_("Cannot "+a),yh=(e,t,a)=>(d2(e,t,"read from private field"),a?a.call(e):t.get(e)),f2=(e,t,a)=>t.has(e)?s_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),O0="popstate";function D0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function h2(e={}){function t(r,i){let l=i.state?.masked,{pathname:u,search:f,hash:m}=l||r.location;return el("",{pathname:u,search:f,hash:m},i.state&&i.state.usr||null,i.state&&i.state.key||"default",l?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function a(r,i){return typeof i=="string"?i:Ka(i)}return p2(t,a,null,e)}function Fe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function $t(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function m2(){return Math.random().toString(36).substring(2,10)}function M0(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 el(e,t,a=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Sr(t):t,state:a,key:t&&t.key||r||m2(),unstable_mask:i}}function Ka({pathname:e="/",search:t="",hash:a=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function Sr(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function p2(e,t,a,r={}){let{window:i=document.defaultView,v5Compat:l=!1}=r,u=i.history,f="POP",m=null,h=g();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function g(){return(u.state||{idx:null}).idx}function y(){f="POP";let j=g(),E=j==null?null:j-h;h=j,m&&m({action:f,location:N.location,delta:E})}function v(j,E){f="PUSH";let R=D0(j)?j:el(N.location,j,E);h=g()+1;let k=M0(R,h),O=N.createHref(R.unstable_mask||R);try{u.pushState(k,"",O)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(O)}l&&m&&m({action:f,location:N.location,delta:1})}function b(j,E){f="REPLACE";let R=D0(j)?j:el(N.location,j,E);h=g();let k=M0(R,h),O=N.createHref(R.unstable_mask||R);u.replaceState(k,"",O),l&&m&&m({action:f,location:N.location,delta:0})}function w(j){return i_(j)}let N={get action(){return f},get location(){return e(i,u)},listen(j){if(m)throw new Error("A history only accepts one active listener");return i.addEventListener(O0,y),m=j,()=>{i.removeEventListener(O0,y),m=null}},createHref(j){return t(i,j)},createURL:w,encodeLocation(j){let E=w(j);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:v,replace:b,go(j){return u.go(j)}};return N}function i_(e,t=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),Fe(a,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Ka(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=a+r),new URL(r,a)}var Io,z0=class{constructor(e){if(f2(this,Io,new Map),e)for(let[t,a]of e)this.set(t,a)}get(e){if(yh(this,Io).has(e))return yh(this,Io).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){yh(this,Io).set(e,t)}};Io=new WeakMap;var g2=new Set(["lazy","caseSensitive","path","id","index","children"]);function x2(e){return g2.has(e)}var y2=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function v2(e){return y2.has(e)}function b2(e){return e.index===!0}function tl(e,t,a=[],r={},i=!1){return e.map((l,u)=>{let f=[...a,String(u)],m=typeof l.id=="string"?l.id:f.join("-");if(Fe(l.index!==!0||!l.children,"Cannot specify children on an index route"),Fe(i||!r[m],`Found a route id collision on id "${m}". Route id's must be globally unique within Data Router usages`),b2(l)){let h={...l,id:m};return r[m]=U0(h,t(h)),h}else{let h={...l,id:m,children:void 0};return r[m]=U0(h,t(h)),l.children&&(h.children=tl(l.children,t,f,r,i)),h}})}function U0(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Kr(e,t,a="/"){return Po(e,t,a,!1)}function Po(e,t,a,r){let i=typeof t=="string"?Sr(t):t,l=Na(i.pathname||"/",a);if(l==null)return null;let u=o_(e);S2(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=O2(l);f=A2(u[m],h,r)}return f}function _2(e,t){let{route:a,pathname:r,params:i}=e;return{id:a.id,pathname:r,params:i,data:t[a.id],loaderData:t[a.id],handle:a.handle}}function o_(e,t=[],a=[],r="",i=!1){let l=(u,f,m=i,h)=>{let g={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&m)return;Fe(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let y=Da([r,g.relativePath]),v=a.concat(g);u.children&&u.children.length>0&&(Fe(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),o_(u.children,t,v,y,m)),!(u.path==null&&!u.index)&&t.push({path:y,score:R2(y,u.index),routesMeta:v})};return e.forEach((u,f)=>{if(u.path===""||!u.path?.includes("?"))l(u,f);else for(let m of l_(u.path))l(u,f,!0,m)}),t}function l_(e){let t=e.split("/");if(t.length===0)return[];let[a,...r]=t,i=a.endsWith("?"),l=a.replace(/\?$/,"");if(r.length===0)return i?[l,""]:[l];let u=l_(r.join("/")),f=[];return f.push(...u.map(m=>m===""?l:[l,m].join("/"))),i&&f.push(...u),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function S2(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:T2(t.routesMeta.map(r=>r.childrenIndex),a.routesMeta.map(r=>r.childrenIndex)))}var w2=/^:[\w-]+$/,N2=3,j2=2,E2=1,C2=10,k2=-2,$0=e=>e==="*";function R2(e,t){let a=e.split("/"),r=a.length;return a.some($0)&&(r+=k2),t&&(r+=j2),a.filter(i=>!$0(i)).reduce((i,l)=>i+(w2.test(l)?N2:l===""?E2:C2),r)}function T2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function A2(e,t,a=!1){let{routesMeta:r}=e,i={},l="/",u=[];for(let f=0;f<r.length;++f){let m=r[f],h=f===r.length-1,g=l==="/"?t:t.slice(l.length)||"/",y=gu({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},g),v=m.route;if(!y&&h&&a&&!r[r.length-1].route.index&&(y=gu({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!y)return null;Object.assign(i,y.params),u.push({params:i,pathname:Da([l,y.pathname]),pathnameBase:z2(Da([l,y.pathnameBase])),route:v}),y.pathnameBase!=="/"&&(l=Da([l,y.pathnameBase]))}return u}function gu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=L2(e.path,e.caseSensitive,e.end),i=t.match(a);if(!i)return null;let l=i[0],u=l.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:r.reduce((h,{paramName:g,isOptional:y},v)=>{if(g==="*"){let w=f[v]||"";u=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const b=f[v];return y&&!b?h[g]=void 0:h[g]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:u,pattern:e}}function L2(e,t=!1,a=!0){$t(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 r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,m,h,g)=>{if(r.push({paramName:f,isOptional:m!=null}),m){let y=g.charAt(h+u.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function O2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $t(!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 Na(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,r=e.charAt(a);return r&&r!=="/"?null:e.slice(a)||"/"}function D2({basename:e,pathname:t}){return t==="/"?e:Da([e,t])}var c_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Om=e=>c_.test(e);function M2(e,t="/"){let{pathname:a,search:r="",hash:i=""}=typeof e=="string"?Sr(e):e,l;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?l=H0(a.substring(1),"/"):l=H0(a,t)):l=t,{pathname:l,search:U2(r),hash:$2(i)}}function H0(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?a.length>1&&a.pop():i!=="."&&a.push(i)}),a.length>1?a.join("/"):"/"}function vh(e,t,a,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function u_(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function Mu(e){let t=u_(e);return t.map((a,r)=>r===t.length-1?a.pathname:a.pathnameBase)}function hl(e,t,a,r=!1){let i;typeof e=="string"?i=Sr(e):(i={...e},Fe(!i.pathname||!i.pathname.includes("?"),vh("?","pathname","search",i)),Fe(!i.pathname||!i.pathname.includes("#"),vh("#","pathname","hash",i)),Fe(!i.search||!i.search.includes("#"),vh("#","search","hash",i)));let l=e===""||i.pathname==="",u=l?"/":i.pathname,f;if(u==null)f=a;else{let y=t.length-1;if(!r&&u.startsWith("..")){let v=u.split("/");for(;v[0]==="..";)v.shift(),y-=1;i.pathname=v.join("/")}f=y>=0?t[y]:"/"}let m=M2(i,f),h=u&&u!=="/"&&u.endsWith("/"),g=(l||u===".")&&a.endsWith("/");return!m.pathname.endsWith("/")&&(h||g)&&(m.pathname+="/"),m}var Da=e=>e.join("/").replace(/\/\/+/g,"/"),z2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),U2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,$2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ml=class{constructor(e,t,a,r=!1){this.status=e,this.statusText=t||"",this.internal=r,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function Ti(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function pl(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var d_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function f_(e,t){let a=e;if(typeof a!="string"||!c_.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let r=a,i=!1;if(d_)try{let l=new URL(window.location.href),u=a.startsWith("//")?new URL(l.protocol+a):new URL(a),f=Na(u.pathname,t);u.origin===l.origin&&f!=null?a=f+u.search+u.hash:i=!0}catch{$t(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:a}}var Zr=Symbol("Uninstrumented");function H2(e,t){let a={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(i=>i({id:t.id,index:t.index,path:t.path,instrument(l){let u=Object.keys(a);for(let f of u)l[f]&&a[f].push(l[f])}}));let r={};if(typeof t.lazy=="function"&&a.lazy.length>0){let i=Ni(a.lazy,t.lazy,()=>{});i&&(r.lazy=i)}if(typeof t.lazy=="object"){let i=t.lazy;["middleware","loader","action"].forEach(l=>{let u=i[l],f=a[`lazy.${l}`];if(typeof u=="function"&&f.length>0){let m=Ni(f,u,()=>{});m&&(r.lazy=Object.assign(r.lazy||{},{[l]:m}))}})}return["loader","action"].forEach(i=>{let l=t[i];if(typeof l=="function"&&a[i].length>0){let u=l[Zr]??l,f=Ni(a[i],u,(...m)=>B0(m[0]));f&&(i==="loader"&&u.hydrate===!0&&(f.hydrate=!0),f[Zr]=u,r[i]=f)}}),t.middleware&&t.middleware.length>0&&a.middleware.length>0&&(r.middleware=t.middleware.map(i=>{let l=i[Zr]??i,u=Ni(a.middleware,l,(...f)=>B0(f[0]));return u?(u[Zr]=l,u):i})),r}function B2(e,t){let a={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(i){let l=Object.keys(i);for(let u of l)i[u]&&a[u].push(i[u])}})),a.navigate.length>0){let r=e.navigate[Zr]??e.navigate,i=Ni(a.navigate,r,(...l)=>{let[u,f]=l;return{to:typeof u=="number"||typeof u=="string"?u:u?Ka(u):".",...I0(e,f??{})}});i&&(i[Zr]=r,e.navigate=i)}if(a.fetch.length>0){let r=e.fetch[Zr]??e.fetch,i=Ni(a.fetch,r,(...l)=>{let[u,,f,m]=l;return{href:f??".",fetcherKey:u,...I0(e,m??{})}});i&&(i[Zr]=r,e.fetch=i)}return e}function Ni(e,t,a){return e.length===0?null:async(...r)=>{let i=await h_(e,a(...r),()=>t(...r),e.length-1);if(i.type==="error")throw i.value;return i.value}}async function h_(e,t,a,r){let i=e[r],l;if(i){let u,f=async()=>(u?console.error("You cannot call instrumented handlers more than once"):u=h_(e,t,a,r-1),l=await u,Fe(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await i(f,t)}catch(m){console.error("An instrumentation function threw an error:",m)}u||await f(),await u}else try{l={type:"success",value:await a()}}catch(u){l={type:"error",value:u}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function B0(e){let{request:t,context:a,params:r,unstable_pattern:i}=e;return{request:I2(t),params:{...r},unstable_pattern:i,context:P2(a)}}function I0(e,t){return{currentUrl:Ka(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 I2(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function P2(e){if(V2(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var G2=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function V2(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")===G2}var m_=["POST","PUT","PATCH","DELETE"],q2=new Set(m_),F2=["GET",...m_],Y2=new Set(F2),p_=new Set([301,302,303,307,308]),K2=new Set([307,308]),bh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},X2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ao={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Q2=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),g_="remix-router-transitions",x_=Symbol("ResetLoaderData");function Z2(e){const t=e.window?e.window:typeof window<"u"?window:void 0,a=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Fe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Q2,l=i;if(e.unstable_instrumentations){let M=e.unstable_instrumentations;l=$=>({...i($),...H2(M.map(Z=>Z.route).filter(Boolean),$)})}let u={},f=tl(e.routes,l,void 0,u),m,h=e.basename||"/";h.startsWith("/")||(h=`/${h}`);let g=e.dataStrategy||nj,y={...e.future},v=null,b=new Set,w=null,N=null,j=null,E=e.hydrationData!=null,R=Kr(f,e.history.location,h),k=!1,O=null,I,B;if(R==null&&!e.patchRoutesOnNavigation){let M=ba(404,{pathname:e.history.location.pathname}),{matches:$,route:Z}=$c(f);I=!0,B=!I,R=$,O={[Z.id]:M}}else if(R&&!e.hydrationData&&ut(R,f,e.history.location.pathname).active&&(R=null),R)if(R.some(M=>M.route.lazy))I=!1,B=!I;else if(!R.some(M=>Dm(M.route)))I=!0,B=!I;else{let M=e.hydrationData?e.hydrationData.loaderData:null,$=e.hydrationData?e.hydrationData.errors:null,Z=R;if($){let fe=R.findIndex(he=>$[he.route.id]!==void 0);Z=Z.slice(0,fe+1)}B=!1,I=Z.every(fe=>{let he=y_(fe.route,M,$);return B=B||he.renderFallback,!he.shouldLoad})}else{I=!1,B=!I,R=[];let M=ut(null,f,e.history.location.pathname);M.active&&M.matches&&(k=!0,R=M.matches)}let H,T={historyAction:e.history.action,location:e.history.location,matches:R,initialized:I,renderFallback:B,navigation:bh,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||O,fetchers:new Map,blockers:new Map},P="POP",X=null,de=!1,le,ce=!1,D=new Map,F=null,A=!1,G=!1,ae=new Set,ee=new Map,J=0,L=-1,q=new Map,re=new Set,ie=new Map,ge=new Map,xe=new Set,Ee=new Map,Me,qe=null;function vn(){if(v=e.history.listen(({action:M,location:$,delta:Z})=>{if(Me){Me(),Me=void 0;return}$t(Ee.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 fe=Dt({currentLocation:T.location,nextLocation:$,historyAction:M});if(fe&&Z!=null){let he=new Promise(Se=>{Me=Se});e.history.go(Z*-1),bt(fe,{state:"blocked",location:$,proceed(){bt(fe,{state:"proceeding",proceed:void 0,reset:void 0,location:$}),he.then(()=>e.history.go(Z))},reset(){let Se=new Map(T.blockers);Se.set(fe,Ao),at({blockers:Se})}}),X?.resolve(),X=null;return}return hn(M,$)}),a){bj(t,D);let M=()=>_j(t,D);t.addEventListener("pagehide",M),F=()=>t.removeEventListener("pagehide",M)}return T.initialized||hn("POP",T.location,{initialHydration:!0}),H}function zn(){v&&v(),F&&F(),b.clear(),le&&le.abort(),T.fetchers.forEach((M,$)=>mn($)),T.blockers.forEach((M,$)=>tt($))}function Ht(M){return b.add(M),()=>b.delete(M)}function at(M,$={}){M.matches&&(M.matches=M.matches.map(he=>{let Se=u[he.route.id],pe=he.route;return pe.element!==Se.element||pe.errorElement!==Se.errorElement||pe.hydrateFallbackElement!==Se.hydrateFallbackElement?{...he,route:Se}:he})),T={...T,...M};let Z=[],fe=[];T.fetchers.forEach((he,Se)=>{he.state==="idle"&&(xe.has(Se)?Z.push(Se):fe.push(Se))}),xe.forEach(he=>{!T.fetchers.has(he)&&!ee.has(he)&&Z.push(he)}),[...b].forEach(he=>he(T,{deletedFetchers:Z,newErrors:M.errors??null,viewTransitionOpts:$.viewTransitionOpts,flushSync:$.flushSync===!0})),Z.forEach(he=>mn(he)),fe.forEach(he=>T.fetchers.delete(he))}function Nt(M,$,{flushSync:Z}={}){let fe=T.actionData!=null&&T.navigation.formMethod!=null&&jn(T.navigation.formMethod)&&T.navigation.state==="loading"&&M.state?._isRedirect!==!0,he;$.actionData?Object.keys($.actionData).length>0?he=$.actionData:he=null:fe?he=T.actionData:he=null;let Se=$.loaderData?Z0(T.loaderData,$.loaderData,$.matches||[],$.errors):T.loaderData,pe=T.blockers;pe.size>0&&(pe=new Map(pe),pe.forEach((Ae,Ce)=>pe.set(Ce,Ao)));let ve=A?!1:Ue(M,$.matches||T.matches),_e=de===!0||T.navigation.formMethod!=null&&jn(T.navigation.formMethod)&&M.state?._isRedirect!==!0;m&&(f=m,m=void 0),A||P==="POP"||(P==="PUSH"?e.history.push(M,M.state):P==="REPLACE"&&e.history.replace(M,M.state));let ke;if(P==="POP"){let Ae=D.get(T.location.pathname);Ae&&Ae.has(M.pathname)?ke={currentLocation:T.location,nextLocation:M}:D.has(M.pathname)&&(ke={currentLocation:M,nextLocation:T.location})}else if(ce){let Ae=D.get(T.location.pathname);Ae?Ae.add(M.pathname):(Ae=new Set([M.pathname]),D.set(T.location.pathname,Ae)),ke={currentLocation:T.location,nextLocation:M}}at({...$,actionData:he,loaderData:Se,historyAction:P,location:M,initialized:!0,renderFallback:!1,navigation:bh,revalidation:"idle",restoreScrollPosition:ve,preventScrollReset:_e,blockers:pe},{viewTransitionOpts:ke,flushSync:Z===!0}),P="POP",de=!1,ce=!1,A=!1,G=!1,X?.resolve(),X=null,qe?.resolve(),qe=null}async function Un(M,$){if(X?.resolve(),X=null,typeof M=="number"){X||(X=tv());let gt=X.promise;return e.history.go(M),gt}let Z=Xh(T.location,T.matches,h,M,$?.fromRouteId,$?.relative),{path:fe,submission:he,error:Se}=P0(!1,Z,$),pe;$?.unstable_mask&&(pe={pathname:"",search:"",hash:"",...typeof $.unstable_mask=="string"?Sr($.unstable_mask):{...T.location.unstable_mask,...$.unstable_mask}});let ve=T.location,_e=el(ve,fe,$&&$.state,void 0,pe);_e={..._e,...e.history.encodeLocation(_e)};let ke=$&&$.replace!=null?$.replace:void 0,Ae="PUSH";ke===!0?Ae="REPLACE":ke===!1||he!=null&&jn(he.formMethod)&&he.formAction===T.location.pathname+T.location.search&&(Ae="REPLACE");let Ce=$&&"preventScrollReset"in $?$.preventScrollReset===!0:void 0,rt=($&&$.flushSync)===!0,Ye=Dt({currentLocation:ve,nextLocation:_e,historyAction:Ae});if(Ye){bt(Ye,{state:"blocked",location:_e,proceed(){bt(Ye,{state:"proceeding",proceed:void 0,reset:void 0,location:_e}),Un(M,$)},reset(){let gt=new Map(T.blockers);gt.set(Ye,Ao),at({blockers:gt})}});return}await hn(Ae,_e,{submission:he,pendingError:Se,preventScrollReset:Ce,replace:$&&$.replace,enableViewTransition:$&&$.viewTransition,flushSync:rt,callSiteDefaultShouldRevalidate:$&&$.unstable_defaultShouldRevalidate})}function lt(){qe||(qe=tv()),Xe(),at({revalidation:"loading"});let M=qe.promise;return T.navigation.state==="submitting"?M:T.navigation.state==="idle"?(hn(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),M):(hn(P||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:ce===!0}),M)}async function hn(M,$,Z){le&&le.abort(),le=null,P=M,A=(Z&&Z.startUninterruptedRevalidation)===!0,be(T.location,T.matches),de=(Z&&Z.preventScrollReset)===!0,ce=(Z&&Z.enableViewTransition)===!0;let fe=m||f,he=Z&&Z.overrideNavigation,Se=Z?.initialHydration&&T.matches&&T.matches.length>0&&!k?T.matches:Kr(fe,$,h),pe=(Z&&Z.flushSync)===!0;if(Se&&T.initialized&&!G&&uj(T.location,$)&&!(Z&&Z.submission&&jn(Z.submission.formMethod))){Nt($,{matches:Se},{flushSync:pe});return}let ve=ut(Se,fe,$.pathname);if(ve.active&&ve.matches&&(Se=ve.matches),!Se){let{error:Et,notFoundMatches:Mt,route:nt}=At($.pathname);Nt($,{matches:Mt,loaderData:{},errors:{[nt.id]:Et}},{flushSync:pe});return}le=new AbortController;let _e=Si(e.history,$,le.signal,Z&&Z.submission),ke=e.getContext?await e.getContext():new z0,Ae;if(Z&&Z.pendingError)Ae=[Xr(Se).route.id,{type:"error",error:Z.pendingError}];else if(Z&&Z.submission&&jn(Z.submission.formMethod)){let Et=await ln(_e,$,Z.submission,Se,ke,ve.active,Z&&Z.initialHydration===!0,{replace:Z.replace,flushSync:pe});if(Et.shortCircuited)return;if(Et.pendingActionResult){let[Mt,nt]=Et.pendingActionResult;if(na(nt)&&Ti(nt.error)&&nt.error.status===404){le=null,Nt($,{matches:Et.matches,loaderData:{},errors:{[Mt]:nt.error}});return}}Se=Et.matches||Se,Ae=Et.pendingActionResult,he=_h($,Z.submission),pe=!1,ve.active=!1,_e=Si(e.history,_e.url,_e.signal)}let{shortCircuited:Ce,matches:rt,loaderData:Ye,errors:gt}=await qt(_e,$,Se,ke,ve.active,he,Z&&Z.submission,Z&&Z.fetcherSubmission,Z&&Z.replace,Z&&Z.initialHydration===!0,pe,Ae,Z&&Z.callSiteDefaultShouldRevalidate);Ce||(le=null,Nt($,{matches:rt||Se,...J0(Ae),loaderData:Ye,errors:gt}))}async function ln(M,$,Z,fe,he,Se,pe,ve={}){Xe();let _e=yj($,Z);if(at({navigation:_e},{flushSync:ve.flushSync===!0}),Se){let Ce=await Pe(fe,$.pathname,M.signal);if(Ce.type==="aborted")return{shortCircuited:!0};if(Ce.type==="error"){if(Ce.partialMatches.length===0){let{matches:Ye,route:gt}=$c(f);return{matches:Ye,pendingActionResult:[gt.id,{type:"error",error:Ce.error}]}}let rt=Xr(Ce.partialMatches).route.id;return{matches:Ce.partialMatches,pendingActionResult:[rt,{type:"error",error:Ce.error}]}}else if(Ce.matches)fe=Ce.matches;else{let{notFoundMatches:rt,error:Ye,route:gt}=At($.pathname);return{matches:rt,pendingActionResult:[gt.id,{type:"error",error:Ye}]}}}let ke,Ae=ru(fe,$);if(!Ae.route.action&&!Ae.route.lazy)ke={type:"error",error:ba(405,{method:M.method,pathname:$.pathname,routeId:Ae.route.id})};else{let Ce=ji(l,u,M,fe,Ae,pe?[]:r,he),rt=await Ne(M,Ce,he,null);if(ke=rt[Ae.route.id],!ke){for(let Ye of fe)if(rt[Ye.route.id]){ke=rt[Ye.route.id];break}}if(M.signal.aborted)return{shortCircuited:!0}}if(Ns(ke)){let Ce;return ve&&ve.replace!=null?Ce=ve.replace:Ce=K0(ke.response.headers.get("Location"),new URL(M.url),h,e.history)===T.location.pathname+T.location.search,await _n(M,ke,!0,{submission:Z,replace:Ce}),{shortCircuited:!0}}if(na(ke)){let Ce=Xr(fe,Ae.route.id);return(ve&&ve.replace)!==!0&&(P="PUSH"),{matches:fe,pendingActionResult:[Ce.route.id,ke,Ae.route.id]}}return{matches:fe,pendingActionResult:[Ae.route.id,ke]}}async function qt(M,$,Z,fe,he,Se,pe,ve,_e,ke,Ae,Ce,rt){let Ye=Se||_h($,pe),gt=pe||ve||ev(Ye),Et=!A&&!ke;if(he){if(Et){let It=bn(Ce);at({navigation:Ye,...It!==void 0?{actionData:It}:{}},{flushSync:Ae})}let Ke=await Pe(Z,$.pathname,M.signal);if(Ke.type==="aborted")return{shortCircuited:!0};if(Ke.type==="error"){if(Ke.partialMatches.length===0){let{matches:Sn,route:Yt}=$c(f);return{matches:Sn,loaderData:{},errors:{[Yt.id]:Ke.error}}}let It=Xr(Ke.partialMatches).route.id;return{matches:Ke.partialMatches,loaderData:{},errors:{[It]:Ke.error}}}else if(Ke.matches)Z=Ke.matches;else{let{error:It,notFoundMatches:Sn,route:Yt}=At($.pathname);return{matches:Sn,loaderData:{},errors:{[Yt.id]:It}}}}let Mt=m||f,{dsMatches:nt,revalidatingFetchers:tn}=G0(M,fe,l,u,e.history,T,Z,gt,$,ke?[]:r,ke===!0,G,ae,xe,ie,re,Mt,h,e.patchRoutesOnNavigation!=null,Ce,rt);if(L=++J,!e.dataStrategy&&!nt.some(Ke=>Ke.shouldLoad)&&!nt.some(Ke=>Ke.route.middleware&&Ke.route.middleware.length>0)&&tn.length===0){let Ke=Te();return Nt($,{matches:Z,loaderData:{},errors:Ce&&na(Ce[1])?{[Ce[0]]:Ce[1].error}:null,...J0(Ce),...Ke?{fetchers:new Map(T.fetchers)}:{}},{flushSync:Ae}),{shortCircuited:!0}}if(Et){let Ke={};if(!he){Ke.navigation=Ye;let It=bn(Ce);It!==void 0&&(Ke.actionData=It)}tn.length>0&&(Ke.fetchers=ia(tn)),at(Ke,{flushSync:Ae})}tn.forEach(Ke=>{vt(Ke.key),Ke.controller&&ee.set(Ke.key,Ke.controller)});let _t=()=>tn.forEach(Ke=>vt(Ke.key));le&&le.signal.addEventListener("abort",_t);let{loaderResults:wr,fetcherResults:Ra}=await He(nt,tn,M,fe);if(M.signal.aborted)return{shortCircuited:!0};le&&le.signal.removeEventListener("abort",_t),tn.forEach(Ke=>ee.delete(Ke.key));let un=Hc(wr);if(un)return await _n(M,un.result,!0,{replace:_e}),{shortCircuited:!0};if(un=Hc(Ra),un)return re.add(un.key),await _n(M,un.result,!0,{replace:_e}),{shortCircuited:!0};let{loaderData:za,errors:as}=Q0(T,Z,wr,Ce,tn,Ra);ke&&T.errors&&(as={...T.errors,...as});let Ua=Te(),rs=Be(L),zs=Ua||rs||tn.length>0;return{matches:Z,loaderData:za,errors:as,...zs?{fetchers:new Map(T.fetchers)}:{}}}function bn(M){if(M&&!na(M[1]))return{[M[0]]:M[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function ia(M){return M.forEach($=>{let Z=T.fetchers.get($.key),fe=Lo(void 0,Z?Z.data:void 0);T.fetchers.set($.key,fe)}),new Map(T.fetchers)}async function kn(M,$,Z,fe){vt(M);let he=(fe&&fe.flushSync)===!0,Se=m||f,pe=Xh(T.location,T.matches,h,Z,$,fe?.relative),ve=Kr(Se,pe,h),_e=ut(ve,Se,pe);if(_e.active&&_e.matches&&(ve=_e.matches),!ve){Tt(M,$,ba(404,{pathname:pe}),{flushSync:he});return}let{path:ke,submission:Ae,error:Ce}=P0(!0,pe,fe);if(Ce){Tt(M,$,Ce,{flushSync:he});return}let rt=e.getContext?await e.getContext():new z0,Ye=(fe&&fe.preventScrollReset)===!0;if(Ae&&jn(Ae.formMethod)){await Rn(M,$,ke,ve,rt,_e.active,he,Ye,Ae,fe&&fe.unstable_defaultShouldRevalidate);return}ie.set(M,{routeId:$,path:ke}),await jt(M,$,ke,ve,rt,_e.active,he,Ye,Ae)}async function Rn(M,$,Z,fe,he,Se,pe,ve,_e,ke){Xe(),ie.delete(M);let Ae=T.fetchers.get(M);yt(M,vj(_e,Ae),{flushSync:pe});let Ce=new AbortController,rt=Si(e.history,Z,Ce.signal,_e);if(Se){let Ct=await Pe(fe,new URL(rt.url).pathname,rt.signal,M);if(Ct.type==="aborted")return;if(Ct.type==="error"){Tt(M,$,Ct.error,{flushSync:pe});return}else if(Ct.matches)fe=Ct.matches;else{Tt(M,$,ba(404,{pathname:Z}),{flushSync:pe});return}}let Ye=ru(fe,Z);if(!Ye.route.action&&!Ye.route.lazy){let Ct=ba(405,{method:_e.formMethod,pathname:Z,routeId:$});Tt(M,$,Ct,{flushSync:pe});return}ee.set(M,Ce);let gt=J,Et=ji(l,u,rt,fe,Ye,r,he),Mt=await Ne(rt,Et,he,M),nt=Mt[Ye.route.id];if(!nt){for(let Ct of Et)if(Mt[Ct.route.id]){nt=Mt[Ct.route.id];break}}if(rt.signal.aborted){ee.get(M)===Ce&&ee.delete(M);return}if(xe.has(M)){if(Ns(nt)||na(nt)){yt(M,xr(void 0));return}}else{if(Ns(nt))if(ee.delete(M),L>gt){yt(M,xr(void 0));return}else return re.add(M),yt(M,Lo(_e)),_n(rt,nt,!1,{fetcherSubmission:_e,preventScrollReset:ve});if(na(nt)){Tt(M,$,nt.error);return}}let tn=T.navigation.location||T.location,_t=Si(e.history,tn,Ce.signal),wr=m||f,Ra=T.navigation.state!=="idle"?Kr(wr,T.navigation.location,h):T.matches;Fe(Ra,"Didn't find any matches after fetcher action");let un=++J;q.set(M,un);let za=Lo(_e,nt.data);T.fetchers.set(M,za);let{dsMatches:as,revalidatingFetchers:Ua}=G0(_t,he,l,u,e.history,T,Ra,_e,tn,r,!1,G,ae,xe,ie,re,wr,h,e.patchRoutesOnNavigation!=null,[Ye.route.id,nt],ke);Ua.filter(Ct=>Ct.key!==M).forEach(Ct=>{let Us=Ct.key,$s=T.fetchers.get(Us),El=Lo(void 0,$s?$s.data:void 0);T.fetchers.set(Us,El),vt(Us),Ct.controller&&ee.set(Us,Ct.controller)}),at({fetchers:new Map(T.fetchers)});let rs=()=>Ua.forEach(Ct=>vt(Ct.key));Ce.signal.addEventListener("abort",rs);let{loaderResults:zs,fetcherResults:Ke}=await He(as,Ua,_t,he);if(Ce.signal.aborted)return;if(Ce.signal.removeEventListener("abort",rs),q.delete(M),ee.delete(M),Ua.forEach(Ct=>ee.delete(Ct.key)),T.fetchers.has(M)){let Ct=xr(nt.data);T.fetchers.set(M,Ct)}let It=Hc(zs);if(It)return _n(_t,It.result,!1,{preventScrollReset:ve});if(It=Hc(Ke),It)return re.add(It.key),_n(_t,It.result,!1,{preventScrollReset:ve});let{loaderData:Sn,errors:Yt}=Q0(T,Ra,zs,void 0,Ua,Ke);Be(un),T.navigation.state==="loading"&&un>L?(Fe(P,"Expected pending action"),le&&le.abort(),Nt(T.navigation.location,{matches:Ra,loaderData:Sn,errors:Yt,fetchers:new Map(T.fetchers)})):(at({errors:Yt,loaderData:Z0(T.loaderData,Sn,Ra,Yt),fetchers:new Map(T.fetchers)}),G=!1)}async function jt(M,$,Z,fe,he,Se,pe,ve,_e){let ke=T.fetchers.get(M);yt(M,Lo(_e,ke?ke.data:void 0),{flushSync:pe});let Ae=new AbortController,Ce=Si(e.history,Z,Ae.signal);if(Se){let nt=await Pe(fe,new URL(Ce.url).pathname,Ce.signal,M);if(nt.type==="aborted")return;if(nt.type==="error"){Tt(M,$,nt.error,{flushSync:pe});return}else if(nt.matches)fe=nt.matches;else{Tt(M,$,ba(404,{pathname:Z}),{flushSync:pe});return}}let rt=ru(fe,Z);ee.set(M,Ae);let Ye=J,gt=ji(l,u,Ce,fe,rt,r,he),Mt=(await Ne(Ce,gt,he,M))[rt.route.id];if(ee.get(M)===Ae&&ee.delete(M),!Ce.signal.aborted){if(xe.has(M)){yt(M,xr(void 0));return}if(Ns(Mt))if(L>Ye){yt(M,xr(void 0));return}else{re.add(M),await _n(Ce,Mt,!1,{preventScrollReset:ve});return}if(na(Mt)){Tt(M,$,Mt.error);return}yt(M,xr(Mt.data))}}async function _n(M,$,Z,{submission:fe,fetcherSubmission:he,preventScrollReset:Se,replace:pe}={}){Z||(X?.resolve(),X=null),$.response.headers.has("X-Remix-Revalidate")&&(G=!0);let ve=$.response.headers.get("Location");Fe(ve,"Expected a Location header on the redirect Response"),ve=K0(ve,new URL(M.url),h,e.history);let _e=el(T.location,ve,{_isRedirect:!0});if(a){let gt=!1;if($.response.headers.has("X-Remix-Reload-Document"))gt=!0;else if(Om(ve)){const Et=i_(ve,!0);gt=Et.origin!==t.location.origin||Na(Et.pathname,h)==null}if(gt){pe?t.location.replace(ve):t.location.assign(ve);return}}le=null;let ke=pe===!0||$.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ae,formAction:Ce,formEncType:rt}=T.navigation;!fe&&!he&&Ae&&Ce&&rt&&(fe=ev(T.navigation));let Ye=fe||he;if(K2.has($.response.status)&&Ye&&jn(Ye.formMethod))await hn(ke,_e,{submission:{...Ye,formAction:ve},preventScrollReset:Se||de,enableViewTransition:Z?ce:void 0});else{let gt=_h(_e,fe);await hn(ke,_e,{overrideNavigation:gt,fetcherSubmission:he,preventScrollReset:Se||de,enableViewTransition:Z?ce:void 0})}}async function Ne(M,$,Z,fe){let he,Se={};try{he=await rj(g,M,$,fe,Z,!1)}catch(pe){return $.filter(ve=>ve.shouldLoad).forEach(ve=>{Se[ve.route.id]={type:"error",error:pe}}),Se}if(M.signal.aborted)return Se;if(!jn(M.method))for(let pe of $){if(he[pe.route.id]?.type==="error")break;!he.hasOwnProperty(pe.route.id)&&!T.loaderData.hasOwnProperty(pe.route.id)&&(!T.errors||!T.errors.hasOwnProperty(pe.route.id))&&pe.shouldCallHandler()&&(he[pe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${pe.route.id}`)})}for(let[pe,ve]of Object.entries(he))if(mj(ve)){let _e=ve.result;Se[pe]={type:"redirect",response:lj(_e,M,pe,$,h)}}else Se[pe]=await oj(ve);return Se}async function He(M,$,Z,fe){let he=Ne(Z,M,fe,null),Se=Promise.all($.map(async _e=>{if(_e.matches&&_e.match&&_e.request&&_e.controller){let Ae=(await Ne(_e.request,_e.matches,fe,_e.key))[_e.match.route.id];return{[_e.key]:Ae}}else return Promise.resolve({[_e.key]:{type:"error",error:ba(404,{pathname:_e.path})}})})),pe=await he,ve=(await Se).reduce((_e,ke)=>Object.assign(_e,ke),{});return{loaderResults:pe,fetcherResults:ve}}function Xe(){G=!0,ie.forEach((M,$)=>{ee.has($)&&ae.add($),vt($)})}function yt(M,$,Z={}){T.fetchers.set(M,$),at({fetchers:new Map(T.fetchers)},{flushSync:(Z&&Z.flushSync)===!0})}function Tt(M,$,Z,fe={}){let he=Xr(T.matches,$);mn(M),at({errors:{[he.route.id]:Z},fetchers:new Map(T.fetchers)},{flushSync:(fe&&fe.flushSync)===!0})}function cn(M){return ge.set(M,(ge.get(M)||0)+1),xe.has(M)&&xe.delete(M),T.fetchers.get(M)||X2}function Yn(M,$){vt(M,$?.reason),yt(M,xr(null))}function mn(M){let $=T.fetchers.get(M);ee.has(M)&&!($&&$.state==="loading"&&q.has(M))&&vt(M),ie.delete(M),q.delete(M),re.delete(M),xe.delete(M),ae.delete(M),T.fetchers.delete(M)}function Bt(M){let $=(ge.get(M)||0)-1;$<=0?(ge.delete(M),xe.add(M)):ge.set(M,$),at({fetchers:new Map(T.fetchers)})}function vt(M,$){let Z=ee.get(M);Z&&(Z.abort($),ee.delete(M))}function Ft(M){for(let $ of M){let Z=cn($),fe=xr(Z.data);T.fetchers.set($,fe)}}function Te(){let M=[],$=!1;for(let Z of re){let fe=T.fetchers.get(Z);Fe(fe,`Expected fetcher: ${Z}`),fe.state==="loading"&&(re.delete(Z),M.push(Z),$=!0)}return Ft(M),$}function Be(M){let $=[];for(let[Z,fe]of q)if(fe<M){let he=T.fetchers.get(Z);Fe(he,`Expected fetcher: ${Z}`),he.state==="loading"&&(vt(Z),q.delete(Z),$.push(Z))}return Ft($),$.length>0}function ct(M,$){let Z=T.blockers.get(M)||Ao;return Ee.get(M)!==$&&Ee.set(M,$),Z}function tt(M){T.blockers.delete(M),Ee.delete(M)}function bt(M,$){let Z=T.blockers.get(M)||Ao;Fe(Z.state==="unblocked"&&$.state==="blocked"||Z.state==="blocked"&&$.state==="blocked"||Z.state==="blocked"&&$.state==="proceeding"||Z.state==="blocked"&&$.state==="unblocked"||Z.state==="proceeding"&&$.state==="unblocked",`Invalid blocker state transition: ${Z.state} -> ${$.state}`);let fe=new Map(T.blockers);fe.set(M,$),at({blockers:fe})}function Dt({currentLocation:M,nextLocation:$,historyAction:Z}){if(Ee.size===0)return;Ee.size>1&&$t(!1,"A router only supports one blocker at a time");let fe=Array.from(Ee.entries()),[he,Se]=fe[fe.length-1],pe=T.blockers.get(he);if(!(pe&&pe.state==="proceeding")&&Se({currentLocation:M,nextLocation:$,historyAction:Z}))return he}function At(M){let $=ba(404,{pathname:M}),Z=m||f,{matches:fe,route:he}=$c(Z);return{notFoundMatches:fe,route:he,error:$}}function en(M,$,Z){if(w=M,j=$,N=Z||null,!E&&T.navigation===bh){E=!0;let fe=Ue(T.location,T.matches);fe!=null&&at({restoreScrollPosition:fe})}return()=>{w=null,j=null,N=null}}function se(M,$){return N&&N(M,$.map(fe=>_2(fe,T.loaderData)))||M.key}function be(M,$){if(w&&j){let Z=se(M,$);w[Z]=j()}}function Ue(M,$){if(w){let Z=se(M,$),fe=w[Z];if(typeof fe=="number")return fe}return null}function ut(M,$,Z){if(e.patchRoutesOnNavigation)if(M){if(Object.keys(M[0].params).length>0)return{active:!0,matches:Po($,Z,h,!0)}}else return{active:!0,matches:Po($,Z,h,!0)||[]};return{active:!1,matches:null}}async function Pe(M,$,Z,fe){if(!e.patchRoutesOnNavigation)return{type:"success",matches:M};let he=M;for(;;){let Se=m==null,pe=m||f,ve=u;try{await e.patchRoutesOnNavigation({signal:Z,path:$,matches:he,fetcherKey:fe,patch:(Ae,Ce)=>{Z.aborted||V0(Ae,Ce,pe,ve,l,!1)}})}catch(Ae){return{type:"error",error:Ae,partialMatches:he}}finally{Se&&!Z.aborted&&(f=[...f])}if(Z.aborted)return{type:"aborted"};let _e=Kr(pe,$,h),ke=null;if(_e){if(Object.keys(_e[0].params).length===0)return{type:"success",matches:_e};if(ke=Po(pe,$,h,!0),!(ke&&he.length<ke.length&&oa(he,ke.slice(0,he.length))))return{type:"success",matches:_e}}if(ke||(ke=Po(pe,$,h,!0)),!ke||oa(he,ke))return{type:"success",matches:null};he=ke}}function oa(M,$){return M.length===$.length&&M.every((Z,fe)=>Z.route.id===$[fe].route.id)}function la(M){u={},m=tl(M,l,void 0,u)}function ca(M,$,Z=!1){let fe=m==null;V0(M,$,m||f,u,l,Z),fe&&(f=[...f],at({}))}return H={get basename(){return h},get future(){return y},get state(){return T},get routes(){return f},get window(){return t},initialize:vn,subscribe:Ht,enableScrollRestoration:en,navigate:Un,fetch:kn,revalidate:lt,createHref:M=>e.history.createHref(M),encodeLocation:M=>e.history.encodeLocation(M),getFetcher:cn,resetFetcher:Yn,deleteFetcher:Bt,dispose:zn,getBlocker:ct,deleteBlocker:tt,patchRoutes:ca,_internalFetchControllers:ee,_internalSetRoutes:la,_internalSetStateDoNotUseOrYouWillBreakYourApp(M){at(M)}},e.unstable_instrumentations&&(H=B2(H,e.unstable_instrumentations.map(M=>M.router).filter(Boolean))),H}function J2(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Xh(e,t,a,r,i,l){let u,f;if(i){u=[];for(let h of t)if(u.push(h),h.route.id===i){f=h;break}}else u=t,f=t[t.length-1];let m=hl(r||".",Mu(u),Na(e.pathname,a)||e.pathname,l==="path");if(r==null&&(m.search=e.search,m.hash=e.hash),(r==null||r===""||r===".")&&f){let h=zm(m.search);if(f.route.index&&!h)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&h){let g=new URLSearchParams(m.search),y=g.getAll("index");g.delete("index"),y.filter(b=>b).forEach(b=>g.append("index",b));let v=g.toString();m.search=v?`?${v}`:""}}return a!=="/"&&(m.pathname=D2({basename:a,pathname:m.pathname})),Ka(m)}function P0(e,t,a){if(!a||!J2(a))return{path:t};if(a.formMethod&&!xj(a.formMethod))return{path:t,error:ba(405,{method:a.formMethod})};let r=()=>({path:t,error:ba(400,{type:"invalid-body"})}),l=(a.formMethod||"get").toUpperCase(),u=N_(t);if(a.body!==void 0){if(a.formEncType==="text/plain"){if(!jn(l))return r();let y=typeof a.body=="string"?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce((v,[b,w])=>`${v}${b}=${w}
|
|
11
|
+
`,""):String(a.body);return{path:t,submission:{formMethod:l,formAction:u,formEncType:a.formEncType,formData:void 0,json:void 0,text:y}}}else if(a.formEncType==="application/json"){if(!jn(l))return r();try{let y=typeof a.body=="string"?JSON.parse(a.body):a.body;return{path:t,submission:{formMethod:l,formAction:u,formEncType:a.formEncType,formData:void 0,json:y,text:void 0}}}catch{return r()}}}Fe(typeof FormData=="function","FormData is not available in this environment");let f,m;if(a.formData)f=Zh(a.formData),m=a.formData;else if(a.body instanceof FormData)f=Zh(a.body),m=a.body;else if(a.body instanceof URLSearchParams)f=a.body,m=X0(f);else if(a.body==null)f=new URLSearchParams,m=new FormData;else try{f=new URLSearchParams(a.body),m=X0(f)}catch{return r()}let h={formMethod:l,formAction:u,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(jn(h.formMethod))return{path:t,submission:h};let g=Sr(t);return e&&g.search&&zm(g.search)&&f.append("index",""),g.search=`?${f}`,{path:Ka(g),submission:h}}function G0(e,t,a,r,i,l,u,f,m,h,g,y,v,b,w,N,j,E,R,k,O){let I=k?na(k[1])?k[1].error:k[1].data:void 0,B=i.createURL(l.location),H=i.createURL(m),T;if(g&&l.errors){let F=Object.keys(l.errors)[0];T=u.findIndex(A=>A.route.id===F)}else if(k&&na(k[1])){let F=k[0];T=u.findIndex(A=>A.route.id===F)-1}let P=k?k[1].statusCode:void 0,X=P&&P>=400,de={currentUrl:B,currentParams:l.matches[0]?.params||{},nextUrl:H,nextParams:u[0].params,...f,actionResult:I,actionStatus:P},le=pl(u),ce=u.map((F,A)=>{let{route:G}=F,ae=null;if(T!=null&&A>T)ae=!1;else if(G.lazy)ae=!0;else if(!Dm(G))ae=!1;else if(g){let{shouldLoad:q}=y_(G,l.loaderData,l.errors);ae=q}else W2(l.loaderData,l.matches[A],F)&&(ae=!0);if(ae!==null)return Qh(a,r,e,le,F,h,t,ae);let ee=!1;typeof O=="boolean"?ee=O:X?ee=!1:(y||B.pathname+B.search===H.pathname+H.search||B.search!==H.search||ej(l.matches[A],F))&&(ee=!0);let J={...de,defaultShouldRevalidate:ee},L=Qo(F,J);return Qh(a,r,e,le,F,h,t,L,J,O)}),D=[];return w.forEach((F,A)=>{if(g||!u.some(ie=>ie.route.id===F.routeId)||b.has(A))return;let G=l.fetchers.get(A),ae=G&&G.state!=="idle"&&G.data===void 0,ee=Kr(j,F.path,E);if(!ee){if(R&&ae)return;D.push({key:A,routeId:F.routeId,path:F.path,matches:null,match:null,request:null,controller:null});return}if(N.has(A))return;let J=ru(ee,F.path),L=new AbortController,q=Si(i,F.path,L.signal),re=null;if(v.has(A))v.delete(A),re=ji(a,r,q,ee,J,h,t);else if(ae)y&&(re=ji(a,r,q,ee,J,h,t));else{let ie;typeof O=="boolean"?ie=O:X?ie=!1:ie=y;let ge={...de,defaultShouldRevalidate:ie};Qo(J,ge)&&(re=ji(a,r,q,ee,J,h,t,ge))}re&&D.push({key:A,routeId:F.routeId,path:F.path,matches:re,match:J,request:q,controller:L})}),{dsMatches:ce,revalidatingFetchers:D}}function Dm(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function y_(e,t,a){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Dm(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=a!=null&&a[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let l=!r&&!i;return{shouldLoad:l,renderFallback:l}}function W2(e,t,a){let r=!t||a.route.id!==t.route.id,i=!e.hasOwnProperty(a.route.id);return r||i}function ej(e,t){let a=e.route.path;return e.pathname!==t.pathname||a!=null&&a.endsWith("*")&&e.params["*"]!==t.params["*"]}function Qo(e,t){if(e.route.shouldRevalidate){let a=e.route.shouldRevalidate(t);if(typeof a=="boolean")return a}return t.defaultShouldRevalidate}function V0(e,t,a,r,i,l){let u;if(e){let h=r[e];Fe(h,`No route found to patch children into: routeId = ${e}`),h.children||(h.children=[]),u=h.children}else u=a;let f=[],m=[];if(t.forEach(h=>{let g=u.find(y=>v_(h,y));g?m.push({existingRoute:g,newRoute:h}):f.push(h)}),f.length>0){let h=tl(f,i,[e||"_","patch",String(u?.length||"0")],r);u.push(...h)}if(l&&m.length>0)for(let h=0;h<m.length;h++){let{existingRoute:g,newRoute:y}=m[h],v=g,[b]=tl([y],i,[],{},!0);Object.assign(v,{element:b.element?b.element:v.element,errorElement:b.errorElement?b.errorElement:v.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:v.hydrateFallbackElement})}}function v_(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((a,r)=>t.children?.some(i=>v_(a,i)))??!1:!1}var q0=new WeakMap,b_=({key:e,route:t,manifest:a,mapRouteProperties:r})=>{let i=a[t.id];if(Fe(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let l=i.lazy[e];if(!l)return;let u=q0.get(i);u||(u={},q0.set(i,u));let f=u[e];if(f)return f;let m=(async()=>{let h=x2(e),y=i[e]!==void 0&&e!=="hasErrorBoundary";if(h)$t(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(y)$t(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await l();v!=null&&(Object.assign(i,{[e]:v}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(v=>v===void 0)&&(i.lazy=void 0))})();return u[e]=m,m},F0=new WeakMap;function tj(e,t,a,r,i){let l=a[e.id];if(Fe(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=F0.get(l);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let y=(async()=>{Fe(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),b={};for(let w in v){let N=v[w];if(N===void 0)continue;let j=v2(w),R=l[w]!==void 0&&w!=="hasErrorBoundary";j?$t(!j,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?$t(!R,`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.`):b[w]=N}Object.assign(l,b),Object.assign(l,{...r(l),lazy:void 0})})();return F0.set(l,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let u=Object.keys(e.lazy),f=[],m;for(let g of u){if(i&&i.includes(g))continue;let y=b_({key:g,route:e,manifest:a,mapRouteProperties:r});y&&(f.push(y),g===t&&(m=y))}let h=f.length>0?Promise.all(f).then(()=>{}):void 0;return h?.catch(()=>{}),m?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:m}}async function Y0(e){let t=e.matches.filter(i=>i.shouldLoad),a={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,l)=>{a[t[l].route.id]=i}),a}async function nj(e){return e.matches.some(t=>t.route.middleware)?__(e,()=>Y0(e)):Y0(e)}function __(e,t){return aj(e,t,r=>{if(gj(r))throw r;return r},fj,a);function a(r,i,l){if(l)return Promise.resolve(Object.assign(l.value,{[i]:{type:"error",result:r}}));{let{matches:u}=e,f=Math.min(Math.max(u.findIndex(h=>h.route.id===i),0),Math.max(u.findIndex(h=>h.shouldCallHandler()),0)),m=Xr(u,u[f].route.id).route.id;return Promise.resolve({[m]:{type:"error",result:r}})}}}async function aj(e,t,a,r,i){let{matches:l,request:u,params:f,context:m,unstable_pattern:h}=e,g=l.flatMap(v=>v.route.middleware?v.route.middleware.map(b=>[v.route.id,b]):[]);return await S_({request:u,params:f,context:m,unstable_pattern:h},g,t,a,r,i)}async function S_(e,t,a,r,i,l,u=0){let{request:f}=e;if(f.signal.aborted)throw f.signal.reason??new Error(`Request aborted: ${f.method} ${f.url}`);let m=t[u];if(!m)return await a();let[h,g]=m,y,v=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await S_(e,t,a,r,i,l,u+1)},y.value}catch(b){return y={value:await l(b,h,y)},y.value}};try{let b=await g(e,v),w=b!=null?r(b):void 0;return i(w)?w:y?w??y.value:(y={value:await v()},y.value)}catch(b){return await l(b,h,y)}}function w_(e,t,a,r,i){let l=b_({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),u=tj(r.route,jn(a.method)?"action":"loader",t,e,i);return{middleware:l,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function Qh(e,t,a,r,i,l,u,f,m=null,h){let g=!1,y=w_(e,t,a,i,l);return{...i,_lazyPromises:y,shouldLoad:f,shouldRevalidateArgs:m,shouldCallHandler(v){return g=!0,m?typeof h=="boolean"?Qo(i,{...m,defaultShouldRevalidate:h}):typeof v=="boolean"?Qo(i,{...m,defaultShouldRevalidate:v}):Qo(i,m):f},resolve(v){let{lazy:b,loader:w,middleware:N}=i.route,j=g||f||v&&!jn(a.method)&&(b||w),E=N&&N.length>0&&!w&&!b;return j&&(jn(a.method)||!E)?sj({request:a,unstable_pattern:r,match:i,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:v,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function ji(e,t,a,r,i,l,u,f=null){return r.map(m=>m.route.id!==i.route.id?{...m,shouldLoad:!1,shouldRevalidateArgs:f,shouldCallHandler:()=>!1,_lazyPromises:w_(e,t,a,m,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Qh(e,t,a,pl(r),m,l,u,!0,f))}async function rj(e,t,a,r,i,l){a.some(h=>h._lazyPromises?.middleware)&&await Promise.all(a.map(h=>h._lazyPromises?.middleware));let u={request:t,unstable_pattern:pl(a),params:a[0].params,context:i,matches:a},m=await e({...u,fetcherKey:r,runClientMiddleware:h=>{let g=u;return __(g,()=>h({...g,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(a.flatMap(h=>[h._lazyPromises?.handler,h._lazyPromises?.route]))}catch{}return m}async function sj({request:e,unstable_pattern:t,match:a,lazyHandlerPromise:r,lazyRoutePromise:i,handlerOverride:l,scopedContext:u}){let f,m,h=jn(e.method),g=h?"action":"loader",y=v=>{let b,w=new Promise((E,R)=>b=R);m=()=>b(),e.signal.addEventListener("abort",m);let N=E=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${a.route.id}]`)):v({request:e,unstable_pattern:t,params:a.params,context:u},...E!==void 0?[E]:[]),j=(async()=>{try{return{type:"data",result:await(l?l(R=>N(R)):N())}}catch(E){return{type:"error",result:E}}})();return Promise.race([j,w])};try{let v=h?a.route.action:a.route.loader;if(r||i)if(v){let b,[w]=await Promise.all([y(v).catch(N=>{b=N}),r,i]);if(b!==void 0)throw b;f=w}else{await r;let b=h?a.route.action:a.route.loader;if(b)[f]=await Promise.all([y(b),i]);else if(g==="action"){let w=new URL(e.url),N=w.pathname+w.search;throw ba(405,{method:e.method,pathname:N,routeId:a.route.id})}else return{type:"data",result:void 0}}else if(v)f=await y(v);else{let b=new URL(e.url),w=b.pathname+b.search;throw ba(404,{pathname:w})}}catch(v){return{type:"error",result:v}}finally{m&&e.signal.removeEventListener("abort",m)}return f}async function ij(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 oj(e){let{result:t,type:a}=e;if(Mm(t)){let r;try{r=await ij(t)}catch(i){return{type:"error",error:i}}return a==="error"?{type:"error",error:new ml(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return a==="error"?W0(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:dj(t),statusCode:Ti(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ti(t)?t.status:void 0}:W0(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 lj(e,t,a,r,i){let l=e.headers.get("Location");if(Fe(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!Om(l)){let u=r.slice(0,r.findIndex(f=>f.route.id===a)+1);l=Xh(new URL(t.url),u,i,l),e.headers.set("Location",l)}return e}function K0(e,t,a,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Om(e)){let l=e,u=l.startsWith("//")?new URL(t.protocol+l):new URL(l);if(i.includes(u.protocol))throw new Error("Invalid redirect location");let f=Na(u.pathname,a)!=null;if(u.origin===t.origin&&f)return u.pathname+u.search+u.hash}try{let l=r.createURL(e);if(i.includes(l.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Si(e,t,a,r){let i=e.createURL(N_(t)).toString(),l={signal:a};if(r&&jn(r.formMethod)){let{formMethod:u,formEncType:f}=r;l.method=u.toUpperCase(),f==="application/json"?(l.headers=new Headers({"Content-Type":f}),l.body=JSON.stringify(r.json)):f==="text/plain"?l.body=r.text:f==="application/x-www-form-urlencoded"&&r.formData?l.body=Zh(r.formData):l.body=r.formData}return new Request(i,l)}function Zh(e){let t=new URLSearchParams;for(let[a,r]of e.entries())t.append(a,typeof r=="string"?r:r.name);return t}function X0(e){let t=new FormData;for(let[a,r]of e.entries())t.append(a,r);return t}function cj(e,t,a,r=!1,i=!1){let l={},u=null,f,m=!1,h={},g=a&&na(a[1])?a[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in t))return;let v=y.route.id,b=t[v];if(Fe(!Ns(b),"Cannot handle redirect results in processLoaderData"),na(b)){let w=b.error;if(g!==void 0&&(w=g,g=void 0),u=u||{},i)u[v]=w;else{let N=Xr(e,v);u[N.route.id]==null&&(u[N.route.id]=w)}r||(l[v]=x_),m||(m=!0,f=Ti(b.error)?b.error.status:500),b.headers&&(h[v]=b.headers)}else l[v]=b.data,b.statusCode&&b.statusCode!==200&&!m&&(f=b.statusCode),b.headers&&(h[v]=b.headers)}),g!==void 0&&a&&(u={[a[0]]:g},a[2]&&(l[a[2]]=void 0)),{loaderData:l,errors:u,statusCode:f||200,loaderHeaders:h}}function Q0(e,t,a,r,i,l){let{loaderData:u,errors:f}=cj(t,a,r);return i.filter(m=>!m.matches||m.matches.some(h=>h.shouldLoad)).forEach(m=>{let{key:h,match:g,controller:y}=m;if(y&&y.signal.aborted)return;let v=l[h];if(Fe(v,"Did not find corresponding fetcher result"),na(v)){let b=Xr(e.matches,g?.route.id);f&&f[b.route.id]||(f={...f,[b.route.id]:v.error}),e.fetchers.delete(h)}else if(Ns(v))Fe(!1,"Unhandled fetcher revalidation redirect");else{let b=xr(v.data);e.fetchers.set(h,b)}}),{loaderData:u,errors:f}}function Z0(e,t,a,r){let i=Object.entries(t).filter(([,l])=>l!==x_).reduce((l,[u,f])=>(l[u]=f,l),{});for(let l of a){let u=l.route.id;if(!t.hasOwnProperty(u)&&e.hasOwnProperty(u)&&l.route.loader&&(i[u]=e[u]),r&&r.hasOwnProperty(u))break}return i}function J0(e){return e?na(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Xr(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function $c(e){let t=e.length===1?e[0]:e.find(a=>a.index||!a.path||a.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ba(e,{pathname:t,routeId:a,method:r,type:i,message:l}={}){let u="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(u="Bad Request",r&&t&&a?f=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${a}", so there is no way to handle the request.`:i==="invalid-body"&&(f="Unable to encode submission body")):e===403?(u="Forbidden",f=`Route "${a}" does not match URL "${t}"`):e===404?(u="Not Found",f=`No route matches URL "${t}"`):e===405&&(u="Method Not Allowed",r&&t&&a?f=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${a}", so there is no way to handle the request.`:r&&(f=`Invalid request method "${r.toUpperCase()}"`)),new ml(e||500,u,new Error(f),!0)}function Hc(e){let t=Object.entries(e);for(let a=t.length-1;a>=0;a--){let[r,i]=t[a];if(Ns(i))return{key:r,result:i}}}function N_(e){let t=typeof e=="string"?Sr(e):e;return Ka({...t,hash:""})}function uj(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function dj(e){return new ml(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function fj(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,a])=>typeof t=="string"&&hj(a))}function hj(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function mj(e){return Mm(e.result)&&p_.has(e.result.status)}function na(e){return e.type==="error"}function Ns(e){return(e&&e.type)==="redirect"}function W0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Mm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function pj(e){return p_.has(e)}function gj(e){return Mm(e)&&pj(e.status)&&e.headers.has("Location")}function xj(e){return Y2.has(e.toUpperCase())}function jn(e){return q2.has(e.toUpperCase())}function zm(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ru(e,t){let a=typeof t=="string"?Sr(t).search:t.search;if(e[e.length-1].route.index&&zm(a||""))return e[e.length-1];let r=u_(e);return r[r.length-1]}function ev(e){let{formMethod:t,formAction:a,formEncType:r,text:i,formData:l,json:u}=e;if(!(!t||!a||!r)){if(i!=null)return{formMethod:t,formAction:a,formEncType:r,formData:void 0,json:void 0,text:i};if(l!=null)return{formMethod:t,formAction:a,formEncType:r,formData:l,json:void 0,text:void 0};if(u!==void 0)return{formMethod:t,formAction:a,formEncType:r,formData:void 0,json:u,text:void 0}}}function _h(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 yj(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 Lo(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 vj(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 xr(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 bj(e,t){try{let a=e.sessionStorage.getItem(g_);if(a){let r=JSON.parse(a);for(let[i,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(i,new Set(l||[]))}}catch{}}function _j(e,t){if(t.size>0){let a={};for(let[r,i]of t)a[r]=[...i];try{e.sessionStorage.setItem(g_,JSON.stringify(a))}catch(r){$t(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function tv(){let e,t,a=new Promise((r,i)=>{e=async l=>{r(l);try{await a}catch{}},t=async l=>{i(l);try{await a}catch{}}});return{promise:a,resolve:e,reject:t}}var Os=_.createContext(null);Os.displayName="DataRouter";var gl=_.createContext(null);gl.displayName="DataRouterState";var j_=_.createContext(!1);function Sj(){return _.useContext(j_)}var Um=_.createContext({isTransitioning:!1});Um.displayName="ViewTransition";var E_=_.createContext(new Map);E_.displayName="Fetchers";var wj=_.createContext(null);wj.displayName="Await";var sa=_.createContext(null);sa.displayName="Navigation";var zu=_.createContext(null);zu.displayName="Location";var Ca=_.createContext({outlet:null,matches:[],isDataRoute:!1});Ca.displayName="Route";var $m=_.createContext(null);$m.displayName="RouteError";var C_="REACT_ROUTER_ERROR",Nj="REDIRECT",jj="ROUTE_ERROR_RESPONSE";function Ej(e){if(e.startsWith(`${C_}:${Nj}:{`))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 Cj(e){if(e.startsWith(`${C_}:${jj}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new ml(t.status,t.statusText,t.data)}catch{}}function kj(e,{relative:t}={}){Fe(zi(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:r}=_.useContext(sa),{hash:i,pathname:l,search:u}=yl(e,{relative:t}),f=l;return a!=="/"&&(f=l==="/"?a:Da([a,l])),r.createHref({pathname:f,search:u,hash:i})}function zi(){return _.useContext(zu)!=null}function ka(){return Fe(zi(),"useLocation() may be used only in the context of a <Router> component."),_.useContext(zu).location}var k_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function R_(e){_.useContext(sa).static||_.useLayoutEffect(e)}function Ot(){let{isDataRoute:e}=_.useContext(Ca);return e?Pj():Rj()}function Rj(){Fe(zi(),"useNavigate() may be used only in the context of a <Router> component.");let e=_.useContext(Os),{basename:t,navigator:a}=_.useContext(sa),{matches:r}=_.useContext(Ca),{pathname:i}=ka(),l=JSON.stringify(Mu(r)),u=_.useRef(!1);return R_(()=>{u.current=!0}),_.useCallback((m,h={})=>{if($t(u.current,k_),!u.current)return;if(typeof m=="number"){a.go(m);return}let g=hl(m,JSON.parse(l),i,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Da([t,g.pathname])),(h.replace?a.replace:a.push)(g,h.state,h)},[t,a,l,i,e])}var Tj=_.createContext(null);function Aj(e){let t=_.useContext(Ca).outlet;return _.useMemo(()=>t&&_.createElement(Tj.Provider,{value:e},t),[t,e])}function xl(){let{matches:e}=_.useContext(Ca),t=e[e.length-1];return t?t.params:{}}function yl(e,{relative:t}={}){let{matches:a}=_.useContext(Ca),{pathname:r}=ka(),i=JSON.stringify(Mu(a));return _.useMemo(()=>hl(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function Lj(e,t,a){Fe(zi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=_.useContext(sa),{matches:i}=_.useContext(Ca),l=i[i.length-1],u=l?l.params:{},f=l?l.pathname:"/",m=l?l.pathnameBase:"/",h=l&&l.route;{let j=h&&h.path||"";L_(f,!h||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${j}">) 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="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let g=ka(),y;y=g;let v=y.pathname||"/",b=v;if(m!=="/"){let j=m.replace(/^\//,"").split("/");b="/"+v.replace(/^\//,"").split("/").slice(j.length).join("/")}let w=Kr(e,{pathname:b});return $t(h||w!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),$t(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 "${y.pathname}${y.search}${y.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.`),Uj(w&&w.map(j=>Object.assign({},j,{params:Object.assign({},u,j.params),pathname:Da([m,r.encodeLocation?r.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?m:Da([m,r.encodeLocation?r.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),i,a)}function Oj(){let e=A_(),t=Ti(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},l={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:l},"ErrorBoundary")," or"," ",_.createElement("code",{style:l},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),a?_.createElement("pre",{style:i},a):null,u)}var Dj=_.createElement(Oj,null),T_=class extends _.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 a=Cj(e.digest);a&&(e=a)}let t=e!==void 0?_.createElement(Ca.Provider,{value:this.props.routeContext},_.createElement($m.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?_.createElement(Mj,{error:e},t):t}};T_.contextType=j_;var Sh=new WeakMap;function Mj({children:e,error:t}){let{basename:a}=_.useContext(sa);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Ej(t.digest);if(r){let i=Sh.get(t);if(i)throw i;let l=f_(r.location,a);if(d_&&!Sh.get(t))if(l.isExternal||r.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:r.replace}));throw Sh.set(t,u),u}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function zj({routeContext:e,match:t,children:a}){let r=_.useContext(Os);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(Ca.Provider,{value:e},a)}function Uj(e,t=[],a){let r=a?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,l=r?.errors;if(l!=null){let g=i.findIndex(y=>y.route.id&&l?.[y.route.id]!==void 0);Fe(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,g+1))}let u=!1,f=-1;if(a&&r){u=r.renderFallback;for(let g=0;g<i.length;g++){let y=i[g];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(f=g),y.route.id){let{loaderData:v,errors:b}=r,w=y.route.loader&&!v.hasOwnProperty(y.route.id)&&(!b||b[y.route.id]===void 0);if(y.route.lazy||w){a.isStatic&&(u=!0),f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}}let m=a?.onError,h=r&&m?(g,y)=>{m(g,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:pl(r.matches),errorInfo:y})}:void 0;return i.reduceRight((g,y,v)=>{let b,w=!1,N=null,j=null;r&&(b=l&&y.route.id?l[y.route.id]:void 0,N=y.route.errorElement||Dj,u&&(f<0&&v===0?(L_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,j=null):f===v&&(w=!0,j=y.route.hydrateFallbackElement||null)));let E=t.concat(i.slice(0,v+1)),R=()=>{let k;return b?k=N:w?k=j:y.route.Component?k=_.createElement(y.route.Component,null):y.route.element?k=y.route.element:k=g,_.createElement(zj,{match:y,routeContext:{outlet:g,matches:E,isDataRoute:r!=null},children:k})};return r&&(y.route.ErrorBoundary||y.route.errorElement||v===0)?_.createElement(T_,{location:r.location,revalidation:r.revalidation,component:N,error:b,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):R()},null)}function Hm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $j(e){let t=_.useContext(Os);return Fe(t,Hm(e)),t}function Hj(e){let t=_.useContext(gl);return Fe(t,Hm(e)),t}function Bj(e){let t=_.useContext(Ca);return Fe(t,Hm(e)),t}function Bm(e){let t=Bj(e),a=t.matches[t.matches.length-1];return Fe(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function Ij(){return Bm("useRouteId")}function A_(){let e=_.useContext($m),t=Hj("useRouteError"),a=Bm("useRouteError");return e!==void 0?e:t.errors?.[a]}function Pj(){let{router:e}=$j("useNavigate"),t=Bm("useNavigate"),a=_.useRef(!1);return R_(()=>{a.current=!0}),_.useCallback(async(i,l={})=>{$t(a.current,k_),a.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...l}))},[e,t])}var nv={};function L_(e,t,a){!t&&!nv[e]&&(nv[e]=!0,$t(!1,a))}var av={};function rv(e,t){!e&&!av[t]&&(av[t]=!0,console.warn(t))}var Gj="useOptimistic",sv=bN[Gj],Vj=()=>{};function qj(e){return sv?sv(e):[e,Vj]}function Fj(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&$t(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:_.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&$t(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&$t(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Yj=["HydrateFallback","hydrateFallbackElement"],Kj=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=a=>{this.status==="pending"&&(this.status="resolved",e(a))},this.reject=a=>{this.status==="pending"&&(this.status="rejected",t(a))}})}};function Xj({router:e,flushSync:t,onError:a,unstable_useTransitions:r}){r=Sj()||r;let[l,u]=_.useState(e.state),[f,m]=qj(l),[h,g]=_.useState(),[y,v]=_.useState({isTransitioning:!1}),[b,w]=_.useState(),[N,j]=_.useState(),[E,R]=_.useState(),k=_.useRef(new Map),O=_.useCallback((T,{deletedFetchers:P,newErrors:X,flushSync:de,viewTransitionOpts:le})=>{X&&a&&Object.values(X).forEach(D=>a(D,{location:T.location,params:T.matches[0]?.params??{},unstable_pattern:pl(T.matches)})),T.fetchers.forEach((D,F)=>{D.data!==void 0&&k.current.set(F,D.data)}),P.forEach(D=>k.current.delete(D)),rv(de===!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(rv(le==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."),!le||!ce){t&&de?t(()=>u(T)):r===!1?u(T):_.startTransition(()=>{r===!0&&m(D=>iv(D,T)),u(T)});return}if(t&&de){t(()=>{N&&(b?.resolve(),N.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:le.currentLocation,nextLocation:le.nextLocation})});let D=e.window.document.startViewTransition(()=>{t(()=>u(T))});D.finished.finally(()=>{t(()=>{w(void 0),j(void 0),g(void 0),v({isTransitioning:!1})})}),t(()=>j(D));return}N?(b?.resolve(),N.skipTransition(),R({state:T,currentLocation:le.currentLocation,nextLocation:le.nextLocation})):(g(T),v({isTransitioning:!0,flushSync:!1,currentLocation:le.currentLocation,nextLocation:le.nextLocation}))},[e.window,t,N,b,r,m,a]);_.useLayoutEffect(()=>e.subscribe(O),[e,O]),_.useEffect(()=>{y.isTransitioning&&!y.flushSync&&w(new Kj)},[y]),_.useEffect(()=>{if(b&&h&&e.window){let T=h,P=b.promise,X=e.window.document.startViewTransition(async()=>{r===!1?u(T):_.startTransition(()=>{r===!0&&m(de=>iv(de,T)),u(T)}),await P});X.finished.finally(()=>{w(void 0),j(void 0),g(void 0),v({isTransitioning:!1})}),j(X)}},[h,b,e.window,r,m]),_.useEffect(()=>{b&&h&&f.location.key===h.location.key&&b.resolve()},[b,N,f.location,h]),_.useEffect(()=>{!y.isTransitioning&&E&&(g(E.state),v({isTransitioning:!0,flushSync:!1,currentLocation:E.currentLocation,nextLocation:E.nextLocation}),R(void 0))},[y.isTransitioning,E]);let I=_.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,P,X)=>e.navigate(T,{state:P,preventScrollReset:X?.preventScrollReset}),replace:(T,P,X)=>e.navigate(T,{replace:!0,state:P,preventScrollReset:X?.preventScrollReset})}),[e]),B=e.basename||"/",H=_.useMemo(()=>({router:e,navigator:I,static:!1,basename:B,onError:a}),[e,I,B,a]);return _.createElement(_.Fragment,null,_.createElement(Os.Provider,{value:H},_.createElement(gl.Provider,{value:f},_.createElement(E_.Provider,{value:k.current},_.createElement(Um.Provider,{value:y},_.createElement(Wj,{basename:B,location:f.location,navigationType:f.historyAction,navigator:I,unstable_useTransitions:r},_.createElement(Qj,{routes:e.routes,future:e.future,state:f,isStatic:!1,onError:a})))))),null)}function iv(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 Qj=_.memo(Zj);function Zj({routes:e,future:t,state:a,isStatic:r,onError:i}){return Lj(e,void 0,{state:a,isStatic:r,onError:i})}function Jj({to:e,replace:t,state:a,relative:r}){Fe(zi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=_.useContext(sa);$t(!i,"<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}=_.useContext(Ca),{pathname:u}=ka(),f=Ot(),m=hl(e,Mu(l),u,r==="path"),h=JSON.stringify(m);return _.useEffect(()=>{f(JSON.parse(h),{replace:t,state:a,relative:r})},[f,h,r,t,a]),null}function O_(e){return Aj(e.context)}function Wj({basename:e="/",children:t=null,location:a,navigationType:r="POP",navigator:i,static:l=!1,unstable_useTransitions:u}){Fe(!zi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=_.useMemo(()=>({basename:f,navigator:i,static:l,unstable_useTransitions:u,future:{}}),[f,i,l,u]);typeof a=="string"&&(a=Sr(a));let{pathname:h="/",search:g="",hash:y="",state:v=null,key:b="default",unstable_mask:w}=a,N=_.useMemo(()=>{let j=Na(h,f);return j==null?null:{location:{pathname:j,search:g,hash:y,state:v,key:b,unstable_mask:w},navigationType:r}},[f,h,g,y,v,b,r,w]);return $t(N!=null,`<Router basename="${f}"> is not able to match the URL "${h}${g}${y}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:_.createElement(sa.Provider,{value:m},_.createElement(zu.Provider,{children:t,value:N}))}var su="get",iu="application/x-www-form-urlencoded";function Uu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function eE(e){return Uu(e)&&e.tagName.toLowerCase()==="button"}function tE(e){return Uu(e)&&e.tagName.toLowerCase()==="form"}function nE(e){return Uu(e)&&e.tagName.toLowerCase()==="input"}function aE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function rE(e,t){return e.button===0&&(!t||t==="_self")&&!aE(e)}function Jh(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,a)=>{let r=e[a];return t.concat(Array.isArray(r)?r.map(i=>[a,i]):[[a,r]])},[]))}function sE(e,t){let a=Jh(e);return t&&t.forEach((r,i)=>{a.has(i)||t.getAll(i).forEach(l=>{a.append(i,l)})}),a}var Bc=null;function iE(){if(Bc===null)try{new FormData(document.createElement("form"),0),Bc=!1}catch{Bc=!0}return Bc}var oE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function wh(e){return e!=null&&!oE.has(e)?($t(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${iu}"`),null):e}function lE(e,t){let a,r,i,l,u;if(tE(e)){let f=e.getAttribute("action");r=f?Na(f,t):null,a=e.getAttribute("method")||su,i=wh(e.getAttribute("enctype"))||iu,l=new FormData(e)}else if(eE(e)||nE(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 m=e.getAttribute("formaction")||f.getAttribute("action");if(r=m?Na(m,t):null,a=e.getAttribute("formmethod")||f.getAttribute("method")||su,i=wh(e.getAttribute("formenctype"))||wh(f.getAttribute("enctype"))||iu,l=new FormData(f,e),!iE()){let{name:h,type:g,value:y}=e;if(g==="image"){let v=h?`${h}.`:"";l.append(`${v}x`,"0"),l.append(`${v}y`,"0")}else h&&l.append(h,y)}}else{if(Uu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=su,r=null,i=iu,u=e}return l&&i==="text/plain"&&(u=l,l=void 0),{action:r,method:a.toLowerCase(),encType:i,formData:l,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Im(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function cE(e,t,a,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&Na(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function uE(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function dE(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 fE(e,t,a){let r=await Promise.all(e.map(async i=>{let l=t.routes[i.route.id];if(l){let u=await uE(l,a);return u.links?u.links():[]}return[]}));return gE(r.flat(1).filter(dE).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function ov(e,t,a,r,i,l){let u=(m,h)=>a[h]?m.route.id!==a[h].route.id:!0,f=(m,h)=>a[h].pathname!==m.pathname||a[h].route.path?.endsWith("*")&&a[h].params["*"]!==m.params["*"];return l==="assets"?t.filter((m,h)=>u(m,h)||f(m,h)):l==="data"?t.filter((m,h)=>{let g=r.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(u(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let y=m.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:a[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function hE(e,t,{includeHydrateFallback:a}={}){return mE(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let l=[i.module];return i.clientActionModule&&(l=l.concat(i.clientActionModule)),i.clientLoaderModule&&(l=l.concat(i.clientLoaderModule)),a&&i.hydrateFallbackModule&&(l=l.concat(i.hydrateFallbackModule)),i.imports&&(l=l.concat(i.imports)),l}).flat(1))}function mE(e){return[...new Set(e)]}function pE(e){let t={},a=Object.keys(e).sort();for(let r of a)t[r]=e[r];return t}function gE(e,t){let a=new Set;return new Set(t),e.reduce((r,i)=>{let l=JSON.stringify(pE(i));return a.has(l)||(a.add(l),r.push({key:l,link:i})),r},[])}function D_(){let e=_.useContext(Os);return Im(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function xE(){let e=_.useContext(gl);return Im(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Pm=_.createContext(void 0);Pm.displayName="FrameworkContext";function M_(){let e=_.useContext(Pm);return Im(e,"You must render this element inside a <HydratedRouter> element"),e}function yE(e,t){let a=_.useContext(Pm),[r,i]=_.useState(!1),[l,u]=_.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:g,onTouchStart:y}=t,v=_.useRef(null);_.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let N=E=>{E.forEach(R=>{u(R.isIntersecting)})},j=new IntersectionObserver(N,{threshold:.5});return v.current&&j.observe(v.current),()=>{j.disconnect()}}},[e]),_.useEffect(()=>{if(r){let N=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(N)}}},[r]);let b=()=>{i(!0)},w=()=>{i(!1),u(!1)};return a?e!=="intent"?[l,v,{}]:[l,v,{onFocus:Oo(f,b),onBlur:Oo(m,w),onMouseEnter:Oo(h,b),onMouseLeave:Oo(g,w),onTouchStart:Oo(y,b)}]:[!1,v,{}]}function Oo(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function vE({page:e,...t}){let{router:a}=D_(),r=_.useMemo(()=>Kr(a.routes,e,a.basename),[a.routes,e,a.basename]);return r?_.createElement(_E,{page:e,matches:r,...t}):null}function bE(e){let{manifest:t,routeModules:a}=M_(),[r,i]=_.useState([]);return _.useEffect(()=>{let l=!1;return fE(e,t,a).then(u=>{l||i(u)}),()=>{l=!0}},[e,t,a]),r}function _E({page:e,matches:t,...a}){let r=ka(),{future:i,manifest:l,routeModules:u}=M_(),{basename:f}=D_(),{loaderData:m,matches:h}=xE(),g=_.useMemo(()=>ov(e,t,h,l,r,"data"),[e,t,h,l,r]),y=_.useMemo(()=>ov(e,t,h,l,r,"assets"),[e,t,h,l,r]),v=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let N=new Set,j=!1;if(t.forEach(R=>{let k=l.routes[R.route.id];!k||!k.hasLoader||(!g.some(O=>O.route.id===R.route.id)&&R.route.id in m&&u[R.route.id]?.shouldRevalidate||k.hasClientLoader?j=!0:N.add(R.route.id))}),N.size===0)return[];let E=cE(e,f,i.unstable_trailingSlashAwareDataRequests,"data");return j&&N.size>0&&E.searchParams.set("_routes",t.filter(R=>N.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[f,i.unstable_trailingSlashAwareDataRequests,m,r,l,g,t,e,u]),b=_.useMemo(()=>hE(y,l),[y,l]),w=bE(y);return _.createElement(_.Fragment,null,v.map(N=>_.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...a})),b.map(N=>_.createElement("link",{key:N,rel:"modulepreload",href:N,...a})),w.map(({key:N,link:j})=>_.createElement("link",{key:N,nonce:a.nonce,...j,crossOrigin:j.crossOrigin??a.crossOrigin})))}function SE(...e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.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 NE(e,t){return Z2({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:h2({window:t?.window}),hydrationData:jE(),routes:e,mapRouteProperties:Fj,hydrationRouteProperties:Yj,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:EE(e.errors)}),e}function EE(e){if(!e)return null;let t=Object.entries(e),a={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")a[r]=new ml(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let l=window[i.__subType];if(typeof l=="function")try{let u=new l(i.message);u.stack="",a[r]=u}catch{}}if(a[r]==null){let l=new Error(i.message);l.stack="",a[r]=l}}else a[r]=i;return a}var z_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ja=_.forwardRef(function({onClick:t,discover:a="render",prefetch:r="none",relative:i,reloadDocument:l,replace:u,unstable_mask:f,state:m,target:h,to:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:b,...w},N){let{basename:j,navigator:E,unstable_useTransitions:R}=_.useContext(sa),k=typeof g=="string"&&z_.test(g),O=f_(g,j);g=O.to;let I=kj(g,{relative:i}),B=ka(),H=null;if(f){let F=hl(f,[],B.unstable_mask?B.unstable_mask.pathname:"/",!0);j!=="/"&&(F.pathname=F.pathname==="/"?j:Da([j,F.pathname])),H=E.createHref(F)}let[T,P,X]=yE(r,w),de=RE(g,{replace:u,unstable_mask:f,state:m,target:h,preventScrollReset:y,relative:i,viewTransition:v,unstable_defaultShouldRevalidate:b,unstable_useTransitions:R});function le(F){t&&t(F),F.defaultPrevented||de(F)}let ce=!(O.isExternal||l),D=_.createElement("a",{...w,...X,href:(ce?H:void 0)||O.absoluteURL||I,onClick:ce?le:t,ref:SE(N,P),target:h,"data-discover":!k&&a==="render"?"true":void 0});return T&&!k?_.createElement(_.Fragment,null,D,_.createElement(vE,{page:I})):D});ja.displayName="Link";var Ai=_.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:r="",end:i=!1,style:l,to:u,viewTransition:f,children:m,...h},g){let y=yl(u,{relative:h.relative}),v=ka(),b=_.useContext(gl),{navigator:w,basename:N}=_.useContext(sa),j=b!=null&&DE(y)&&f===!0,E=w.encodeLocation?w.encodeLocation(y).pathname:y.pathname,R=v.pathname,k=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;a||(R=R.toLowerCase(),k=k?k.toLowerCase():null,E=E.toLowerCase()),k&&N&&(k=Na(k,N)||k);const O=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let I=R===E||!i&&R.startsWith(E)&&R.charAt(O)==="/",B=k!=null&&(k===E||!i&&k.startsWith(E)&&k.charAt(E.length)==="/"),H={isActive:I,isPending:B,isTransitioning:j},T=I?t:void 0,P;typeof r=="function"?P=r(H):P=[r,I?"active":null,B?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let X=typeof l=="function"?l(H):l;return _.createElement(ja,{...h,"aria-current":T,className:P,ref:g,style:X,to:u,viewTransition:f},typeof m=="function"?m(H):m)});Ai.displayName="NavLink";var CE=_.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:r,replace:i,state:l,method:u=su,action:f,onSubmit:m,relative:h,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:v,...b},w)=>{let{unstable_useTransitions:N}=_.useContext(sa),j=LE(),E=OE(f,{relative:h}),R=u.toLowerCase()==="get"?"get":"post",k=typeof f=="string"&&z_.test(f),O=I=>{if(m&&m(I),I.defaultPrevented)return;I.preventDefault();let B=I.nativeEvent.submitter,H=B?.getAttribute("formmethod")||u,T=()=>j(B||I.currentTarget,{fetcherKey:t,method:H,navigate:a,replace:i,state:l,relative:h,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:v});N&&a!==!1?_.startTransition(()=>T()):T()};return _.createElement("form",{ref:w,method:R,action:E,onSubmit:r?m:O,...b,"data-discover":!k&&e==="render"?"true":void 0})});CE.displayName="Form";function kE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function U_(e){let t=_.useContext(Os);return Fe(t,kE(e)),t}function RE(e,{target:t,replace:a,unstable_mask:r,state:i,preventScrollReset:l,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let g=Ot(),y=ka(),v=yl(e,{relative:u});return _.useCallback(b=>{if(rE(b,t)){b.preventDefault();let w=a!==void 0?a:Ka(y)===Ka(v),N=()=>g(e,{replace:w,unstable_mask:r,state:i,preventScrollReset:l,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m});h?_.startTransition(()=>N()):N()}},[y,g,v,a,r,i,t,e,l,u,f,m,h])}function $u(e){$t(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=_.useRef(Jh(e)),a=_.useRef(!1),r=ka(),i=_.useMemo(()=>sE(r.search,a.current?null:t.current),[r.search]),l=Ot(),u=_.useCallback((f,m)=>{const h=Jh(typeof f=="function"?f(new URLSearchParams(i)):f);a.current=!0,l("?"+h,m)},[l,i]);return[i,u]}var TE=0,AE=()=>`__${String(++TE)}__`;function LE(){let{router:e}=U_("useSubmit"),{basename:t}=_.useContext(sa),a=Ij(),r=e.fetch,i=e.navigate;return _.useCallback(async(l,u={})=>{let{action:f,method:m,encType:h,formData:g,body:y}=lE(l,t);if(u.navigate===!1){let v=u.fetcherKey||AE();await r(v,a,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:g,body:y,formMethod:u.method||m,formEncType:u.encType||h,flushSync:u.flushSync})}else await i(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:g,body:y,formMethod:u.method||m,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:a,flushSync:u.flushSync,viewTransition:u.viewTransition})},[r,i,t,a])}function OE(e,{relative:t}={}){let{basename:a}=_.useContext(sa),r=_.useContext(Ca);Fe(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),l={...yl(e||".",{relative:t})},u=ka();if(e==null){l.search=u.search;let f=new URLSearchParams(l.search),m=f.getAll("index");if(m.some(g=>g==="")){f.delete("index"),m.filter(y=>y).forEach(y=>f.append("index",y));let g=f.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&i.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(l.pathname=l.pathname==="/"?a:Da([a,l.pathname])),Ka(l)}function DE(e,{relative:t}={}){let a=_.useContext(Um);Fe(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=U_("useViewTransitionState"),i=yl(e,{relative:t});if(!a.isTransitioning)return!1;let l=Na(a.currentLocation.pathname,r)||a.currentLocation.pathname,u=Na(a.nextLocation.pathname,r)||a.nextLocation.pathname;return gu(i.pathname,u)!=null||gu(i.pathname,l)!=null}const ME="modulepreload",zE=function(e){return"/"+e},lv={},ne=function(t,a,r){let i=Promise.resolve();if(a&&a.length>0){let m=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=u?.nonce||u?.getAttribute("nonce");i=m(a.map(h=>{if(h=zE(h),h in lv)return;lv[h]=!0;const g=h.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${y}`))return;const v=document.createElement("link");if(v.rel=g?"stylesheet":ME,g||(v.as="script"),v.crossOrigin="",v.href=h,f&&v.setAttribute("nonce",f),document.head.appendChild(v),g)return new Promise((b,w)=>{v.addEventListener("load",b),v.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${h}`)))})}))}function l(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return i.then(u=>{for(const f of u||[])f.status==="rejected"&&l(f.reason);return t().catch(l)})};const $_=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim();const UE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const $E=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase());const cv=e=>{const t=$E(e);return t.charAt(0).toUpperCase()+t.slice(1)};var HE={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 BE=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const IE=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:i="",children:l,iconNode:u,...f},m)=>_.createElement("svg",{ref:m,...HE,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:$_("lucide",i),...!l&&!BE(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,g])=>_.createElement(h,g)),...Array.isArray(l)?l:[l]]));const Oe=(e,t)=>{const a=_.forwardRef(({className:r,...i},l)=>_.createElement(IE,{ref:l,iconNode:t,className:$_(`lucide-${UE(cv(e))}`,`lucide-${e}`,r),...i}));return a.displayName=cv(e),a};const PE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],H_=Oe("arrow-right",PE);const GE=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],uv=Oe("arrow-up-right",GE);const VE=[["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"}]],qE=Oe("boxes",VE);const FE=[["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=Oe("brain",FE);const KE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ts=Oe("check",KE);const XE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],rn=Oe("chevron-right",XE);const QE=[["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"}]],B_=Oe("circle-alert",QE);const ZE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],JE=Oe("circle",ZE);const WE=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],eC=Oe("cloud",WE);const tC=[["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"}]],Wh=Oe("copy",tC);const nC=[["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"}]],I_=Oe("database",nC);const aC=[["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"}]],rC=Oe("file-spreadsheet",aC);const sC=[["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"}]],Wr=Oe("file-text",sC);const iC=[["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"}]],P_=Oe("file",iC);const oC=[["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"}]],lC=Oe("files",oC);const cC=[["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"}]],Hu=Oe("folder-git-2",cC);const uC=[["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"}]],dC=Oe("folder-input",uC);const fC=[["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"}]],hC=Oe("folder-open",fC);const mC=[["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"}]],G_=Oe("folder-plus",mC);const pC=[["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"}]],_a=Oe("folder",pC);const gC=[["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"}]],em=Oe("git-branch",gC);const xC=[["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"}]],yC=Oe("git-commit-horizontal",xC);const vC=[["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"}]],bC=Oe("git-fork",vC);const _C=[["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"}]],dv=Oe("github",_C);const SC=[["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"}]],wC=Oe("globe",SC);const NC=[["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"}]],jC=Oe("grid-3x3",NC);const EC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],CC=Oe("info",EC);const kC=[["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"}]],RC=Oe("key",kC);const TC=[["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"}]],AC=Oe("laptop",TC);const LC=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],OC=Oe("list-filter",LC);const DC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],sn=Oe("loader-circle",DC);const MC=[["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"}]],zC=Oe("log-out",MC);const UC=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],$C=Oe("menu",UC);const HC=[["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"}]],BC=Oe("monitor",HC);const IC=[["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"}]],PC=Oe("moon",IC);const GC=[["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"}]],Ei=Oe("package",GC);const VC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],qC=Oe("panel-left",VC);const FC=[["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"}]],tm=Oe("pencil",FC);const YC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Gm=Oe("plus",YC);const KC=[["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"}]],XC=Oe("refresh-cw",KC);const QC=[["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"}]],ZC=Oe("rotate-cw",QC);const JC=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],nm=Oe("search",JC);const WC=[["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"}]],ek=Oe("settings",WC);const tk=[["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"}]],nk=Oe("share-2",tk);const ak=[["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"}]],rk=Oe("sparkles",ak);const sk=[["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"}]],ik=Oe("sun",sk);const ok=[["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"}]],Vm=Oe("trash-2",ok);const lk=[["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"}]],am=Oe("upload",lk);const ck=[["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"}]],uk=Oe("users",ck);const dk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],br=Oe("x",dk),fv=e=>Symbol.iterator in e,hv=e=>"entries"in e,mv=(e,t)=>{const a=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(a.size!==r.size)return!1;for(const[i,l]of a)if(!r.has(i)||!Object.is(l,r.get(i)))return!1;return!0},fk=(e,t)=>{const a=e[Symbol.iterator](),r=t[Symbol.iterator]();let i=a.next(),l=r.next();for(;!i.done&&!l.done;){if(!Object.is(i.value,l.value))return!1;i=a.next(),l=r.next()}return!!i.done&&!!l.done};function hk(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:fv(e)&&fv(t)?hv(e)&&hv(t)?mv(e,t):fk(e,t):mv({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function Ds(e){const t=wi.useRef(void 0);return a=>{const r=e(a);return hk(t.current,r)?t.current:t.current=r}}const pv=e=>{let t;const a=new Set,r=(h,g)=>{const y=typeof h=="function"?h(t):h;if(!Object.is(y,t)){const v=t;t=g??(typeof y!="object"||y===null)?y:Object.assign({},t,y),a.forEach(b=>b(t,v))}},i=()=>t,f={setState:r,getState:i,getInitialState:()=>m,subscribe:h=>(a.add(h),()=>a.delete(h))},m=t=e(r,i,f);return f},mk=(e=>e?pv(e):pv),pk=e=>e;function gk(e,t=pk){const a=wi.useSyncExternalStore(e.subscribe,wi.useCallback(()=>t(e.getState()),[e,t]),wi.useCallback(()=>t(e.getInitialState()),[e,t]));return wi.useDebugValue(a),a}const gv=e=>{const t=mk(e),a=r=>gk(t,r);return Object.assign(a,t),a},ns=(e=>e?gv(e):gv),Do="c4a_token";function xv(e){try{const t=e.split(".");if(t.length!==3)return null;const a=t[1].replace(/-/g,"+").replace(/_/g,"/"),r=atob(a),i=Uint8Array.from(r,u=>u.charCodeAt(0));return JSON.parse(new TextDecoder().decode(i))}catch{return null}}function yv(e){const t=e.userId,a=e.name,r=e.email,i=e.avatar_url,l=e.workspaceId;if(!t||!r||!l)return null;const u={id:t,name:a??r,email:r,personal_workspace_id:l};return i&&(u.avatar_url=i),u}function vv(e){const t=e.exp;return t?Date.now()>=t*1e3:!1}const qn=ns(e=>({token:null,user:null,isAuthenticated:!1,init:()=>{const t=localStorage.getItem(Do);if(!t){e({token:null,user:null,isAuthenticated:!1});return}const a=xv(t);if(!a||vv(a)){localStorage.removeItem(Do),e({token:null,user:null,isAuthenticated:!1});return}const r=yv(a);if(!r){localStorage.removeItem(Do),e({token:null,user:null,isAuthenticated:!1});return}e({token:t,user:r,isAuthenticated:!0})},login:t=>{const a=xv(t);if(!a||vv(a))return;const r=yv(a);r&&(localStorage.setItem(Do,t),e({token:t,user:r,isAuthenticated:!0}))},logout:()=>{localStorage.removeItem(Do),e({token:null,user:null,isAuthenticated:!1})}})),nl=ns(e=>({activeWorkspaceId:null,init:()=>{const t=qn.getState().user;t?.personal_workspace_id&&e({activeWorkspaceId:t.personal_workspace_id})},setActiveWorkspace:t=>{e({activeWorkspaceId:t})}}));qn.subscribe((e,t)=>{e.user!==t.user&&(e.user?.personal_workspace_id?nl.getState().setActiveWorkspace(e.user.personal_workspace_id):nl.getState().setActiveWorkspace(null))});const V_="/api/v1";class Ln extends Error{constructor(t,a,r){super(r),this.status=t,this.code=a,this.name="ApiError"}}async function Ic(e,t,a,r,i){let l=`${V_}${t}`;if(r){const y=new URLSearchParams(r).toString();y&&(l+=`?${y}`)}const u={"Content-Type":"application/json"},f=qn.getState().token;f&&(u.Authorization=`Bearer ${f}`);const m=nl.getState().activeWorkspaceId;m&&(u["X-Workspace-Id"]=m);const h={method:e,headers:u};a!==void 0&&(h.body=JSON.stringify(a)),i?.signal&&(h.signal=i.signal);const g=await fetch(l,h);if(!g.ok){let y="UNKNOWN",v=g.statusText;try{const b=await g.json();b.code&&(y=b.code),b.message&&(v=b.message)}catch{}throw g.status===401&&qn.getState().logout(),new Ln(g.status,y,v)}return g.json()}const Nh=new Map;function xk(e,t){let a=`${V_}${e}`;if(t){const r=new URLSearchParams(t).toString();r&&(a+=`?${r}`)}return a}const De={get(e,t,a){const i=`${nl.getState().activeWorkspaceId??""}::${xk(e,t)}`,l=Nh.get(i);if(l)return l;const u=Ic("GET",e,void 0,t,a).finally(()=>{Nh.delete(i)});return Nh.set(i,u),u},post(e,t,a){return Ic("POST",e,t,void 0,a)},put(e,t){return Ic("PUT",e,t)},delete(e){return Ic("DELETE",e)}},yk=3e4,vk=1e3,bk=3e4;class _k{ws=null;url="";handlers=new Map;statusHandlers=new Set;heartbeatTimer=null;reconnectTimer=null;reconnectAttempt=0;intentionalClose=!1;_status="disconnected";get status(){return this._status}setStatus(t){this._status=t;for(const a of this.statusHandlers)a(t)}onStatusChange(t){return this.statusHandlers.add(t),()=>{this.statusHandlers.delete(t)}}connect(t){this.url=t,this.intentionalClose=!1,this.reconnectAttempt=0,this.open()}disconnect(){this.intentionalClose=!0,this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}on(t,a){let r=this.handlers.get(t);return r||(r=new Set,this.handlers.set(t,r)),r.add(a),()=>{r.delete(a),r.size===0&&this.handlers.delete(t)}}send(t,a){if(this.ws?.readyState!==WebSocket.OPEN)return;const r={event:t,payload:a,timestamp:Date.now()};this.ws.send(JSON.stringify(r))}open(){this.setStatus("connecting");const t=new WebSocket(this.url);t.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},t.onmessage=a=>{try{const r=JSON.parse(String(a.data));if(r.event==="pong")return;const i=this.handlers.get(r.event);if(i)for(const l of i)l(r.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()}))},yk)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const t=Math.min(vk*2**this.reconnectAttempt,bk);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},t)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const Ea=new _k,Wt=ns((e,t)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{e({loading:!0,error:null});try{const a=await De.get("/libraries");e({libraries:a,loading:!1})}catch(a){e({error:a instanceof Error?a.message:"Failed to load libraries",loading:!1})}},createLibrary:async a=>{const r=await De.post("/libraries",a);return e(i=>({libraries:[...i.libraries,r]})),r},deleteLibrary:async a=>{await De.delete(`/libraries/${a}`),e(r=>({libraries:r.libraries.filter(i=>i.id!==a)}))},updateLibraryName:async(a,r)=>{const i=await De.put(`/libraries/${a}`,{name:r});e(l=>({libraries:l.libraries.map(u=>u.id===a?i:u)}))},_updateLibraryOnline:(a,r)=>{e(i=>({libraries:i.libraries.map(l=>l.id===a?{...l,is_online:r}:l)}))},_refreshLibrary:async a=>{try{const r=await De.get(`/libraries/${a}`);e(i=>({libraries:i.libraries.map(l=>l.id===a?r:l)}))}catch{t().fetchLibraries()}}})),Ui=e=>{const t=e.libraries.filter(r=>r.type==="cloud").sort((r,i)=>r.created_at.localeCompare(i.created_at)),a=e.libraries.filter(r=>r.type==="daemon").sort((r,i)=>r.name.localeCompare(i.name));return[...t,...a]},Sk=e=>e.libraries.filter(t=>t.type==="daemon");Ea.on("ws:daemon:status",e=>{const t=e;t.lib_id&&Wt.getState()._updateLibraryOnline(t.lib_id,t.is_online),Wt.getState().fetchLibraries()});Ea.on("ws:daemon:connected",e=>{const t=e;t.lib_id&&Wt.getState()._updateLibraryOnline(t.lib_id,!0),Wt.getState().fetchLibraries()});Ea.on("ws:library:updated",e=>{const t=e;Wt.getState()._refreshLibrary(t.library_id)});function wk({name:e,avatarUrl:t,size:a=24}){const[r,i]=_.useState(!1),l=e.charAt(0).toUpperCase();return t&&!r?d.jsx("img",{src:t,alt:"",className:"rounded-full object-cover",style:{width:a,height:a},onError:()=>i(!0)}):d.jsx("span",{className:"inline-flex items-center justify-center rounded-full bg-c4a-accent font-mono font-bold text-white",style:{width:a,height:a,fontSize:a*.48},children:l})}function Nk(){const{t:e}=ye(),t=Ot(),a=qn(v=>v.user),r=qn(v=>v.logout),[i,l]=_.useState(!1),u=_.useRef(null),f=Wt(Ds(Sk)),m=f.some(v=>v.is_online),h=_.useCallback(()=>{r(),l(!1),t("/login",{replace:!0})},[r,t]),g=()=>{u.current&&clearTimeout(u.current),l(!0)},y=()=>{u.current=setTimeout(()=>l(!1),150)};return a?d.jsxs("div",{className:"relative",onMouseEnter:g,onMouseLeave:y,children:[d.jsxs("button",{className:"relative flex cursor-pointer items-center gap-1",children:[d.jsx(wk,{name:a.name,avatarUrl:a.avatar_url,size:30}),d.jsx("span",{className:`absolute right-0 top-0 h-2 w-2 rounded-full ${m?"bg-c4a-success":"bg-c4a-text-muted"}`})]}),i&&d.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:[d.jsxs("div",{className:"px-4 py-3",children:[d.jsx("p",{className:"text-sm text-c4a-text-primary",children:a.name}),d.jsx("p",{className:"text-xs text-c4a-text-muted",children:a.email})]}),d.jsx("div",{className:"border-t border-c4a-border-subtle",children:f.length===0?d.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:[d.jsx("span",{className:"flex h-3 w-3 shrink-0 items-center justify-center",children:d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-c4a-text-muted"})}),e("user.menu.connect_source")]}):f.map(v=>d.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:[d.jsx("span",{className:"flex h-3 w-3 shrink-0 items-center justify-center",children:d.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${v.is_online?"bg-c4a-success":"bg-c4a-error"}`})}),v.name]},v.id))}),d.jsx("div",{className:"border-t border-c4a-border-subtle",children:d.jsxs("button",{onClick:h,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:[d.jsx(zC,{size:12,className:"shrink-0"}),e("user.menu.sign_out")]})})]})]}):null}function rm({onLoginClick:e}){const{t}=ye();return qn(r=>r.isAuthenticated)?d.jsx(Nk,{}):d.jsx(ja,{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 bv=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function jk(){const{t:e}=ye(),[t,a]=_.useState(!1);return d.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[d.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[d.jsxs(ja,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[d.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),d.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),d.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[d.jsx("nav",{className:"flex items-center gap-4",children:bv.map(({to:r,labelKey:i})=>d.jsx(Ai,{to:r,end:r==="/",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(i)},r))}),d.jsx(rm,{})]}),d.jsx("button",{onClick:()=>a(!t),className:"text-c4a-text-secondary md:hidden",children:t?d.jsx(br,{size:20}):d.jsx($C,{size:20})})]}),t&&d.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[d.jsx("nav",{className:"flex flex-col gap-2",children:bv.map(({to:r,labelKey:i})=>d.jsx(Ai,{to:r,end:r==="/",onClick:()=>a(!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(i)},r))}),d.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:d.jsx(rm,{onLoginClick:()=>a(!1)})})]})]})}function Ek(e){return e==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e==="system"?"dark":e}function q_(e){if(typeof window>"u")return;const t=Ek(e);document.documentElement.setAttribute("data-theme",t),localStorage.setItem("theme",e)}function Ck(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const qm=ns(e=>({theme:Ck(),setTheme:t=>{q_(t),e({theme:t})}}));let _v=!1;function kk(){if(_v||typeof window>"u")return;_v=!0;const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{const{theme:a}=qm.getState();a==="system"&&q_("system")};e.addEventListener("change",t)}kk();const Rk=[{mode:"light",icon:ik,labelKey:"footer.theme.light"},{mode:"dark",icon:PC,labelKey:"footer.theme.dark"},{mode:"system",icon:BC,labelKey:"footer.theme.system"}];function F_(){const{t:e}=ye(),{theme:t,setTheme:a}=qm();return d.jsx("div",{className:"flex items-center gap-1",children:Rk.map(({mode:r,icon:i,labelKey:l})=>d.jsx("button",{onClick:()=>a(r),title:e(l),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${t===r?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:d.jsx(i,{size:14})},r))})}function Y_(){const{i18n:e}=ye(),t=()=>{const a=e.language==="en"?"zh":"en";e.changeLanguage(a)};return d.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 K_({compact:e}){const{t}=ye(),a=new Date().getFullYear(),r=e?"footer.copyright_compact":"footer.copyright";return d.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:t(r,{year:a})})}const Tk="_brandIcon_1c7st_1",Ak="_iconPulse_1c7st_35",Sv={brandIcon:Tk,iconPulse:Ak};function Lk({variant:e}){const{t}=ye(),a=e==="studio"?"bg-c4a-bg-surface":"bg-c4a-bg-base";return d.jsx("footer",{className:`border-t border-c4a-border-subtle ${a} px-4 py-4`,children:d.jsxs("div",{className:"flex items-end justify-between gap-4",children:[d.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[d.jsx("div",{className:Sv.brandIcon,children:d.jsx("span",{className:Sv.iconPulse,children:"C4A"})}),d.jsxs("div",{className:"flex flex-col",children:[d.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:t("footer.tagline")})]})]}),d.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(F_,{}),d.jsx(Y_,{})]}),d.jsx(K_,{})]})]})})}function Ok(){return d.jsxs("div",{className:"flex min-h-screen flex-col",children:[d.jsx(jk,{}),d.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:d.jsx(O_,{})}),d.jsx(Lk,{})]})}function Dk({onToggleSidebar:e}){return d.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-surface/95 backdrop-blur-sm",children:d.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[e&&d.jsx("button",{onClick:e,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:d.jsx(qC,{size:20})}),d.jsxs(ja,{to:"/",className:"hidden items-center gap-2 text-c4a-text-primary md:flex",children:[d.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),d.jsx("span",{className:"font-mono text-sm font-semibold uppercase tracking-tight",children:"Context4AI"})]})]}),d.jsx(ja,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:d.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),d.jsx(rm,{})]})})}const Mk=e=>`flex items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${e?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,zk=[{to:"/studio/modeling",icon:qE,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:YE,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:nm,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:nk,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:uk,i18nKey:"studio.sidebar.collaboration"}],Uk=[{to:"/studio/settings/api-keys",i18nKey:"settings.tab.api_keys",icon:RC}],$k=["My Drive","个人云","我的云盘"];function Hk({onNavigate:e}){const{t}=ye(),r=ka().pathname.startsWith("/studio/settings"),[i,l]=_.useState(r);return _.useEffect(()=>{r&&l(!0)},[r]),d.jsxs("div",{children:[d.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 ${r?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[d.jsx(ek,{size:14}),t("studio.sidebar.settings"),d.jsx(rn,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${i?"rotate-90":""}`})]}),i&&d.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:Uk.map(({to:u,i18nKey:f,icon:m})=>d.jsxs(Ai,{to:u,onClick:e,className:({isActive:h})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${h?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,children:[d.jsx(m,{size:13,className:"shrink-0 opacity-60"}),t(f)]},u))})]})}function wv({onNavigate:e}){const{t}=ye(),a=ka(),r=Ot(),i=Wt(Ds(Ui)),l=a.pathname.startsWith("/studio/sources")||a.pathname.startsWith("/studio/source/"),[u,f]=_.useState(l);_.useEffect(()=>{l&&f(!0)},[l]);const m=h=>h.is_default&&$k.includes(h.name)?t("sources.library.default_cloud_name"):h.name;return d.jsxs("aside",{className:"flex h-full w-[220px] shrink-0 flex-col border-r border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("nav",{className:"flex flex-col gap-1",children:[d.jsxs("div",{className:"group/sources",children:[d.jsxs("button",{onClick:()=>f(h=>!h),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:[d.jsx(I_,{size:14}),t("studio.sidebar.sources"),d.jsx("span",{role:"button",tabIndex:0,onClick:h=>{h.stopPropagation(),r("/studio/sources/add-client"),e?.()},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.stopPropagation(),r("/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:d.jsx(Gm,{size:12})}),d.jsx(rn,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${u?"rotate-90":""}`})]}),u&&d.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:i.map(h=>{const g=m(h);return d.jsxs(Ai,{to:`/studio/sources/${h.id}`,onClick:e,className:({isActive:y})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${y?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,children:[h.type==="cloud"?d.jsx(eC,{size:13,className:"shrink-0 opacity-60"}):d.jsx(AC,{size:13,className:"shrink-0 opacity-60"}),d.jsx("span",{className:"truncate",children:g}),h.type==="daemon"&&(()=>{const y=h.config?.machine_id;return d.jsxs("span",{role:"button",tabIndex:0,onClick:v=>{v.preventDefault(),v.stopPropagation(),r("/studio/sources/add-client"),e?.()},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),r("/studio/sources/add-client"),e?.())},className:"group/dot relative ml-auto shrink-0 cursor-pointer rounded-full p-1",children:[d.jsx("span",{className:`block h-[7px] w-[7px] rounded-full ${h.is_online?"bg-c4a-success":"bg-c4a-error"}`}),d.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:h.is_online?t("sources.menu.status_online",{machine:y??""}):t("sources.menu.status_offline",{machine:y??""})})]})})()]},h.id)})})]}),zk.map(({to:h,icon:g,i18nKey:y})=>d.jsxs(Ai,{to:h,onClick:e,className:({isActive:v})=>Mk(v),children:[d.jsx(g,{size:14}),t(y)]},h)),d.jsx(Hk,{...e?{onNavigate:e}:{}})]}),d.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(F_,{}),d.jsx(Y_,{})]}),d.jsx(K_,{compact:!0})]})]})}const al=ns(e=>({status:"disconnected",onlineCount:0,connections:[],setStatus:t=>e({status:t}),fetchDaemonStatus:async()=>{try{const t=await De.get("/daemons/status");e({onlineCount:t.online_count,connections:t.connections})}catch{}}})),Bk=e=>e==="connecting"?"disconnected":e;Ea.onStatusChange(e=>{al.getState().setStatus(Bk(e))});Ea.on("ws:daemon:connected",e=>{const t=e;al.setState(a=>{if(a.connections.some(u=>u.machine_id===t.machine_id))return a;const i={machine_id:t.machine_id};t.lib_id&&(i.lib_id=t.lib_id);const l=[...a.connections,i];return{connections:l,onlineCount:l.length}})});Ea.on("ws:daemon:status",e=>{const t=e;al.setState(a=>{if(t.is_online){if(a.connections.some(f=>f.machine_id===t.machine_id))return a;const l={machine_id:t.machine_id};t.lib_id&&(l.lib_id=t.lib_id);const u=[...a.connections,l];return{connections:u,onlineCount:u.length}}const r=a.connections.filter(i=>i.machine_id!==t.machine_id);return{connections:r,onlineCount:r.length}})});function Ik(){const e=Ot(),[t,a]=_.useState(!1),r=qn(u=>u.isAuthenticated),[i,l]=_.useState(!1);return _.useEffect(()=>{const u=qn.getState();u.isAuthenticated||u.init(),l(!0)},[]),_.useEffect(()=>{i&&!r&&e("/login",{replace:!0})},[i,r,e]),_.useEffect(()=>{!i||!r||(Wt.getState().fetchLibraries(),al.getState().fetchDaemonStatus())},[i,r]),_.useEffect(()=>{if(!(!i||!r))return Ea.onStatusChange(u=>{u==="connected"&&(Wt.getState().fetchLibraries(),al.getState().fetchDaemonStatus())})},[i,r]),!i||!r?null:d.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[d.jsx(Dk,{onToggleSidebar:()=>a(!t)}),d.jsxs("div",{className:"flex min-h-0 flex-1",children:[d.jsx("div",{className:"hidden md:block",children:d.jsx(wv,{})}),t&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>a(!1)}),d.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:d.jsx(wv,{onNavigate:()=>a(!1)})})]}),d.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:d.jsx(O_,{})})]})]})}function Pk(){const{t:e}=ye();return d.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[d.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:e("home.hero.title")}),d.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:e("home.hero.description")}),d.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[d.jsxs(ja,{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"),d.jsx(H_,{size:14})]}),d.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 Gk=new Set(["github","google","feishu"]),Vk=new Set(["oidc","oauth2"]);function qk(){const{t:e}=ye(),t=Ot(),a=qn(O=>O.login),r=qn(O=>O.isAuthenticated),[i,l]=_.useState([]),[u,f]=_.useState(!0),[m,h]=_.useState(null),[g,y]=_.useState(!1);_.useEffect(()=>{r&&t("/studio",{replace:!0})},[r,t]);const v=_.useCallback(async()=>{f(!0),h(null);try{const O=await De.get("/auth/providers");l(O)}catch{h(e("login.error"))}finally{f(!1)}},[e]);_.useEffect(()=>{v()},[v]);const b=O=>{y(!0),window.location.href=`/api/v1/auth/${O}/login`},w=async()=>{y(!0);try{const O=await De.post("/auth/test-account/login");a(O.token),t("/studio",{replace:!0})}catch{y(!1),h(e("login.error"))}},N=i.filter(O=>Gk.has(O.type)),j=i.filter(O=>Vk.has(O.type)),E=i.find(O=>O.type==="test_account"),R=N.length>0||j.length>0,k=(N.length>0?1:0)+(j.length>0?1:0)+(E?1:0)>1;return d.jsx("div",{className:"flex flex-1 items-center justify-center px-4 py-12",children:d.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 ${g?"border-transparent":"border-c4a-border-subtle border-t-c4a-accent"}`,children:[d.jsx("style",{children:`
|
|
14
|
+
.login-provider-btn {
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
.login-provider-btn::before {
|
|
18
|
+
content: '';
|
|
19
|
+
position: absolute;
|
|
20
|
+
inset: 0;
|
|
21
|
+
background: #fff;
|
|
22
|
+
opacity: 0;
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
border-radius: inherit;
|
|
25
|
+
}
|
|
26
|
+
/* 日间:普通按钮用黑闪(更轻);主题色按钮保持白闪在橙底上更明显 */
|
|
27
|
+
:root[data-theme="light"] .login-provider-btn::before {
|
|
28
|
+
background: #000;
|
|
29
|
+
}
|
|
30
|
+
:root[data-theme="light"] .login-provider-btn:hover::before {
|
|
31
|
+
animation: login-btn-flash-light-soft 0.42s forwards;
|
|
32
|
+
}
|
|
33
|
+
:root[data-theme="light"] .login-test-account-btn::before {
|
|
34
|
+
background: #fff;
|
|
35
|
+
}
|
|
36
|
+
:root[data-theme="light"] .login-test-account-btn:hover::before {
|
|
37
|
+
animation: login-btn-flash-accent 0.42s forwards;
|
|
38
|
+
}
|
|
39
|
+
.login-provider-btn:hover {
|
|
40
|
+
animation: login-provider-hover-in 0.42s forwards;
|
|
41
|
+
}
|
|
42
|
+
/* 普通按钮:闪动再轻一档 */
|
|
43
|
+
.login-provider-btn:hover::before {
|
|
44
|
+
animation: login-btn-flash-soft 0.42s forwards;
|
|
45
|
+
}
|
|
46
|
+
.login-test-account-btn {
|
|
47
|
+
position: relative;
|
|
48
|
+
}
|
|
49
|
+
.login-test-account-btn::before {
|
|
50
|
+
content: '';
|
|
51
|
+
position: absolute;
|
|
52
|
+
inset: 0;
|
|
53
|
+
background: #fff;
|
|
54
|
+
opacity: 0;
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
border-radius: inherit;
|
|
57
|
+
}
|
|
58
|
+
.login-test-account-btn:hover {
|
|
59
|
+
animation: login-test-account-hover-in 0.42s forwards;
|
|
60
|
+
}
|
|
61
|
+
/* 主题色按钮:白闪略加强,在橙底上更明显 */
|
|
62
|
+
.login-test-account-btn:hover::before {
|
|
63
|
+
animation: login-btn-flash-accent 0.42s forwards;
|
|
64
|
+
}
|
|
65
|
+
/* 普通按钮(暗黑):更轻 */
|
|
66
|
+
@keyframes login-btn-flash-soft {
|
|
67
|
+
0% { opacity: 0; }
|
|
68
|
+
8% { opacity: 0.04; }
|
|
69
|
+
14% { opacity: 0; }
|
|
70
|
+
24% { opacity: 0.04; }
|
|
71
|
+
30% { opacity: 0; }
|
|
72
|
+
40% { opacity: 0.04; }
|
|
73
|
+
46% { opacity: 0; }
|
|
74
|
+
100% { opacity: 0; }
|
|
75
|
+
}
|
|
76
|
+
/* 普通按钮(日间):黑闪更轻 */
|
|
77
|
+
@keyframes login-btn-flash-light-soft {
|
|
78
|
+
0% { opacity: 0; }
|
|
79
|
+
8% { opacity: 0.045; }
|
|
80
|
+
14% { opacity: 0; }
|
|
81
|
+
24% { opacity: 0.045; }
|
|
82
|
+
30% { opacity: 0; }
|
|
83
|
+
40% { opacity: 0.045; }
|
|
84
|
+
46% { opacity: 0; }
|
|
85
|
+
100% { opacity: 0; }
|
|
86
|
+
}
|
|
87
|
+
/* 主题色按钮:白闪略深一档,闪动看得清 */
|
|
88
|
+
@keyframes login-btn-flash-accent {
|
|
89
|
+
0% { opacity: 0; }
|
|
90
|
+
8% { opacity: 0.14; }
|
|
91
|
+
14% { opacity: 0; }
|
|
92
|
+
24% { opacity: 0.14; }
|
|
93
|
+
30% { opacity: 0; }
|
|
94
|
+
40% { opacity: 0.14; }
|
|
95
|
+
46% { opacity: 0; }
|
|
96
|
+
100% { opacity: 0; }
|
|
97
|
+
}
|
|
98
|
+
/* 边框/背景/文字尽快进入 hover 态,后面只保留 ::before 闪动 */
|
|
99
|
+
@keyframes login-provider-hover-in {
|
|
100
|
+
0% { border-color: var(--c4a-border-default); background-color: transparent; color: var(--c4a-text-secondary); }
|
|
101
|
+
18% { border-color: var(--c4a-border-strong); background-color: var(--c4a-bg-hover); color: var(--c4a-text-primary); }
|
|
102
|
+
100% { border-color: var(--c4a-border-strong); background-color: var(--c4a-bg-hover); color: var(--c4a-text-primary); }
|
|
103
|
+
}
|
|
104
|
+
@keyframes login-test-account-hover-in {
|
|
105
|
+
0% { filter: brightness(1); }
|
|
106
|
+
100% { filter: brightness(1.1); }
|
|
107
|
+
}
|
|
108
|
+
`}),g&&d.jsxs(d.Fragment,{children:[d.jsx("style",{children:`
|
|
109
|
+
.login-animated-border {
|
|
110
|
+
stroke-dasharray: 92 8;
|
|
111
|
+
animation:
|
|
112
|
+
border-accel 2s cubic-bezier(0.33, 0, 0.67, 0.33) forwards,
|
|
113
|
+
border-fast 0.75s linear 2s infinite,
|
|
114
|
+
border-grow 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
|
|
115
|
+
}
|
|
116
|
+
@keyframes border-accel {
|
|
117
|
+
0% { stroke-dashoffset: 0; }
|
|
118
|
+
100% { stroke-dashoffset: -200; }
|
|
119
|
+
}
|
|
120
|
+
@keyframes border-fast {
|
|
121
|
+
0% { stroke-dashoffset: 0; }
|
|
122
|
+
100% { stroke-dashoffset: -100; }
|
|
123
|
+
}
|
|
124
|
+
@keyframes border-grow {
|
|
125
|
+
0% { stroke-dasharray: 25 75; }
|
|
126
|
+
100% { stroke-dasharray: 92 8; }
|
|
127
|
+
}
|
|
128
|
+
`}),d.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:d.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&&!g&&d.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:d.jsx(sn,{size:24,className:"animate-spin text-c4a-text-muted"})}),!u&&!g&&m&&d.jsxs("div",{className:"flex min-h-[160px] flex-col items-center justify-center gap-4",children:[d.jsx("p",{className:"text-center font-mono text-xs text-c4a-text-muted",children:m}),d.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&&!m&&d.jsxs("div",{className:"flex flex-col gap-6",children:[d.jsx("h2",{className:"text-center font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:e("login.title")}),d.jsxs("div",{className:"flex flex-col gap-2",children:[N.map(O=>d.jsx(Nv,{provider:O,onClick:()=>b(O.id),label:e("login.provider_cta",{name:O.display_name}),disabled:g},O.id)),N.length>0&&j.length>0&&d.jsx(jv,{label:e("login.or")}),j.map(O=>d.jsx(Nv,{provider:O,onClick:()=>b(O.id),label:e("login.provider_cta",{name:O.display_name}),disabled:g},O.id)),R&&E&&k&&d.jsx(jv,{label:e("login.or")}),E&&d.jsxs("button",{disabled:g,onClick:w,className:"login-test-account-btn 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:[E.icon&&d.jsx("img",{src:E.icon,alt:"",className:"relative z-10 h-5 w-5 shrink-0 opacity-90"}),d.jsx("span",{className:`relative z-10 ${g?"opacity-50":""}`,children:e("login.provider_cta",{name:e("login.test_account")})})]})]})]})]})})}function Nv({provider:e,onClick:t,label:a,disabled:r}){return d.jsxs("button",{onClick:t,disabled:r,className:"group login-provider-btn flex h-11 w-full cursor-pointer items-center justify-center gap-3 border border-c4a-border-default bg-transparent font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-all duration-150 ease-out disabled:cursor-not-allowed",children:[e.icon&&d.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-150 ease-out group-hover:opacity-100 group-hover:grayscale-0 group-disabled:opacity-100 group-disabled:grayscale-0"}),d.jsx("span",{className:`relative z-10 ${r?"opacity-50":""}`,children:a})]})}function jv({label:e}){return d.jsxs("div",{className:"flex items-center gap-3 py-1",children:[d.jsx("div",{className:"h-px flex-1 border-t border-dashed border-c4a-border-default"}),d.jsx("span",{className:"font-mono text-xs uppercase text-c4a-text-muted",children:e}),d.jsx("div",{className:"h-px flex-1 border-t border-dashed border-c4a-border-default"})]})}const Fk="animate-pulse font-mono text-xs uppercase tracking-tight text-c4a-text-muted";function Fm({labelKey:e="login.loading",className:t}){const{t:a}=ye();return d.jsx("span",{className:t??Fk,children:a(e)})}function Yk(){const e=Ot(),t=qn(a=>a.login);return _.useEffect(()=>{const r=new URLSearchParams(window.location.search).get("token");if(r){t(r);const i=qn.getState().isAuthenticated;e(i?"/studio":"/login",{replace:!0})}else e("/login",{replace:!0})},[t,e]),d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx(Fm,{labelKey:"login.authenticating",className:"animate-pulse font-mono text-sm uppercase tracking-tight text-c4a-text-muted"})})}function Cn({icon:e,title:t,description:a,action:r,fullPage:i}){const l=d.jsxs("div",{className:i?"w-full max-w-[800px] text-center":"flex flex-col items-center text-center",children:[e&&d.jsx("div",{className:"mb-3 text-c4a-text-muted",children:e}),i?d.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:t}):d.jsx("p",{className:"font-mono text-sm text-c4a-text-secondary",children:t}),d.jsx("p",{className:`mt-2 ${i?"mt-3 text-sm text-c4a-text-secondary":"max-w-md text-xs text-c4a-text-muted"}`,children:a}),r&&d.jsx("div",{className:i?"mt-6 flex justify-center":"mt-4",children:r})]});return d.jsx("div",{className:`flex flex-1 items-center justify-center ${i?"p-8 pb-24":"p-8 pb-23"}`,children:l})}function Xa({title:e,version:t,description:a}){const{t:r}=ye();return d.jsx(Cn,{fullPage:!0,title:e,description:a,action:t?d.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:r("placeholder.coming",{version:t})}):void 0})}function Kk(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.docs.title"),version:"0.4.13",description:e("page.docs.description")})}function Xk(){const{t:e}=ye();return d.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[d.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:e("notfound.title")}),d.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:e("notfound.description")}),d.jsx(ja,{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 Ev(){const{t:e}=ye(),t=A_();let a="500",r=e("error.description");return Ti(t)?(a=String(t.status),t.status===404?r=e("notfound.description"):t.statusText&&(r=t.statusText)):t instanceof Error&&(r=t.message),console.error(`[ErrorPage] ${a}:`,t),d.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[d.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:a}),d.jsx("p",{className:"mt-4 max-w-md text-base text-c4a-text-secondary",children:r}),d.jsxs("div",{className:"mt-8 flex items-center gap-3",children:[d.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:[d.jsx(ZC,{size:14}),e("error.reload")]}),d.jsx(ja,{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 Qk(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.modeling.title"),version:"0.4.16",description:e("page.modeling.description")})}function Zk(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.brain.title"),version:"0.4.18",description:e("page.brain.description")})}function Jk(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.discovery.title"),version:"0.6.x",description:e("page.discovery.description")})}function Wk(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.sharing.title"),version:"0.4.39",description:e("page.sharing.description")})}function eR(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.collaboration.title"),version:"0.5.x",description:e("page.collaboration.description")})}function Qa({children:e,onClose:t,className:a="",overlayClass:r="bg-black/50",closeOnOverlay:i=!0,closeOnEsc:l=!0,disableClose:u=!1}){const f=_.useRef(null);_.useEffect(()=>{if(!l)return;const h=g=>{g.key==="Escape"&&!u&&t()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[t,l,u]);const m=_.useCallback(h=>{i&&!u&&f.current&&!f.current.contains(h.target)&&t()},[t,i,u]);return d.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center ${r}`,onClick:m,children:d.jsx("div",{ref:f,className:a,children:e})})}function tR(){const{t:e}=ye(),[t,a]=_.useState([]),[r,i]=_.useState(!0),[l,u]=_.useState(!1),[f,m]=_.useState(null),h=[{label:e("page.settings.title")},{label:e("settings.tab.api_keys")}],g=_.useCallback(async()=>{i(!0);try{const b=await De.get("/auth/api-keys");a(b)}catch{}finally{i(!1)}},[]);_.useEffect(()=>{g()},[g]);const y=b=>{u(!1),m(b),g()},v=async b=>{if(confirm(e("api_keys.delete.confirm")))try{await De.delete(`/auth/api-keys/${b}`),g()}catch{}};return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[d.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:h.map((b,w)=>{const N=w===h.length-1;return d.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[w>0&&d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"}),d.jsx("span",{className:N?"text-c4a-text-primary":"",children:b.label})]},w)})}),r&&d.jsx("div",{className:"flex flex-1 items-center justify-center pb-24",children:d.jsx(Fm,{})}),!r&&t.length===0&&d.jsx(Cn,{fullPage:!0,title:e("api_keys.empty.title"),description:e("api_keys.empty.description"),action:d.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")})}),!r&&t.length>0&&d.jsxs("div",{className:"mt-4",children:[d.jsxs("div",{className:"mb-4 flex items-center justify-between gap-4",children:[d.jsx("p",{className:"text-xs text-c4a-text-muted",children:e("api_keys.description")}),d.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:[d.jsx(Gm,{size:14}),e("api_keys.create")]})]}),d.jsx("div",{className:"flex flex-col gap-3",children:t.map(b=>d.jsx(nR,{apiKey:b,onDelete:()=>v(b.id)},b.id))})]}),l&&d.jsx(aR,{onClose:()=>u(!1),onCreated:y}),f&&d.jsx(rR,{apiKey:f,onClose:()=>m(null)})]})}function nR({apiKey:e,onDelete:t}){const{t:a}=ye(),r=e.last_used_at?new Date(e.last_used_at).toLocaleDateString():a("api_keys.never_used"),i=new Date(e.created_at).toLocaleDateString();return d.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-mono text-sm text-c4a-text-primary",children:e.name}),d.jsxs("p",{className:"mt-1 text-xs text-c4a-text-muted",children:[d.jsxs("span",{className:"font-mono",children:[e.key_prefix,"****"]}),d.jsx("span",{className:"mx-2",children:"·"}),r]}),d.jsx("p",{className:"mt-0.5 text-xs text-c4a-text-muted",children:a("api_keys.created_at",{date:i})})]}),d.jsx("button",{onClick:t,className:"cursor-pointer p-1 text-c4a-text-muted transition-colors hover:text-c4a-error",title:"Delete",children:d.jsx(Vm,{size:14})})]})})}function aR({onClose:e,onCreated:t}){const{t:a}=ye(),[r,i]=_.useState(""),[l,u]=_.useState("never"),[f,m]=_.useState(!1),h=_.useRef(null),[g,y]=_.useState(!1),v=[{value:"never",label:a("api_keys.expires.never")},{value:"30d",label:a("api_keys.expires.30d")},{value:"90d",label:a("api_keys.expires.90d")},{value:"1y",label:a("api_keys.expires.1y")}],b=v.find(N=>N.value===l);_.useEffect(()=>{if(!f)return;const N=j=>{h.current&&!h.current.contains(j.target)&&m(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[f]);const w=async()=>{if(r.trim()){y(!0);try{const N=sR(l),j=await De.post("/auth/api-keys",{name:r.trim(),scope:["read"],expires_at:N});t(j)}catch{y(!1)}}};return d.jsxs(Qa,{onClose:e,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-8 shadow-c4a-lg",children:[d.jsx("h2",{className:"mb-6 font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:a("api_keys.create")}),d.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:a("api_keys.form.name")}),d.jsx("input",{value:r,onChange:N=>i(N.target.value),placeholder:a("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"}),d.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:a("api_keys.form.expiry")}),d.jsxs("div",{ref:h,className:"relative mb-6",children:[d.jsxs("button",{type:"button",onClick:()=>m(N=>!N),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:[d.jsx("span",{children:b?.label}),d.jsx(rn,{size:14,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${f?"rotate-90":""}`})]}),f&&d.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(N=>d.jsxs("button",{type:"button",onClick:()=>{u(N.value),m(!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 ${N.value===l?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[d.jsx(ts,{size:12,className:`shrink-0 ${N.value===l?"opacity-100":"opacity-0"}`}),N.label]},N.value))})]}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.jsx("button",{onClick:e,disabled:g,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:a("common.cancel")}),d.jsx("button",{onClick:w,disabled:!r.trim()||g,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:a("api_keys.create")})]})]})}function rR({apiKey:e,onClose:t}){const{t:a}=ye(),[r,i]=_.useState(!1),l=async()=>{try{await navigator.clipboard.writeText(e.key),i(!0),setTimeout(()=>i(!1),2e3)}catch{const u=document.querySelector("[data-api-key-value]");if(u){const f=document.createRange();f.selectNodeContents(u);const m=window.getSelection();m?.removeAllRanges(),m?.addRange(f)}}};return d.jsxs(Qa,{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:[d.jsx("h2",{className:"mb-4 font-mono text-sm uppercase tracking-tight text-c4a-accent",children:a("api_keys.created")}),d.jsx("p",{className:"mb-4 text-sm text-c4a-text-secondary",children:a("api_keys.copy_warning")}),d.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:[d.jsx("code",{"data-api-key-value":!0,className:"flex-1 truncate font-mono text-xs text-c4a-text-primary",children:e.key}),d.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:a(r?"api_keys.copied":"api_keys.copy")})]}),d.jsx("div",{className:"flex justify-end",children:d.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:a("api_keys.done")})})]})}function sR(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 iR(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.code_setup.title"),version:"0.4.13",description:e("page.code_setup.description")})}function oR(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.code_compile.title"),version:"0.4.13",description:e("page.code_compile.description")})}function lR(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.code_review.title"),version:"0.4.14",description:e("page.code_review.description")})}function cR(){const{t:e}=ye();return d.jsx(Xa,{title:e("page.code_result.title"),version:"0.4.14",description:e("page.code_result.description")})}const Bu=(e,t)=>{for(const a of e){if(a.path===t)return a;if(a.children){const r=Bu(a.children,t);if(r)return r}}return null},uR=(e,t)=>t===""?e:Bu(e,t)?.children??[],Go=(e,t)=>{if(!t)return[];const a=t.split("/"),r=[];let i="";for(const l of a){i=i?`${i}/${l}`:l;const u=Bu(e,i);u&&r.push(u)}return r},Iu=ns(e=>({rootSources:[],currentRoot:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",fetchRootSources:async({library_id:t,limit:a,offset:r})=>{e({loading:!0,error:null});try{const i={library_id:t};a!==void 0&&(i.limit=String(a)),r!==void 0&&(i.offset=String(r));const l=await De.get("/sources",i);e({rootSources:l.items,total:l.total,limit:l.limit,offset:l.offset,loading:!1})}catch(i){e({error:i instanceof Error?i.message:"Failed to load sources",loading:!1})}},fetchRootSource:async t=>{e({loading:!0,error:null,currentRoot:null});try{const a=await De.get(`/sources/${t}`);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 t=>await De.post("/sources",t),addTreeNode:async(t,a)=>{const r=await De.post(`/sources/${t}/tree`,a);return e(i=>({rootSources:i.rootSources.map(l=>l.id===t?r:l),currentRoot:i.currentRoot?.id===t?r:i.currentRoot})),r},updateSource:async(t,a)=>{const r=await De.put(`/sources/${t}`,a);e(i=>({rootSources:i.rootSources.map(l=>l.id===t?r:l),currentRoot:i.currentRoot?.id===t?r:i.currentRoot}))},deleteSource:async t=>{await De.delete(`/sources/${t}`),e(a=>({rootSources:a.rootSources.filter(r=>r.id!==t),currentRoot:a.currentRoot?.id===t?null:a.currentRoot}))},deleteTreeNode:async(t,a)=>{const r=await De.delete(`/sources/${t}/tree?path=${encodeURIComponent(a)}`);return e(i=>({rootSources:i.rootSources.map(l=>l.id===t?r:l),currentRoot:i.currentRoot?.id===t?r:i.currentRoot})),r},uploadDoc:async t=>await De.post("/sources/upload",t),setFilter:t=>e({filter:t}),clearSources:()=>e({rootSources:[],currentRoot:null,total:0,offset:0})}));function As({segments:e}){const{t}=ye(),a=_.useRef(null),r=_.useRef(null),[i,l]=_.useState(0),u=[{label:t("sources.breadcrumb.sources")},...e],f=Math.max(0,u.length-3);_.useEffect(()=>{const h=a.current,g=r.current;if(!h||!g)return;const y=()=>{const b=h.clientWidth,w=Array.from(g.children);if(w.length===0)return;const N=w.map(H=>H.offsetWidth),j=4;if(N.reduce((H,T)=>H+T,0)+j*(N.length-1)<=b){l(0);return}const R=20,k=(N[0]??0)+(N[1]??0)+j,O=N[N.length-1]??0,I=k+j+R+j+O;let B=f;for(let H=1;H<=f;H++){let T=0;for(let P=2+H;P<N.length-1;P++)T+=N[P]+j;if(I+T<=b){B=H;break}}l(B)};y();const v=new ResizeObserver(y);return v.observe(h),()=>v.disconnect()},[f,e,t]);const m=(()=>{if(i===0||u.length<=3)return u;const h=u.slice(0,2),g=u[u.length-1],y=u.slice(2+i,u.length-1);return[...h,{label:"…"},...y,g]})();return d.jsxs("div",{ref:a,className:"relative min-w-0 overflow-hidden",children:[d.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs tracking-tight text-c4a-text-muted",children:m.map((h,g)=>{const y=g===m.length-1;return d.jsxs("span",{className:`flex shrink-0 items-center gap-1 ${g===0?"uppercase":""}`,children:[g>0&&d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"}),h.to&&!y?d.jsx(ja,{to:h.to,className:"cursor-pointer whitespace-nowrap transition-colors hover:text-c4a-text-primary",children:h.label}):d.jsx("span",{className:`whitespace-nowrap ${y?"text-c4a-text-primary":""}`,children:h.label})]},g)})}),d.jsx("div",{ref:r,"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((h,g)=>d.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[g>0&&d.jsx(rn,{size:12}),d.jsx("span",{className:"whitespace-nowrap",children:h.label})]},g))})]})}const dR=["all","indexed","not_indexed"];function fR({value:e,onChange:t}){const{t:a}=ye(),[r,i]=_.useState(!1),l=_.useRef(null),u=_.useRef(null),f={all:a("sources.filter.all"),indexed:a("sources.filter.indexed"),not_indexed:a("sources.filter.not_indexed")},m=_.useCallback(y=>{l.current&&!l.current.contains(y.target)&&i(!1)},[]);_.useEffect(()=>{if(r)return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[r,m]);const h=_.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),i(!0)},[]),g=_.useCallback(()=>{u.current=setTimeout(()=>i(!1),150)},[]);return d.jsxs("div",{ref:l,className:"relative",onMouseEnter:h,onMouseLeave:g,children:[d.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:[d.jsx(OC,{size:12}),d.jsx("span",{className:"hidden sm:inline",children:f[e]}),d.jsx(rn,{size:12,className:`hidden transition-transform duration-200 sm:block ${r?"rotate-90":""}`})]}),r&&d.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:dR.map(y=>d.jsxs("button",{onClick:()=>{t(y),i(!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 ${y===e?"text-c4a-accent":"text-c4a-text-secondary"}`,children:[d.jsx(ts,{size:12,className:y===e?"opacity-100":"opacity-0"}),f[y]]},y))})]})}function X_({currentName:e,onConfirm:t,onCancel:a,error:r}){const[i,l]=_.useState(e),u=_.useRef(null);_.useEffect(()=>{u.current?.select()},[]);const f=_.useCallback(()=>{const h=i.trim();h&&h!==e?t(h):a()},[i,e,t,a]),m=_.useCallback(h=>{h.key==="Enter"?(h.preventDefault(),f()):h.key==="Escape"&&a()},[f,a]);return d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("input",{ref:u,value:i,onChange:h=>l(h.target.value),onKeyDown:m,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}),d.jsx("button",{onClick:h=>{h.stopPropagation(),f()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:d.jsx(ts,{size:14})}),d.jsx("button",{onClick:h=>{h.stopPropagation(),a()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:d.jsx(br,{size:14})}),r&&d.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:r})]})}const hR=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),mR=new Set([".ts",".tsx",".md"]),pR=new Set([".md",".txt",".ts",".tsx",".doc",".docx",".pdf",".ppt",".pptx"]),gR=new Set([".md",".txt"]),xR=5*1024*1024,yR=10;function sm(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}function vR(e){const t=e.includes("/")?e.split("/").pop():e;if(hR.has(t.toLowerCase()))return!0;const a=sm(t);return mR.has(a)}const bR=e=>{const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const a=i=>String(i).padStart(2,"0"),r=`${a(t.getMonth()+1)}-${a(t.getDate())} ${a(t.getHours())}:${a(t.getMinutes())}`;return t.getFullYear()===new Date().getFullYear()?r:`${t.getFullYear()}-${r}`},Cv={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function _R({source:e,isDaemonLibrary:t,isRepoRoot:a}){const{t:r}=ye(),i=e.kind==="source",l=i&&(e.source_type==="code"||vR(e.name)),u=l?"text-c4a-accent":"text-c4a-text-secondary group-hover:text-c4a-accent",f=e.metadata?.origin==="remote";let m;if(e.kind==="folder"?m=a||f?d.jsx(Hu,{size:16,className:`shrink-0 ${u}`}):t?d.jsx(hC,{size:16,className:`shrink-0 ${u}`}):d.jsx(_a,{size:16,className:`shrink-0 ${u}`}):e.source_type==="code"?m=d.jsx(Ei,{size:16,className:`shrink-0 ${u}`}):m=d.jsx(Wr,{size:16,className:`shrink-0 ${u}`}),!i||!l)return d.jsx(d.Fragment,{children:m});const h=Cv[e.index_status]??Cv.none,g=r(`sources.status.${e.index_status}`);return d.jsxs("span",{className:"group/dot relative shrink-0",children:[m,d.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${h}`}),d.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:g})]})}function kv({source:e,displayName:t,childCount:a,isDaemonLibrary:r,isRepoRoot:i,hasUpdate:l,onClick:u,onRename:f,onDelete:m}){const{t:h}=ye(),[g,y]=_.useState(!1),[v,b]=_.useState(null),w=_.useCallback(async k=>{if(!f)return;const O=await f(k);O?b(O):(y(!1),b(null))},[f]),N=_.useCallback(()=>{y(!1),b(null)},[]),j=!i&&f,E=m,R=e.updated_at||e.created_at;return d.jsxs("div",{className:"group flex cursor-pointer items-center gap-3 rounded py-2 pl-3 pr-5 transition-colors hover:bg-c4a-accent/10 hover:text-c4a-accent",onClick:g?void 0:u,children:[d.jsx(_R,{source:e,isDaemonLibrary:r??!1,isRepoRoot:i??!1}),g?d.jsx("div",{className:"min-w-0 flex-1",onClick:k=>k.stopPropagation(),children:d.jsx(X_,{currentName:e.name,onConfirm:w,onCancel:N,error:v})}):d.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-c4a-text-secondary group-hover:text-c4a-accent",children:t??e.name}),d.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[l&&d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-tight text-c4a-accent/60",children:[d.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-c4a-accent"}),h("sources.change_detection.has_updates")]}),e.kind==="folder"&&a!==void 0&&d.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:h("common.items",{count:a})}),R&&d.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:bR(R)})]}),(j||E)&&d.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[j?d.jsx("button",{title:h("sources.actions.rename"),onClick:k=>{k.stopPropagation(),y(!0)},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:d.jsx(tm,{size:14})}):E?d.jsx("span",{className:"p-1",children:d.jsx("span",{className:"inline-block h-[14px] w-[14px]"})}):null,E&&d.jsx("button",{title:h("sources.actions.delete"),onClick:k=>{k.stopPropagation(),m()},className:"rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:d.jsx(Vm,{size:14})})]})]})}function Rv({target:e,onConfirm:t,onCancel:a}){const{t:r}=ye();return d.jsxs(Qa,{onClose:a,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:r("sources.delete.confirm_title")}),d.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[e.type==="resource"&&d.jsxs(d.Fragment,{children:[d.jsx("p",{children:r("sources.delete.resource",{name:e.name})}),d.jsx("p",{children:r("sources.delete.resource_impact")}),d.jsx("p",{className:"text-c4a-warning",children:r("sources.delete.session_warning")}),d.jsx("p",{children:r("sources.delete.entity_safe")})]}),e.type==="folder"&&d.jsxs(d.Fragment,{children:[d.jsx("p",{children:r("sources.delete.folder",{name:e.name})}),e.folderCount!==void 0&&e.sourceCount!==void 0?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:r("sources.delete.folder_contents",{folders:e.folderCount,sources:e.sourceCount})}),e.indexedCount!==void 0&&e.indexedCount>0&&d.jsx("p",{children:r("sources.delete.indexed_hint",{indexed:e.indexedCount,total:e.sourceCount})})]}):d.jsx("p",{children:r("sources.delete.folder_impact_generic")}),d.jsx("p",{className:"text-c4a-warning",children:r("sources.delete.irreversible")})]}),e.type==="repo"&&d.jsxs(d.Fragment,{children:[d.jsx("p",{children:r("sources.delete.repo",{name:e.name,library:e.libraryName})}),e.packageCount!==void 0&&e.docCount!==void 0?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:r("sources.delete.repo_contents",{packages:e.packageCount,docs:e.docCount})}),e.indexedCount!==void 0&&e.indexedCount>0&&d.jsx("p",{children:r("sources.delete.indexed_hint",{indexed:e.indexedCount,total:e.packageCount+e.docCount})})]}):d.jsx("p",{children:r("sources.delete.repo_impact_generic")}),d.jsx("p",{children:r("sources.delete.local_safe")}),d.jsx("p",{children:r("sources.delete.entity_safe")})]}),e.type==="client"&&d.jsxs(d.Fragment,{children:[d.jsx("p",{children:r("sources.delete.client",{name:e.name})}),d.jsx("p",{children:r("sources.delete.client_impact")}),d.jsx("p",{children:r("sources.delete.local_safe")}),d.jsx("p",{children:r("sources.delete.entity_safe")}),d.jsx("p",{className:"text-c4a-warning",children:r("sources.delete.irreversible")}),d.jsx("p",{className:"text-c4a-text-muted",children:r("sources.delete.client_reregister")})]})]}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{onClick: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",children:r("common.cancel")}),d.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:r("common.confirm")})]})]})}function SR({onConfirm:e,onCancel:t,error:a}){const{t:r}=ye(),[i,l]=_.useState(""),u=_.useRef(null);_.useEffect(()=>{u.current?.focus()},[]);const f=_.useCallback(()=>{const h=i.trim();h&&e(h)},[i,e]),m=_.useCallback(h=>{h.key==="Enter"&&(h.preventDefault(),f())},[f]);return d.jsxs(Qa,{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:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(G_,{size:16,className:"shrink-0 text-c4a-accent"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:r("sources.actions.new_folder")})]}),d.jsxs("div",{className:"mt-4",children:[d.jsx("input",{ref:u,value:i,onChange:h=>l(h.target.value),onKeyDown:m,placeholder:r("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}),a&&d.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:a})]}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.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:r("common.cancel")}),d.jsx("button",{onClick:f,disabled:!i.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:r("common.confirm")})]})]})}function jh({label:e,icon:t,items:a,alignRight:r}){const[i,l]=_.useState(!1),u=_.useRef(null),f=_.useRef(null),m=_.useCallback(y=>{u.current&&!u.current.contains(y.target)&&l(!1)},[]);_.useEffect(()=>{if(i)return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[i,m]);const h=_.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null),l(!0)},[]),g=_.useCallback(()=>{f.current=setTimeout(()=>l(!1),150)},[]);return d.jsxs("div",{ref:u,className:"relative",onMouseEnter:h,onMouseLeave:g,children:[d.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&&d.jsx("span",{className:"hidden sm:inline",children:e}),e&&d.jsx(rn,{size:12,className:`hidden transition-transform duration-200 sm:block ${i?"rotate-90":""}`})]}),i&&d.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 ${r?"right-0":"left-0"}`,children:a.map(y=>d.jsxs("button",{onClick:()=>{y.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:[y.icon,y.label]},y.label))})]})}function wR({onClose:e}){const{t}=ye();return d.jsxs(Qa,{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:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(rk,{size:18,className:"text-c4a-accent"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:t("sources.upgrade.title")})]}),d.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:t("sources.upgrade.description")}),d.jsx("div",{className:"mt-6 flex justify-end",children:d.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")})})]})}function NR(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function jR({onConfirm:e,onCancel:t,error:a,uploading:r}){const{t:i}=ye(),[l,u]=_.useState([]),[f,m]=_.useState(null),[h,g]=_.useState(!1),[y,v]=_.useState(!1),b=_.useRef(null),w=_.useCallback(B=>{m(null);for(const H of B){const T=sm(H.name);if(!pR.has(T)){m(i("sources.upload.unsupported_type",{name:H.name}));return}if(H.size>xR){m(i("sources.upload.file_too_large",{name:H.name}));return}}u(H=>{const T=new Map(H.map(X=>[X.name,X]));for(const X of B)T.set(X.name,{name:X.name,size:X.size,file:X});const P=Array.from(T.values());return P.length>yR?(m(i("sources.upload.too_many_files")),H):P})},[i]),N=_.useCallback(B=>{const H=B.target.files;!H||H.length===0||(w(Array.from(H)),B.target.value="")},[w]),j=_.useCallback(B=>{u(H=>H.filter((T,P)=>P!==B)),m(null)},[]),E=_.useCallback(B=>{B.preventDefault(),g(!1);const H=B.dataTransfer?.files;!H||H.length===0||w(Array.from(H))},[w]),R=_.useCallback(B=>{B.preventDefault(),g(!0)},[]),k=_.useCallback(B=>{B.preventDefault(),g(!1)},[]),O=_.useCallback(async()=>{if(!(l.length===0||y)){v(!0);try{const B=await Promise.all(l.map(H=>new Promise((T,P)=>{const X=sm(H.name),de=gR.has(X),le=new FileReader;le.onerror=()=>P(le.error),de?(le.onload=()=>T({name:H.name,content:le.result,encoding:"utf-8"}),le.readAsText(H.file)):(le.onload=()=>{const ce=le.result,D=ce.slice(ce.indexOf(",")+1);T({name:H.name,content:D,encoding:"base64"})},le.readAsDataURL(H.file))})));e(B)}catch{v(!1)}}},[l,y,e]),I=a||f;return d.jsxs(Qa,{onClose:t,disableClose:y||(r??!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:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(am,{size:16,className:"shrink-0 text-c4a-accent"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.upload.title")})]}),d.jsxs("div",{className:"mt-4",children:[d.jsx("input",{ref:b,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:N,className:"hidden"}),d.jsxs("button",{type:"button",onClick:()=>b.current?.click(),onDrop:E,onDragOver:R,onDragLeave:k,disabled:y||r,className:`flex w-full flex-col items-center justify-center rounded border-2 border-dashed px-4 py-8 transition-colors ${h?"border-c4a-accent bg-c4a-accent/5":"border-c4a-border-default hover:border-c4a-accent/50"} ${y||r?"cursor-not-allowed opacity-40":"cursor-pointer"}`,children:[d.jsx(am,{size:24,className:"text-c4a-text-muted"}),d.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:i("sources.upload.drop_hint")}),d.jsx("p",{className:"mt-1 text-[10px] text-c4a-text-muted",children:i("sources.upload.supported_formats")})]})]}),l.length>0&&d.jsxs("div",{className:"mt-3",children:[d.jsx("p",{className:"text-xs text-c4a-text-muted",children:i("sources.upload.selected",{count:l.length})}),d.jsx("div",{className:"mt-1 max-h-40 space-y-1 overflow-y-auto c4a-scrollbar",children:l.map((B,H)=>d.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[d.jsx(Wr,{size:12,className:"shrink-0 text-c4a-text-muted"}),d.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-primary",children:B.name}),d.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:NR(B.size)}),!y&&!r&&d.jsx("button",{type:"button",onClick:()=>j(H),className:"shrink-0 text-c4a-text-muted transition-colors hover:text-c4a-text-primary",title:i("sources.upload.remove"),children:d.jsx(br,{size:12})})]},`${B.name}-${H}`))})]}),I&&d.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:I}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{onClick:t,disabled:y||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 disabled:opacity-40",children:i("common.cancel")}),d.jsxs("button",{onClick:O,disabled:l.length===0||y||r,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:[(y||r)&&d.jsx(sn,{size:12,className:"animate-spin"}),i(y||r?"sources.upload.uploading":"common.confirm")]})]})]})}const ER=/^v\d+\.\d+\.\d+$/;function im(e){const t=/^v(\d+)\.(\d+)\.(\d+)$/.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function CR(e,t){const a=im(e),r=im(t);return!a||!r?!1:a[0]!==r[0]?a[0]>r[0]:a[1]!==r[1]?a[1]>r[1]:a[2]>r[2]}function kR(e){const t=im(e);return t?`v${t[0]}.${t[1]}.${t[2]+1}`:"v0.0.1"}function RR({currentVersion:e,onConfirm:t,onCancel:a,uploading:r,serverError:i}){const{t:l}=ye(),[u,f]=_.useState(()=>kR(e)),m=_.useMemo(()=>ER.test(u)?CR(u,e)?null:l("upload.version_must_increase",{version:e}):l("upload.version_must_increase",{version:e}),[u,e,l]),h=_.useCallback(()=>{m||r||t(u)},[m,r,t,u]);return d.jsxs(Qa,{onClose:a,disableClose:r??!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:[d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:l("upload.new_version_title")}),d.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:l("upload.new_version_desc")}),d.jsxs("div",{className:"mt-4",children:[d.jsx("label",{className:"block text-xs text-c4a-text-muted uppercase",children:l("upload.version_label")}),d.jsx("input",{type:"text",value:u,onChange:g=>f(g.target.value),disabled:r,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"}),d.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:l("upload.current_version",{version:e})}),m&&d.jsx("p",{className:"mt-1 text-xs text-c4a-error",children:m}),i&&!m&&d.jsx("p",{className:"mt-1 text-xs text-c4a-error",children:i})]}),d.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[d.jsx("button",{type:"button",onClick:a,disabled: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 disabled:opacity-40",children:l("common.cancel")}),d.jsxs("button",{type:"button",onClick:h,disabled:!!m||r,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:[r&&d.jsx(sn,{size:12,className:"animate-spin"}),l("upload.confirm")]})]})]})}function TR({pathLabel:e,loading:t,badge:a,onNavigateUp:r,children:i}){return d.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[d.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:e}),a]}),d.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),d.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:t?d.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:d.jsx(sn,{size:14,className:"animate-spin text-c4a-text-muted"})}):d.jsxs(d.Fragment,{children:[r&&d.jsxs("button",{onClick:r,className:"flex w-full cursor-pointer items-center gap-3 rounded pl-3 pr-5 py-2 text-left text-sm text-c4a-text-primary transition-colors hover:bg-c4a-bg-hover",children:[d.jsx(_a,{size:16,className:"shrink-0 text-c4a-text-muted"}),d.jsx("span",{children:".."})]}),i]})})]})}function AR(e){const t=e.match(/^[\w.-]+@([\w.-]+):([\w./-]+?)(?:\.git)?$/);if(t){const a=t[1],r=t[2];return{slug:r,repoUrl:`https://${a}/${r}`,host:a}}try{const a=new URL(e),r=a.hostname,i=a.pathname.replace(/^\//,"").replace(/\.git$/,"");return i?{slug:i,repoUrl:`https://${r}/${i}`,host:r}:null}catch{return null}}function LR(e,t){return`${e}/tree/${encodeURIComponent(t)}`}function OR(e,t){return`${e}/commit/${t}`}function Q_({remoteUrl:e,fallbackName:t,branch:a,commit:r}){const i=e?AR(e):null,l=r.slice(0,7);return d.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:[i?d.jsxs("a",{href:i.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:i.repoUrl,children:[d.jsx(dv,{size:12,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:i.slug})]}):d.jsxs("span",{className:"flex items-center gap-1 truncate",children:[d.jsx(dv,{size:12,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:t||"repo"})]}),d.jsx("span",{className:"text-c4a-text-muted",children:"/"}),i?d.jsxs("a",{href:LR(i.repoUrl,a),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[d.jsx(em,{size:10,className:"shrink-0"}),d.jsx("span",{children:a})]}):d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(em,{size:10,className:"shrink-0"}),d.jsx("span",{children:a})]}),d.jsx("span",{className:"text-c4a-text-muted",children:"/"}),i?d.jsx("a",{href:OR(i.repoUrl,r),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:l}):d.jsx("span",{children:l})]})}function DR(e,t,a){const[r,i]=_.useState({}),l=_.useRef(new Set);return _.useEffect(()=>{if(!e||!t||a.length===0)return;const u=a.filter(f=>{const m=f.metadata;return m?.origin==="remote"&&m?.remote_url&&m?.remote_commit&&!l.current.has(f.id)});if(u.length!==0){u.forEach(f=>l.current.add(f.id));for(const f of u){const m=f.metadata;De.post("/import/remote/refs",{library_id:e,url:m.remote_url}).then(h=>{const g=m.remote_ref||"",y=h.branches?.find(v=>v.name===g)??h.tags?.find(v=>v.name===g);y&&y.commit!==m.remote_commit&&i(v=>({...v,[f.id]:!0}))}).catch(()=>{})}}},[e,t,a]),r}function MR({library:e,onNewFolder:t,onUploadDoc:a,onImportRepo:r,onImportDir:i,onUpgrade:l}){const{t:u}=ye(),f=e.type==="daemon",m="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",h=f?d.jsxs("div",{className:"flex gap-3",children:[i&&d.jsx("button",{onClick:i,disabled:!e.is_online,className:m,children:u("sources.actions.import_dir")}),r&&d.jsx("button",{onClick:r,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")})]}):d.jsxs("div",{className:"flex gap-3",children:[d.jsx("button",{onClick:t,className:m,children:u("sources.actions.new_folder")}),a&&d.jsx("button",{onClick:a,className:m,children:u("sources.actions.upload_document")}),l&&d.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 d.jsx(Cn,{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:h})}function zR(){const{t:e}=ye();return d.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[d.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:e("sources.empty.indexed.title")}),d.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:e("sources.empty.indexed.description")})]})}const Eh=e=>{let t=0,a=0,r=0,i=0,l=0;const u=f=>{for(const m of f.children??[])m.kind==="folder"?(t++,u(m)):m.kind==="source"&&(a++,m.source_type==="code"?r++:i++,(m.index_status==="indexed"||m.index_status==="stale")&&l++)};return u(e),{folders:t,sources:a,codeSources:r,docSources:i,indexedSources:l}};function UR(){const{t:e}=ye(),t=Ot(),{libId:a}=xl(),[r,i]=$u(),l=r.get("rootId")||null,u=r.get("path")||"",m=Wt(Ds(Ui)).find(se=>se.id===a),h=Wt(se=>se.updateLibraryName),g=Wt(se=>se.deleteLibrary),{rootSources:y,currentRoot:v,loading:b,filter:w,fetchRootSources:N,fetchRootSource:j,createSource:E,addTreeNode:R,updateSource:k,deleteSource:O,deleteTreeNode:I,uploadDoc:B,setFilter:H}=Iu(),[T,P]=_.useState(!1),[X,de]=_.useState(null),[le,ce]=_.useState(null),[D,F]=_.useState(null),[A,G]=_.useState(null),[ae,ee]=_.useState(!1),[J,L]=_.useState(!1),[q,re]=_.useState(null),[ie,ge]=_.useState(!1),[xe,Ee]=_.useState(null),[Me,qe]=_.useState(null),[vn,zn]=_.useState(!1),[Ht,at]=_.useState(null),[Nt,Un]=_.useState(!1);_.useEffect(()=>{a&&N({library_id:a})},[a,N]),_.useEffect(()=>{l&&j(l)},[l,j]);const lt=l!==null,hn=_.useMemo(()=>lt?v?[...uR(v.tree,u)].sort((Ue,ut)=>Ue.kind!==ut.kind?Ue.kind==="folder"?-1:1:Ue.name.localeCompare(ut.name)).map(Ue=>({type:"node",root:v,node:Ue})):[]:[...y].sort((ut,Pe)=>ut.kind!==Pe.kind?ut.kind==="folder"?-1:1:new Date(Pe.created_at).getTime()-new Date(ut.created_at).getTime()).map(ut=>({type:"root",root:ut,node:null})),[lt,y,v,u]),ln=_.useMemo(()=>w==="all"?hn:hn.filter(se=>se.type==="root"||!se.node||se.node.kind==="folder"?!0:w==="indexed"?se.node.index_status==="indexed":se.node.index_status==="none"||!se.node.index_status),[hn,w]),qt=m?.type==="daemon",bn=m?.type==="cloud",ia=qt&&!lt,kn=DR(a,bn,y),Rn=_.useMemo(()=>{if(!m)return[];const se=[{label:m.is_default?e("sources.library.default_cloud_name"):m.name,to:`/studio/sources/${m.id}`}];return lt&&v&&(se.push({label:v.name,to:`/studio/sources/${m.id}?rootId=${v.id}`}),u&&Go(v.tree,u).forEach(Ue=>{se.push({label:Ue.name,to:`/studio/sources/${m.id}?rootId=${v.id}&path=${encodeURIComponent(Ue.path)}`})})),se},[m,lt,v,u,e]),jt=_.useCallback(async se=>{if(a)try{lt&&l?await R(l,{parent_path:u,kind:"folder",name:se}):(await E({library_id:a,kind:"folder",name:se}),N({library_id:a})),P(!1),de(null)}catch(be){be instanceof Ln&&be.status===409&&de(e("sources.error.name_conflict",{name:se}))}},[a,lt,l,u,E,R,N,e]),_n=_.useCallback(se=>{a&&(se.type==="root"?se.root.kind==="source"?t(`/studio/source/${se.root.id}`):i({rootId:se.root.id}):se.node&&(se.node.kind==="folder"?i({rootId:se.root.id,path:se.node.path}):t(`/studio/source/${se.root.id}?path=${encodeURIComponent(se.node.path)}`)))},[a,t,i]),Ne=_.useCallback(()=>{if(!(!l||!a))if(u){const se=u.split("/");se.pop();const be=se.join("/");i(be?{rootId:l,path:be}:{rootId:l})}else i({})},[l,a,u,i]),He=_.useCallback(async(se,be)=>{try{return await k(se,{name:be}),N({library_id:a}),null}catch(Ue){return Ue instanceof Ln&&Ue.status===409?e("sources.error.name_conflict",{name:be}):null}},[a,k,N,e]),Xe=_.useCallback(se=>{if(se.type==="root"){F(se.root.id),G(null);const be=se.root.tree.length>0?Eh({children:se.root.tree}):void 0;ce(qt?{type:"repo",name:se.root.name,libraryName:m.name,...be?{packageCount:be.codeSources,docCount:be.docSources,indexedCount:be.indexedSources}:{}}:{type:se.root.kind==="folder"?"folder":"resource",name:se.root.name,...se.root.kind==="folder"&&be?{folderCount:be.folders,sourceCount:be.sources,indexedCount:be.indexedSources}:{}})}else if(se.node)if(F(se.root.id),G(se.node.path),se.node.kind==="folder"){const be=Eh(se.node);ce({type:"folder",name:se.node.name,folderCount:be.folders,sourceCount:be.sources,indexedCount:be.indexedSources})}else ce({type:"resource",name:se.node.name})},[qt,m]),yt=_.useCallback(async()=>{if(!(!D||!a)){try{A?await I(D,A):(await O(D),N({library_id:a}))}catch{}ce(null),F(null),G(null)}},[D,A,a,O,I,N]),Tt=_.useCallback(()=>{if(!a)return;const se=new URLSearchParams;l&&(se.set("parentId",l),v&&se.set("parentName",v.name)),u&&se.set("parentPath",u);const be=se.toString();t(`/studio/sources/import/${a}${be?`?${be}`:""}`)},[a,t,l,u,v]),cn=_.useCallback(()=>{a&&t(`/studio/sources/import-dir/${a}`)},[a,t]),Yn=_.useCallback(async(se,be)=>{if(a){ge(!0),re(null);try{const Ue={library_id:a,files:se.map(M=>{const $={file_name:M.name,content:M.content};return M.encoding&&($.encoding=M.encoding),be&&($.version_label=be),$})};lt&&l&&(Ue.root_source_id=l,Ue.parent_path=u);const ut=await B(Ue),Pe=ut.results??[],oa=Pe.some(M=>M.status==="created")||(ut.created?.length??0)>0,la=Pe.some(M=>M.status==="hash_changed"),ca=Pe.filter(M=>M.status==="no_change").length;if(la&&!be){const M=Pe.find($=>$.status==="hash_changed");Ee({files:se,currentVersion:M?.current_version_label??"v0.0.0"}),L(!1)}else if(oa&&(lt&&l?j(l):N({library_id:a})),L(!1),Ee(null),ca>0){const M=ca===Pe.length?e("upload.no_change"):e("upload.partial_no_change",{count:ca});qe(M),setTimeout(()=>qe(null),4e3)}}catch(Ue){Ue instanceof Ln&&Ue.status===409?re(e("sources.error.name_conflict",{name:se[0]?.name??""})):Ue instanceof Ln&&re(Ue.message)}finally{ge(!1)}}},[a,lt,l,u,B,N,j,e]),mn=_.useCallback(async se=>{xe&&await Yn(xe.files,se)},[xe,Yn]),Bt=m?.is_default===!0,vt=_.useCallback(async se=>{if(a)try{await h(a,se),zn(!1),at(null)}catch(be){const Ue=be instanceof Error?be.message:String(be);at(Ue)}},[a,h]),Ft=_.useCallback(()=>{zn(!1),at(null)},[]),Te=_.useCallback(async()=>{if(a){try{await g(a),t("/studio/sources/add-client")}catch{}Un(!1)}},[a,g,t]),Be=_.useCallback(()=>{Un(!1)},[]);if(!m)return d.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:d.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const ct=y.length===0&&w==="all"&&!b&&!lt,tt=ln.filter(se=>se.type==="node"&&se.node?.kind==="source").length===0&&w==="indexed"&&!b,bt=!lt||!v?!1:v.metadata?.origin==="remote"?!0:u?Go(v.tree,u).some(be=>be.metadata?.origin==="remote"):!1,Dt=!ia,At=bn&&!bt,en=ia;return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("div",{className:"min-w-0 flex-1",children:vn?d.jsx(X_,{currentName:m.name,onConfirm:vt,onCancel:Ft,error:Ht}):d.jsx(As,{segments:Rn})}),d.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[At&&d.jsxs(d.Fragment,{children:[d.jsx(jh,{label:e("sources.actions.upload"),icon:d.jsx(am,{size:14}),items:[{label:e("sources.actions.upload_doc"),icon:d.jsx(Wr,{size:14}),onClick:()=>L(!0)}]}),d.jsx(jh,{label:e("sources.actions.add"),icon:d.jsx(Gm,{size:14}),items:[{label:e("sources.actions.add_folder"),icon:d.jsx(G_,{size:14}),onClick:()=>P(!0)},{label:e("sources.actions.add_web"),icon:d.jsx(wC,{size:14}),onClick:()=>ee(!0)},{label:e("sources.actions.add_feishu"),icon:d.jsx(rC,{size:14}),onClick:()=>ee(!0)}]}),d.jsxs("button",{onClick:()=>{const se=new URLSearchParams;l&&(se.set("parentId",l),v&&se.set("parentName",v.name)),u&&se.set("parentPath",u);const be=se.toString();t(`/studio/sources/import-remote/${a}${be?`?${be}`:""}`)},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:[d.jsx(uv,{size:14}),d.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_repo_url")})]})]}),en&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:cn,disabled:!m.is_online,title:m.is_online?void 0:e("sources.import.daemon_offline",{name:m.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:[d.jsx(dC,{size:14}),d.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_dir")})]}),d.jsxs("button",{onClick:Tt,disabled:!m.is_online,title:m.is_online?void 0:e("sources.import.daemon_offline",{name:m.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:[d.jsx(uv,{size:14}),d.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_repo")})]}),d.jsx(jh,{label:"",icon:d.jsx(tm,{size:14}),alignRight:!0,items:[{label:e("sources.library.rename"),icon:d.jsx(tm,{size:14}),onClick:()=>zn(!0)},...Bt?[]:[{label:e("sources.actions.delete"),icon:d.jsx(Vm,{size:14}),onClick:()=>Un(!0)}]]})]}),Dt&&d.jsx(fR,{value:w,onChange:H})]})]}),ct?d.jsx(MR,{library:m,onNewFolder:()=>P(!0),...qt?{onImportRepo:Tt,onImportDir:cn}:{},...bn?{onUploadDoc:()=>L(!0),onUpgrade:()=>{const se=new URLSearchParams;l&&(se.set("parentId",l),v&&se.set("parentName",v.name)),u&&se.set("parentPath",u);const be=se.toString();t(`/studio/sources/import-remote/${a}${be?`?${be}`:""}`)}}:{}}):d.jsx(TR,{pathLabel:(()=>{if(!lt||!v)return"/";const se=v.metadata,be=qt?typeof se?.local_path=="string"?se.local_path:v.name:"/"+v.name;if(!u)return be;const Ue=Go(v.tree,u);return be+"/"+Ue.map(ut=>ut.name).join("/")})(),loading:b,badge:(()=>{if(!lt||!v)return;let se=v.metadata,be=v.name;if(!se?.origin&&u){const Pe=Go(v.tree,u);for(const oa of Pe){const la=oa.metadata;if(la?.origin==="remote"){se=la,be=oa.name;break}}}const Ue=se?.pinned_branch??se?.remote_ref,ut=se?.pinned_hash??se?.remote_commit;if(!(!Ue||!ut))return d.jsx(Q_,{remoteUrl:se?.remote_url,fallbackName:be,branch:Ue,commit:ut})})(),onNavigateUp:lt?Ne:void 0,children:ln.length===0?tt?d.jsx(zR,{}):lt?null:d.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:e("common.items",{count:0})}):d.jsx("div",{className:"flex flex-col gap-0.5",children:ln.map(se=>{if(se.type==="root"){const Pe=se.root,oa=qt,la=oa?Pe.metadata?.local_path:void 0,ca=Pe.tree.length>0?Eh({children:Pe.tree}):void 0,M=ca?ca.folders+ca.sources:0,$=Pe.metadata,Z=$?.origin==="remote",fe=$?.import_type==="directory",he=Z||oa&&!fe;return d.jsx(kv,{source:{id:Pe.id,library_id:Pe.library_id,owner_id:Pe.owner_id,path:"",kind:Pe.kind,source_type:Pe.source_type,name:Pe.name,content_hash:Pe.content_hash,metadata:Pe.metadata,index_status:Pe.index_status,created_at:Pe.created_at,updated_at:Pe.updated_at},...typeof la=="string"?{displayName:la}:{},...Pe.kind==="folder"?{childCount:M}:{},isDaemonLibrary:qt??!1,isRepoRoot:he,...kn[Pe.id]?{hasUpdate:!0}:{},onClick:()=>_n(se),...Z?{}:{onRename:Se=>He(Pe.id,Se)},onDelete:()=>Xe(se)},Pe.id)}const be=se.node,Ue=`${se.root.id}:${be.path}`,ut=be.kind==="folder"?be.children?.length??0:void 0;return d.jsx(kv,{source:{id:se.root.id,library_id:se.root.library_id,owner_id:se.root.owner_id,path:be.path,kind:be.kind,source_type:be.source_type??null,name:be.name,content_hash:null,metadata:be.metadata??null,index_status:be.index_status??"none",created_at:se.root.created_at,updated_at:se.root.updated_at},...ut!==void 0?{childCount:ut}:{},isDaemonLibrary:qt??!1,onClick:()=>_n(se),...bn&&se.root.metadata?.origin!=="remote"?{onDelete:()=>Xe(se)}:{}},Ue)})})}),T&&d.jsx(SR,{onConfirm:jt,onCancel:()=>{P(!1),de(null)},error:X}),J&&d.jsx(jR,{onConfirm:Yn,onCancel:()=>{L(!1),re(null)},error:q,uploading:ie}),xe&&d.jsx(RR,{currentVersion:xe.currentVersion,onConfirm:mn,onCancel:()=>{Ee(null),re(null)},uploading:ie,serverError:q}),Me&&d.jsxs("div",{className:"fixed top-4 left-1/2 z-50 flex -translate-x-1/2 items-center gap-2 rounded border border-c4a-accent/30 bg-c4a-bg-elevated px-5 py-3 font-mono text-sm text-c4a-accent shadow-c4a-lg",children:[d.jsx("span",{children:"ⓘ"}),Me]}),ae&&d.jsx(wR,{onClose:()=>ee(!1)}),le&&d.jsx(Rv,{target:le,onConfirm:yt,onCancel:()=>{ce(null),F(null),G(null)}}),Nt&&m&&d.jsx(Rv,{target:{type:"client",name:m.name},onConfirm:Te,onCancel:Be})]})}function $R(){const{t:e}=ye(),t=Ot(),a=Wt(u=>u.libraries),r=Wt(u=>u.loading),[i,l]=_.useState(!1);return _.useEffect(()=>{if(r)return;if(a.length===0&&!i){l(!0),Wt.getState().fetchLibraries();return}const u=a.find(f=>f.is_default);u?t(`/studio/sources/${u.id}`,{replace:!0}):a.length>0&&t(`/studio/sources/${a[0].id}`,{replace:!0})},[a,r,t,i]),i&&!r&&a.length===0?d.jsx(Cn,{fullPage:!0,icon:d.jsx(I_,{size:32}),title:e("sources.empty.cloud.title"),description:e("sources.empty.cloud.description")}):d.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:d.jsx(Fm,{})})}function Fa({active:e,current:t}){return d.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 Cs(){return d.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function Z_({libraryName:e}){const{t}=ye();return d.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[d.jsx("p",{className:"text-sm text-c4a-warning",children:t("sources.import.daemon_offline",{name:e})}),d.jsx(ja,{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 Ym({step:e,totalSteps:t,importing:a,stepBusy:r,canProceed:i,safetyNoticeKey:l,confirmLabelKey:u,onPrev:f,onNext:m,onImport:h}){const{t:g}=ye();return d.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-4 sm:mt-6",children:[d.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-c4a-text-muted line-clamp-1 sm:line-clamp-none",title:g(l),onClick:y=>y.currentTarget.classList.toggle("line-clamp-1"),children:g(l)}),d.jsxs("div",{className:"flex shrink-0 gap-2",children:[e>1&&d.jsx("button",{onClick:f,disabled:a||r,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:g("common.previous")}),e<t?d.jsx("button",{onClick:m,disabled:!i||r,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:g("common.next")}):d.jsxs("button",{onClick:h,disabled:a||r||!i,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:[a&&d.jsx(sn,{size:12,className:"animate-spin"}),g(a?"sources.import.importing":u)]})]})]})}function J_(e,t){const a=_.useCallback(async(u,f)=>{if(!e)throw new Error("No library");const m=await De.post(`/libraries/${e}/rpc`,{method:u,params:f});if(m.error){const h=m.error;throw new Error(h.message??JSON.stringify(m.error))}return m.result??m},[e]),[r,i]=_.useState([]);_.useEffect(()=>{if(!e)return;let u=!1;return(async()=>{try{const f=await De.get("/sources",{library_id:e,limit:"500"});if(u)return;const m=f.items.map(h=>{const g=h.metadata;return typeof g?.local_path=="string"?g.local_path:null}).filter(h=>h!==null);i(m)}catch{}})(),()=>{u=!0}},[e]);const l=_.useMemo(()=>{const u=t?.config;return!u||!Array.isArray(u.allowed_paths)?[]:u.allowed_paths},[t]);return{rpc:a,importedPaths:r,allowedPaths:l}}function HR(e,t){const a=e.toLowerCase();try{if(a.endsWith("package.json")){const r=JSON.parse(t);if(typeof r.name=="string"&&r.name.trim())return r.name.trim()}if(a.endsWith("pyproject.toml"))return t.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(a.endsWith("go.mod"))return t.match(/^\s*module\s+([^\s]+)\s*$/m)?.[1]??null;if(a.endsWith("cargo.toml"))return t.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(a.endsWith("pom.xml"))return t.match(/<artifactId>([^<]+)<\/artifactId>/)?.[1]?.trim()??null;if(a.endsWith("build.gradle"))return t.match(/rootProject\.name\s*=\s*["']([^"']+)["']/)?.[1]??null}catch{return null}return null}function W_(e,t,a="repo"){const r=[];for(const l of e){const u=l.path.split("/"),f=u.slice(0,-1).join("/")||".",m=u.length===1||l.path==="package.json",h=f==="."?a:u[u.length-2]||f,g=HR(l.path,l.content);r.push({name:g||h,path:f,isRoot:m})}const i=t.filter(l=>/\.md$/i.test(l.path)).map(l=>l.path);return{packages:r,mdFiles:i}}const Tv=new Set(["tree","blob","commit","commits","raw","src"]),BR=new Set(["commit","commits"]);function IR(e){let t;try{t=new URL(e.trim())}catch{return{repoUrl:e.trim()}}const a=t.pathname.split("/").filter(Boolean);let r=-1;for(let h=2;h<a.length;h++){const g=a[h];if(g==="-"&&h+1<a.length&&Tv.has(a[h+1])){r=h;break}if(Tv.has(g)){r=h;break}}if(r===-1)return{repoUrl:`${t.protocol}//${t.host}${t.pathname}`.replace(/\/+$/,"")};const i=a.slice(0,r).join("/"),l=`${t.protocol}//${t.host}/${i}`;let u,f;if(a[r]==="-"?(u=a[r+1],f=r+2):(u=a[r],f=r+1),f>=a.length)return{repoUrl:l};const m=a[f];return BR.has(u)?{repoUrl:l,commit:m}:{repoUrl:l,ref:m}}function Qr(e){try{return(new URL(e).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return e.split("/").pop()||e}}function om(){const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`}const PR=1500;async function e1(e){const t=PR-(Date.now()-e);t>0&&await new Promise(a=>setTimeout(a,t))}function t1(){const{t:e}=ye(),[t,a]=_.useState(!1),[r,i]=_.useState(null),l=_.useRef(),u=_.useRef(),f=window.location.host,m=`c4a-daemon --server ${f} --allow <dir1> <dir2>`,h=`c4a-daemon --server ${f}`,g=_.useCallback((b,w)=>{navigator.clipboard.writeText(b),i(w),clearTimeout(l.current),l.current=setTimeout(()=>i(null),1500)},[]),y=_.useCallback(()=>{clearTimeout(u.current),a(!0)},[]),v=_.useCallback(()=>{u.current=setTimeout(()=>a(!1),150)},[]);return d.jsxs("span",{className:"relative",onMouseEnter:y,onMouseLeave:v,children:[d.jsx(B_,{size:12,className:"text-c4a-warning"}),t&&d.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:y,onMouseLeave:v,children:[d.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:e("sources.import.allowed_dirs_tooltip_restrict")}),d.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[d.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:m}),d.jsx("button",{onClick:()=>g(m,0),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:r===0?d.jsx(ts,{size:10}):d.jsx(Wh,{size:10})})]}),d.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:e("sources.import.allowed_dirs_tooltip_all")}),d.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[d.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:h}),d.jsx("button",{onClick:()=>g(h,1),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:r===1?d.jsx(ts,{size:10}):d.jsx(Wh,{size:10})})]})]})]})}function n1({open:e,onClose:t,rpc:a,onNavigate:r,defaultPath:i}){const{t:l}=ye(),[u,f]=_.useState(i??""),[m,h]=_.useState(null),[g,y]=_.useState(!1),v=_.useRef(null);_.useEffect(()=>{i&&!u&&f(i)},[i]);const b=_.useCallback(async()=>{const N=u.trim();if(N){y(!0),h(null);try{(await a("fs/exists",{path:N})).exists?(r(N),f(i??""),h(null),t()):h(l("sources.import.wildcard_path_not_found"))}catch(j){h(j instanceof Error?j.message:String(j))}finally{y(!1)}}},[u,a,l,r,t]),w=_.useCallback(()=>{f(i??""),h(null),t()},[t,i]);return e?d.jsxs(Qa,{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:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:l("sources.import.wildcard_go_title")}),d.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:d.jsx(br,{size:14})})]}),d.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[d.jsx("input",{ref:v,type:"text",value:u,onChange:N=>{f(N.target.value),h(null)},onKeyDown:N=>{N.key==="Enter"&&b()},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"}),d.jsxs("button",{onClick:b,disabled:g||!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:[g?d.jsx(sn,{size:12,className:"animate-spin"}):d.jsx(H_,{size:12}),l("sources.import.wildcard_go")]})]}),m&&d.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:m})]}):null}function a1({rpc:e,allowedPaths:t,importedPaths:a,onNavigateUpExtra:r}){const i=!!t&&t.length>0,l=i&&t.length===1&&t[0]==="*",[u,f]=_.useState(i),[m,h]=_.useState(i&&!l?"":"/"),[g,y]=_.useState([]),[v,b]=_.useState(!1),[w,N]=_.useState(null),[j,E]=_.useState(null);_.useEffect(()=>{if(i&&!l)return;let P=!1;return(async()=>{try{const X=await e("fs/homeDir",{});P||E(X.home_dir)}catch{P||E("/")}})(),()=>{P=!0}},[i,l,e]);const[R,k]=_.useState(!1),O=_.useCallback(async P=>{b(!0),N(null);try{const X=await e("fs/listTree",{path:P,depth:1});y(X.entries||[]),h(P),f(!1)}catch(X){const de=X instanceof Error?X.message:String(X);N(de)}finally{b(!1)}},[e]);_.useEffect(()=>{i&&!l||j!==null&&O(j)},[j,i,l,O]);const I=_.useMemo(()=>new Set(a??[]),[a]),B=_.useCallback(()=>{if(i&&!l&&t.some(de=>de===m)){f(!0),h(""),y([]),N(null),r?.();return}const P=m.split("/").slice(0,-1).join("/")||"/";r?.(),O(P)},[i,l,t,m,O,r]),H=_.useMemo(()=>g.filter(P=>P.type==="directory"),[g]),T=_.useMemo(()=>g.filter(P=>P.type==="file"),[g]);return{atRoot:u,currentPath:m,entries:g,loading:v,error:w,homeDir:j,goToOpen:R,hasAllowedPaths:i,isWildcard:l,importedSet:I,dirs:H,files:T,loadTree:O,handleNavigateUp:B,setGoToOpen:k}}function GR({rpc:e,selectedPath:t,onSelect:a,allowedPaths:r,importedPaths:i}){const{t:l}=ye(),[u,f]=_.useState(null),{atRoot:m,currentPath:h,entries:g,loading:y,error:v,homeDir:b,goToOpen:w,isWildcard:N,importedSet:j,dirs:E,files:R,loadTree:k,handleNavigateUp:O,setGoToOpen:I}=a1({rpc:e,allowedPaths:r??[],importedPaths:i??[],onNavigateUpExtra:()=>f(null)}),[B,H]=_.useState(null),[T,P]=_.useState(!1);_.useEffect(()=>{if(!t){H(null),P(!1);return}H(null),P(!0);let ce=!1;return(async()=>{try{const D=await e("fs/repoStatus",{path:t});ce||(H({branch:D.branch,hash:D.head_hash,remoteUrl:D.remote_url}),P(!1))}catch{ce||(H(null),P(!1))}})(),()=>{ce=!0}},[t,e]);const X=_.useCallback(ce=>{if(ce.type==="directory")if(ce.is_git_repo){if(j.has(ce.path))return;f(null),a(ce.path,ce.name)}else f(ce.path),k(ce.path)},[a,k,j]),de=_.useMemo(()=>E.sort((ce,D)=>ce.is_git_repo&&!D.is_git_repo?-1:!ce.is_git_repo&&D.is_git_repo?1:ce.name.localeCompare(D.name)),[E]),le=_.useMemo(()=>R.sort((ce,D)=>ce.name.localeCompare(D.name)),[R]);return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[m?d.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[d.jsx("span",{children:l("sources.import.allowed_dirs")}),d.jsx(t1,{})]}):d.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:h}),t&&T?d.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[d.jsx(sn,{size:12,className:"animate-spin"}),d.jsx("span",{children:l("common.loading")})]}):t&&B?d.jsx(Q_,{remoteUrl:B.remoteUrl,fallbackName:t.split("/").pop()||t,branch:B.branch,commit:B.hash}):!t&&N&&m?d.jsx("button",{onClick:()=>I(!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]}),d.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),m?N?d.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:b&&d.jsxs("button",{onClick:()=>k(b),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[d.jsx(_a,{size:14,className:"shrink-0"}),d.jsxs("span",{className:"truncate",children:[b,d.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",l("sources.import.wildcard_home"),")"]})]}),d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):d.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:r.map(ce=>d.jsxs("button",{onClick:()=>k(ce),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[d.jsx(_a,{size:14,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:ce}),d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"})]},ce))}):v&&!y?d.jsx("p",{className:"py-4 text-xs text-c4a-error",children:v}):d.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[y&&d.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:d.jsx(sn,{size:14,className:"animate-spin text-c4a-text-muted"})}),h!=="/"&&d.jsxs("button",{onClick:O,disabled:y,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[d.jsx(_a,{size:14}),d.jsx("span",{children:".."})]}),de.map(ce=>{const D=ce.is_git_repo&&j.has(ce.path),F=ce.is_git_repo?Hu:_a;return d.jsxs("div",{className:`flex w-full items-center rounded pl-2 pr-4 text-left text-sm transition-colors ${D?"cursor-not-allowed text-c4a-accent/60":t===ce.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-accent/10 hover:text-c4a-accent"}`,children:[d.jsxs("button",{onClick:()=>X(ce),disabled:D||y,className:"flex flex-1 items-center gap-2 px-2 py-1.5",children:[d.jsx(F,{size:14,className:"shrink-0"}),d.jsx("span",{className:"flex-1 truncate text-left",children:ce.name}),D&&d.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")})]}),!D&&d.jsx("button",{onClick:A=>{A.stopPropagation(),k(ce.path)},disabled:y,className:"shrink-0 rounded p-1.5 text-c4a-text-muted transition-colors hover:bg-c4a-accent/10 hover:text-c4a-accent disabled:pointer-events-none",title:ce.path,children:d.jsx(rn,{size:12})})]},ce.path)}),le.map(ce=>d.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[d.jsx(P_,{size:14,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:ce.name})]},ce.path)),g.length===0&&!y&&d.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:l("sources.import.no_entries")})]}),u&&!t&&d.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:l("sources.import.not_git")}),d.jsx(n1,{open:w,onClose:()=>I(!1),rpc:e,onNavigate:k,defaultPath:b??void 0})]})}const bi=50,Ch=["main","master"];function VR(e){const t=[],a=[];for(const r of e)Ch.includes(r.name)?t.push(r):a.push(r);return t.sort((r,i)=>Ch.indexOf(r.name)-Ch.indexOf(i.name)),[...t,...a]}function Av(e,t,a){_.useEffect(()=>{if(!a)return;const r=i=>{e.current&&!e.current.contains(i.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t,a])}function r1({refs:e,loading:t,error:a,selectedRef:r,commit:i,onRefChange:l,onCommitChange:u,onValidChange:f,onBranchSwitch:m}){const{t:h}=ye(),[g,y]=_.useState(!1),[v,b]=_.useState(""),[w,N]=_.useState(!0),[j,E]=_.useState(!0),R=_.useRef(null),k=_.useRef(null),[O,I]=_.useState(!1),[B,H]=_.useState(""),T=_.useRef(null),P=_.useRef(null);Av(R,()=>{y(!1),b("")},g),Av(T,()=>{I(!1),H("")},O),_.useEffect(()=>{g&&setTimeout(()=>k.current?.focus(),0)},[g]),_.useEffect(()=>{O&&setTimeout(()=>P.current?.focus(),0)},[O]),_.useEffect(()=>{f(!!r)},[r,f]);const X=_.useCallback(J=>{l(J.name),u(J.commit),y(!1),b(""),m?.(J.name)},[l,u,m]),de=_.useCallback((J,L)=>{u(J),l(L),I(!1),H("")},[u,l]),le=_.useMemo(()=>e?VR(e.branches):[],[e]),ce=_.useMemo(()=>{const J=v.toLowerCase();return(J?le.filter(q=>q.name.toLowerCase().includes(J)):le).slice(0,bi)},[le,v]),D=_.useMemo(()=>{if(!e)return[];const J=v.toLowerCase();return(J?e.tags.filter(q=>q.name.toLowerCase().includes(J)):e.tags).slice(0,bi)},[e,v]),F=_.useMemo(()=>{if(!e)return[];if(e.commits&&e.commits.length>0){const ie=B.toLowerCase(),ge=e.commits.map(xe=>({hash:xe.hash,refName:r||"",label:`${xe.hash.slice(0,8)} ${xe.message?`— ${xe.message.slice(0,50)}`:""}`.trim()}));return ie?ge.filter(xe=>xe.hash.toLowerCase().includes(ie)||xe.label.toLowerCase().includes(ie)).slice(0,bi):ge.slice(0,bi)}const J=new Set,L=[],q=[...e.branches??[],...e.tags??[]];for(const ie of q){const ge=ie.commit.slice(0,8);J.has(ie.commit)||(J.add(ie.commit),L.push({hash:ie.commit,refName:ie.name,label:`${ge} (${ie.name})`}))}if(!B)return L.slice(0,bi);const re=B.toLowerCase();return L.filter(ie=>ie.hash.toLowerCase().includes(re)||ie.label.toLowerCase().includes(re)).slice(0,bi)},[e,B,r]),[A,G]=_.useState(!1);if(_.useEffect(()=>{if(!t){G(!1);return}const J=setTimeout(()=>G(!0),5e3);return()=>clearTimeout(J)},[t]),t)return d.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:[d.jsx(sn,{size:20,className:"animate-spin text-c4a-accent"}),d.jsx("span",{className:"mt-2 text-sm text-c4a-accent",children:h("sources.import_remote.loading_refs")}),A&&d.jsx("span",{className:"mt-1.5 text-xs text-c4a-text-muted",children:h("sources.import_remote.loading_refs_slow")})]});if(a)return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-sm font-medium text-red-400",children:[d.jsx(br,{size:14,className:"shrink-0"}),h("sources.import.error_title")]}),d.jsx("p",{className:"mt-2 max-h-40 overflow-y-auto break-all font-mono text-xs leading-relaxed text-red-400/70",children:a})]});if(!e)return null;const ae=e.branches.find(J=>J.name===r)?.name??e.tags.find(J=>J.name===r)?.name??r,ee=i?i.slice(0,8):"";return d.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:[d.jsxs("div",{children:[d.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:h("sources.import_remote.ref_label")}),d.jsxs("div",{ref:R,className:"relative mt-2",children:[d.jsxs("button",{onClick:()=>y(!g),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:[d.jsx("span",{children:ae||"—"}),d.jsx(rn,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${g?"rotate-90":""}`})]}),g&&d.jsxs("div",{className:"absolute z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[d.jsx("div",{className:"border-b border-c4a-border-default px-3 py-2.5",children:d.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1.5",children:[d.jsx(nm,{size:14,className:"shrink-0 text-c4a-text-muted"}),d.jsx("input",{ref:k,type:"text",value:v,onChange:J=>b(J.target.value),placeholder:h("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"})]})}),d.jsxs("div",{className:"flex max-h-80 flex-col md:flex-row",children:[ce.length>0&&d.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto md:border-r md:border-c4a-border-default",children:[d.jsxs("button",{onClick:()=>N(!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:[d.jsx(rn,{size:12,className:`transition-transform duration-200 ${w?"rotate-90":""}`}),h("sources.import_remote.ref_branches")," (",e.branches.length,")"]}),w&&ce.map(J=>d.jsxs("button",{onClick:()=>X(J),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${J.name===r?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[d.jsx("span",{className:"truncate",children:J.name}),J.name===r&&d.jsx("span",{children:"✓"})]},`b-${J.name}`))]}),D.length>0&&d.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto border-t border-c4a-border-default md:border-t-0",children:[d.jsxs("button",{onClick:()=>E(!j),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:[d.jsx(rn,{size:12,className:`transition-transform duration-200 ${j?"rotate-90":""}`}),h("sources.import_remote.ref_tags")," (",e.tags.length,")"]}),j&&D.map(J=>d.jsxs("button",{onClick:()=>X(J),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${J.name===r?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[d.jsx("span",{className:"truncate",children:J.name}),J.name===r&&d.jsx("span",{children:"✓"})]},`t-${J.name}`))]})]}),ce.length===0&&D.length===0&&d.jsx("div",{className:"px-3 py-4 text-center font-mono text-sm text-c4a-text-muted",children:"No matches"})]})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:h("sources.import_remote.commit_label")}),d.jsxs("div",{ref:T,className:"relative mt-2",children:[d.jsxs("button",{onClick:()=>I(!O),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:[d.jsx("span",{className:i?"":"font-normal text-c4a-text-muted",children:ee||"—"}),d.jsx(rn,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${O?"rotate-90":""}`})]}),O&&d.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:[d.jsx("div",{className:"sticky top-0 z-10 border-b border-c4a-border-default bg-c4a-bg-elevated px-3 py-2",children:d.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1",children:[d.jsx(nm,{size:12,className:"shrink-0 text-c4a-text-muted"}),d.jsx("input",{ref:P,type:"text",value:B,onChange:J=>H(J.target.value),placeholder:h("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"})]})}),F.map(J=>d.jsxs("button",{onClick:()=>de(J.hash,J.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:[d.jsx("span",{className:"truncate",children:J.label}),J.hash===i&&d.jsx("span",{className:"text-c4a-accent",children:"✓"})]},J.hash)),F.length===0&&d.jsx("div",{className:"px-3 py-4 text-center font-mono text-xs text-c4a-text-muted",children:"No matches"})]})]}),d.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[d.jsx(CC,{size:12,className:"shrink-0"}),h("sources.import_remote.commit_hint")]})]})]})}const qR="_progressTrack_4p57j_1",FR="_progressFill_4p57j_9",YR="_progressFillFailed_4p57j_45",KR="_indeterminate_4p57j_53",Pc={progressTrack:qR,progressFill:FR,progressFillFailed:YR,indeterminate:KR};function XR(e){const t={},a=100/e.length;return e.forEach((r,i)=>{t[r.key]=Math.round(a*(i+1))}),t}function QR(e,t,a,r,i,l){const u=g=>g>0?t[e[g-1].key]??0:0;if(i){const g=e.findIndex(b=>b.key===i),y=u(g),v=t[i]??100;return y+l/100*(v-y)}if(!a)return r.length===e.length?100:0;const f=e.findIndex(g=>g.key===a);if(f<0)return 0;const m=u(f),h=t[a]??100;return l>=0?m+l/100*(h-m):m}function ZR({stages:e,currentStage:t,completedStages:a,failedStage:r,progress:i,breakpoints:l}){const u=l??XR(e),f=i?.percent??-1,m=_.useRef(0),[h,g]=_.useState(0),y=_.useRef(null),v=QR(e,u,t,a,r,f>=0?f:-1);m.current=v,_.useEffect(()=>{v>h&&g(v)},[v]),_.useEffect(()=>{if(!t||r){y.current&&(clearInterval(y.current),y.current=null);return}const R=e.findIndex(H=>H.key===t),k=u[t]??100,O=R===e.length-1?k-1:k-2,I=500,B=.025;return y.current=setInterval(()=>{g(H=>{const T=m.current;if(H>=T&&H<O){const P=Math.max(.1,(O-H)*B);return Math.min(H+P,O)}return H})},I),()=>{y.current&&(clearInterval(y.current),y.current=null)}},[t,r,e,u]);const b=_.useRef(null);_.useEffect(()=>{if(a.length===e.length&&!r)return y.current&&(clearInterval(y.current),y.current=null),b.current=setInterval(()=>{g(R=>R>=100?(b.current&&clearInterval(b.current),b.current=null,100):Math.min(100,R+4))},32),()=>{b.current&&(clearInterval(b.current),b.current=null)}},[a.length,e.length,r]);const w=Math.min(100,Math.max(0,h)),N=!!t&&!r,j=!!r,E=a.length===e.length&&!r;return d.jsxs("div",{className:"space-y-3",children:[d.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:e.map(R=>{const k=a.includes(R.key),O=r===R.key,I=t===R.key;let B="inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-mono text-[11px] uppercase tracking-tight transition-colors";return O?B+=" bg-red-500/10 text-red-400":k?B+=" bg-c4a-accent/10 text-c4a-accent":I?B+=" bg-c4a-accent/15 text-c4a-accent":B+=" bg-c4a-bg-elevated text-c4a-text-muted",d.jsxs("span",{className:B,children:[O?d.jsx(br,{size:10,className:"shrink-0"}):k?d.jsx(ts,{size:10,className:"shrink-0"}):I?d.jsx(sn,{size:10,className:"shrink-0 animate-spin"}):d.jsx(JE,{size:8,className:"shrink-0 opacity-40"}),R.label]},R.key)})}),d.jsx("div",{className:Pc.progressTrack,children:w>0?d.jsx("div",{className:`${Pc.progressFill} ${j?Pc.progressFillFailed:""}`,style:{width:`${w}%`}},"fill"):N?d.jsx("div",{className:Pc.indeterminate,style:{width:"100%",height:"100%"}},"pulse"):null}),d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("span",{className:"font-mono text-[11px] text-c4a-text-muted tabular-nums",children:E?"100%":N||j?`${Math.round(w)}%`:""}),i?.label&&N&&d.jsx("span",{className:"hidden truncate font-mono text-[11px] text-c4a-text-muted sm:block",children:i.label})]})]})}function s1({stages:e,currentStage:t,completedStages:a,failedStage:r,progress:i,breakpoints:l,failedError:u,logs:f}){const m=_.useRef(null);return _.useEffect(()=>{m.current?.scrollIntoView({behavior:"smooth"})},[f.length]),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsx(ZR,{stages:e,currentStage:t,completedStages:a,failedStage:r,progress:i,...l?{breakpoints:l}:{}}),d.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((h,g)=>d.jsx("p",{className:"font-mono text-xs text-c4a-text-muted leading-relaxed",children:h},g)),d.jsx("div",{ref:m})]}),r&&u&&d.jsx("div",{className:"mt-3 max-h-32 overflow-y-auto rounded-sm bg-red-500/5 px-4 py-3",children:d.jsx("p",{className:"break-all font-mono text-xs leading-relaxed text-red-400/80",children:u})})]})}function yr({icon:e,label:t,value:a,tooltip:r,size:i="sm"}){const l=i==="sm";return d.jsxs("div",{className:"group/stat relative rounded border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted [&>svg]:size-4",children:[e,d.jsx("span",{className:"font-mono text-xs uppercase",children:t})]}),d.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-secondary ${l?"text-sm truncate":"text-lg"}`,title:l?String(a):void 0,children:a}),r&&d.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:r})]})}const kh=100;function i1({repoName:e,repoIdentifier:t,branch:a,commit:r,packages:i,mdFiles:l,importing:u,completed:f}){const{t:m}=ye(),h=r?r.slice(0,7):"",[g,y]=_.useState("packages"),[v,b]=_.useState(kh),w=_.useRef(null),N=_.useRef(null);_.useEffect(()=>{b(kh),N.current?.scrollTo(0,0)},[g]),_.useEffect(()=>{const O=w.current;if(!O)return;const I=g==="packages"?i.length:l.length;if(v>=I)return;const B=new IntersectionObserver(H=>{H[0]?.isIntersecting&&b(T=>Math.min(T+kh,I))},{root:N.current,threshold:.1});return B.observe(O),()=>B.disconnect()},[g,v,i.length,l.length]);const j=g==="packages"?i:l,E=j.slice(0,v),R=v<j.length,k=_.useMemo(()=>f?m("sources.import_remote.complete"):u?m("sources.import.importing"):m("sources.import.confirm_heading",{name:e}),[f,u,e,m]);return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[d.jsx("p",{className:"text-sm text-c4a-text-secondary",children:k}),d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[d.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:e}),d.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:t})]}),d.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[d.jsx(yr,{icon:d.jsx(em,{size:14}),label:m("sources.import.branch"),value:a}),d.jsx(yr,{icon:d.jsx(yC,{size:14}),label:m("sources.import.commit"),value:h}),d.jsx(yr,{icon:d.jsx(Ei,{size:14}),label:m("sources.import.packages"),value:String(i.length),tooltip:m("sources.import.dir_code_packages_tip")}),d.jsx(yr,{icon:d.jsx(Wr,{size:14}),label:m("sources.import.documents"),value:String(l.length),tooltip:m("sources.import.dir_doc_files_tip")})]}),u&&d.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[d.jsx(sn,{size:14,className:"animate-spin text-c4a-accent"}),d.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:m("sources.import.importing")})]}),(i.length>0||l.length>0)&&d.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-base",children:[d.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[d.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-secondary sm:block",children:m("sources.import.recognized",{packages:i.length,docs:l.length})}),d.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[d.jsxs("button",{onClick:()=>y("packages"),className:`flex items-center gap-1 px-2.5 py-1 text-xs transition-colors ${g==="packages"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[d.jsx(Ei,{size:13}),d.jsx("span",{className:"font-mono",children:i.length})]}),d.jsxs("button",{onClick:()=>y("docs"),className:`flex items-center gap-1 border-l border-c4a-border-subtle px-2.5 py-1 text-xs transition-colors ${g==="docs"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[d.jsx(Wr,{size:13}),d.jsx("span",{className:"font-mono",children:l.length})]})]})]}),d.jsx("hr",{className:"border-c4a-border-subtle"}),d.jsx("div",{ref:N,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:j.length===0?d.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:g==="packages"?m("sources.import.no_packages"):"—"}):d.jsxs(d.Fragment,{children:[g==="packages"?E.map(O=>d.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[d.jsx(Ei,{size:14,className:"shrink-0 text-c4a-accent"}),d.jsx("span",{className:"text-c4a-text-secondary",children:O.name}),d.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:O.path}),O.isRoot&&d.jsx("span",{className:"rounded bg-c4a-bg-active px-1 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:"root"})]},O.path)):E.map(O=>d.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[d.jsx(Wr,{size:14,className:"shrink-0 text-c4a-text-secondary"}),d.jsx("span",{className:"truncate text-c4a-text-secondary",children:O})]},O)),R&&d.jsx("div",{ref:w,className:"h-4"})]})})]})]})}const JR=["scan","save"],Gc={scan:"sources.import.stage.scan",save:"sources.import.stage.save"},WR={scan:20,save:90};function eT(){const{t:e}=ye(),t=Ot(),{libId:a}=xl(),[r]=$u(),l=Wt(Ds(Ui)).find(Ne=>Ne.id===a),u=Iu(Ne=>Ne.createSource),f=r.get("parentId")||"",m=r.get("parentName")||"",h=r.get("parentPath")||"",[g,y]=_.useState(1),[v,b]=_.useState(null),[w,N]=_.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),[j,E]=_.useState(null),[R,k]=_.useState(!1),[O,I]=_.useState(null),[B,H]=_.useState(""),[T,P]=_.useState(""),[X,de]=_.useState(!1),[le,ce]=_.useState(!1),[D,F]=_.useState(!1),[A,G]=_.useState(null),[ae,ee]=_.useState([]),[J,L]=_.useState(null),[q,re]=_.useState(null),[ie,ge]=_.useState([]),xe=_.useRef(null),Ee=l?.is_online??!1,{rpc:Me,importedPaths:qe,allowedPaths:vn}=J_(a,l),zn=_.useMemo(()=>JR.map(Ne=>({key:Ne,label:Gc[Ne]?e(Gc[Ne]):Ne})),[e]),Ht=_.useCallback(Ne=>{ge(He=>[...He,`[${om()}] ${Ne}`])},[]),at=_.useRef(null),Nt=_.useCallback(Ne=>{const He=at.current;He&&He!==Ne&&(ee(Xe=>Xe.includes(He)?Xe:[...Xe,He]),Ht(`${e(Gc[He]??He)} ${e("sources.import.stage.done_suffix")}`)),Ht(`${e(Gc[Ne]??Ne)}...`),at.current=Ne,G(Ne),re(null)},[Ht,e]),Un=_.useCallback((Ne,He)=>{N(Xe=>({...Xe,repoPath:Ne,repoName:He}))},[]),lt=_.useCallback(async()=>{k(!0),I(null);try{const Ne=await Me("fs/repoStatus",{path:w.repoPath}),He={branches:Ne.branches??[{name:Ne.branch,commit:Ne.head_hash}],tags:Ne.tags??[],default:Ne.branch,commits:Ne.commits??[{hash:Ne.head_hash,message:"HEAD"}]};E(He),N(Xe=>({...Xe,isDirty:Ne.is_dirty})),H(Xe=>{if(Xe)return Xe;const yt=He.branches.find(Yn=>Yn.name===He.default),Tt=He.branches[0],cn=yt??Tt;return cn?(P(cn.commit),cn.name):Xe})}catch(Ne){const He=Ne instanceof Error?Ne.message:"Failed to load repository info";I(He)}finally{k(!1)}},[Me,w.repoPath]);_.useEffect(()=>{g===2&&w.repoPath&&!j&<()},[g,w.repoPath,j,lt]);const hn=_.useCallback(async Ne=>{try{const He=await Me("fs/repoStatus",{path:w.repoPath,branch:Ne});E(Xe=>Xe&&{...Xe,commits:He.commits??[]})}catch{}},[Me,w.repoPath]),ln=_.useCallback(async()=>{if(!a)return;const Ne=Date.now();ce(!0),F(!1),b(null),L(null),ee([]),at.current=null,G(null),re(null),ge([]),y(3);try{Nt("scan");const He=await Me("fs/repoScan",{path:w.repoPath,hash:T}),Xe=He.files||[],yt=He.manifests||[],Tt=Qr(w.repoPath),{packages:cn,mdFiles:Yn}=W_(yt,Xe,Tt);N(vt=>({...vt,branch:B,commit:T,repoFiles:Xe,packages:cn,mdFiles:Yn,repoFileContents:yt})),Nt("save");const mn=await u({library_id:a,repo_name:w.repoName||Tt,repo_root_path:w.repoPath,repo_branch:B,repo_commit:T,repo_files:Xe.map(vt=>vt.path),repo_file_contents:yt,...f?{parent_source_id:f,parent_path:h}:{}});ee(["scan","save"]),at.current=null,G(null),Ht(`${e("sources.import.stage.save")} ${e("sources.import.stage.done_suffix")}`),Ht(e("sources.import.stage.complete"));const Bt=Array.isArray(mn)?mn[0]:mn;xe.current=Bt?.id??null,await e1(Ne),F(!0),ce(!1),y(4)}catch(He){const Xe=at.current??"scan";L(Xe),at.current=null,G(null);const yt=He instanceof Error?He.message:String(He);Ht(`ERROR: ${yt}`),b(yt),ce(!1)}},[a,w,B,T,f,h,Me,u,Nt,Ht]),qt=_.useCallback(()=>{L(null),b(null),ln()},[ln]),bn=_.useCallback(()=>{if(a)if(f){const Ne=w.repoName||Qr(w.repoPath),He=h?`${h}/${Ne}`:Ne;t(`/studio/sources/${a}?rootId=${f}&path=${encodeURIComponent(He)}`)}else xe.current?t(`/studio/sources/${a}?rootId=${xe.current}`):t(`/studio/sources/${a}`)},[a,t,f,h,w.repoPath,w.repoName]),ia=_.useMemo(()=>g===1?!!w.repoPath:g===2?X:g===3?D:!1,[g,w.repoPath,X,D]),kn=_.useMemo(()=>{if(!l)return[];const Ne=[{label:l.is_default?e("sources.library.default_cloud_name"):l.name,to:`/studio/sources/${l.id}`}];if(f&&(Ne.push({label:m||f,to:`/studio/sources/${l.id}?rootId=${f}`}),h)){const He=h.split("/").filter(Boolean);for(const[Xe,yt]of He.entries()){const Tt=He.slice(0,Xe+1).join("/");Ne.push({label:yt,to:`/studio/sources/${l.id}?rootId=${f}&path=${encodeURIComponent(Tt)}`})}}return Ne.push({label:e("sources.import.title")}),Ne},[l,f,m,h,e]);if(!l)return d.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:d.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Rn=g===4,jt=g===3&&!!J&&!le,_n=g<=2;return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[d.jsx("div",{className:"shrink-0",children:d.jsx(As,{segments:kn})}),d.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[d.jsx(Fa,{active:g>=1,current:g===1}),d.jsx("span",{className:g===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.select")}),d.jsx(Cs,{}),d.jsx(Fa,{active:g>=2,current:g===2}),d.jsx("span",{className:g===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.version")}),d.jsx(Cs,{}),d.jsx(Fa,{active:g>=3,current:g===3}),d.jsx("span",{className:g===3?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.loading")}),d.jsx(Cs,{}),d.jsx(Fa,{active:g>=4,current:g===4}),d.jsx("span",{className:g===4?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.confirm")})]}),d.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:Ee?d.jsxs(d.Fragment,{children:[g===1&&d.jsx(GR,{rpc:Me,selectedPath:w.repoPath,onSelect:Un,allowedPaths:vn,importedPaths:qe}),g===2&&d.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:d.jsx(r1,{refs:j,loading:R,error:O,selectedRef:B,commit:T,onRefChange:H,onCommitChange:P,onValidChange:de,onRetry:lt,onBranchSwitch:hn})}),g===3&&d.jsx(s1,{stages:zn,currentStage:A,completedStages:ae,failedStage:J,progress:q,breakpoints:WR,failedError:v,logs:ie}),g===4&&d.jsx(i1,{repoName:w.repoName||Qr(w.repoPath),repoIdentifier:w.repoPath,branch:B,commit:T,packages:w.packages,mdFiles:w.mdFiles,importing:!1,completed:D})]}):d.jsx(Z_,{libraryName:l.name})}),Ee&&d.jsx(d.Fragment,{children:Rn?d.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:d.jsx("button",{onClick:bn,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")})}):jt?d.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[d.jsx("button",{onClick:()=>{y(2),L(null),b(null),ee([]),at.current=null,G(null),ge([])},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")}),d.jsx("button",{onClick:qt,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")})]}):_n?d.jsx(Ym,{step:g,totalSteps:4,importing:le,stepBusy:R||g===3&&le,canProceed:ia,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>y(Ne=>Ne-1),onNext:()=>{g===2?ln():y(Ne=>Ne+1)},onImport:ln}):null}),v&&g!==3&&d.jsxs(Qa,{onClose:()=>b(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:[d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:e("sources.import.error_title")}),d.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:v}),d.jsx("div",{className:"mt-6 flex justify-end",children:d.jsx("button",{onClick:()=>b(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 a=0,r=0,i=0;const l=[],u=f=>{for(const m of f)if(m.type==="directory")r++,m.is_git_repo&&i++,m.children&&u(m.children);else if(a++,/\.md$/i.test(m.name)){const h=m.path.startsWith(t)?m.path.slice(t.length).replace(/^\//,""):m.name;l.push(h)}};return u(e),{files:a,dirs:r,gitRepos:i,mdFiles:l}};function tT({rpc:e,selectedPath:t,onSelect:a,allowedPaths:r,importedPaths:i}){const{t:l}=ye(),{atRoot:u,currentPath:f,entries:m,loading:h,error:g,homeDir:y,goToOpen:v,isWildcard:b,importedSet:w,dirs:N,files:j,loadTree:E,handleNavigateUp:R,setGoToOpen:k}=a1({rpc:e,allowedPaths:r??[],importedPaths:i??[]}),O=_.useCallback(T=>{if(T.type!=="directory"||w.has(T.path))return;const P=Lv(T.children||[],T.path);a(T.path,T.name,P),E(T.path)},[a,E,w]);_.useEffect(()=>{if(f&&!u&&m.length>=0&&!h){const T=f.split("/").pop()||f,P=Lv(m,f);a(f,T,P)}},[f,u,m,h,a]);const I=_.useMemo(()=>t?t.split("/").pop()||t:"",[t]),B=_.useMemo(()=>N.sort((T,P)=>T.is_git_repo&&!P.is_git_repo?-1:!T.is_git_repo&&P.is_git_repo?1:T.name.localeCompare(P.name)),[N]),H=_.useMemo(()=>j.sort((T,P)=>T.name.localeCompare(P.name)),[j]);return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u?d.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[d.jsx("span",{children:l("sources.import.allowed_dirs")}),d.jsx(t1,{})]}):d.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:f}),t?d.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[d.jsx(_a,{size:12}),d.jsx("span",{children:I})]}):b&&u?d.jsx("button",{onClick:()=>k(!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]}),d.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),u?b?d.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:y&&d.jsxs("button",{onClick:()=>E(y),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[d.jsx(_a,{size:14,className:"shrink-0"}),d.jsxs("span",{className:"truncate",children:[y,d.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",l("sources.import.wildcard_home"),")"]})]}),d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):d.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:r.map(T=>d.jsxs("button",{onClick:()=>E(T),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[d.jsx(_a,{size:14,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:T}),d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"})]},T))}):g&&!h?d.jsx("p",{className:"py-4 text-xs text-c4a-error",children:g}):d.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[h&&d.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:d.jsx(sn,{size:14,className:"animate-spin text-c4a-text-muted"})}),f!=="/"&&d.jsxs("button",{onClick:R,disabled:h,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[d.jsx(_a,{size:14}),d.jsx("span",{children:".."})]}),B.map(T=>{const P=w.has(T.path),X=T.is_git_repo?Hu:_a;return d.jsxs("button",{onClick:()=>O(T),disabled:P||h,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-sm transition-colors ${P?"cursor-not-allowed text-c4a-accent/60":t===T.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[d.jsx(X,{size:14,className:"shrink-0"}),d.jsx("span",{className:"flex-1 truncate",children:T.name}),P&&d.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")}),d.jsx(rn,{size:12,className:"shrink-0 text-c4a-text-muted"})]},T.path)}),H.map(T=>d.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-sm text-c4a-text-muted",children:[d.jsx(P_,{size:14,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:T.name})]},T.path)),m.length===0&&!h&&d.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:l("sources.import.no_entries")})]}),d.jsx(n1,{open:v,onClose:()=>k(!1),rpc:e,onNavigate:E,defaultPath:y??void 0})]})}const nT=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),aT=e=>{let t=0,a=0,r=0,i=0,l=0;const u=new Set;for(const f of e)if(f.type==="directory")a++,f.is_git_repo&&l++;else{t++,f.path.toLowerCase().endsWith(".md")&&i++;const h=f.path.split("/").pop();if(h&&nT.has(h.toLowerCase())){const g=f.path.split("/").slice(0,-1).join("/");e.some(v=>v.type==="directory"&&v.is_git_repo&&(g===v.path||g.startsWith(`${v.path}/`)))||u.add(g)}}return r=u.size,{totalFiles:t,totalDirs:a,codePackages:r,docFiles:i,gitRepos:l}};function rT({dirPath:e,rpc:t,importing:a,onScanComplete:r,onBusyChange:i}){const{t:l}=ye(),[u,f]=_.useState(!1),[m,h]=_.useState(null),[g,y]=_.useState(null),v=_.useCallback(async()=>{f(!0),i?.(!0),h(null),y(null);try{const b=await t("fs/dirScan",{path:e}),w=b.entries||[],N=b.manifests||[],j=aT(w);y(j),r(w,j,N)}catch(b){const w=b instanceof Error?b.message:String(b);h(w)}finally{f(!1),i?.(!1)}},[e,t,r,i]);return _.useEffect(()=>{v()},[v]),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[d.jsx("p",{className:"shrink-0 font-mono text-xs text-c4a-text-muted",children:e}),d.jsx("div",{className:"mt-3 shrink-0 border-t border-c4a-border-subtle"}),d.jsxs("div",{className:"c4a-scrollbar min-h-0 flex-1 overflow-y-auto",children:[u&&d.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[d.jsx(sn,{size:14,className:"animate-spin text-c4a-accent"}),d.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:l("sources.import.dir_scanning")})]}),m&&d.jsxs("div",{className:"mt-6",children:[d.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[d.jsx(B_,{size:14,className:"mt-0.5 shrink-0"}),l("sources.import.dir_scan_error")]}),d.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:m}),d.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:[d.jsx(XC,{size:12}),l("sources.import.dir_scan_retry")]})]}),g&&!u&&!m&&d.jsxs("div",{className:"mt-6 space-y-3",children:[d.jsxs("p",{className:"font-mono text-sm uppercase text-c4a-accent",children:[l("sources.import.dir_scan_complete"),"!"]}),d.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[d.jsx(yr,{icon:d.jsx(Wr,{size:14}),label:l("sources.import.dir_doc_files"),value:g.docFiles,tooltip:l("sources.import.dir_doc_files_tip"),size:"lg"}),d.jsx(yr,{icon:d.jsx(Ei,{size:14}),label:l("sources.import.dir_code_packages"),value:g.codePackages,tooltip:l("sources.import.dir_code_packages_tip"),size:"lg"}),g.gitRepos>0&&d.jsx(yr,{icon:d.jsx(Hu,{size:14}),label:l("sources.import.dir_git_repos"),value:g.gitRepos,size:"lg"}),d.jsx(yr,{icon:d.jsx(_a,{size:14}),label:l("sources.import.dir_total_dirs"),value:g.totalDirs,size:"lg"}),d.jsx(yr,{icon:d.jsx(lC,{size:14}),label:l("sources.import.dir_total_files"),value:g.totalFiles,size:"lg"})]}),g.gitRepos>0&&d.jsx("p",{className:"text-xs text-c4a-warning",children:l("sources.import.dir_git_skip_hint",{count:g.gitRepos})})]}),a&&d.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[d.jsx(sn,{size:14,className:"animate-spin text-c4a-accent"}),d.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:l("sources.import.importing")})]})]})]})}function sT(){const{t:e}=ye(),t=Ot(),{libId:a}=xl(),i=Wt(Ds(Ui)).find(P=>P.id===a),l=Iu(P=>P.createSource),[u,f]=_.useState(1),[m,h]=_.useState(!1),[g,y]=_.useState(null),[v,b]=_.useState(!1),[w,N]=_.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),j=i?.is_online??!1,{rpc:E,importedPaths:R,allowedPaths:k}=J_(a,i),O=_.useCallback((P,X,de)=>{N(le=>({...le,dirPath:P,dirName:X,fileCount:de.files,subDirCount:de.dirs,gitRepoCount:de.gitRepos,mdFiles:de.mdFiles}))},[]),I=_.useCallback((P,X,de)=>{N(le=>({...le,scanEntries:P,scanStats:X,manifests:de}))},[]),B=_.useCallback(async()=>{if(a){h(!0);try{const P=await l({library_id:a,dir_files:w.scanEntries,dir_name:w.dirName,dir_path:w.dirPath,dir_file_contents:w.manifests}),X=Array.isArray(P)?P[0]:P;X?.id?t(`/studio/sources/${a}?rootId=${X.id}`):t(`/studio/sources/${a}`)}catch(P){const X=P instanceof Error?P.message:String(P);y(X),h(!1)}}},[a,w,l,t]),H=_.useMemo(()=>u===1?!!w.dirPath:u===2?w.scanEntries.length>0:!0,[u,w]),T=_.useMemo(()=>i?[{label:i.is_default?e("sources.library.default_cloud_name"):i.name,to:`/studio/sources/${i.id}`},{label:e("sources.import.dir_title")}]:[],[i,e]);return i?d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[d.jsx("div",{className:"shrink-0",children:d.jsx(As,{segments:T})}),d.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[d.jsx(Fa,{active:u>=1,current:u===1}),d.jsx("span",{className:u===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.dir_step.select")}),d.jsx(Cs,{}),d.jsx(Fa,{active:u>=2,current:u===2}),d.jsx("span",{className:u===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.dir_step.confirm")})]}),d.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:j?d.jsxs(d.Fragment,{children:[u===1&&d.jsx(tT,{rpc:E,selectedPath:w.dirPath,onSelect:O,allowedPaths:k,importedPaths:R}),u===2&&d.jsx(rT,{dirPath:w.dirPath,rpc:E,importing:m,onScanComplete:I,onBusyChange:b})]}):d.jsx(Z_,{libraryName:i.name})}),j&&d.jsx(Ym,{step:u,totalSteps:2,importing:m,stepBusy:v,canProceed:H,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>f(P=>P-1),onNext:()=>f(P=>P+1),onImport:B}),g&&d.jsxs(Qa,{onClose:()=>y(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:[d.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:e("sources.import.error_title")}),d.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:g}),d.jsx("div",{className:"mt-6 flex justify-end",children:d.jsx("button",{onClick:()=>y(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")})})]})]}):d.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:d.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})})}const iT=/^https:\/\/[^/]+\/.+/;function oT({url:e,onUrlChange:t,onValidChange:a,onRefHint:r}){const{t:i}=ye(),[l,u]=_.useState(null),[f,m]=_.useState([]),h=_.useRef(null);_.useEffect(()=>{De.get("/import/remote/git-hosts").then(b=>m(b.hosts),()=>{})},[]);const g=_.useCallback(b=>{if(!b){u(null),a(!1);return}const w=IR(b),N=w.repoUrl!==b.trim(),j=N?w.repoUrl:b;N&&(t(j),r?.(w.ref,w.commit)),iT.test(j)?(u(null),a(!0)):(u(i("sources.import_remote.url_invalid")),a(!1))},[t,a,r,i]),y=_.useCallback(b=>{const w=b.target.value;t(w),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>g(w),500)},[t,g]),v=_.useCallback(b=>{b.preventDefault();const w=b.clipboardData.getData("text").trim();t(w),h.current&&clearTimeout(h.current),g(w)},[t,g]);return _.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),_.useEffect(()=>{e&&g(e)},[]),d.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:d.jsxs("div",{className:"w-full max-w-xl space-y-5",children:[d.jsx("input",{type:"text",value:e,onChange:y,onPaste:v,placeholder:i("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}),d.jsx("div",{className:"h-14 text-center text-sm leading-relaxed text-c4a-text-muted",children:l?d.jsxs("p",{className:"flex items-center justify-center gap-1.5 text-red-400",children:[d.jsx(br,{size:14,className:"shrink-0"}),l]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{children:f.length>0?d.jsxs(d.Fragment,{children:[i("sources.import_remote.url_hint_public"),f.map((b,w)=>d.jsxs("span",{children:[w>0&&"、",d.jsx("span",{className:"font-mono font-medium text-c4a-accent",children:b})]},b))]}):i("sources.import_remote.url_hint_no_auth")}),d.jsx("p",{className:"mt-1 text-c4a-text-muted/60",children:i("sources.import_remote.url_hint_format")})]})})]})})}const Ov=["prepare","clone","scan","save"],Vc={prepare:"sources.import.stage.prepare",clone:"sources.import.stage.clone",scan:"sources.import.stage.scan",save:"sources.import.stage.save"},lT={prepare:5,clone:90,scan:95,save:100};function cT(e){return new Promise((t,a)=>{let r=!1,i=null,l=null;const u=()=>{r=!0,i&&(clearInterval(i),i=null),l&&(l(),l=null)},f=(h,g,y)=>{r||(u(),h==="done"&&g?t(g):a(new Error(y??"Clone failed")))};l=Ea.on("task/complete",h=>{const g=h;g.task_id===e&&f(g.status??"error",g.result,g.error)}),i=setInterval(async()=>{if(!r)try{const h=await De.get(`/import/remote/tasks/${e}`);h.status!=="running"&&f(h.status,h.result,h.error)}catch{}},5e3)})}function uT(e,t,a){if(e instanceof Ln){const r=e.message.toLowerCase();if(e.status===503)return a("sources.import_remote.error.capacity");if(r.includes("connect")||r.includes("connectionrefused")||r.includes("unavailable")||r.includes("econnrefused"))return a("sources.import_remote.error.network");if(r.includes("authentication")||r.includes("token")||r.includes("credential")||r.includes("401")||r.includes("403"))try{const i=new URL(t).hostname;return a("sources.import_remote.error.auth_required",{host:i})}catch{return a("sources.import_remote.error.auth_required",{host:t})}return r.includes("not found")||r.includes("404")||r.includes("does not exist")?a("sources.import_remote.error.not_found"):e.message||a("sources.import_remote.error.network")}return e instanceof TypeError&&e.message.includes("fetch")?a("sources.import_remote.error.network"):e instanceof Error?e.message:a("sources.import_remote.error.network")}function dT(e){return e==="cloning"?"clone":e==="detecting"||e==="extracting"?"scan":e==="saving"?"save":e}function fT(){const{t:e}=ye(),t=Ot(),{libId:a}=xl(),[r]=$u(),i=r.get("url")||"",l=r.get("ref")||"",u=r.get("sourceUuid")||"",f=r.get("parentId")||"",m=r.get("parentName")||"",h=r.get("parentPath")||"",y=Wt(Ds(Ui)).find(Te=>Te.id===a),[v,b]=_.useState(new Set),w=_.useCallback(async()=>{if(a)try{const Te=new Set;if(f){const ct=(await De.get(`/sources/${f}`)).tree??[];let tt=h===""?ct:[];if(h){const bt=(Dt,At)=>{for(const en of Dt){if(en.path===At)return en.children??[];if(en.children){const se=bt(en.children,At);if(se.length>0)return se}}return[]};tt=bt(ct,h)}for(const bt of tt)Te.add(bt.name.toLowerCase())}else{const Be=await De.get("/sources",{library_id:a});for(const ct of Be.items)Te.add(ct.name.toLowerCase())}b(Te)}catch{}},[a,f,h]);_.useEffect(()=>{w()},[w]);const[N,j]=_.useState(i?2:1),[E,R]=_.useState(i),[k,O]=_.useState(!!i),[I,B]=_.useState(l),[H,T]=_.useState(""),[P,X]=_.useState(!!l),[de,le]=_.useState(""),ce=_.useRef(void 0),D=_.useRef(void 0),[F,A]=_.useState(null),[G,ae]=_.useState(!1),[ee,J]=_.useState(null),[L,q]=_.useState(!1),[re,ie]=_.useState(!1),[ge,xe]=_.useState(null),[Ee,Me]=_.useState(null),[qe,vn]=_.useState(null),[zn,Ht]=_.useState(null),[at,Nt]=_.useState([]),[Un,lt]=_.useState(null),[hn,ln]=_.useState([]),qt=_.useRef(null),bn=_.useRef(""),ia=_.useMemo(()=>Ov.map(Te=>({key:Te,label:Vc[Te]?e(Vc[Te]):Te})),[e]),kn=_.useCallback(Te=>{ln(Be=>[...Be,`[${om()}] ${Te}`])},[]),Rn=_.useRef(null),jt=_.useCallback(Te=>{const Be=Rn.current;Be&&Be!==Te&&(Nt(ct=>ct.includes(Be)?ct:[...ct,Be]),kn(`${e(Vc[Be]??Be)} ${e("sources.import.stage.done_suffix")}`)),kn(`${e(Vc[Te]??Te)}...`),Rn.current=Te,Ht(Te),lt(null)},[kn,e]),_n=_.useCallback((Te,Be)=>{ce.current=Te,D.current=Be},[]),Ne=_.useCallback(async Te=>{if(a){ae(!0),J(null);try{const Be=await De.post("/import/remote/refs",{library_id:a,url:E},Te?{signal:Te}:void 0);A(Be);const ct=Be.branches??[],tt=Be.tags??[],bt=[...ct,...tt];bt.length>0&&B(Dt=>{if(Dt)return Dt;const At=ce.current,en=D.current;if(At){const Ue=bt.find(ut=>ut.name===At);if(Ue)return T(Ue.commit),Ue.name}en&&T(en);const be=ct.find(Ue=>Ue.name===Be.default)??ct[0];return be?(en||T(be.commit),be.name):Dt})}catch(Be){if(Te?.aborted)return;J(uT(Be,E,e))}finally{Te?.aborted||ae(!1)}}},[a,E,e]);_.useEffect(()=>{if(N!==2||!a)return;const Te=new AbortController;return Ne(Te.signal),()=>Te.abort()},[N,a,Ne]),_.useEffect(()=>{if(!L)return;let Te="";return Ea.on("task/progress",ct=>{const tt=ct,bt=dT(tt.stage??"");bt&&Ov.includes(bt)&&(lt({percent:tt.percent??-1,label:tt.detail??tt.label??""}),tt.detail&&tt.detail!==Te&&(Te=tt.detail,ln(Dt=>[...Dt,`[${om()}] ${tt.detail}`])))})},[L]);const He=_.useCallback(async()=>{if(!a)return;const Te=Date.now();q(!0),ie(!1),Me(null),vn(null),Nt([]),Rn.current=null,Ht(null),lt(null),ln([]),j(3);try{jt("prepare"),await new Promise(Ue=>setTimeout(Ue,300)),jt("clone");const Be=Qr(E),ct=de||Be,tt=h?`${h}/${ct}`:ct,{task_id:bt}=await De.post("/import/remote/clone",{library_id:a,url:E,ref:I,...H?{commit:H}:{},repo_name:tt}),Dt=await cT(bt);bn.current=Dt.commit_hash,jt("scan");const At=await De.post("/import/remote/scan",{library_id:a,path:Dt.path,hash:Dt.commit_hash});jt("save");const en=await De.post("/import/remote/import",{library_id:a,url:E,ref:I,commit:Dt.commit_hash,repo_name:tt,dir_name:ct,repo_files:At.files,repo_file_contents:At.manifests,...u?{source_uuid:u}:{},...f?{parent_source_id:f,parent_path:h}:{}});Nt(["prepare","clone","scan","save"]),Rn.current=null,Ht(null),kn(`${e("sources.import.stage.save")} ${e("sources.import.stage.done_suffix")}`),kn(e("sources.import.stage.complete"));const{packages:se,mdFiles:be}=W_(At.manifests,At.files,Be);xe({packages:se,mdFiles:be}),qt.current=en.id,await e1(Te),ie(!0),q(!1),j(4)}catch(Be){const ct=Rn.current??"prepare";vn(ct),Rn.current=null,Ht(null);let tt;Be instanceof Ln||Be instanceof Error?tt=Be.message:tt=String(Be),kn(`ERROR: ${tt}`),Me(tt),q(!1)}},[a,E,I,H,de,u,f,h,jt,kn]),Xe=_.useCallback(()=>{vn(null),Me(null),He()},[He]),yt=_.useCallback(()=>{if(a)if(f){const Te=Qr(E),Be=de||Te,ct=h?`${h}/${Be}`:Be;t(`/studio/sources/${a}?rootId=${f}&path=${encodeURIComponent(ct)}`)}else qt.current?t(`/studio/sources/${a}?rootId=${qt.current}`):t(`/studio/sources/${a}`)},[a,t,f,h,de,E]),Tt=(de||Qr(E)).toLowerCase(),cn=v.has(Tt),Yn=_.useMemo(()=>N===1?k:N===2?P&&!cn:!1,[N,k,P,cn]),mn=_.useMemo(()=>{if(!y)return[];const Te=[{label:y.is_default?e("sources.library.default_cloud_name"):y.name,to:`/studio/sources/${y.id}`}];if(f&&(Te.push({label:m||f,to:`/studio/sources/${y.id}?rootId=${f}`}),h)){const Be=h.split("/").filter(Boolean);for(const[ct,tt]of Be.entries()){const bt=Be.slice(0,ct+1).join("/");Te.push({label:tt,to:`/studio/sources/${y.id}?rootId=${f}&path=${encodeURIComponent(bt)}`})}}return Te.push({label:e("sources.import_remote.title")}),Te},[y,f,m,h,e]);if(!y)return d.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:d.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Bt=N===4&&re,vt=N===3&&!!qe&&!L,Ft=N<=2;return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[d.jsx("div",{className:"shrink-0",children:d.jsx(As,{segments:mn})}),d.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[d.jsx(Fa,{active:N>=1,current:N===1}),d.jsx("span",{className:N===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.select")}),d.jsx(Cs,{}),d.jsx(Fa,{active:N>=2,current:N===2}),d.jsx("span",{className:N===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.version")}),d.jsx(Cs,{}),d.jsx(Fa,{active:N>=3,current:N===3}),d.jsx("span",{className:N===3?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.loading")}),d.jsx(Cs,{}),d.jsx(Fa,{active:N>=4,current:N===4}),d.jsx("span",{className:N===4?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.confirm")})]}),d.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[N===1&&d.jsx(oT,{url:E,onUrlChange:R,onValidChange:O,onRefHint:_n}),N===2&&a&&d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[d.jsx(r1,{refs:F,loading:G,error:ee,selectedRef:I,commit:H,onRefChange:B,onCommitChange:T,onValidChange:X,onRetry:()=>Ne()}),!G&&F&&d.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:e("sources.import.dir_name")}),d.jsx("input",{type:"text",value:de,onChange:Te=>le(Te.target.value),placeholder:Qr(E),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 ${cn?"border-red-400 focus:border-red-400":"border-c4a-border-default focus:border-c4a-accent"}`}),cn?d.jsx("p",{className:"mt-1.5 text-xs text-red-400",children:e("sources.import.dir_name_duplicate")}):d.jsx("p",{className:"mt-1.5 text-xs text-c4a-text-muted",children:e("sources.import.dir_name_hint")})]})]}),N===3&&d.jsx(s1,{stages:ia,currentStage:zn,completedStages:at,failedStage:qe,progress:Un,breakpoints:lT,failedError:Ee,logs:hn}),N===4&&d.jsx(i1,{repoName:Qr(E),repoIdentifier:E,branch:I,commit:bn.current,packages:ge?.packages??[],mdFiles:ge?.mdFiles??[],importing:!1,completed:re})]}),Bt?d.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:d.jsx("button",{onClick:yt,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")})}):vt?d.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[d.jsx("button",{onClick:()=>{j(2),vn(null),Me(null),Nt([]),Rn.current=null,Ht(null),ln([])},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")}),d.jsx("button",{onClick:Xe,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")})]}):Ft?d.jsx(Ym,{step:N,totalSteps:2,importing:!1,stepBusy:G,canProceed:Yn,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"common.next",onPrev:()=>j(Te=>Te-1),onNext:()=>j(Te=>Te+1),onImport:He}):null]})}function hT(){const{t:e}=ye(),t=Ot(),a=Wt(v=>v.createLibrary),[r,i]=_.useState("waiting"),[l,u]=_.useState(null),[f,m]=_.useState(""),[h,g]=_.useState(!1);_.useEffect(()=>Ea.on("ws:daemon:connected",b=>{const w=b;u(w),m(w.machine_id),i(w.needs_registration?"new_client":"reconnected")}),[]),_.useEffect(()=>{let v=!1;return(async()=>{try{const b=await De.get("/daemons/pending");if(v||b.pending.length===0)return;const w=b.pending[0];u({machine_id:w.machine_id,needs_registration:!0}),m(w.machine_id),i("new_client")}catch{}})(),()=>{v=!0}},[]);const y=_.useCallback(async()=>{if(l){g(!0);try{const v=await a({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{g(!1)}}},[l,f,a,t]);return d.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[d.jsx(As,{segments:[{label:e("sources.add_client.title")}]}),d.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:e("sources.add_client.description")}),d.jsx("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:d.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[d.jsxs("li",{children:[d.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",e("sources.add_client.step1")]}),d.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 ",d.jsx(Rh,{text:"npm install -g @c4a/daemon"})]})]}),d.jsxs("li",{children:[d.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",e("sources.add_client.step2")]}),d.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}`," ",d.jsx(Rh,{text:`c4a-daemon --server ${window.location.host}`})]}),d.jsx("p",{className:"mt-2 text-xs text-c4a-text-muted",children:e("sources.add_client.step2_allow")}),d.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`," ",d.jsx(Rh,{text:`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`})]})]}),d.jsxs("li",{children:[d.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",e("sources.add_client.step3")]}),d.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:e("sources.add_client.step3_desc")})]})]})}),d.jsxs("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:[r==="waiting"&&d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(sn,{size:16,className:"animate-spin text-c4a-warning"}),d.jsx("span",{className:"text-sm text-c4a-warning",children:e("sources.add_client.waiting")})]}),r==="new_client"&&l&&d.jsxs("div",{className:"space-y-4",children:[d.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-accent",children:e("sources.add_client.detected")}),d.jsxs("div",{className:"space-y-2 text-sm",children:[d.jsx(Th,{label:e("sources.add_client.machine_name"),value:l.machine_id}),l.os&&d.jsx(Th,{label:e("sources.add_client.os"),value:l.os}),l.daemon_version&&d.jsx(Th,{label:e("sources.add_client.daemon_version"),value:l.daemon_version})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:e("sources.add_client.client_name")}),d.jsx("input",{value:f,onChange:v=>m(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"})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[d.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")}),d.jsxs("button",{onClick:y,disabled:h||!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:[h&&d.jsx(sn,{size:12,className:"animate-spin"}),e("sources.add_client.confirm")]})]})]}),r==="reconnected"&&l&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ts,{size:16,className:"text-c4a-success"}),d.jsx("span",{className:"text-sm text-c4a-text-primary",children:e("sources.add_client.reconnected",{name:l.machine_id})})]}),l.lib_id&&d.jsx(ja,{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 Rh({text:e}){const[t,a]=_.useState(!1),r=_.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{a(!0),setTimeout(()=>a(!1),1500)})},[e]);return d.jsx("button",{type:"button",onClick:r,className:"shrink-0 rounded p-0.5 text-c4a-accent opacity-60 transition-opacity hover:opacity-100",title:"Copy",children:t?d.jsx(ts,{size:13}):d.jsx(Wh,{size:13})})}function Th({label:e,value:t}){return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:e}),d.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:t})]})}const o1=_.createContext(null);function l1(){const e=_.useContext(o1);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}function Km({value:e,onChange:t,children:a}){return d.jsx(o1.Provider,{value:{value:e,onChange:t},children:d.jsx("div",{className:"flex flex-1 flex-col",children:a})})}function Xm({children:e}){return d.jsx("div",{className:"flex border-b border-c4a-border-subtle",children:e})}function Va({value:e,children:t}){const{value:a,onChange:r}=l1(),i=a===e;return d.jsx("button",{onClick:()=>r(e),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${i?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:t})}function Sa({value:e,children:t}){const{value:a}=l1();return a!==e?null:d.jsx("div",{className:"flex flex-1 flex-col",children:t})}const mT={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 Vt({children:e,variant:t="accent",tooltip:a}){return d.jsx("span",{className:`inline-block font-mono text-[10px] uppercase px-1.5 py-0.5 rounded-sm ${mT[t]}`,title:a,children:e})}function vl(e){return e===void 0?null:e>=.9?{labelKey:"confidence.high",variant:"success",value:e}:e>=.7?{labelKey:"confidence.ai",variant:"warning",value:e}:{labelKey:"confidence.low",variant:"error",value:e}}const c1="c4a_explorer_mode";function pT(){try{const e=localStorage.getItem(c1);if(e==="append"||e==="replace")return e}catch{}return"append"}const Vo=ns((e,t)=>({tabs:[],activeTabId:null,mode:pT(),openTab:a=>{const{tabs:r,mode:i}=t(),l=r.find(u=>u.id===a.id);if(l){e({activeTabId:l.id});return}if(i==="append")e({tabs:[...r,{...a,isAnchor:!1}],activeTabId:a.id});else{const u=r.find(f=>f.id===t().activeTabId);if(!u||u.isAnchor)e({tabs:[...r,{...a,isAnchor:!1}],activeTabId:a.id});else{const f=r.findIndex(h=>h.id===t().activeTabId),m=[...r];m[f]={...a,isAnchor:!1},e({tabs:m,activeTabId:a.id})}}},closeTab:a=>{const{tabs:r,activeTabId:i}=t(),l=r.find(h=>h.id===a);if(!l||l.isAnchor)return;const u=r.findIndex(h=>h.id===a),f=r.filter(h=>h.id!==a);let m=i;i===a&&(m=f[u-1]?.id??f[0]?.id??null),e({tabs:f,activeTabId:m})},activateTab:a=>{e({activeTabId:a})},closeAll:()=>{const{tabs:a}=t(),r=a.filter(i=>i.isAnchor);e({tabs:r,activeTabId:r[0]?.id??null})},setAnchor:a=>{const r={...a,isAnchor:!0};e({tabs:[r],activeTabId:r.id})},toggleMode:()=>{const a=t().mode==="append"?"replace":"append";try{localStorage.setItem(c1,a)}catch{}e({mode:a})},reset:()=>{e({tabs:[],activeTabId:null})}})),u1=_.createContext(null);function gT({children:e}){const t=Vo(r=>r.openTab),a=_.useCallback((r,i,l,u)=>{t({id:`${r}:${i}`,type:r,resourceId:i,label:l,...u!=null&&{icon:u}})},[t]);return d.jsx(u1.Provider,{value:{active:!0,navigate:a},children:e})}function $i(){return _.useContext(u1)}function d1(e,t){const a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const xT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vT={};function Dv(e,t){return(vT.jsx?yT:xT).test(e)}const bT=/[ \t\n\f\r]/g;function Pu(e){return typeof e=="object"?e.type==="text"?Mv(e.value):!1:Mv(e)}function Mv(e){return e.replace(bT,"")===""}class bl{constructor(t,a,r){this.normal=a,this.property=t,r&&(this.space=r)}}bl.prototype.normal={};bl.prototype.property={};bl.prototype.space=void 0;function f1(e,t){const a={},r={};for(const i of e)Object.assign(a,i.property),Object.assign(r,i.normal);return new bl(a,r,t)}function lm(e){return e.toLowerCase()}class Fn{constructor(t,a){this.attribute=a,this.property=t}}Fn.prototype.attribute="";Fn.prototype.booleanish=!1;Fn.prototype.boolean=!1;Fn.prototype.commaOrSpaceSeparated=!1;Fn.prototype.commaSeparated=!1;Fn.prototype.defined=!1;Fn.prototype.mustUseProperty=!1;Fn.prototype.number=!1;Fn.prototype.overloadedBoolean=!1;Fn.prototype.property="";Fn.prototype.spaceSeparated=!1;Fn.prototype.space=void 0;let _T=0;const Ve=Ms(),Jt=Ms(),cm=Ms(),me=Ms(),St=Ms(),Ci=Ms(),ta=Ms();function Ms(){return 2**++_T}const um=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Jt,commaOrSpaceSeparated:ta,commaSeparated:Ci,number:me,overloadedBoolean:cm,spaceSeparated:St},Symbol.toStringTag,{value:"Module"})),Ah=Object.keys(um);class Qm extends Fn{constructor(t,a,r,i){let l=-1;if(super(t,a),zv(this,"space",i),typeof r=="number")for(;++l<Ah.length;){const u=Ah[l];zv(this,Ah[l],(r&um[u])===um[u])}}}Qm.prototype.defined=!0;function zv(e,t,a){a&&(e[t]=a)}function Hi(e){const t={},a={};for(const[r,i]of Object.entries(e.properties)){const l=new Qm(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,a[lm(r)]=r,a[lm(l.attribute)]=r}return new bl(t,a,e.space)}const h1=Hi({properties:{ariaActiveDescendant:null,ariaAtomic:Jt,ariaAutoComplete:null,ariaBusy:Jt,ariaChecked:Jt,ariaColCount:me,ariaColIndex:me,ariaColSpan:me,ariaControls:St,ariaCurrent:null,ariaDescribedBy:St,ariaDetails:null,ariaDisabled:Jt,ariaDropEffect:St,ariaErrorMessage:null,ariaExpanded:Jt,ariaFlowTo:St,ariaGrabbed:Jt,ariaHasPopup:null,ariaHidden:Jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:St,ariaLevel:me,ariaLive:null,ariaModal:Jt,ariaMultiLine:Jt,ariaMultiSelectable:Jt,ariaOrientation:null,ariaOwns:St,ariaPlaceholder:null,ariaPosInSet:me,ariaPressed:Jt,ariaReadOnly:Jt,ariaRelevant:null,ariaRequired:Jt,ariaRoleDescription:St,ariaRowCount:me,ariaRowIndex:me,ariaRowSpan:me,ariaSelected:Jt,ariaSetSize:me,ariaSort:null,ariaValueMax:me,ariaValueMin:me,ariaValueNow:me,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function m1(e,t){return t in e?e[t]:t}function p1(e,t){return m1(e,t.toLowerCase())}const ST=Hi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ci,acceptCharset:St,accessKey:St,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:St,autoFocus:Ve,autoPlay:Ve,blocking:St,capture:null,charSet:null,checked:Ve,cite:null,className:St,cols:me,colSpan:null,content:null,contentEditable:Jt,controls:Ve,controlsList:St,coords:me|Ci,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:cm,draggable:Jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:St,height:me,hidden:cm,high:me,href:null,hrefLang:null,htmlFor:St,httpEquiv:St,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:St,itemRef:St,itemScope:Ve,itemType:St,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:me,manifest:null,max:null,maxLength:me,media:null,method:null,min:null,minLength:me,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,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:Ve,optimum:me,pattern:null,ping:St,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:St,required:Ve,reversed:Ve,rows:me,rowSpan:me,sandbox:St,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:me,sizes:null,slot:null,span:me,spellCheck:Jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:me,step:null,style:null,tabIndex:me,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Jt,width:me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:St,axis:null,background:null,bgColor:null,border:me,borderColor:null,bottomMargin:me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:me,leftMargin:me,link:null,longDesc:null,lowSrc:null,marginHeight:me,marginWidth:me,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:me,rules:null,scheme:null,scrolling:Jt,standby:null,summary:null,text:null,topMargin:me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:me,security:null,unselectable:null},space:"html",transform:p1}),wT=Hi({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:ta,accentHeight:me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:me,amplitude:me,arabicForm:null,ascent:me,attributeName:null,attributeType:null,azimuth:me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:me,by:null,calcMode:null,capHeight:me,className:St,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:me,diffuseConstant:me,direction:null,display:null,dur:null,divisor:me,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:me,enableBackground:null,end:null,event:null,exponent:me,externalResourcesRequired:null,fill:null,fillOpacity:me,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:Ci,g2:Ci,glyphName:Ci,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:me,horizOriginX:me,horizOriginY:me,id:null,ideographic:me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:me,k:me,k1:me,k2:me,k3:me,k4:me,kernelMatrix:ta,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:me,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:me,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:me,overlineThickness:me,paintOrder:null,panose1:null,path:null,pathLength:me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:St,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:me,pointsAtY:me,pointsAtZ:me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ta,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ta,rev:ta,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ta,requiredFeatures:ta,requiredFonts:ta,requiredFormats:ta,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:me,specularExponent:me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:me,strikethroughThickness:me,string:null,stroke:null,strokeDashArray:ta,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:me,strokeOpacity:me,strokeWidth:null,style:null,surfaceScale:me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ta,tabIndex:me,tableValues:null,target:null,targetX:me,targetY:me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ta,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:me,underlineThickness:me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:me,values:null,vAlphabetic:me,vMathematical:me,vectorEffect:null,vHanging:me,vIdeographic:me,version:null,vertAdvY:me,vertOriginX:me,vertOriginY:me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:m1}),g1=Hi({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()}}),x1=Hi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:p1}),y1=Hi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),NT={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"},jT=/[A-Z]/g,Uv=/-[a-z]/g,ET=/^data[-\w.:]+$/i;function v1(e,t){const a=lm(t);let r=t,i=Fn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&ET.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Uv,kT);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Uv.test(l)){let u=l.replace(jT,CT);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}i=Qm}return new i(r,t)}function CT(e){return"-"+e.toLowerCase()}function kT(e){return e.charAt(1).toUpperCase()}const b1=f1([h1,ST,g1,x1,y1],"html"),_l=f1([h1,wT,g1,x1,y1],"svg");function _1(e){return e.join(" ").trim()}var _i={},Lh,$v;function RT(){if($v)return Lh;$v=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
|
|
129
|
+
`,h="/",g="*",y="",v="comment",b="declaration";function w(j,E){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];E=E||{};var R=1,k=1;function O(D){var F=D.match(t);F&&(R+=F.length);var A=D.lastIndexOf(m);k=~A?D.length-A:k+D.length}function I(){var D={line:R,column:k};return function(F){return F.position=new B(D),P(),F}}function B(D){this.start=D,this.end={line:R,column:k},this.source=E.source}B.prototype.content=j;function H(D){var F=new Error(E.source+":"+R+":"+k+": "+D);if(F.reason=D,F.filename=E.source,F.line=R,F.column=k,F.source=j,!E.silent)throw F}function T(D){var F=D.exec(j);if(F){var A=F[0];return O(A),j=j.slice(A.length),F}}function P(){T(a)}function X(D){var F;for(D=D||[];F=de();)F!==!1&&D.push(F);return D}function de(){var D=I();if(!(h!=j.charAt(0)||g!=j.charAt(1))){for(var F=2;y!=j.charAt(F)&&(g!=j.charAt(F)||h!=j.charAt(F+1));)++F;if(F+=2,y===j.charAt(F-1))return H("End of comment missing");var A=j.slice(2,F-2);return k+=2,O(A),j=j.slice(F),k+=2,D({type:v,comment:A})}}function le(){var D=I(),F=T(r);if(F){if(de(),!T(i))return H("property missing ':'");var A=T(l),G=D({type:b,property:N(F[0].replace(e,y)),value:A?N(A[0].replace(e,y)):y});return T(u),G}}function ce(){var D=[];X(D);for(var F;F=le();)F!==!1&&(D.push(F),X(D));return D}return P(),ce()}function N(j){return j?j.replace(f,y):y}return Lh=w,Lh}var Hv;function TT(){if(Hv)return _i;Hv=1;var e=_i&&_i.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_i,"__esModule",{value:!0}),_i.default=a;const t=e(RT());function a(r,i){let l=null;if(!r||typeof r!="string")return l;const u=(0,t.default)(r),f=typeof i=="function";return u.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:g}=m;f?i(h,g,m):g&&(l=l||{},l[h]=g)}),l}return _i}var Mo={},Bv;function AT(){if(Bv)return Mo;Bv=1,Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(h){return!h||a.test(h)||e.test(h)},u=function(h,g){return g.toUpperCase()},f=function(h,g){return"".concat(g,"-")},m=function(h,g){return g===void 0&&(g={}),l(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(i,f):h=h.replace(r,f),h.replace(t,u))};return Mo.camelCase=m,Mo}var zo,Iv;function LT(){if(Iv)return zo;Iv=1;var e=zo&&zo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(TT()),a=AT();function r(i,l){var u={};return!i||typeof i!="string"||(0,t.default)(i,function(f,m){f&&m&&(u[(0,a.camelCase)(f,l)]=m)}),u}return r.default=r,zo=r,zo}var OT=LT();const DT=Kb(OT),MT=zT("start");function zT(e){return t;function t(a){const r=a&&a.position&&a.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function UT(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Pv(e.position):"start"in e||"end"in e?Pv(e):"line"in e||"column"in e?dm(e):""}function dm(e){return Gv(e&&e.line)+":"+Gv(e&&e.column)}function Pv(e){return dm(e&&e.start)+"-"+dm(e&&e.end)}function Gv(e){return e&&typeof e=="number"?e:1}class Dn extends Error{constructor(t,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let i="",l={},u=!1;if(a&&("line"in a&&"column"in a?l={place:a}:"start"in a&&"end"in a?l={place:a}:"type"in a?l={ancestors:[a],place:a.position}:l={...a}),typeof t=="string"?i=t:!l.cause&&t&&(u=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const m=r.indexOf(":");m===-1?l.ruleId=r:(l.source=r.slice(0,m),l.ruleId=r.slice(m+1))}if(!l.place&&l.ancestors&&l.ancestors){const m=l.ancestors[l.ancestors.length-1];m&&(l.place=m.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=i,this.line=f?f.line:void 0,this.name=UT(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}}Dn.prototype.file="";Dn.prototype.name="";Dn.prototype.reason="";Dn.prototype.message="";Dn.prototype.stack="";Dn.prototype.column=void 0;Dn.prototype.line=void 0;Dn.prototype.ancestors=void 0;Dn.prototype.cause=void 0;Dn.prototype.fatal=void 0;Dn.prototype.place=void 0;Dn.prototype.ruleId=void 0;Dn.prototype.source=void 0;const Zm={}.hasOwnProperty,$T=new Map,HT=/[A-Z]/g,BT=new Set(["table","tbody","thead","tfoot","tr"]),IT=new Set(["td","th"]),S1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function PT(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=QT(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=XT(a,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?_l:b1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=w1(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function w1(e,t,a){if(t.type==="element")return GT(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return VT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return FT(e,t,a);if(t.type==="mdxjsEsm")return qT(e,t);if(t.type==="root")return YT(e,t,a);if(t.type==="text")return KT(e,t)}function GT(e,t,a){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=_l,e.schema=i),e.ancestors.push(t);const l=j1(e,t.tagName,!1),u=ZT(e,t);let f=Wm(e,t);return BT.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!Pu(m):!0})),N1(e,u,l,t),Jm(u,f),e.ancestors.pop(),e.schema=r,e.create(t,l,u,a)}function VT(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}rl(e,t.position)}function qT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);rl(e,t.position)}function FT(e,t,a){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=_l,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:j1(e,t.name,!0),u=JT(e,t),f=Wm(e,t);return N1(e,u,l,t),Jm(u,f),e.ancestors.pop(),e.schema=r,e.create(t,l,u,a)}function YT(e,t,a){const r={};return Jm(r,Wm(e,t)),e.create(t,e.Fragment,r,a)}function KT(e,t){return t.value}function N1(e,t,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=r)}function Jm(e,t){if(t.length>0){const a=t.length>1?t:t[0];a&&(e.children=a)}}function XT(e,t,a){return r;function r(i,l,u,f){const h=Array.isArray(u.children)?a:t;return f?h(l,u,f):h(l,u)}}function QT(e,t){return a;function a(r,i,l,u){const f=Array.isArray(l.children),m=MT(r);return t(i,l,u,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function ZT(e,t){const a={};let r,i;for(i in t.properties)if(i!=="children"&&Zm.call(t.properties,i)){const l=WT(e,i,t.properties[i]);if(l){const[u,f]=l;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&IT.has(t.tagName)?r=f:a[u]=f}}if(r){const l=a.style||(a.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function JT(e,t){const a={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const u=l.expression;u.type;const f=u.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else rl(e,t.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const f=r.value.data.estree.body[0];f.type,l=e.evaluater.evaluateExpression(f.expression)}else rl(e,t.position);else l=r.value===null?!0:r.value;a[i]=l}return a}function Wm(e,t){const a=[];let r=-1;const i=e.passKeys?new Map:$T;for(;++r<t.children.length;){const l=t.children[r];let u;if(e.passKeys){const m=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(m){const h=i.get(m)||0;u=m+"-"+h,i.set(m,h+1)}}const f=w1(e,l,u);f!==void 0&&a.push(f)}return a}function WT(e,t,a){const r=v1(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?d1(a):_1(a)),r.property==="style"){let i=typeof a=="object"?a:eA(e,String(a));return e.stylePropertyNameCase==="css"&&(i=tA(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?NT[r.property]||r.property:r.attribute,a]}}function eA(e,t){try{return DT(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,i=new Dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=S1+"#cannot-parse-style-attribute",i}}function j1(e,t,a){let r;if(!a)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,u;for(;++l<i.length;){const f=Dv(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(l&&f.type==="Literal"),optional:!1}:f}r=u}else r=Dv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Zm.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);rl(e)}function rl(e,t){const a=new Dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=S1+"#cannot-handle-mdx-estrees-without-createevaluater",a}function tA(e){const t={};let a;for(a in e)Zm.call(e,a)&&(t[nA(a)]=e[a]);return t}function nA(e){let t=e.replace(HT,aA);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function aA(e){return"-"+e.toLowerCase()}var fm=Object.defineProperty,rA=Object.getOwnPropertyDescriptor,sA=Object.getOwnPropertyNames,iA=Object.prototype.hasOwnProperty,oA=(e,t)=>{let a={};for(var r in e)fm(a,r,{get:e[r],enumerable:!0});return fm(a,Symbol.toStringTag,{value:"Module"}),a},lA=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=sA(t),l=0,u=i.length,f;l<u;l++)f=i[l],!iA.call(e,f)&&f!==a&&fm(e,f,{get:(m=>t[m]).bind(null,f),enumerable:!(r=rA(t,f))||r.enumerable});return e},cA=(e,t,a)=>(lA(e,t,"default"),a),wt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function uA(e){return ep(e)}function ep(e){return Array.isArray(e)?dA(e):e instanceof RegExp?e:typeof e=="object"?fA(e):e}function dA(e){let t=[];for(let a=0,r=e.length;a<r;a++)t[a]=ep(e[a]);return t}function fA(e){let t={};for(let a in e)t[a]=ep(e[a]);return t}function E1(e,...t){return t.forEach(a=>{for(let r in a)e[r]=a[r]}),e}function C1(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?C1(e.substring(0,e.length-1)):e.substr(~t+1)}var Oh=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,qc=class{static hasCaptures(e){return e===null?!1:(Oh.lastIndex=0,Oh.test(e))}static replaceCaptures(e,t,a){return e.replace(Oh,(r,i,l,u)=>{let f=a[parseInt(i||l,10)];if(f){let m=t.substring(f.start,f.end);for(;m[0]===".";)m=m.substring(1);switch(u){case"downcase":return m.toLowerCase();case"upcase":return m.toUpperCase();default:return m}}else return r})}};function k1(e,t){return e<t?-1:e>t?1:0}function R1(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let a=e.length,r=t.length;if(a===r){for(let i=0;i<a;i++){let l=k1(e[i],t[i]);if(l!==0)return l}return 0}return a-r}function Vv(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 T1(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var A1=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}},xu=class{constructor(e,t,a){this._colorMap=e,this._defaults=t,this._root=a}static createFromRawTheme(e,t){return this.createFromParsedTheme(pA(e),t)}static createFromParsedTheme(e,t){return xA(e,t)}_cachedMatchRoot=new A1(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,r=this._cachedMatchRoot.get(t).find(i=>hA(e.parent,i.parentScopes));return r?new L1(r.fontStyle,r.foreground,r.background):null}},Dh=class ou{constructor(t,a){this.parent=t,this.scopeName=a}static push(t,a){for(const r of a)t=new ou(t,r);return t}static from(...t){let a=null;for(let r=0;r<t.length;r++)a=new ou(a,t[r]);return a}push(t){return new ou(this,t)}getSegments(){let t=this;const a=[];for(;t;)a.push(t.scopeName),t=t.parent;return a.reverse(),a}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const a=[];let r=this;for(;r&&r!==t;)a.push(r.scopeName),r=r.parent;return r===t?a.reverse():void 0}};function hA(e,t){if(t.length===0)return!0;for(let a=0;a<t.length;a++){let r=t[a],i=!1;if(r===">"){if(a===t.length-1)return!1;r=t[++a],i=!0}for(;e&&!mA(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function mA(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var L1=class{constructor(e,t,a){this.fontStyle=e,this.foregroundId=t,this.backgroundId=a}};function pA(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,a=[],r=0;for(let i=0,l=t.length;i<l;i++){let u=t[i];if(!u.settings)continue;let f;if(typeof u.scope=="string"){let y=u.scope;y=y.replace(/^[,]+/,""),y=y.replace(/[,]+$/,""),f=y.split(",")}else Array.isArray(u.scope)?f=u.scope:f=[""];let m=-1;if(typeof u.settings.fontStyle=="string"){m=0;let y=u.settings.fontStyle.split(" ");for(let v=0,b=y.length;v<b;v++)switch(y[v]){case"italic":m=m|1;break;case"bold":m=m|2;break;case"underline":m=m|4;break;case"strikethrough":m=m|8;break}}let h=null;typeof u.settings.foreground=="string"&&Vv(u.settings.foreground)&&(h=u.settings.foreground);let g=null;typeof u.settings.background=="string"&&Vv(u.settings.background)&&(g=u.settings.background);for(let y=0,v=f.length;y<v;y++){let w=f[y].trim().split(" "),N=w[w.length-1],j=null;w.length>1&&(j=w.slice(0,w.length-1),j.reverse()),a[r++]=new gA(N,j,i,m,h,g)}}return a}var gA=class{constructor(e,t,a,r,i,l){this.scope=e,this.parentScopes=t,this.index=a,this.fontStyle=r,this.foreground=i,this.background=l}},En=(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))(En||{});function xA(e,t){e.sort((m,h)=>{let g=k1(m.scope,h.scope);return g!==0||(g=R1(m.parentScopes,h.parentScopes),g!==0)?g:m.index-h.index});let a=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let m=e.shift();m.fontStyle!==-1&&(a=m.fontStyle),m.foreground!==null&&(r=m.foreground),m.background!==null&&(i=m.background)}let l=new yA(t),u=new L1(a,l.getId(r),l.getId(i)),f=new bA(new hm(0,null,-1,0,0),[]);for(let m=0,h=e.length;m<h;m++){let g=e[m];f.insert(0,g.scope,g.parentScopes,g.fontStyle,l.getId(g.foreground),l.getId(g.background))}return new xu(l,u,f)}var yA=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,a=e.length;t<a;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)}},vA=Object.freeze([]),hm=class O1{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,a,r,i,l){this.scopeDepth=t,this.parentScopes=a||vA,this.fontStyle=r,this.foreground=i,this.background=l}clone(){return new O1(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let a=[];for(let r=0,i=t.length;r<i;r++)a[r]=t[r].clone();return a}acceptOverwrite(t,a,r,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,a!==-1&&(this.fontStyle=a),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},bA=class mm{constructor(t,a=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=a}_rulesWithParentScopes;static _cmpBySpecificity(t,a){if(t.scopeDepth!==a.scopeDepth)return a.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,a.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=a.parentScopes.length);){const l=a.parentScopes[i].length-t.parentScopes[r].length;if(l!==0)return l;r++,i++}return a.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,l;if(r===-1?(i=t,l=""):(i=t.substring(0,r),l=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(l)}const a=this._rulesWithParentScopes.concat(this._mainRule);return a.sort(mm._cmpBySpecificity),a}insert(t,a,r,i,l,u){if(a===""){this._doInsertHere(t,r,i,l,u);return}let f=a.indexOf("."),m,h;f===-1?(m=a,h=""):(m=a.substring(0,f),h=a.substring(f+1));let g;this._children.hasOwnProperty(m)?g=this._children[m]:(g=new mm(this._mainRule.clone(),hm.cloneArr(this._rulesWithParentScopes)),this._children[m]=g),g.insert(t+1,h,r,i,l,u)}_doInsertHere(t,a,r,i,l){if(a===null){this._mainRule.acceptOverwrite(t,r,i,l);return}for(let u=0,f=this._rulesWithParentScopes.length;u<f;u++){let m=this._rulesWithParentScopes[u];if(R1(m.parentScopes,a)===0){m.acceptOverwrite(t,r,i,l);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),l===0&&(l=this._mainRule.background),this._rulesWithParentScopes.push(new hm(t,a,r,i,l))}},Li=class va{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const a=va.getLanguageId(t),r=va.getTokenType(t),i=va.getFontStyle(t),l=va.getForeground(t),u=va.getBackground(t);console.log({languageId:a,tokenType:r,fontStyle:i,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,a,r,i,l,u,f){let m=va.getLanguageId(t),h=va.getTokenType(t),g=va.containsBalancedBrackets(t)?1:0,y=va.getFontStyle(t),v=va.getForeground(t),b=va.getBackground(t);return a!==0&&(m=a),r!==8&&(h=r),i!==null&&(g=i?1:0),l!==-1&&(y=l),u!==0&&(v=u),f!==0&&(b=f),(m<<0|h<<8|g<<10|y<<11|v<<15|b<<24)>>>0}};function yu(e,t){const a=[],r=_A(e);let i=r.next();for(;i!==null;){let m=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":m=1;break;case"L":m=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let h=u();if(a.push({matcher:h,priority:m}),i!==",")break;i=r.next()}return a;function l(){if(i==="-"){i=r.next();const m=l();return h=>!!m&&!m(h)}if(i==="("){i=r.next();const m=f();return i===")"&&(i=r.next()),m}if(qv(i)){const m=[];do m.push(i),i=r.next();while(qv(i));return h=>t(m,h)}return null}function u(){const m=[];let h=l();for(;h;)m.push(h),h=l();return g=>m.every(y=>y(g))}function f(){const m=[];let h=u();for(;h&&(m.push(h),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");h=u()}return g=>m.some(y=>y(g))}}function qv(e){return!!e&&!!e.match(/[\w\.:]+/)}function _A(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,a=t.exec(e);return{next:()=>{if(!a)return null;const r=a[0];return a=t.exec(e),r}}}function D1(e){typeof e.dispose=="function"&&e.dispose()}var sl=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},SA=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},wA=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))}},NA=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new sl(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new wA;for(const a of e)jA(a,this.initialScopeName,this.repo,t);for(const a of t.references)if(a instanceof sl){if(this.seenFullScopeRequests.has(a.scopeName))continue;this.seenFullScopeRequests.add(a.scopeName),this.Q.push(a)}else{if(this.seenFullScopeRequests.has(a.scopeName)||this.seenPartialScopeRequests.has(a.toKey()))continue;this.seenPartialScopeRequests.add(a.toKey()),this.Q.push(a)}}};function jA(e,t,a,r){const i=a.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const l=a.lookup(t);e instanceof sl?lu({baseGrammar:l,selfGrammar:i},r):pm(e.ruleName,{baseGrammar:l,selfGrammar:i,repository:i.repository},r);const u=a.injections(e.scopeName);if(u)for(const f of u)r.add(new sl(f))}function pm(e,t,a){if(t.repository&&t.repository[e]){const r=t.repository[e];vu([r],t,a)}}function lu(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&vu(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&vu(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function vu(e,t,a){for(const r of e){if(a.visitedRule.has(r))continue;a.visitedRule.add(r);const i=r.repository?E1({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&vu(r.patterns,{...t,repository:i},a);const l=r.include;if(!l)continue;const u=M1(l);switch(u.kind){case 0:lu({...t,selfGrammar:t.baseGrammar},a);break;case 1:lu(t,a);break;case 2:pm(u.ruleName,{...t,repository:i},a);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 m={baseGrammar:t.baseGrammar,selfGrammar:f,repository:i};u.kind===4?pm(u.ruleName,m,a):lu(m,a)}else u.kind===4?a.add(new SA(u.scopeName,u.ruleName)):a.add(new sl(u.scopeName));break}}}var EA=class{kind=0},CA=class{kind=1},kA=class{constructor(e){this.ruleName=e}kind=2},RA=class{constructor(e){this.scopeName=e}kind=3},TA=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function M1(e){if(e==="$base")return new EA;if(e==="$self")return new CA;const t=e.indexOf("#");if(t===-1)return new RA(e);if(t===0)return new kA(e.substring(1));{const a=e.substring(0,t),r=e.substring(t+1);return new TA(a,r)}}var AA=/\\(\d+)/,Fv=/\\(\d+)/g,LA=-1,z1=-2;var Sl=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,a,r){this.$location=e,this.id=t,this._name=a||null,this._nameIsCapturing=qc.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=qc.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${C1(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:qc.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:qc.replaceCaptures(this._contentName,e,t)}},OA=class extends Sl{retokenizeCapturedWithRuleId;constructor(e,t,a,r,i){super(e,t,a,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,a,r){throw new Error("Not supported!")}},DA=class extends Sl{_match;captures;_cachedCompiledPatterns;constructor(e,t,a,r,i){super(e,t,a,null),this._match=new il(r,this.id),this.captures=i,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,a,r){return this._getCachedCompiledPatterns(e).compileAG(e,a,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ol,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Yv=class extends Sl{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,a,r,i){super(e,t,a,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const a of this.patterns)e.getRule(a).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,a,r){return this._getCachedCompiledPatterns(e).compileAG(e,a,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ol,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},gm=class extends Sl{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,a,r,i,l,u,f,m,h){super(e,t,a,r),this._begin=new il(i,this.id),this.beginCaptures=l,this._end=new il(u||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=f,this.applyEndPatternLast=m||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.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,a,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,a,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ol;for(const a of this.patterns)e.getRule(a).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}},bu=class extends Sl{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,a,r,i,l,u,f,m){super(e,t,a,r),this._begin=new il(i,this.id),this.beginCaptures=l,this.whileCaptures=f,this._while=new il(u,z1),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=m.patterns,this.hasMissingPatterns=m.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,a,r){return this._getCachedCompiledPatterns(e).compileAG(e,a,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ol;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,a,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,a,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ol,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},U1=class Nn{static createCaptureRule(t,a,r,i,l){return t.registerRule(u=>new OA(a,u,r,i,l))}static getCompiledRuleId(t,a,r){return t.id||a.registerRule(i=>{if(t.id=i,t.match)return new DA(t.$vscodeTextmateLocation,t.id,t.name,t.match,Nn._compileCaptures(t.captures,a,r));if(typeof t.begin>"u"){t.repository&&(r=E1({},r,t.repository));let l=t.patterns;return typeof l>"u"&&t.include&&(l=[{include:t.include}]),new Yv(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Nn._compilePatterns(l,a,r))}return t.while?new bu(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Nn._compileCaptures(t.beginCaptures||t.captures,a,r),t.while,Nn._compileCaptures(t.whileCaptures||t.captures,a,r),Nn._compilePatterns(t.patterns,a,r)):new gm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Nn._compileCaptures(t.beginCaptures||t.captures,a,r),t.end,Nn._compileCaptures(t.endCaptures||t.captures,a,r),t.applyEndPatternLast,Nn._compilePatterns(t.patterns,a,r))}),t.id}static _compileCaptures(t,a,r){let i=[];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++)i[u]=null;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const f=parseInt(u,10);let m=0;t[u].patterns&&(m=Nn.getCompiledRuleId(t[u],a,r)),i[f]=Nn.createCaptureRule(a,t[u].$vscodeTextmateLocation,t[u].name,t[u].contentName,m)}}return i}static _compilePatterns(t,a,r){let i=[];if(t)for(let l=0,u=t.length;l<u;l++){const f=t[l];let m=-1;if(f.include){const h=M1(f.include);switch(h.kind){case 0:case 1:m=Nn.getCompiledRuleId(r[f.include],a,r);break;case 2:let g=r[h.ruleName];g&&(m=Nn.getCompiledRuleId(g,a,r));break;case 3:case 4:const y=h.scopeName,v=h.kind===4?h.ruleName:null,b=a.getExternalGrammar(y,r);if(b)if(v){let w=b.repository[v];w&&(m=Nn.getCompiledRuleId(w,a,b.repository))}else m=Nn.getCompiledRuleId(b.repository.$self,a,b.repository);break}}else m=Nn.getCompiledRuleId(f,a,r);if(m!==-1){const h=a.getRule(m);let g=!1;if((h instanceof Yv||h instanceof gm||h instanceof bu)&&h.hasMissingPatterns&&h.patterns.length===0&&(g=!0),g)continue;i.push(m)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},il=class $1{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,a){if(t&&typeof t=="string"){const r=t.length;let i=0,l=[],u=!1;for(let f=0;f<r;f++)if(t.charAt(f)==="\\"&&f+1<r){const h=t.charAt(f+1);h==="z"?(l.push(t.substring(i,f)),l.push("$(?!\\n)(?<!\\n)"),i=f+2):(h==="A"||h==="G")&&(u=!0),f++}this.hasAnchor=u,i===0?this.source=t:(l.push(t.substring(i,r)),this.source=l.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=a,typeof this.source=="string"?this.hasBackReferences=AA.test(this.source):this.hasBackReferences=!1}clone(){return new $1(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,a){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=a.map(i=>t.substring(i.start,i.end));return Fv.lastIndex=0,this.source.replace(Fv,(i,l)=>T1(r[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=[],a=[],r=[],i=[],l,u,f,m;for(l=0,u=this.source.length;l<u;l++)f=this.source.charAt(l),t[l]=f,a[l]=f,r[l]=f,i[l]=f,f==="\\"&&l+1<u&&(m=this.source.charAt(l+1),m==="A"?(t[l+1]="",a[l+1]="",r[l+1]="A",i[l+1]="A"):m==="G"?(t[l+1]="",a[l+1]="G",r[l+1]="",i[l+1]="G"):(t[l+1]=m,a[l+1]=m,r[l+1]=m,i[l+1]=m),l++);return{A0_G0:t.join(""),A0_G1:a.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,a){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?a?this._anchorCache.A1_G1:this._anchorCache.A1_G0:a?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ol=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(a=>a.source);this._cached=new Kv(e,t,this._items.map(a=>a.ruleId))}return this._cached}compileAG(e,t,a){return this._hasAnchors?t?a?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,a)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,a)),this._anchorCache.A1_G0):a?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,a)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,a)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,a){let r=this._items.map(i=>i.resolveAnchors(t,a));return new Kv(e,r,this._items.map(i=>i.ruleId))}},Kv=class{constructor(e,t,a){this.regExps=t,this.rules=a,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,a=this.rules.length;t<a;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
130
|
+
`)}findNextMatchSync(e,t,a){const r=this.scanner.findNextMatchSync(e,t,a);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Mh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},MA=class xm{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,a){this._defaultAttributes=new Mh(t,8),this._embeddedLanguagesMatcher=new zA(Object.entries(a||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?xm._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Mh(0,0);_getBasicScopeAttributes=new A1(t=>{const a=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Mh(a,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const a=t.match(xm.STANDARD_TOKEN_TYPE_REGEXP);if(!a)return 8;switch(a[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/},zA=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(([a,r])=>T1(a));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])}},Xv=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function H1(e,t,a,r,i,l,u,f){const m=t.content.length;let h=!1,g=-1;if(u){const b=UA(e,t,a,r,i,l);i=b.stack,r=b.linePos,a=b.isFirstLine,g=b.anchorPosition}const y=Date.now();for(;!h;){if(f!==0&&Date.now()-y>f)return new Xv(i,!0);v()}return new Xv(i,!1);function v(){const b=$A(e,t,a,r,i,g);if(!b){l.produce(i,m),h=!0;return}const w=b.captureIndices,N=b.matchedRuleId,j=w&&w.length>0?w[0].end>r:!1;if(N===LA){const E=i.getRule(e);l.produce(i,w[0].start),i=i.withContentNameScopesList(i.nameScopesList),qo(e,t,a,i,l,E.endCaptures,w),l.produce(i,w[0].end);const R=i;if(i=i.parent,g=R.getAnchorPos(),!j&&R.getEnterPos()===r){i=R,l.produce(i,m),h=!0;return}}else{const E=e.getRule(N);l.produce(i,w[0].start);const R=i,k=E.getName(t.content,w),O=i.contentNameScopesList.pushAttributed(k,e);if(i=i.push(N,r,g,w[0].end===m,null,O,O),E instanceof gm){const I=E;qo(e,t,a,i,l,I.beginCaptures,w),l.produce(i,w[0].end),g=w[0].end;const B=I.getContentName(t.content,w),H=O.pushAttributed(B,e);if(i=i.withContentNameScopesList(H),I.endHasBackReferences&&(i=i.withEndRule(I.getEndWithResolvedBackReferences(t.content,w))),!j&&R.hasSameRuleAs(i)){i=i.pop(),l.produce(i,m),h=!0;return}}else if(E instanceof bu){const I=E;qo(e,t,a,i,l,I.beginCaptures,w),l.produce(i,w[0].end),g=w[0].end;const B=I.getContentName(t.content,w),H=O.pushAttributed(B,e);if(i=i.withContentNameScopesList(H),I.whileHasBackReferences&&(i=i.withEndRule(I.getWhileWithResolvedBackReferences(t.content,w))),!j&&R.hasSameRuleAs(i)){i=i.pop(),l.produce(i,m),h=!0;return}}else if(qo(e,t,a,i,l,E.captures,w),l.produce(i,w[0].end),i=i.pop(),!j){i=i.safePop(),l.produce(i,m),h=!0;return}}w[0].end>r&&(r=w[0].end,a=!1)}}function UA(e,t,a,r,i,l){let u=i.beginRuleCapturedEOL?0:-1;const f=[];for(let m=i;m;m=m.pop()){const h=m.getRule(e);h instanceof bu&&f.push({rule:h,stack:m})}for(let m=f.pop();m;m=f.pop()){const{ruleScanner:h,findOptions:g}=IA(m.rule,e,m.stack.endRule,a,r===u),y=h.findNextMatchSync(t,r,g);if(y){if(y.ruleId!==z1){i=m.stack.pop();break}y.captureIndices&&y.captureIndices.length&&(l.produce(m.stack,y.captureIndices[0].start),qo(e,t,a,m.stack,l,m.rule.whileCaptures,y.captureIndices),l.produce(m.stack,y.captureIndices[0].end),u=y.captureIndices[0].end,y.captureIndices[0].end>r&&(r=y.captureIndices[0].end,a=!1))}else{i=m.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:u,isFirstLine:a}}function $A(e,t,a,r,i,l){const u=HA(e,t,a,r,i,l),f=e.getInjections();if(f.length===0)return u;const m=BA(f,e,t,a,r,i,l);if(!m)return u;if(!u)return m;const h=u.captureIndices[0].start,g=m.captureIndices[0].start;return g<h||m.priorityMatch&&g===h?m:u}function HA(e,t,a,r,i,l){const u=i.getRule(e),{ruleScanner:f,findOptions:m}=B1(u,e,i.endRule,a,r===l),h=f.findNextMatchSync(t,r,m);return h?{captureIndices:h.captureIndices,matchedRuleId:h.ruleId}:null}function BA(e,t,a,r,i,l,u){let f=Number.MAX_VALUE,m=null,h,g=0;const y=l.contentNameScopesList.getScopeNames();for(let v=0,b=e.length;v<b;v++){const w=e[v];if(!w.matcher(y))continue;const N=t.getRule(w.ruleId),{ruleScanner:j,findOptions:E}=B1(N,t,null,r,i===u),R=j.findNextMatchSync(a,i,E);if(!R)continue;const k=R.captureIndices[0].start;if(!(k>=f)&&(f=k,m=R.captureIndices,h=R.ruleId,g=w.priority,f===i))break}return m?{priorityMatch:g===-1,captureIndices:m,matchedRuleId:h}:null}function B1(e,t,a,r,i){return{ruleScanner:e.compileAG(t,a,r,i),findOptions:0}}function IA(e,t,a,r,i){return{ruleScanner:e.compileWhileAG(t,a,r,i),findOptions:0}}function qo(e,t,a,r,i,l,u){if(l.length===0)return;const f=t.content,m=Math.min(l.length,u.length),h=[],g=u[0].end;for(let y=0;y<m;y++){const v=l[y];if(v===null)continue;const b=u[y];if(b.length===0)continue;if(b.start>g)break;for(;h.length>0&&h[h.length-1].endPos<=b.start;)i.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop();if(h.length>0?i.produceFromScopes(h[h.length-1].scopes,b.start):i.produce(r,b.start),v.retokenizeCapturedWithRuleId){const N=v.getName(f,u),j=r.contentNameScopesList.pushAttributed(N,e),E=v.getContentName(f,u),R=j.pushAttributed(E,e),k=r.push(v.retokenizeCapturedWithRuleId,b.start,-1,!1,null,j,R),O=e.createOnigString(f.substring(0,b.end));H1(e,O,a&&b.start===0,b.start,k,i,!1,0),D1(O);continue}const w=v.getName(f,u);if(w!==null){const j=(h.length>0?h[h.length-1].scopes:r.contentNameScopesList).pushAttributed(w,e);h.push(new PA(j,b.end))}}for(;h.length>0;)i.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop()}var PA=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function GA(e,t,a,r,i,l,u,f){return new qA(e,t,a,r,i,l,u,f)}function Qv(e,t,a,r,i){const l=yu(t,_u),u=U1.getCompiledRuleId(a,r,i.repository);for(const f of l)e.push({debugSelector:t,matcher:f.matcher,ruleId:u,grammar:i,priority:f.priority})}function _u(e,t){if(t.length<e.length)return!1;let a=0;return e.every(r=>{for(let i=a;i<t.length;i++)if(VA(t[i],r))return a=i+1,!0;return!1})}function VA(e,t){if(!e)return!1;if(e===t)return!0;const a=t.length;return e.length>a&&e.substr(0,a)===t&&e[a]==="."}var qA=class{constructor(e,t,a,r,i,l,u,f){if(this._rootScopeName=e,this.balancedBracketSelectors=l,this._onigLib=f,this._basicScopeAttributesProvider=new MA(a,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=u,this._grammar=Zv(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const m of Object.keys(i)){const h=yu(m,_u);for(const g of h)this._tokenTypeMatchers.push({matcher:g.matcher,type:i[m]})}}_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:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],a=this._rootScopeName,r=e.lookup(a);if(r){const i=r.injections;if(i)for(let u in i)Qv(t,u,i[u],this,r);const l=this._grammarRepository.injections(a);l&&l.forEach(u=>{const f=this.getExternalGrammar(u);if(f){const m=f.injectionSelector;m&&Qv(t,m,f,this,f)}})}return t.sort((i,l)=>i.priority-l.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,a=e(t);return this._ruleId2desc[t]=a,a}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const a=this._grammarRepository.lookup(e);if(a)return this._includedGrammars[e]=Zv(a,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,a=0){const r=this._tokenize(e,t,!1,a);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,a=0){const r=this._tokenize(e,t,!0,a);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,a,r){this._rootId===-1&&(this._rootId=U1.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===ym.NULL){i=!0;const h=this._basicScopeAttributesProvider.getDefaultAttributes(),g=this.themeProvider.getDefaults(),y=Li.set(0,h.languageId,h.tokenType,null,g.fontStyle,g.foregroundId,g.backgroundId),v=this.getRule(this._rootId).getName(null,null);let b;v?b=Zo.createRootAndLookUpScopeName(v,y,this):b=Zo.createRoot("unknown",y),t=new ym(null,this._rootId,-1,-1,!1,null,b,b)}else i=!1,t.reset();e=e+`
|
|
131
|
+
`;const l=this.createOnigString(e),u=l.content.length,f=new YA(a,e,this._tokenTypeMatchers,this.balancedBracketSelectors),m=H1(this,l,i,0,t,f,!0,r);return D1(l),{lineLength:u,lineTokens:f,ruleStack:m.stack,stoppedEarly:m.stoppedEarly}}};function Zv(e,t){return e=uA(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 Zo=class Pa{constructor(t,a,r){this.parent=t,this.scopePath=a,this.tokenAttributes=r}static fromExtension(t,a){let r=t,i=t?.scopePath??null;for(const l of a)i=Dh.push(i,l.scopeNames),r=new Pa(r,i,l.encodedTokenAttributes);return r}static createRoot(t,a){return new Pa(null,new Dh(null,t),a)}static createRootAndLookUpScopeName(t,a,r){const i=r.getMetadataForScope(t),l=new Dh(null,t),u=r.themeProvider.themeMatch(l),f=Pa.mergeAttributes(a,i,u);return new Pa(null,l,f)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Pa.equals(this,t)}static equals(t,a){do{if(t===a||!t&&!a)return!0;if(!t||!a||t.scopeName!==a.scopeName||t.tokenAttributes!==a.tokenAttributes)return!1;t=t.parent,a=a.parent}while(!0)}static mergeAttributes(t,a,r){let i=-1,l=0,u=0;return r!==null&&(i=r.fontStyle,l=r.foregroundId,u=r.backgroundId),Li.set(t,a.languageId,a.tokenType,null,i,l,u)}pushAttributed(t,a){if(t===null)return this;if(t.indexOf(" ")===-1)return Pa._pushAttributed(this,t,a);const r=t.split(/ /g);let i=this;for(const l of r)i=Pa._pushAttributed(i,l,a);return i}static _pushAttributed(t,a,r){const i=r.getMetadataForScope(a),l=t.scopePath.push(a),u=r.themeProvider.themeMatch(l),f=Pa.mergeAttributes(t.tokenAttributes,i,u);return new Pa(t,l,f)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const a=[];let r=this;for(;r&&r!==t;)a.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?a.reverse():void 0}},ym=class ws{constructor(t,a,r,i,l,u,f,m){this.parent=t,this.ruleId=a,this.beginRuleCapturedEOL=l,this.endRule=u,this.nameScopesList=f,this.contentNameScopesList=m,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new ws(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:ws._equals(this,t)}static _equals(t,a){return t===a?!0:this._structuralEquals(t,a)?Zo.equals(t.contentNameScopesList,a.contentNameScopesList):!1}static _structuralEquals(t,a){do{if(t===a||!t&&!a)return!0;if(!t||!a||t.depth!==a.depth||t.ruleId!==a.ruleId||t.endRule!==a.endRule)return!1;t=t.parent,a=a.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){ws._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,a,r,i,l,u,f){return new ws(this,t,a,r,i,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,a){return this.parent&&(a=this.parent._writeString(t,a)),t[a++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,a}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 ws(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let a=this;for(;a&&a._enterPos===t._enterPos;){if(a.ruleId===t.ruleId)return!0;a=a.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,a){const r=Zo.fromExtension(t?.nameScopesList??null,a.nameScopesList);return new ws(t,a.ruleId,a.enterPos??-1,a.anchorPos??-1,a.beginRuleCapturedEOL,a.endRule,r,Zo.fromExtension(r,a.contentNameScopesList))}},FA=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(a=>a==="*"?(this.allowAny=!0,[]):yu(a,_u).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(a=>yu(a,_u).map(r=>r.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}},YA=class{constructor(e,t,a,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=a,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 r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!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)&&(r=Li.set(r,0,u.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(l))}if(i&&(r=Li.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const a=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:a}),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 a=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)a[r]=this._binaryTokens[r];return a}},KA=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,a,r,i){if(!this._grammars.has(e)){let l=this._rawGrammars.get(e);if(!l)return null;this._grammars.set(e,GA(e,l,t,a,r,i,this,this._onigLib))}return this._grammars.get(e)}},XA=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new KA(xu.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,a){this._syncRegistry.setTheme(xu.createFromRawTheme(t,a))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,a,r){return this.loadGrammarWithConfiguration(t,a,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,a,r){return this._loadGrammar(t,a,r.embeddedLanguages,r.tokenTypes,new FA(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,a,r,i,l){const u=new NA(this._syncRegistry,t);for(;u.Q.length>0;)u.Q.map(f=>this._loadSingleGrammar(f.scopeName)),u.processQueue();return this._grammarForScopeName(t,a,r,i,l)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const a=this._options.loadGrammar(t);if(a){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(a,r)}}addGrammar(t,a=[],r=0,i=null){return this._syncRegistry.addGrammar(t,a),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,a=0,r=null,i=null,l=null){return this._syncRegistry.grammarForScopeName(t,a,r,i,l)}},vm=ym.NULL;function Su(e,t){const a=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,l]of Object.entries(t?.colorReplacements||{}))typeof l=="string"?a[i]=l:i===r&&Object.assign(a,l);return a}function es(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function QA(e){return Array.isArray(e)?e:[e]}async function I1(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Gu(e){return!e||["plaintext","txt","text","plain"].includes(e)}function tp(e){return e==="ansi"||Gu(e)}function Vu(e){return e==="none"}function P1(e){return Vu(e)}function qu(e,t=!1){if(e.length===0)return[["",0]];const a=e.split(/(\r?\n)/g);let r=0;const i=[];for(let l=0;l<a.length;l+=2){const u=t?a[l]+(a[l+1]||""):a[l];i.push([u,r]),r+=a[l].length,r+=a[l+1]?.length||0}return i}const Jv={light:"#333333",dark:"#bbbbbb"},Wv={light:"#fffffe",dark:"#1e1e1e"},eb="__shiki_resolved";function np(e){if(e?.[eb])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:a,fg:r}=t;if(!a||!r){const f=t.settings?t.settings.find(m=>!m.name&&!m.scope):void 0;f?.settings?.foreground&&(r=f.settings.foreground),f?.settings?.background&&(a=f.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!a&&t?.colors?.["editor.background"]&&(a=t.colors["editor.background"]),r||(r=t.type==="light"?Jv.light:Jv.dark),a||(a=t.type==="light"?Wv.light:Wv.dark),t.fg=r,t.bg=a}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const l=new Map;function u(f){if(l.has(f))return l.get(f);i+=1;const m=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${m}`]?u(f):(l.set(f,m),m)}t.settings=t.settings.map(f=>{const m=f.settings?.foreground&&!f.settings.foreground.startsWith("#"),h=f.settings?.background&&!f.settings.background.startsWith("#");if(!m&&!h)return f;const g={...f,settings:{...f.settings}};if(m){const y=u(f.settings.foreground);t.colorReplacements[y]=f.settings.foreground,g.settings.foreground=y}if(h){const y=u(f.settings.background);t.colorReplacements[y]=f.settings.background,g.settings.background=y}return g});for(const f of Object.keys(t.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!t.colors[f]?.startsWith("#")){const m=u(t.colors[f]);t.colorReplacements[m]=t.colors[f],t.colors[f]=m}return Object.defineProperty(t,eb,{enumerable:!1,writable:!1,value:!0}),t}async function G1(e){return Array.from(new Set((await Promise.all(e.filter(t=>!tp(t)).map(async t=>await I1(t).then(a=>Array.isArray(a)?a:[a])))).flat()))}async function V1(e){return(await Promise.all(e.map(async t=>P1(t)?null:np(await I1(t))))).filter(t=>!!t)}function q1(e,t){if(!t)return e;if(t[e]){const a=new Set([e]);for(;t[e];){if(e=t[e],a.has(e))throw new wt(`Circular alias \`${Array.from(a).join(" -> ")} -> ${e}\``);a.add(e)}}return e}var ZA=class extends XA{_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,a,r={}){super(e),this._resolver=e,this._themes=t,this._langs=a,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=np(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=xu.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=q1(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const a={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,a);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,t.size)for(const i of t)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=Array.from(this._langGraph.entries()),a=t.filter(([r,i])=>!i);if(a.length){const r=t.filter(([i,l])=>l?(l.embeddedLanguages||l.embeddedLangs)?.some(u=>a.map(([f])=>f).includes(u)):!1).filter(i=>!a.includes(i));throw new wt(`Missing languages ${a.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of t)this._resolver.addLanguage(i);for(const[r,i]of t)this.loadLanguage(i)}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 a of t)this._langGraph.set(a,this._langMap.get(a))}},JA=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:a=>e.createScanner(a),createOnigString:a=>e.createString(a)},t.forEach(a=>this.addLanguage(a))}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 a=[];for(let r=1;r<=t.length;r++){const i=t.slice(0,r).join(".");a=[...a,...this._injections.get(i)||[]]}return a}};let Uo=0;function WA(e){Uo+=1,e.warnings!==!1&&Uo>=10&&Uo%10===0&&console.warn(`[Shiki] ${Uo} 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 wt("`engine` option is required for synchronous mode");const a=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(np),i=new ZA(new JA(e.engine,a),r,a,e.langAlias);let l;function u(R){return q1(R,e.langAlias)}function f(R){j();const k=i.getGrammar(typeof R=="string"?R:R.name);if(!k)throw new wt(`Language \`${R}\` not found, you may need to load it first`);return k}function m(R){if(R==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};j();const k=i.getTheme(R);if(!k)throw new wt(`Theme \`${R}\` not found, you may need to load it first`);return k}function h(R){j();const k=m(R);return l!==R&&(i.setTheme(k),l=R),{theme:k,colorMap:i.getColorMap()}}function g(){return j(),i.getLoadedThemes()}function y(){return j(),i.getLoadedLanguages()}function v(...R){j(),i.loadLanguages(R.flat(1))}async function b(...R){return v(await G1(R))}function w(...R){j();for(const k of R.flat(1))i.loadTheme(k)}async function N(...R){return j(),w(await V1(R))}function j(){if(t)throw new wt("Shiki instance has been disposed")}function E(){t||(t=!0,i.dispose(),Uo-=1)}return{setTheme:h,getTheme:m,getLanguage:f,getLoadedThemes:g,getLoadedLanguages:y,resolveLangAlias:u,loadLanguage:b,loadLanguageSync:v,loadTheme:N,loadThemeSync:w,dispose:E,[Symbol.dispose]:E}}async function eL(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,a,r]=await Promise.all([V1(e.themes||[]),G1(e.langs||[]),e.engine]);return WA({...e,themes:t,langs:a,engine:r})}const F1=new WeakMap;function Fu(e,t){F1.set(e,t)}function ll(e){return F1.get(e)}var Yu=class Y1{_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,a){return new Y1(Object.fromEntries(QA(a).map(r=>[r,vm])),t)}constructor(...t){if(t.length===2){const[a,r]=t;this.lang=r,this._stacks=a}else{const[a,r,i]=t;this.lang=r,this._stacks={[i]:a}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return tL(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function tL(e){const t=[],a=new Set;function r(i){if(a.has(i))return;a.add(i);const l=i?.nameScopesList?.scopeName;l&&t.push(l),i.parent&&r(i.parent)}return r(e),t}function nL(e,t){if(!(e instanceof Yu))throw new wt("Invalid grammar state");return e.getInternalStack(t)}function K1(e,t,a={}){const{theme:r=e.getLoadedThemes()[0]}=a;if(Gu(e.resolveLangAlias(a.lang||"text"))||Vu(r))return qu(t).map(f=>[{content:f[0],offset:f[1]}]);const{theme:i,colorMap:l}=e.setTheme(r),u=e.getLanguage(a.lang||"text");if(a.grammarState){if(a.grammarState.lang!==u.name)throw new wt(`Grammar state language "${a.grammarState.lang}" does not match highlight language "${u.name}"`);if(!a.grammarState.themes.includes(i.name))throw new wt(`Grammar state themes "${a.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return rL(t,u,i,l,a)}function aL(...e){if(e.length===2)return ll(e[1]);const[t,a,r={}]=e,{lang:i="text",theme:l=t.getLoadedThemes()[0]}=r;if(Gu(i)||Vu(l))throw new wt("Plain language does not have grammar state");if(i==="ansi")throw new wt("ANSI language does not have grammar state");const{theme:u,colorMap:f}=t.setTheme(l),m=t.getLanguage(i);return new Yu(ap(a,m,u,f,r).stateStack,m.name,u.name)}function rL(e,t,a,r,i){const l=ap(e,t,a,r,i),u=new Yu(l.stateStack,t.name,a.name);return Fu(l.tokens,u),l.tokens}function ap(e,t,a,r,i){const l=Su(a,i),{tokenizeMaxLineLength:u=0,tokenizeTimeLimit:f=500}=i,m=qu(e);let h=i.grammarState?nL(i.grammarState,a.name)??vm:i.grammarContextCode!=null?ap(i.grammarContextCode,t,a,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:vm,g=[];const y=[];for(let v=0,b=m.length;v<b;v++){const[w,N]=m[v];if(w===""){g=[],y.push([]);continue}if(u>0&&w.length>=u){g=[],y.push([{content:w,offset:N,color:"",fontStyle:0}]);continue}let j,E,R;i.includeExplanation&&(j=t.tokenizeLine(w,h,f),E=j.tokens,R=0);const k=t.tokenizeLine2(w,h,f),O=k.tokens.length/2;for(let I=0;I<O;I++){const B=k.tokens[2*I],H=I+1<O?k.tokens[2*I+2]:w.length;if(B===H)continue;const T=k.tokens[2*I+1],P=es(r[Li.getForeground(T)],l),X=Li.getFontStyle(T),de={content:w.substring(B,H),offset:N+B,color:P,fontStyle:X};if(i.includeExplanation){const le=[];if(i.includeExplanation!=="scopeName")for(const D of a.settings){let F;switch(typeof D.scope){case"string":F=D.scope.split(/,/).map(A=>A.trim());break;case"object":F=D.scope;break;default:continue}le.push({settings:D,selectors:F.map(A=>A.split(/ /))})}de.explanation=[];let ce=0;for(;B+ce<H;){const D=E[R],F=w.substring(D.startIndex,D.endIndex);ce+=F.length,de.explanation.push({content:F,scopes:i.includeExplanation==="scopeName"?sL(D.scopes):iL(le,D.scopes)}),R+=1}}g.push(de)}y.push(g),g=[],h=k.ruleStack}return{tokens:y,stateStack:h}}function sL(e){return e.map(t=>({scopeName:t}))}function iL(e,t){const a=[];for(let r=0,i=t.length;r<i;r++){const l=t[r];a[r]={scopeName:l,themeMatches:lL(e,l,t.slice(0,r))}}return a}function tb(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function oL(e,t,a){if(!tb(e[e.length-1],t))return!1;let r=e.length-2,i=a.length-1;for(;r>=0&&i>=0;)tb(e[r],a[i])&&(r-=1),i-=1;return r===-1}function lL(e,t,a){const r=[];for(const{selectors:i,settings:l}of e)for(const u of i)if(oL(u,t,a)){r.push(l);break}return r}function X1(e,t,a,r=K1){const i=Object.entries(a.themes).filter(h=>h[1]).map(h=>({color:h[0],theme:h[1]})),l=i.map(h=>{const g=r(e,t,{...a,theme:h.theme});return{tokens:g,state:ll(g),theme:typeof h.theme=="string"?h.theme:h.theme.name}}),u=cL(...l.map(h=>h.tokens)),f=u[0].map((h,g)=>h.map((y,v)=>{const b={content:y.content,variants:{},offset:y.offset};return"includeExplanation"in a&&a.includeExplanation&&(b.explanation=y.explanation),u.forEach((w,N)=>{const{content:j,explanation:E,offset:R,...k}=w[g][v];b.variants[i[N].color]=k}),b})),m=l[0].state?new Yu(Object.fromEntries(l.map(h=>[h.theme,h.state?.getInternalStack(h.theme)])),l[0].state.lang):void 0;return m&&Fu(f,m),f}function cL(...e){const t=e.map(()=>[]),a=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(m=>m[r]),l=t.map(()=>[]);t.forEach((m,h)=>m.push(l[h]));const u=i.map(()=>0),f=i.map(m=>m[0]);for(;f.every(m=>m);){const m=Math.min(...f.map(h=>h.content.length));for(let h=0;h<a;h++){const g=f[h];g.content.length===m?(l[h].push(g),u[h]+=1,f[h]=i[h][u[h]]):(l[h].push({...g,content:g.content.slice(0,m)}),f[h]={...g,content:g.content.slice(m),offset:g.offset+m})}}}return t}const uL=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],nb={}.hasOwnProperty;function dL(e,t){const a=t||{};function r(i,...l){let u=r.invalid;const f=r.handlers;if(i&&nb.call(i,e)){const m=String(i[e]);u=nb.call(f,m)?f[m]:r.unknown}if(u)return u.call(this,i,...l)}return r.handlers=a.handlers||{},r.invalid=a.invalid,r.unknown=a.unknown,r}const fL=/["&'<>`]/g,hL=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,mL=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,pL=/[|\\{}()[\]^$+*?.]/g,ab=new WeakMap;function gL(e,t){if(e=e.replace(t.subset?xL(t.subset):fL,r),t.subset||t.escapeOnly)return e;return e.replace(hL,a).replace(mL,r);function a(i,l,u){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,u.charCodeAt(l+2),t)}function r(i,l,u){return t.format(i.charCodeAt(0),u.charCodeAt(l+1),t)}}function xL(e){let t=ab.get(e);return t||(t=yL(e),ab.set(e,t)),t}function yL(e){const t=[];let a=-1;for(;++a<e.length;)t.push(e[a].replace(pL,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const vL=/[\dA-Fa-f]/;function bL(e,t,a){const r="&#x"+e.toString(16).toUpperCase();return a&&t&&!vL.test(String.fromCharCode(t))?r:r+";"}const _L=/\d/;function SL(e,t,a){const r="&#"+String(e);return a&&t&&!_L.test(String.fromCharCode(t))?r:r+";"}const wL=["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"],zh={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:"€"},NL=["cent","copy","divide","gt","lt","not","para","times"],Q1={}.hasOwnProperty,bm={};let Fc;for(Fc in zh)Q1.call(zh,Fc)&&(bm[zh[Fc]]=Fc);const jL=/[^\dA-Za-z]/;function EL(e,t,a,r){const i=String.fromCharCode(e);if(Q1.call(bm,i)){const l=bm[i],u="&"+l;return a&&wL.includes(l)&&!NL.includes(l)&&(!r||t&&t!==61&&jL.test(String.fromCharCode(t)))?u:u+";"}return""}function CL(e,t,a){let r=bL(e,t,a.omitOptionalSemicolons),i;if((a.useNamedReferences||a.useShortestReferences)&&(i=EL(e,t,a.omitOptionalSemicolons,a.attribute)),(a.useShortestReferences||!i)&&a.useShortestReferences){const l=SL(e,t,a.omitOptionalSemicolons);l.length<r.length&&(r=l)}return i&&(!a.useShortestReferences||i.length<r.length)?i:r}function ki(e,t){return gL(e,Object.assign({format:CL},t))}const kL=/^>|^->|<!--|-->|--!>|<!-$/g,RL=[">"],TL=["<",">"];function AL(e,t,a,r){return r.settings.bogusComments?"<?"+ki(e.value,Object.assign({},r.settings.characterReferences,{subset:RL}))+">":"<!--"+e.value.replace(kL,i)+"-->";function i(l){return ki(l,Object.assign({},r.settings.characterReferences,{subset:TL}))}}function LL(e,t,a,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function rb(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=a.indexOf(t);for(;i!==-1;)r++,i=a.indexOf(t,i+t.length);return r}const on=J1(1),Z1=J1(-1),OL=[];function J1(e){return t;function t(a,r,i){const l=a?a.children:OL;let u=(r||0)+e,f=l[u];if(!i)for(;f&&Pu(f);)u+=e,f=l[u];return f}}const DL={}.hasOwnProperty;function W1(e){return t;function t(a,r,i){return DL.call(e,a.tagName)&&e[a.tagName](a,r,i)}}const rp=W1({body:zL,caption:Uh,colgroup:Uh,dd:BL,dt:HL,head:Uh,html:ML,li:$L,optgroup:IL,option:PL,p:UL,rp:sb,rt:sb,tbody:VL,td:ib,tfoot:qL,th:ib,thead:GL,tr:FL});function Uh(e,t,a){const r=on(a,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Pu(r.value.charAt(0)))}function ML(e,t,a){const r=on(a,t);return!r||r.type!=="comment"}function zL(e,t,a){const r=on(a,t);return!r||r.type!=="comment"}function UL(e,t,a){const r=on(a,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!a||!(a.type==="element"&&(a.tagName==="a"||a.tagName==="audio"||a.tagName==="del"||a.tagName==="ins"||a.tagName==="map"||a.tagName==="noscript"||a.tagName==="video"))}function $L(e,t,a){const r=on(a,t);return!r||r.type==="element"&&r.tagName==="li"}function HL(e,t,a){const r=on(a,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function BL(e,t,a){const r=on(a,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function sb(e,t,a){const r=on(a,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function IL(e,t,a){const r=on(a,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function PL(e,t,a){const r=on(a,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function GL(e,t,a){const r=on(a,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function VL(e,t,a){const r=on(a,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function qL(e,t,a){return!on(a,t)}function FL(e,t,a){const r=on(a,t);return!r||r.type==="element"&&r.tagName==="tr"}function ib(e,t,a){const r=on(a,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const YL=W1({body:QL,colgroup:ZL,head:XL,html:KL,tbody:JL});function KL(e){const t=on(e,-1);return!t||t.type!=="comment"}function XL(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const a=e.children[0];return!a||a.type==="element"}function QL(e){const t=on(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Pu(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function ZL(e,t,a){const r=Z1(a,t),i=on(e,-1,!0);return a&&r&&r.type==="element"&&r.tagName==="colgroup"&&rp(r,a.children.indexOf(r),a)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function JL(e,t,a){const r=Z1(a,t),i=on(e,-1);return a&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&rp(r,a.children.indexOf(r),a)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Yc={name:[[`
|
|
132
|
+
\f\r &/=>`.split(""),`
|
|
133
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
134
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
135
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
136
|
+
\f\r &>`.split(""),`\0
|
|
137
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
138
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
139
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function WL(e,t,a,r){const i=r.schema,l=i.space==="svg"?!1:r.settings.omitOptionalTags;let u=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const f=[];let m;i.space==="html"&&e.tagName==="svg"&&(r.schema=_l);const h=eO(r,e.properties),g=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,g&&(u=!1),(h||!l||!YL(e,t,a))&&(f.push("<",e.tagName,h?" "+h:""),u&&(i.space==="svg"||r.settings.closeSelfClosing)&&(m=h.charAt(h.length-1),(!r.settings.tightSelfClosing||m==="/"||m&&m!=='"'&&m!=="'")&&f.push(" "),f.push("/")),f.push(">")),f.push(g),!u&&(!l||!rp(e,t,a))&&f.push("</"+e.tagName+">"),f.join("")}function eO(e,t){const a=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const l=tO(e,i,t[i]);l&&a.push(l)}}for(;++r<a.length;){const l=e.settings.tightAttributes?a[r].charAt(a[r].length-1):void 0;r!==a.length-1&&l!=='"'&&l!=="'"&&(a[r]+=" ")}return a.join("")}function tO(e,t,a){const r=v1(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,l=e.settings.allowDangerousCharacters?0:1;let u=e.quote,f;if(r.overloadedBoolean&&(a===r.attribute||a==="")?a=!0:(r.boolean||r.overloadedBoolean)&&(typeof a!="string"||a===r.attribute||a==="")&&(a=!!a),a==null||a===!1||typeof a=="number"&&Number.isNaN(a))return"";const m=ki(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Yc.name[i][l]}));return a===!0||(a=Array.isArray(a)?(r.commaSeparated?d1:_1)(a,{padLeft:!e.settings.tightCommaSeparatedLists}):String(a),e.settings.collapseEmptyAttributes&&!a)?m:(e.settings.preferUnquoted&&(f=ki(a,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Yc.unquoted[i][l]}))),f!==a&&(e.settings.quoteSmart&&rb(a,u)>rb(a,e.alternative)&&(u=e.alternative),f=u+ki(a,Object.assign({},e.settings.characterReferences,{subset:(u==="'"?Yc.single:Yc.double)[i][l],attribute:!0}))+u),m+(f&&"="+f))}const nO=["<","&"];function eS(e,t,a,r){return a&&a.type==="element"&&(a.tagName==="script"||a.tagName==="style")?e.value:ki(e.value,Object.assign({},r.settings.characterReferences,{subset:nO}))}function aO(e,t,a,r){return r.settings.allowDangerousHtml?e.value:eS(e,t,a,r)}function rO(e,t,a,r){return r.all(e)}const sO=dL("type",{invalid:iO,unknown:oO,handlers:{comment:AL,doctype:LL,element:WL,raw:aO,root:rO,text:eS}});function iO(e){throw new Error("Expected node, not `"+e+"`")}function oO(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const lO={},cO={},uO=[];function dO(e,t){const a=t||lO,r=a.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:fO,all:hO,settings:{omitOptionalTags:a.omitOptionalTags||!1,allowParseErrors:a.allowParseErrors||!1,allowDangerousCharacters:a.allowDangerousCharacters||!1,quoteSmart:a.quoteSmart||!1,preferUnquoted:a.preferUnquoted||!1,tightAttributes:a.tightAttributes||!1,upperDoctype:a.upperDoctype||!1,tightDoctype:a.tightDoctype||!1,bogusComments:a.bogusComments||!1,tightCommaSeparatedLists:a.tightCommaSeparatedLists||!1,tightSelfClosing:a.tightSelfClosing||!1,collapseEmptyAttributes:a.collapseEmptyAttributes||!1,allowDangerousHtml:a.allowDangerousHtml||!1,voids:a.voids||uL,characterReferences:a.characterReferences||cO,closeSelfClosing:a.closeSelfClosing||!1,closeEmptyElements:a.closeEmptyElements||!1},schema:a.space==="svg"?_l:b1,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function fO(e,t,a){return sO(e,t,a,this)}function hO(e){const t=[],a=e&&e.children||uO;let r=-1;for(;++r<a.length;)t[r]=this.one(a[r],r,e);return t.join("")}function tS(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 a=Array.isArray(t)?t:t.split(/\s+/g);for(const r of a)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function mO(e){const t=qu(e,!0).map(([i])=>i);function a(i){if(i===e.length)return{line:t.length-1,character:t[t.length-1].length};let l=i,u=0;for(const f of t){if(l<f.length)break;l-=f.length,u++}return{line:u,character:l}}function r(i,l){let u=0;for(let f=0;f<i;f++)u+=t[f].length;return u+=l,u}return{lines:t,indexToPos:a,posToIndex:r}}function nS(e,t,a){const r=new Set;for(const l of e.matchAll(/:?lang=["']([^"']+)["']/g)){const u=l[1].toLowerCase().trim();u&&r.add(u)}for(const l of e.matchAll(/(?:```|~~~)([\w-]+)/g)){const u=l[1].toLowerCase().trim();u&&r.add(u)}for(const l of e.matchAll(/\\begin\{([\w-]+)\}/g)){const u=l[1].toLowerCase().trim();u&&r.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&&r.add(f)}if(!a)return Array.from(r);const i=a.getBundledLanguages();return Array.from(r).filter(l=>l&&i[l])}const sp="light-dark()",pO=["color","background-color"];function gO(e,t){let a=0;const r=[];for(const i of t)i>a&&r.push({...e,content:e.content.slice(a,i),offset:e.offset+a}),a=i;return a<e.content.length&&r.push({...e,content:e.content.slice(a),offset:e.offset+a}),r}function xO(e,t){const a=Array.from(t instanceof Set?t:new Set(t)).sort((r,i)=>r-i);return a.length?e.map(r=>r.flatMap(i=>{const l=a.filter(u=>i.offset<u&&u<i.offset+i.content.length).map(u=>u-i.offset).sort((u,f)=>u-f);return l.length?gO(i,l):i})):e}function yO(e,t,a,r,i="css-vars"){const l={content:e.content,explanation:e.explanation,offset:e.offset},u=t.map(g=>wu(e.variants[g])),f=new Set(u.flatMap(g=>Object.keys(g))),m={},h=(g,y)=>{const v=y==="color"?"":y==="background-color"?"-bg":`-${y}`;return a+t[g]+(y==="color"?"":v)};return u.forEach((g,y)=>{for(const v of f){const b=g[v]||"inherit";if(y===0&&r&&pO.includes(v))if(r===sp&&u.length>1){const w=t.findIndex(j=>j==="light"),N=t.findIndex(j=>j==="dark");if(w===-1||N===-1)throw new wt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');m[v]=`light-dark(${u[w][v]||"inherit"}, ${u[N][v]||"inherit"})`,i==="css-vars"&&(m[h(y,v)]=b)}else m[v]=b;else i==="css-vars"&&(m[h(y,v)]=b)}}),l.htmlStyle=m,l}function wu(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&En.Italic&&(t["font-style"]="italic"),e.fontStyle&En.Bold&&(t["font-weight"]="bold");const a=[];e.fontStyle&En.Underline&&a.push("underline"),e.fontStyle&En.Strikethrough&&a.push("line-through"),a.length&&(t["text-decoration"]=a.join(" "))}return t}function _m(e){return typeof e=="string"?e:Object.entries(e).map(([t,a])=>`${t}:${a}`).join(";")}function vO(){const e=new WeakMap;function t(a){if(!e.has(a.meta)){let i=function(u){if(typeof u=="number"){if(u<0||u>a.source.length)throw new wt(`Invalid decoration offset: ${u}. Code length: ${a.source.length}`);return{...r.indexToPos(u),offset:u}}else{const f=r.lines[u.line];if(f===void 0)throw new wt(`Invalid decoration position ${JSON.stringify(u)}. Lines length: ${r.lines.length}`);let m=u.character;if(m<0&&(m=f.length+m),m<0||m>f.length)throw new wt(`Invalid decoration position ${JSON.stringify(u)}. Line ${u.line} length: ${f.length}`);return{...u,character:m,offset:r.posToIndex(u.line,m)}}};const r=mO(a.source),l=(a.options.decorations||[]).map(u=>({...u,start:i(u.start),end:i(u.end)}));bO(l),e.set(a.meta,{decorations:l,converter:r,source:a.source})}return e.get(a.meta)}return{name:"shiki:decorations",tokens(a){if(this.options.decorations?.length)return xO(a,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(a){if(!this.options.decorations?.length)return;const r=t(this),i=Array.from(a.children).filter(g=>g.type==="element"&&g.tagName==="span");if(i.length!==r.converter.lines.length)throw new wt(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function l(g,y,v,b){const w=i[g];let N="",j=-1,E=-1;if(y===0&&(j=0),v===0&&(E=0),v===Number.POSITIVE_INFINITY&&(E=w.children.length),j===-1||E===-1)for(let k=0;k<w.children.length;k++)N+=aS(w.children[k]),j===-1&&N.length===y&&(j=k+1),E===-1&&N.length===v&&(E=k+1);if(j===-1)throw new wt(`Failed to find start index for decoration ${JSON.stringify(b.start)}`);if(E===-1)throw new wt(`Failed to find end index for decoration ${JSON.stringify(b.end)}`);const R=w.children.slice(j,E);if(!b.alwaysWrap&&R.length===w.children.length)f(w,b,"line");else if(!b.alwaysWrap&&R.length===1&&R[0].type==="element")f(R[0],b,"token");else{const k={type:"element",tagName:"span",properties:{},children:R};f(k,b,"wrapper"),w.children.splice(j,R.length,k)}}function u(g,y){i[g]=f(i[g],y,"line")}function f(g,y,v){const b=y.properties||{},w=y.transform||(N=>N);return g.tagName=y.tagName||"span",g.properties={...g.properties,...b,class:g.properties.class},y.properties?.class&&tS(g,y.properties.class),g=w(g,v)||g,g}const m=[],h=r.decorations.sort((g,y)=>y.start.offset-g.start.offset||g.end.offset-y.end.offset);for(const g of h){const{start:y,end:v}=g;if(y.line===v.line)l(y.line,y.character,v.character,g);else if(y.line<v.line){l(y.line,y.character,Number.POSITIVE_INFINITY,g);for(let b=y.line+1;b<v.line;b++)m.unshift(()=>u(b,g));l(v.line,0,v.character,g)}}m.forEach(g=>g())}}}function bO(e){for(let t=0;t<e.length;t++){const a=e[t];if(a.start.offset>a.end.offset)throw new wt(`Invalid decoration range: ${JSON.stringify(a.start)} - ${JSON.stringify(a.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],l=a.start.offset<=i.start.offset&&i.start.offset<a.end.offset,u=a.start.offset<i.end.offset&&i.end.offset<=a.end.offset,f=i.start.offset<=a.start.offset&&a.start.offset<i.end.offset,m=i.start.offset<a.end.offset&&a.end.offset<=i.end.offset;if(l||u||f||m){if(l&&u||f&&m||f&&a.start.offset===a.end.offset||u&&i.start.offset===i.end.offset)continue;throw new wt(`Decorations ${JSON.stringify(a.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function aS(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(aS).join(""):""}const _O=[vO()];function Nu(e){const t=SO(e.transformers||[]);return[...t.pre,...t.normal,...t.post,..._O]}function SO(e){const t=[],a=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":a.push(i);break;default:r.push(i)}return{pre:t,post:a,normal:r}}var js=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],$h={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function wO(e,t){const a=e.indexOf("\x1B",t);if(a!==-1&&e[a+1]==="["){const r=e.indexOf("m",a);if(r!==-1)return{sequence:e.substring(a+2,r).split(";"),startPosition:a,position:r+1}}return{position:e.length}}function ob(e){const t=e.shift();if(t==="2"){const a=e.splice(0,3).map(r=>Number.parseInt(r));return a.length!==3||a.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:a}}else if(t==="5"){const a=e.shift();if(a)return{type:"table",index:Number(a)}}}function NO(e){const t=[];for(;e.length>0;){const a=e.shift();if(!a)continue;const r=Number.parseInt(a);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)$h[r]&&t.push({type:"setDecoration",value:$h[r]});else if(r<=29){const i=$h[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:js[r-30]}});else if(r===38){const i=ob(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:js[r-40]}});else if(r===48){const i=ob(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:js[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:js[r-100+8]}})}return t}function jO(){let e=null,t=null,a=new Set;return{parse(r){const i=[];let l=0;do{const u=wO(r,l),f=u.sequence?r.substring(l,u.startPosition):r.substring(l);if(f.length>0&&i.push({value:f,foreground:e,background:t,decorations:new Set(a)}),u.sequence){const m=NO(u.sequence);for(const h of m)h.type==="resetAll"?(e=null,t=null,a.clear()):h.type==="resetForegroundColor"?e=null:h.type==="resetBackgroundColor"?t=null:h.type==="resetDecoration"&&a.delete(h.value);for(const h of m)h.type==="setForegroundColor"?e=h.value:h.type==="setBackgroundColor"?t=h.value:h.type==="setDecoration"&&a.add(h.value)}l=u.position}while(l<r.length);return i}}}var EO={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 CO(e=EO){function t(f){return e[f]}function a(f){return`#${f.map(m=>Math.max(0,Math.min(m,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let h=0;h<js.length;h++)r.push(t(js[h]));let f=[0,95,135,175,215,255];for(let h=0;h<6;h++)for(let g=0;g<6;g++)for(let y=0;y<6;y++)r.push(a([f[h],f[g],f[y]]));let m=8;for(let h=0;h<24;h++,m+=10)r.push(a([m,m,m]));return r}function l(f){return i()[f]}function u(f){switch(f.type){case"named":return t(f.name);case"rgb":return a(f.rgb);case"table":return l(f.index)}}return{value:u}}const kO={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 RO(e,t,a){const r=Su(e,a),i=qu(t),l=CO(Object.fromEntries(js.map(f=>{const m=`terminal.ansi${f[0].toUpperCase()}${f.substring(1)}`;return[f,e.colors?.[m]||kO[f]]}))),u=jO();return i.map(f=>u.parse(f[0]).map(m=>{let h,g;m.decorations.has("reverse")?(h=m.background?l.value(m.background):e.bg,g=m.foreground?l.value(m.foreground):e.fg):(h=m.foreground?l.value(m.foreground):e.fg,g=m.background?l.value(m.background):void 0),h=es(h,r),g=es(g,r),m.decorations.has("dim")&&(h=TO(h));let y=En.None;return m.decorations.has("bold")&&(y|=En.Bold),m.decorations.has("italic")&&(y|=En.Italic),m.decorations.has("underline")&&(y|=En.Underline),m.decorations.has("strikethrough")&&(y|=En.Strikethrough),{content:m.value,offset:f[1],color:h,bgColor:g,fontStyle:y}}))}function TO(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],l=r[1],u=r[2],f=r[3];return`#${i}${i}${l}${l}${u}${u}${Math.round(Number.parseInt(`${f}${f}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const i=r[0],l=r[1],u=r[2];return`#${i}${i}${l}${l}${u}${u}80`}}}const a=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return a?`var(${a[1]}-dim)`:e}function Sm(e,t,a={}){const r=e.resolveLangAlias(a.lang||"text"),{theme:i=e.getLoadedThemes()[0]}=a;if(!Gu(r)&&!Vu(i)&&r==="ansi"){const{theme:l}=e.setTheme(i);return RO(l,t,a)}return K1(e,t,a)}function ju(e,t,a){let r,i,l,u,f,m;if("themes"in a){const{defaultColor:h="light",cssVariablePrefix:g="--shiki-",colorsRendering:y="css-vars"}=a,v=Object.entries(a.themes).filter(E=>E[1]).map(E=>({color:E[0],theme:E[1]})).sort((E,R)=>E.color===h?-1:R.color===h?1:0);if(v.length===0)throw new wt("`themes` option must not be empty");const b=X1(e,t,a,Sm);if(m=ll(b),h&&sp!==h&&!v.find(E=>E.color===h))throw new wt(`\`themes\` option must contain the defaultColor key \`${h}\``);const w=v.map(E=>e.getTheme(E.theme)),N=v.map(E=>E.color);l=b.map(E=>E.map(R=>yO(R,N,g,h,y))),m&&Fu(l,m);const j=v.map(E=>Su(E.theme,a));i=lb(v,w,j,g,h,"fg",y),r=lb(v,w,j,g,h,"bg",y),u=`shiki-themes ${w.map(E=>E.name).join(" ")}`,f=h?void 0:[i,r].join(";")}else if("theme"in a){const h=Su(a.theme,a);l=Sm(e,t,a);const g=e.getTheme(a.theme);r=es(g.bg,h),i=es(g.fg,h),u=g.name,m=ll(l)}else throw new wt("Invalid options, either `theme` or `themes` must be provided");return{tokens:l,fg:i,bg:r,themeName:u,rootStyle:f,grammarState:m}}function lb(e,t,a,r,i,l,u){return e.map((f,m)=>{const h=es(t[m][l],a[m])||"inherit",g=`${r+f.color}${l==="bg"?"-bg":""}:${h}`;if(m===0&&i){if(i===sp&&e.length>1){const y=e.findIndex(b=>b.color==="light"),v=e.findIndex(b=>b.color==="dark");if(y===-1||v===-1)throw new wt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${es(t[y][l],a[y])||"inherit"}, ${es(t[v][l],a[v])||"inherit"});${g}`}return h}return u==="css-vars"?g:null}).filter(f=>!!f).join(";")}function Eu(e,t,a,r={meta:{},options:a,codeToHast:(i,l)=>Eu(e,i,l),codeToTokens:(i,l)=>ju(e,i,l)}){let i=t;for(const w of Nu(a))i=w.preprocess?.call(r,i,a)||i;let{tokens:l,fg:u,bg:f,themeName:m,rootStyle:h,grammarState:g}=ju(e,i,a);const{mergeWhitespaces:y=!0,mergeSameStyleTokens:v=!1}=a;y===!0?l=LO(l):y==="never"&&(l=OO(l)),v&&(l=DO(l));const b={...r,get source(){return i}};for(const w of Nu(a))l=w.tokens?.call(b,l)||l;return AO(l,{...a,fg:u,bg:f,themeName:m,rootStyle:a.rootStyle===!1?!1:a.rootStyle??h},b,g)}function AO(e,t,a,r=ll(e)){const i=Nu(t),l=[],u={type:"root",children:[]},{structure:f="classic",tabindex:m="0"}=t,h={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?h.style=t.rootStyle:h.style=`background-color:${t.bg};color:${t.fg}`),m!==!1&&m!=null&&(h.tabindex=m.toString());for(const[N,j]of Object.entries(t.meta||{}))N.startsWith("_")||(h[N]=j);let g={type:"element",tagName:"pre",properties:h,children:[],data:t.data},y={type:"element",tagName:"code",properties:{},children:l};const v=[],b={...a,structure:f,addClassToHast:tS,get source(){return a.source},get tokens(){return e},get options(){return t},get root(){return u},get pre(){return g},get code(){return y},get lines(){return v}};if(e.forEach((N,j)=>{j&&(f==="inline"?u.children.push({type:"element",tagName:"br",properties:{},children:[]}):f==="classic"&&l.push({type:"text",value:`
|
|
140
|
+
`}));let E={type:"element",tagName:"span",properties:{class:"line"},children:[]},R=0;for(const k of N){let O={type:"element",tagName:"span",properties:{...k.htmlAttrs},children:[{type:"text",value:k.content}]};const I=_m(k.htmlStyle||wu(k));I&&(O.properties.style=I);for(const B of i)O=B?.span?.call(b,O,j+1,R,E,k)||O;f==="inline"?u.children.push(O):f==="classic"&&E.children.push(O),R+=k.content.length}if(f==="classic"){for(const k of i)E=k?.line?.call(b,E,j+1)||E;v.push(E),l.push(E)}else f==="inline"&&v.push(E)}),f==="classic"){for(const N of i)y=N?.code?.call(b,y)||y;g.children.push(y);for(const N of i)g=N?.pre?.call(b,g)||g;u.children.push(g)}else if(f==="inline"){const N=[];let j={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const R of u.children)R.type==="element"&&R.tagName==="br"?(N.push(j),j={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(R.type==="element"||R.type==="text")&&j.children.push(R);N.push(j);let E={type:"element",tagName:"code",properties:{},children:N};for(const R of i)E=R?.code?.call(b,E)||E;u.children=[];for(let R=0;R<E.children.length;R++){R>0&&u.children.push({type:"element",tagName:"br",properties:{},children:[]});const k=E.children[R];k.type==="element"&&u.children.push(...k.children)}}let w=u;for(const N of i)w=N?.root?.call(b,w)||w;return r&&Fu(w,r),w}function LO(e){return e.map(t=>{const a=[];let r="",i;return t.forEach((l,u)=>{const f=!(l.fontStyle&&(l.fontStyle&En.Underline||l.fontStyle&En.Strikethrough));f&&l.content.match(/^\s+$/)&&t[u+1]?(i===void 0&&(i=l.offset),r+=l.content):r?(f?a.push({...l,offset:i,content:r+l.content}):a.push({content:r,offset:i},l),i=void 0,r=""):a.push(l)}),a})}function OO(e){return e.map(t=>t.flatMap(a=>{if(a.content.match(/^\s+$/))return a;const r=a.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return a;const[,i,l,u]=r;if(!i&&!u)return a;const f=[{...a,offset:a.offset+i.length,content:l}];return i&&f.unshift({content:i,offset:a.offset}),u&&f.push({content:u,offset:a.offset+i.length+l.length}),f}))}function DO(e){return e.map(t=>{const a=[];for(const r of t){if(a.length===0){a.push({...r});continue}const i=a[a.length-1],l=_m(i.htmlStyle||wu(i)),u=_m(r.htmlStyle||wu(r)),f=i.fontStyle&&(i.fontStyle&En.Underline||i.fontStyle&En.Strikethrough),m=r.fontStyle&&(r.fontStyle&En.Underline||r.fontStyle&En.Strikethrough);!f&&!m&&l===u?i.content+=r.content:a.push({...r})}return a})}const MO=dO;function zO(e,t,a){const r={meta:{},options:a,codeToHast:(l,u)=>Eu(e,l,u),codeToTokens:(l,u)=>ju(e,l,u)};let i=MO(Eu(e,t,a,r));for(const l of Nu(a))i=l.postprocess?.call(r,i,a)||i;return i}async function UO(e){const t=await eL(e);return{getLastGrammarState:(...a)=>aL(t,...a),codeToTokensBase:(a,r)=>Sm(t,a,r),codeToTokensWithThemes:(a,r)=>X1(t,a,r),codeToTokens:(a,r)=>ju(t,a,r),codeToHast:(a,r)=>Eu(t,a,r),codeToHtml:(a,r)=>zO(t,a,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function $O(e){const t=e.langs,a=e.themes,r=e.engine;async function i(l){function u(y){if(typeof y=="string"){if(y=l.langAlias?.[y]||y,tp(y))return[];const v=t[y];if(!v)throw new wt(`Language \`${y}\` is not included in this bundle. You may want to load it from external source.`);return v}return y}function f(y){if(P1(y))return"none";if(typeof y=="string"){const v=a[y];if(!v)throw new wt(`Theme \`${y}\` is not included in this bundle. You may want to load it from external source.`);return v}return y}const m=(l.themes??[]).map(y=>f(y)),h=(l.langs??[]).map(y=>u(y)),g=await UO({engine:l.engine??r(),...l,themes:m,langs:h});return{...g,loadLanguage(...y){return g.loadLanguage(...y.map(u))},loadTheme(...y){return g.loadTheme(...y.map(f))},getBundledLanguages(){return t},getBundledThemes(){return a}}}return i}function HO(e){let t;async function a(r={}){if(t){const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}else{t=e({...r,themes:[],langs:[]});const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}}return a}function BO(e,t){const a=HO(e);async function r(i,l){const u=await a({langs:[l.lang],themes:"theme"in l?[l.theme]:Object.values(l.themes)}),f=await t?.guessEmbeddedLanguages?.(i,l.lang,u);return f&&await u.loadLanguage(...f),u}return{getSingletonHighlighter(i){return a(i)},async codeToHtml(i,l){return(await r(i,l)).codeToHtml(i,l)},async codeToHast(i,l){return(await r(i,l)).codeToHast(i,l)},async codeToTokens(i,l){return(await r(i,l)).codeToTokens(i,l)},async codeToTokensBase(i,l){return(await r(i,l)).codeToTokensBase(i,l)},async codeToTokensWithThemes(i,l){return(await r(i,l)).codeToTokensWithThemes(i,l)},async getLastGrammarState(i,l){return(await a({langs:[l.lang],themes:[l.theme]})).getLastGrammarState(i,l)}}}var cb=Object.prototype.hasOwnProperty;function ub(e,t,a){for(a of e.keys())if(Jo(a,t))return a}function Jo(e,t){var a,r,i;if(e===t)return!0;if(e&&t&&(a=e.constructor)===t.constructor){if(a===Date)return e.getTime()===t.getTime();if(a===RegExp)return e.toString()===t.toString();if(a===Array){if((r=e.length)===t.length)for(;r--&&Jo(e[r],t[r]););return r===-1}if(a===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i=="object"&&(i=ub(t,i),!i)||!t.has(i))return!1;return!0}if(a===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i=="object"&&(i=ub(t,i),!i)||!Jo(r[1],t.get(i)))return!1;return!0}if(a===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(a===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!a||typeof e=="object"){r=0;for(a in e)if(cb.call(e,a)&&++r&&!cb.call(t,a)||!(a in t)||!Jo(e[a],t[a]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function rS(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(a=rS(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function db(){for(var e,t,a=0,r="",i=arguments.length;a<i;a++)(e=arguments[a])&&(t=rS(e))&&(r&&(r+=" "),r+=t);return r}var Hh=e=>{const t=_.useRef(e);return e!==t.current&&!Jo(e,t.current)&&(t.current=e),t.current},IO=(e,t,a)=>{const r=Date.now();clearTimeout(t.current.timeoutId);const i=Math.max(0,t.current.nextAllowedTime-r);t.current.timeoutId=setTimeout(()=>{e().catch(console.error),t.current.nextAllowedTime=r+a},i)},sS="plaintext",fb=e=>e==null?[]:Array.isArray(e)?e:[e],PO=e=>e==null?null:typeof e=="string"?`s:${e}`:`o:${e.name}::${e.scopeName}`,hb=e=>{const t=new Set,a=[];for(const r of e){const i=PO(r);i==null||t.has(i)||(t.add(i),a.push(r))}return a},GO=(e,t)=>e==null?!1:typeof e=="string"?e in t:typeof e.name=="string"&&typeof e.scopeName=="string",VO=(e,t)=>tp(e)||t.includes(e)?e:sS,qO=(e,t,a,r)=>{const i=fb(t),l=fb(r),u=[...i,...l];let f=sS,m;if(e==null||typeof e=="string"&&!e.trim())return{languageId:f,langsToLoad:hb([...l,...i])};if(typeof e=="object")f=e.name,m=e;else{const h=e.toLowerCase(),g=v=>v?.toLowerCase()===h,y=u.find(v=>typeof v=="object"&&v!=null&&!!(g(v.name)||g(v.scopeName)||g(v.scopeName?.split(".").pop())||v.aliases?.some(g)||v.fileTypes?.some(g)));y?(f=y.name||e,m=y):a?.[e]?(f=a[e],m=a[e]):(f=e,m=e)}return{languageId:f,langsToLoad:hb([m,...l,...i])}},mb=e=>typeof e=="object"&&e!==null&&"tokenColors"in e&&Array.isArray(e.tokenColors);function FO(e){const t=mb(e),a=typeof e=="object"&&e!==null&&!t,r=typeof e=="object"&&e!==null&&!t&&Object.entries(e).some(([i,l])=>i.trim()!==""&&(typeof l=="string"&&l.trim()!==""||mb(l)));return a?{isMultiTheme:!0,themeId:r?`multi-${Object.values(e).map(l=>(typeof l=="string"?l:l?.name)||"custom").sort().join("-")}`:"multi-default",multiTheme:r?e:null,themesToLoad:r?Object.values(e):[]}:{isMultiTheme:!1,themeId:typeof e=="string"?e:e?.name||"custom",singleTheme:e,themesToLoad:[e]}}function YO(e=1){return{name:"react-shiki:line-numbers",code(t){if(this.addClassToHast(t,"has-line-numbers"),e!==1){const a=t.properties?.style||"",r=a?`${a}; --line-start: ${e}`:`--line-start: ${e}`;t.properties={...t.properties,style:r}}},line(t){return this.addClassToHast(t,"line-numbers"),t}}}var pb={light:"github-light",dark:"github-dark"},KO=(e,t)=>e.isMultiTheme?{themes:e.multiTheme??pb,defaultColor:t.defaultColor,cssVariablePrefix:t.cssVariablePrefix}:{theme:e.singleTheme??pb.dark},XO=e=>{const t=[...e.transformers||[]];return e.showLineNumbers&&t.push(YO(e.startingLineNumber)),t},QO=({languageId:e,resolvedTheme:t,options:a})=>{const{defaultColor:r,cssVariablePrefix:i,showLineNumbers:l,startingLineNumber:u,transformers:f,...m}=a;return{lang:e,...KO(t,a),...m,transformers:XO(a)}},ZO=(e,t,a)=>{const r=a.getBundledLanguages();return nS(e).flatMap(i=>r[i]??[])},JO=(e,t,a,r={},i)=>{const[l,u]=_.useState(null),f=Hh(t),m=Hh(a),h=Hh(r),{languageId:g,langsToLoad:y}=_.useMemo(()=>qO(f,h.customLanguages,h.langAlias,h.preloadLanguages),[f,h.customLanguages,h.preloadLanguages,h.langAlias]),v=_.useMemo(()=>FO(m),[m]),{themesToLoad:b}=v,w=_.useRef({nextAllowedTime:0,timeoutId:void 0}),N=_.useMemo(()=>QO({languageId:g,resolvedTheme:v,options:h}),[g,v,h]);return _.useEffect(()=>{let j=!0;const E=async()=>{if(!g)return;const k=h.highlighter?h.highlighter:await i(y,b,h.engine);if(!h.highlighter){const B=ZO(e,g,k);B.length>0&&await k.loadLanguage(...B)}const O=VO(g,k.getLoadedLanguages()),I={...N,lang:O};if(j){const B=h.outputFormat==="html"?k.codeToHtml(e,I):PT(k.codeToHast(e,I),{jsx:d.jsx,jsxs:d.jsxs,Fragment:d.Fragment});u(B)}},{delay:R}=h;return R?IO(E,w,R):E().catch(console.error),()=>{j=!1,clearTimeout(w.current.timeoutId)}},[e,N,h.delay,h.highlighter,y,b]),l};function WO(e,{insertAt:t}={}){if(typeof document>"u")return;const a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&a.firstChild?a.insertBefore(r,a.firstChild):a.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}WO(`.relative {
|
|
141
|
+
position: relative;
|
|
142
|
+
}
|
|
143
|
+
.defaultStyles pre {
|
|
144
|
+
overflow: auto;
|
|
145
|
+
border-radius: 0.5rem;
|
|
146
|
+
padding-left: 1.5rem;
|
|
147
|
+
padding-right: 1.5rem;
|
|
148
|
+
padding-top: 1.25rem;
|
|
149
|
+
padding-bottom: 1.25rem;
|
|
150
|
+
}
|
|
151
|
+
.languageLabel {
|
|
152
|
+
position: absolute;
|
|
153
|
+
right: 0.75rem;
|
|
154
|
+
top: 0.5rem;
|
|
155
|
+
font-family: monospace;
|
|
156
|
+
font-size: 0.75rem;
|
|
157
|
+
letter-spacing: -0.05em;
|
|
158
|
+
color: rgba(107, 114, 128, 0.85);
|
|
159
|
+
}
|
|
160
|
+
.line-numbers::before {
|
|
161
|
+
counter-increment: line-number;
|
|
162
|
+
content: counter(line-number);
|
|
163
|
+
display: inline-flex;
|
|
164
|
+
justify-content: flex-end;
|
|
165
|
+
align-items: flex-start;
|
|
166
|
+
box-sizing: content-box;
|
|
167
|
+
min-width: var(--line-numbers-width, 2ch);
|
|
168
|
+
padding-left: var(--line-numbers-padding-left, 2ch);
|
|
169
|
+
padding-right: var(--line-numbers-padding-right, 2ch);
|
|
170
|
+
color: var(--line-numbers-foreground, rgba(107, 114, 128, 0.6));
|
|
171
|
+
font-size: var(--line-numbers-font-size, inherit);
|
|
172
|
+
font-weight: var(--line-numbers-font-weight, inherit);
|
|
173
|
+
line-height: var(--line-numbers-line-height, inherit);
|
|
174
|
+
font-family: var(--line-numbers-font-family, inherit);
|
|
175
|
+
opacity: var(--line-numbers-opacity, 1);
|
|
176
|
+
user-select: none;
|
|
177
|
+
pointer-events: none;
|
|
178
|
+
}
|
|
179
|
+
.has-line-numbers {
|
|
180
|
+
counter-reset: line-number calc(var(--line-start, 1) - 1);
|
|
181
|
+
--line-numbers-foreground: rgba(107, 114, 128, 0.5);
|
|
182
|
+
--line-numbers-width: 2ch;
|
|
183
|
+
--line-numbers-padding-left: 0ch;
|
|
184
|
+
--line-numbers-padding-right: 2ch;
|
|
185
|
+
--line-numbers-font-size: inherit;
|
|
186
|
+
--line-numbers-font-weight: inherit;
|
|
187
|
+
--line-numbers-line-height: inherit;
|
|
188
|
+
--line-numbers-font-family: inherit;
|
|
189
|
+
--line-numbers-opacity: 1;
|
|
190
|
+
}
|
|
191
|
+
`);var e3=e=>_.forwardRef(({language:t,theme:a,delay:r,transformers:i,defaultColor:l,cssVariablePrefix:u,addDefaultStyles:f=!0,style:m,langStyle:h,className:g,langClassName:y,showLanguage:v=!0,showLineNumbers:b=!1,startingLineNumber:w=1,children:N,as:j="pre",customLanguages:E,preloadLanguages:R,...k},O)=>{const I={delay:r,transformers:i,customLanguages:E,preloadLanguages:R,showLineNumbers:b,defaultColor:l,cssVariablePrefix:u,startingLineNumber:w,...k},B=typeof t=="object"?t.name||null:t?.trim()||null,H=e(N,t,a,I),T=typeof H=="string";return d.jsxs(j,{ref:O,"data-testid":"shiki-container",className:db("relative","not-prose",f&&"defaultStyles",g),style:m,id:"shiki-container",children:[v&&B?d.jsx("span",{className:db("languageLabel",y),style:h,id:"language-label",children:B}):null,T?d.jsx("div",{dangerouslySetInnerHTML:{__html:H}}):H]})}),ip=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function t3(){return 2147483648}function n3(){return typeof performance<"u"?performance.now():Date.now()}const a3=(e,t)=>e+(t-e%t)%t;async function r3(e){let t,a;const r={};function i(b){a=b,r.HEAPU8=new Uint8Array(b),r.HEAPU32=new Uint32Array(b)}function l(b,w,N){r.HEAPU8.copyWithin(b,w,w+N)}function u(b){try{return t.grow(b-a.byteLength+65535>>>16),i(t.buffer),1}catch{}}function f(b){const w=r.HEAPU8.length;b=b>>>0;const N=t3();if(b>N)return!1;for(let j=1;j<=4;j*=2){let E=w*(1+.2/j);E=Math.min(E,b+100663296);const R=Math.min(N,a3(Math.max(b,E),65536));if(u(R))return!0}return!1}const m=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(b,w,N=1024){const j=w+N;let E=w;for(;b[E]&&!(E>=j);)++E;if(E-w>16&&b.buffer&&m)return m.decode(b.subarray(w,E));let R="";for(;w<E;){let k=b[w++];if(!(k&128)){R+=String.fromCharCode(k);continue}const O=b[w++]&63;if((k&224)===192){R+=String.fromCharCode((k&31)<<6|O);continue}const I=b[w++]&63;if((k&240)===224?k=(k&15)<<12|O<<6|I:k=(k&7)<<18|O<<12|I<<6|b[w++]&63,k<65536)R+=String.fromCharCode(k);else{const B=k-65536;R+=String.fromCharCode(55296|B>>10,56320|B&1023)}}return R}function g(b,w){return b?h(r.HEAPU8,b,w):""}const y={emscripten_get_now:n3,emscripten_memcpy_big:l,emscripten_resize_heap:f,fd_write:()=>0};async function v(){const w=await e({env:y,wasi_snapshot_preview1:y});t=w.memory,i(t.buffer),Object.assign(r,w),r.UTF8ToString=g}return await v(),r}var s3=Object.defineProperty,i3=(e,t,a)=>t in e?s3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,an=(e,t,a)=>i3(e,typeof t!="symbol"?t+"":t,a);let fn=null;function o3(e){throw new ip(e.UTF8ToString(e.getLastOnigError()))}class Ku{constructor(t){an(this,"utf16Length"),an(this,"utf8Length"),an(this,"utf16Value"),an(this,"utf8Value"),an(this,"utf16OffsetToUtf8"),an(this,"utf8OffsetToUtf16");const a=t.length,r=Ku._utf8ByteLength(t),i=r!==a,l=i?new Uint32Array(a+1):null;i&&(l[a]=r);const u=i?new Uint32Array(r+1):null;i&&(u[r]=a);const f=new Uint8Array(r);let m=0;for(let h=0;h<a;h++){const g=t.charCodeAt(h);let y=g,v=!1;if(g>=55296&&g<=56319&&h+1<a){const b=t.charCodeAt(h+1);b>=56320&&b<=57343&&(y=(g-55296<<10)+65536|b-56320,v=!0)}i&&(l[h]=m,v&&(l[h+1]=m),y<=127?u[m+0]=h:y<=2047?(u[m+0]=h,u[m+1]=h):y<=65535?(u[m+0]=h,u[m+1]=h,u[m+2]=h):(u[m+0]=h,u[m+1]=h,u[m+2]=h,u[m+3]=h)),y<=127?f[m++]=y:y<=2047?(f[m++]=192|(y&1984)>>>6,f[m++]=128|(y&63)>>>0):y<=65535?(f[m++]=224|(y&61440)>>>12,f[m++]=128|(y&4032)>>>6,f[m++]=128|(y&63)>>>0):(f[m++]=240|(y&1835008)>>>18,f[m++]=128|(y&258048)>>>12,f[m++]=128|(y&4032)>>>6,f[m++]=128|(y&63)>>>0),v&&h++}this.utf16Length=a,this.utf8Length=r,this.utf16Value=t,this.utf8Value=f,this.utf16OffsetToUtf8=l,this.utf8OffsetToUtf16=u}static _utf8ByteLength(t){let a=0;for(let r=0,i=t.length;r<i;r++){const l=t.charCodeAt(r);let u=l,f=!1;if(l>=55296&&l<=56319&&r+1<i){const m=t.charCodeAt(r+1);m>=56320&&m<=57343&&(u=(l-55296<<10)+65536|m-56320,f=!0)}u<=127?a+=1:u<=2047?a+=2:u<=65535?a+=3:a+=4,f&&r++}return a}createString(t){const a=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,a),a}}const Xu=class Ga{constructor(t){if(an(this,"id",++Ga.LAST_ID),an(this,"_onigBinding"),an(this,"content"),an(this,"utf16Length"),an(this,"utf8Length"),an(this,"utf16OffsetToUtf8"),an(this,"utf8OffsetToUtf16"),an(this,"ptr"),!fn)throw new ip("Must invoke loadWasm first.");this._onigBinding=fn,this.content=t;const a=new Ku(t);this.utf16Length=a.utf16Length,this.utf8Length=a.utf8Length,this.utf16OffsetToUtf8=a.utf16OffsetToUtf8,this.utf8OffsetToUtf16=a.utf8OffsetToUtf16,this.utf8Length<1e4&&!Ga._sharedPtrInUse?(Ga._sharedPtr||(Ga._sharedPtr=fn.omalloc(1e4)),Ga._sharedPtrInUse=!0,fn.HEAPU8.set(a.utf8Value,Ga._sharedPtr),this.ptr=Ga._sharedPtr):this.ptr=a.createString(fn)}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===Ga._sharedPtr?Ga._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};an(Xu,"LAST_ID",0);an(Xu,"_sharedPtr",0);an(Xu,"_sharedPtrInUse",!1);let iS=Xu;class l3{constructor(t){if(an(this,"_onigBinding"),an(this,"_ptr"),!fn)throw new ip("Must invoke loadWasm first.");const a=[],r=[];for(let f=0,m=t.length;f<m;f++){const h=new Ku(t[f]);a[f]=h.createString(fn),r[f]=h.utf8Length}const i=fn.omalloc(4*t.length);fn.HEAPU32.set(a,i/4);const l=fn.omalloc(4*t.length);fn.HEAPU32.set(r,l/4);const u=fn.createOnigScanner(i,l,t.length);for(let f=0,m=t.length;f<m;f++)fn.ofree(a[f]);fn.ofree(l),fn.ofree(i),u===0&&o3(fn),this._onigBinding=fn,this._ptr=u}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,a,r){let i=0;if(typeof r=="number"&&(i=r),typeof t=="string"){t=new iS(t);const l=this._findNextMatchSync(t,a,!1,i);return t.dispose(),l}return this._findNextMatchSync(t,a,!1,i)}_findNextMatchSync(t,a,r,i){const l=this._onigBinding,u=l.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(a),i);if(u===0)return null;const f=l.HEAPU32;let m=u/4;const h=f[m++],g=f[m++],y=[];for(let v=0;v<g;v++){const b=t.convertUtf8OffsetToUtf16(f[m++]),w=t.convertUtf8OffsetToUtf16(f[m++]);y[v]={start:b,end:w,length:w-b}}return{index:h,captureIndices:y}}}function c3(e){return typeof e.instantiator=="function"}function u3(e){return typeof e.default=="function"}function d3(e){return typeof e.data<"u"}function f3(e){return typeof Response<"u"&&e instanceof Response}function h3(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 Kc;function oS(e){if(Kc)return Kc;async function t(){fn=await r3(async a=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(a)),typeof r=="function"&&(r=await r(a)),c3(r)?r=await r.instantiator(a):u3(r)?r=await r.default(a):(d3(r)&&(r=r.data),f3(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await m3(r)(a):r=await p3(r)(a):h3(r)?r=await Bh(r)(a):r instanceof WebAssembly.Module?r=await Bh(r)(a):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Bh(r.default)(a))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Kc=t(),Kc}function Bh(e){return t=>WebAssembly.instantiate(e,t)}function m3(e){return t=>WebAssembly.instantiateStreaming(e,t)}function p3(e){return async t=>{const a=await e.arrayBuffer();return WebAssembly.instantiate(a,t)}}let lS;function g3(e){lS=e}function x3(){return lS}async function cS(e){return e&&await oS(e),{createScanner(t){return new l3(t.map(a=>typeof a=="string"?a:a.source))},createString(t){return new iS(t)}}}const y3=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:cS,getDefaultWasmLoader:x3,loadWasm:oS,setDefaultWasmLoader:g3},Symbol.toStringTag,{value:"Module"}));var uS=oA({});cA(uS,y3);const v3=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>ne(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>ne(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>ne(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>ne(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>ne(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>ne(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>ne(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>ne(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>ne(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>ne(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>ne(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>ne(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>ne(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>ne(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>ne(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>ne(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>ne(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>ne(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>ne(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>ne(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>ne(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>ne(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>ne(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>ne(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>ne(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>ne(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>ne(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>ne(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>ne(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>ne(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>ne(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>ne(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>ne(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>ne(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>ne(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>ne(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>ne(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>ne(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>ne(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>ne(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>ne(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>ne(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>ne(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>ne(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>ne(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>ne(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>ne(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>ne(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>ne(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>ne(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>ne(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>ne(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>ne(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>ne(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>ne(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>ne(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>ne(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>ne(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>ne(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>ne(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>ne(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>ne(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>ne(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>ne(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>ne(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],b3=Object.fromEntries(v3.map(e=>[e.id,e.import])),dS=[{id:"angular-html",name:"Angular HTML",import:(()=>ne(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>ne(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"astro",name:"Astro",import:(()=>ne(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([6,7,2,8,3,9,10])))},{id:"blade",name:"Blade",import:(()=>ne(()=>import("./blade-BjGOyj-B.js"),__vite__mapDeps([11,12,1,2,3,13,14,15,7])))},{id:"c",name:"C",import:(()=>ne(()=>import("./c-BIGW1oBm.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>ne(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([16,2])))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>ne(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([17,18,19,20,15])))},{id:"css",name:"CSS",import:(()=>ne(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>ne(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"glsl",name:"GLSL",import:(()=>ne(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([19,20])))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>ne(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([21,2,8,22,10])))},{id:"haml",name:"Ruby Haml",import:(()=>ne(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([23,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>ne(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([24,1,2,3,25])))},{id:"html",name:"HTML",import:(()=>ne(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>ne(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([12,1,2,3])))},{id:"http",name:"HTTP",import:(()=>ne(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([26,27,7,13,14,21,2,8,22,10])))},{id:"hurl",name:"Hurl",import:(()=>ne(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([28,21,2,8,22,10,13,14,29])))},{id:"imba",name:"Imba",import:(()=>ne(()=>import("./imba-DGztddWO.js"),[]))},{id:"java",name:"Java",import:(()=>ne(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>ne(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>ne(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([30,1,2,3])))},{id:"jison",name:"Jison",import:(()=>ne(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([31,2])))},{id:"json",name:"JSON",import:(()=>ne(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>ne(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>ne(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>ne(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>ne(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>ne(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([32,17,18,19,20,15,33,2,34])))},{id:"less",name:"Less",import:(()=>ne(()=>import("./less-B1dDrJ26.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>ne(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>ne(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([35,3,36,5,8])))},{id:"mdc",name:"MDC",import:(()=>ne(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([37,38,25,12,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>ne(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"php",name:"PHP",import:(()=>ne(()=>import("./php-R6g_5hLQ.js"),__vite__mapDeps([39,1,2,3,13,14,15,7])))},{id:"postcss",name:"PostCSS",import:(()=>ne(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>ne(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([40,2,3,1])))},{id:"python",name:"Python",aliases:["py"],import:(()=>ne(()=>import("./python-B6aJPvgy.js"),[]))},{id:"r",name:"R",import:(()=>ne(()=>import("./r-Dspwwk_N.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>ne(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"sass",name:"Sass",import:(()=>ne(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scss",name:"SCSS",import:(()=>ne(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>ne(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"sql",name:"SQL",import:(()=>ne(()=>import("./sql-BLtJtn59.js"),[]))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>ne(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>ne(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([41,2,8,3,9])))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>ne(()=>import("./ts-tags-DQrlYJgV.js"),__vite__mapDeps([42,8,3,2,19,20,1,15,13,14])))},{id:"tsx",name:"TSX",import:(()=>ne(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>ne(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"vue",name:"Vue",import:(()=>ne(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([43,3,2,8,7,1,12])))},{id:"vue-html",name:"Vue HTML",import:(()=>ne(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([44,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>ne(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([45,3,5,36,46,9,2])))},{id:"wasm",name:"WebAssembly",import:(()=>ne(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>ne(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>ne(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"xml",name:"XML",import:(()=>ne(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([13,14])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>ne(()=>import("./yaml-Buea-lGh.js"),[]))}],_3=Object.fromEntries(dS.map(e=>[e.id,e.import])),S3=Object.fromEntries(dS.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),fS={..._3,...S3},w3=$O({langs:fS,themes:b3,engine:()=>(0,uS.createOnigurumaEngine)(ne(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{getSingletonHighlighter:N3}=BO(w3,{guessEmbeddedLanguages:nS});async function j3(e,t,a){const r=e.filter(i=>GO(i,fS));return await N3({langs:r,themes:t,engine:a??cS(ne(()=>import("./wasm-CG6Dc4jp.js"),[]))})}var E3=(e,t,a,r={})=>JO(e,t,a,r,j3),C3=e3(E3),k3=C3;const R3={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 T3(e){if(!e)return"plaintext";const t=e.split(".").pop()?.toLowerCase();return t?R3[t]??"plaintext":"plaintext"}function gb({code:e,language:t,sourcePath:a}){const r=qm(f=>f.theme),l=(r==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":r)==="dark"?"github-dark":"github-light",u=t??T3(a);return d.jsx("div",{className:"flex min-w-0 flex-1 flex-col rounded border border-c4a-border-subtle overflow-auto c4a-scrollbar [&>*]:flex-1 [&_pre]:min-h-full [&_pre]:whitespace-pre-wrap [&_pre]:break-words",children:d.jsx(k3,{language:u,theme:l,children:e})})}let Xc=null,Qc=[];const Zc=ns((e,t)=>({cache:new Map,pending:new Set,resolve:a=>{const{cache:r,pending:i}=t(),l=a.filter(u=>!r.has(u)&&!i.has(u)&&!Qc.includes(u));l.length!==0&&(Qc.push(...l),e({pending:new Set([...i,...l])}),Xc&&clearTimeout(Xc),Xc=setTimeout(()=>{const u=[...Qc];Qc=[],Xc=null,u.length!==0&&De.post("/resolve",{refs:u}).then(f=>{const{cache:m,pending:h}=t(),g=new Map(m),y=new Set(h);for(const v of u){const b=f[v];b?g.set(v,b):g.set(v,{exists:!1}),y.delete(v)}e({cache:g,pending:y})}).catch(()=>{const{cache:f,pending:m}=t(),h=new Map(f),g=new Set(m);for(const y of u)h.set(y,{error:!0,exists:!1}),g.delete(y);e({cache:h,pending:g})})},50))},retry:a=>{const{cache:r}=t(),i=new Map(r);i.delete(a),e({cache:i}),t().resolve([a])}})),Ih="/studio",aa={entity:e=>`${Ih}/entities/${e}`,relation:e=>`${Ih}/relations/${e}`,content:e=>`${Ih}/contents/${e}`},hS=/^ref:(entity|relation|content):(.+)$/;function A3(e){const t=hS.exec(e);return!t||!t[2]?null:{type:t[1],id:t[2]}}function op(e){return typeof e=="string"&&hS.test(e)}const xb={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function L3(e,t){if(e.type==="content")return"📄";if(e.type==="relation")return"🔗";const a=t?.entity_type;return a&&xb[a]?xb[a]:"🔹"}function O3(e){switch(e.type){case"entity":return aa.entity(e.id);case"relation":return aa.relation(e.id);case"content":return aa.content(e.id);default:return"#"}}function lp({pointer:e}){const t=Ot(),{t:a}=ye(),r=$i(),i=Zc(b=>b.cache),l=Zc(b=>b.pending);_.useEffect(()=>{Zc.getState().resolve([e])},[e]);const u=A3(e);if(!u)return d.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:e});const f=i.get(e);if(l.has(e)||!f&&!i.has(e))return d.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 d.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted cursor-pointer",title:a("ref.retry"),onClick:()=>Zc.getState().retry(e),children:["<",a("ref.unknown"),": ",u.id.slice(0,12),">"]});if(f&&!f.exists)return d.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted line-through",title:e,children:["<",a("ref.stale"),": ",u.id.slice(0,12),">"]});const h=L3(u,f),g=u.type==="relation"?f?.relation_type||u.id.slice(0,12):f?.name||u.id.slice(0,12),y=O3(u),v=()=>{r?.active?r.navigate(u.type,u.id,g,h):t(y)};return d.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:[d.jsx("span",{children:h}),d.jsx("span",{children:g})]})}function Oi({data:e,defaultExpanded:t=2}){return d.jsx("div",{className:"font-mono text-xs",children:d.jsx(wm,{value:e,depth:0,defaultExpanded:t})})}function wm({keyName:e,value:t,depth:a,defaultExpanded:r}){const[i,l]=_.useState(a<r);if(typeof t=="string"&&op(t))return d.jsxs("div",{className:"flex items-baseline gap-1",style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsx(lp,{pointer:t})]});if(t==null)return d.jsxs("div",{style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsx("span",{className:"text-c4a-text-muted",children:"null"})]});if(typeof t=="string")return d.jsxs("div",{style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsxs("span",{className:"text-c4a-accent",children:['"',t,'"']})]});if(typeof t=="number")return d.jsxs("div",{style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsx("span",{className:"text-c4a-success",children:t})]});if(typeof t=="boolean")return d.jsxs("div",{style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsx("span",{className:"text-c4a-warning",children:String(t)})]});if(Array.isArray(t))return t.length===0?d.jsxs("div",{style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsx("span",{className:"text-c4a-text-muted",children:"[]"})]}):d.jsxs("div",{children:[d.jsxs("div",{style:{paddingLeft:a*16},className:"cursor-pointer hover:bg-c4a-bg-hover rounded px-1 -mx-1",onClick:()=>l(!i),children:[d.jsx("span",{className:"text-c4a-text-muted mr-1",children:i?"▼":"▶"}),e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),!i&&d.jsxs("span",{className:"text-c4a-text-muted",children:["[",t.length," items]"]})]}),i&&t.map((u,f)=>d.jsx(wm,{keyName:String(f),value:u,depth:a+1,defaultExpanded:r},f))]});if(typeof t=="object"){const u=Object.entries(t);return u.length===0?d.jsxs("div",{style:{paddingLeft:a*16},children:[e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),d.jsx("span",{className:"text-c4a-text-muted",children:"{}"})]}):d.jsxs("div",{children:[d.jsxs("div",{style:{paddingLeft:a*16},className:"cursor-pointer hover:bg-c4a-bg-hover rounded px-1 -mx-1",onClick:()=>l(!i),children:[d.jsx("span",{className:"text-c4a-text-muted mr-1",children:i?"▼":"▶"}),e!==void 0&&d.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),!i&&d.jsx("span",{className:"text-c4a-text-muted",children:"{ ... }"})]}),i&&u.map(([f,m])=>d.jsx(wm,{keyName:f,value:m,depth:a+1,defaultExpanded:r},f))]})}return null}const D3={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function yb({entity:e}){const t=Ot(),a=$i(),r=D3[e.type]??"🔹",i=()=>{a?.active?a.navigate("entity",e.id,e.name,r):t(aa.entity(e.id))};return d.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3 cursor-pointer hover:border-c4a-accent transition-colors",onClick:i,children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"shrink-0",children:r}),d.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:e.name}),e.kind&&d.jsx(Vt,{variant:"muted",children:e.kind})]})})}function vb({data:e}){const{t}=ye(),a=Ot(),r=$i(),i=e.manifest?.dependencies,l=i?Object.entries(i):[],u=(f,m)=>{r?.active?r.navigate("content",f,m,"📄"):a(aa.content(f))};return d.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{children:"📦"}),d.jsx("span",{className:"font-mono text-lg font-bold text-c4a-text-primary",children:e.name??t("package.unknown")})]}),d.jsxs("div",{className:"mt-1 flex items-center gap-2 text-xs",children:[e.manifest_type&&d.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}),e.path&&d.jsx("span",{className:"font-mono text-c4a-text-muted",children:e.path})]})]}),e.last_commit_hash&&d.jsxs("div",{className:"mt-3",children:[d.jsx("h4",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-tertiary mb-2",children:t("package.last_commit")}),d.jsxs("div",{className:"font-mono text-xs text-c4a-text-muted",children:[d.jsx("span",{children:e.last_commit_hash.slice(0,7)}),e.last_commit_message&&d.jsx("span",{className:"ml-2 text-c4a-text-secondary",children:e.last_commit_message}),e.last_commit_date&&d.jsx("span",{className:"ml-2",children:e.last_commit_date})]})]}),d.jsxs("div",{className:"mt-3",children:[d.jsx("h4",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-tertiary mb-2",children:t("package.dependencies")}),l.length===0?d.jsx("p",{className:"font-mono text-xs text-c4a-text-muted",children:t("package.no_dependencies")}):d.jsx("div",{className:"space-y-0.5",children:l.map(([f,m])=>d.jsxs("div",{className:"flex justify-between font-mono text-xs",children:[d.jsx("span",{className:"text-c4a-text-primary",children:f}),d.jsx("span",{className:"text-c4a-text-muted",children:m})]},f))})]}),e.files&&e.files.length>0&&d.jsxs("div",{className:"mt-3",children:[d.jsxs("h4",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-tertiary mb-2",children:[t("package.files")," (",e.files.length,")"]}),d.jsx("div",{className:"space-y-0.5",children:e.files.map(f=>d.jsxs("div",{className:"flex items-center justify-between font-mono text-xs",children:[d.jsxs("span",{className:"flex items-center gap-1 text-c4a-text-secondary",children:[d.jsx("span",{children:"📄"}),d.jsx("span",{children:f.path})]}),f.hash_id&&d.jsx("span",{className:"font-mono text-[10px] text-c4a-accent hover:underline cursor-pointer",onClick:()=>u(f.hash_id,f.path),children:f.hash_id.slice(0,12)})]},f.path))})]})]})}function bb(e){try{const t=JSON.parse(e);return t&&typeof t=="object"&&"manifest_type"in t}catch{return!1}}function mS({hashId:e,sourcePath:t}){const{t:a}=ye(),[r,i]=_.useState(null),[l,u]=_.useState(null),[f,m]=_.useState("raw");_.useEffect(()=>{e&&(u(null),De.get(`/contents/${e}`).then(g=>{i(g),m("raw")}).catch(g=>{g instanceof Ln&&g.status===404?u("not_found"):u("load_failed")}))},[e]);const h=!l&&r;return d.jsx("div",{className:"flex flex-1 flex-col",children:d.jsxs(Km,{value:f,onChange:g=>m(g),children:[d.jsx("div",{children:d.jsxs(Xm,{children:[d.jsx(Va,{value:"raw",children:a("content.detail.tab.raw")}),d.jsx(Va,{value:"digest",children:a("content.detail.tab.digest")}),d.jsx(Va,{value:"extraction",children:a("content.detail.tab.extraction")}),d.jsx(Va,{value:"entities",children:a("content.detail.tab.entities")})]})}),d.jsx("div",{className:"mt-4 flex flex-1 flex-col",children:l?d.jsx(Cn,{title:a(`common.error.${l}`),description:a(`common.error.${l}_description`)}):h?d.jsxs(d.Fragment,{children:[d.jsx(Sa,{value:"raw",children:d.jsx(M3,{hashId:r.hash_id,sourcePath:t})}),d.jsx(Sa,{value:"digest",children:d.jsx(z3,{hashId:r.hash_id})}),d.jsx(Sa,{value:"extraction",children:d.jsx(U3,{hashId:r.hash_id})}),d.jsx(Sa,{value:"entities",children:d.jsx($3,{hashId:r.hash_id})})]}):d.jsx(wl,{})})]})})}function wl(){return d.jsx("div",{className:"flex flex-1 items-center justify-center pb-15",children:d.jsx(sn,{size:24,className:"animate-spin text-c4a-text-muted"})})}function M3({hashId:e,sourcePath:t}){const{t:a}=ye(),[r,i]=_.useState(null),[l,u]=_.useState(!1),[f,m]=_.useState(!1);if(_.useEffect(()=>{u(!1),De.get(`/contents/${e}/raw`).then(h=>{i(h),u(!0),m(!1)}).catch(h=>{h instanceof Ln&&h.status===404&&m(!0),u(!0)})},[e]),!l){if(r){if(bb(r.content))try{return d.jsx(vb,{data:JSON.parse(r.content)})}catch{}return d.jsx(gb,{code:r.content,sourcePath:t})}return d.jsx(wl,{})}if(f||!r||r.source==="unavailable")return d.jsx(Cn,{title:a("common.empty.content_raw.title"),description:a("common.empty.content_raw.description")});if(bb(r.content))try{const h=JSON.parse(r.content);return d.jsx(vb,{data:h})}catch{}return d.jsx(gb,{code:r.content,sourcePath:t})}function z3({hashId:e}){const{t}=ye(),[a,r]=_.useState(null),[i,l]=_.useState(!1),[u,f]=_.useState(!1);return _.useEffect(()=>{l(!1),De.get(`/contents/${e}/digest`).then(m=>{r(m),l(!0),f(!1)}).catch(m=>{m instanceof Ln&&m.status===404&&f(!0),l(!0)})},[e]),i?u||!a?d.jsx(Cn,{title:t("common.empty.content_digest.title"),description:t("common.empty.content_digest.description")}):d.jsxs("div",{className:"flex flex-1 flex-col gap-3",children:[a.digest_data.language&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-xs text-c4a-text-muted",children:[t("content.detail.language"),":"]}),d.jsx(Vt,{children:a.digest_data.language})]}),d.jsx("div",{className:"flex flex-1 flex-col overflow-auto rounded border border-c4a-border-subtle p-3",children:d.jsx(Oi,{data:a.digest_data,defaultExpanded:2})})]}):a?d.jsxs("div",{className:"flex flex-1 flex-col gap-3",children:[a.digest_data.language&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-xs text-c4a-text-muted",children:[t("content.detail.language"),":"]}),d.jsx(Vt,{children:a.digest_data.language})]}),d.jsx("div",{className:"flex flex-1 flex-col overflow-auto c4a-scrollbar rounded border border-c4a-border-subtle p-3",children:d.jsx(Oi,{data:a.digest_data,defaultExpanded:2})})]}):d.jsx(wl,{})}function U3({hashId:e}){const{t}=ye(),[a,r]=_.useState(null),[i,l]=_.useState(!1),[u,f]=_.useState(!1);return _.useEffect(()=>{l(!1),De.get(`/contents/${e}/extractions`).then(m=>{!m.extractions||m.extractions.length===0?f(!0):r(m),l(!0)}).catch(m=>{m instanceof Ln&&m.status===404&&f(!0),l(!0)})},[e]),i?u||!a?d.jsx(Cn,{title:t("common.empty.content_extraction.title"),description:t("common.empty.content_extraction.description")}):d.jsx(_b,{extractions:a.extractions}):a?d.jsx(_b,{extractions:a.extractions}):d.jsx(wl,{})}function _b({extractions:e}){const{t}=ye();return d.jsx("div",{className:"flex flex-1 flex-col gap-4 overflow-auto c4a-scrollbar",children:e.map(a=>{const r=vl(a.extraction_confidence);return d.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.model&&d.jsx(Vt,{variant:"muted",children:a.model}),r&&d.jsx(Vt,{variant:r.variant,tooltip:`confidence: ${r.value}`,children:t(r.labelKey)})]}),d.jsx(Oi,{data:{atoms:a.atoms,candidate_entities:a.candidate_entities},defaultExpanded:2})]},a.id)})})}function $3({hashId:e}){const{t}=ye(),[a,r]=_.useState([]),[i,l]=_.useState(!1),[u,f]=_.useState(!1);return _.useEffect(()=>{l(!1),De.get(`/contents/${e}/entities`).then(m=>{!m.entities||m.entities.length===0?f(!0):r(m.entities),l(!0)}).catch(m=>{m instanceof Ln&&m.status===404&&f(!0),l(!0)})},[e]),i?u||a.length===0?d.jsx(Cn,{title:t("common.empty.content_entities.title"),description:t("common.empty.content_entities.description")}):d.jsx("div",{className:"flex flex-1 flex-col overflow-auto c4a-scrollbar",children:d.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(m=>d.jsx(yb,{entity:m},m.id))})}):a.length>0?d.jsx("div",{className:"flex flex-1 flex-col overflow-auto c4a-scrollbar",children:d.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(m=>d.jsx(yb,{entity:m},m.id))})}):d.jsx(wl,{})}const Sb={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 H3({data:e,atoms:t}){return d.jsxs("div",{className:"space-y-4",children:[e&&Object.keys(e).length>0&&d.jsx("div",{children:d.jsx(Oi,{data:e,defaultExpanded:2})}),t&&d.jsx(B3,{atoms:t})]})}function B3({atoms:e}){const t=Object.keys(Sb);return d.jsx("div",{className:"space-y-2",children:t.map(a=>{const r=e[a];return!r||r.length===0?null:d.jsx(I3,{type:a,label:Sb[a]??a,items:r},a)})})}function I3({type:e,label:t,items:a}){const[r,i]=_.useState(!0);return d.jsxs("details",{open:r,onToggle:l=>i(l.target.open),children:[d.jsxs("summary",{className:"cursor-pointer font-mono text-xs uppercase text-c4a-text-secondary hover:text-c4a-text-primary py-1.5",children:[t," (",a.length,")"]}),d.jsx("div",{className:"pl-4 pb-2",children:d.jsx(P3,{type:e,items:a})})]})}function P3({type:e,items:t}){switch(e){case"entities":case"behaviors":case"events":case"relations":return d.jsx(wb,{items:t});case"roles":return d.jsx(G3,{items:t});case"attributes":return d.jsx(V3,{items:t});case"states":return d.jsx(q3,{items:t});case"transitions":return d.jsx(F3,{items:t});case"rules":case"constraints":return d.jsx(Y3,{items:t});case"decisions":return d.jsx(K3,{items:t});case"metrics":return d.jsx(X3,{items:t});case"claims":return d.jsx(Q3,{items:t});case"comparisons":return d.jsx(Z3,{items:t});case"boundaries":return d.jsx(J3,{items:t});default:return d.jsx(wb,{items:t})}}function Za({value:e}){const{t}=ye(),a=vl(e);return a?d.jsx(Vt,{variant:a.variant,tooltip:`confidence: ${a.value}`,children:t(a.labelKey)}):null}function wb({items:e}){return d.jsx("div",{className:"space-y-1",children:e.map((t,a)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[t.ref&&op(t.ref)?d.jsx(lp,{pointer:t.ref}):d.jsx("span",{className:"text-c4a-text-primary",children:t.name??String(t)}),d.jsx(Za,{value:t.confidence})]},a))})}function G3({items:e}){return d.jsx("div",{className:"space-y-1.5",children:e.map((t,a)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx(Vt,{variant:"accent",children:t.name??"role"}),!!t.performs&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-c4a-text-muted",children:"performs"}),op(String(t.performs))?d.jsx(lp,{pointer:String(t.performs)}):d.jsx("span",{className:"text-c4a-text-primary",children:String(t.performs)})]}),d.jsx(Za,{value:t.confidence})]},a))})}function V3({items:e}){return d.jsx("div",{className:"space-y-1",children:e.map((t,a)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsxs("span",{className:"text-c4a-text-secondary font-mono",children:[t.name,":"]}),d.jsx("span",{className:"text-c4a-text-primary",children:String(t.value??"")}),d.jsx(Za,{value:t.confidence})]},a))})}function q3({items:e}){return d.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map((t,a)=>d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(Vt,{children:t.name??String(t)}),d.jsx(Za,{value:t.confidence})]},a))})}function F3({items:e}){return d.jsx("div",{className:"space-y-1.5",children:e.map((t,a)=>{const r=t;return d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx(Vt,{variant:"muted",children:String(r.from_state??"?")}),d.jsx("span",{className:"text-c4a-text-muted",children:"→"}),d.jsx(Vt,{variant:"muted",children:String(r.to_state??"?")}),!!r.trigger&&d.jsx("span",{className:"text-c4a-text-muted italic",children:String(r.trigger)}),d.jsx(Za,{value:t.confidence})]},a)})})}function Y3({items:e}){return d.jsx("div",{className:"space-y-1.5",children:e.map((t,a)=>{const r=t;return d.jsx("div",{className:"text-xs",children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"text-c4a-warning font-mono font-bold",children:"IF"}),d.jsx("span",{className:"text-c4a-text-primary",children:String(r.condition??r.name??"")}),d.jsx("span",{className:"text-c4a-accent font-mono font-bold",children:"THEN"}),d.jsx("span",{className:"text-c4a-text-primary",children:String(r.conclusion??r.description??"")}),d.jsx(Za,{value:t.confidence})]})},a)})})}function K3({items:e}){return d.jsx("div",{className:"space-y-1.5",children:e.map((t,a)=>d.jsxs("div",{className:"text-xs",children:[d.jsx("span",{className:"text-c4a-text-primary font-mono",children:t.name}),t.description&&d.jsx("span",{className:"text-c4a-text-muted ml-2",children:t.description}),d.jsx(Za,{value:t.confidence})]},a))})}function X3({items:e}){return d.jsx("div",{className:"space-y-1",children:e.map((t,a)=>{const r=t;return d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:"text-c4a-text-primary font-mono",children:t.name}),!!r.unit&&d.jsx("span",{className:"text-c4a-text-muted",children:String(r.unit)}),!!r.threshold&&d.jsxs("span",{className:"text-c4a-text-secondary",children:["< ",String(r.threshold)]}),d.jsx(Za,{value:t.confidence})]},a)})})}function Q3({items:e}){return d.jsx("div",{className:"space-y-1.5",children:e.map((t,a)=>{const r=t;return d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[!!r.claim_type&&d.jsx(Vt,{variant:"warning",children:String(r.claim_type)}),d.jsx("span",{className:"text-c4a-text-primary",children:t.description??t.name}),!!r.valid_from&&d.jsxs("span",{className:"text-c4a-text-muted",children:[String(r.valid_from)," 起"]}),d.jsx(Za,{value:t.confidence})]},a)})})}function Z3({items:e}){return d.jsx("div",{className:"space-y-3",children:e.map((t,a)=>{const r=t,i=r.criteria,l=r.options;return!i||!l?d.jsx("div",{className:"text-xs text-c4a-text-muted",children:d.jsx(Oi,{data:t,defaultExpanded:1})},a):d.jsx("div",{className:"rounded border border-c4a-border-subtle overflow-auto",children:d.jsxs("table",{className:"w-full text-xs font-mono",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-c4a-border-subtle bg-c4a-bg-surface text-c4a-text-muted",children:[d.jsx("th",{className:"px-2 py-1 text-left",children:"Criteria"}),l.map((u,f)=>d.jsx("th",{className:"px-2 py-1 text-left",children:String(u.name??`Option ${f+1}`)},f))]})}),d.jsx("tbody",{children:i.map((u,f)=>d.jsxs("tr",{className:"border-b border-c4a-border-subtle",children:[d.jsx("td",{className:"px-2 py-1 text-c4a-text-secondary",children:u}),l.map((m,h)=>{const g=m.values;return d.jsx("td",{className:"px-2 py-1 text-c4a-text-primary",children:g?.[f]??"—"},h)})]},f))})]})},a)})})}function J3({items:e}){return d.jsx("div",{className:"space-y-1",children:e.map((t,a)=>{const r=t,i=r.included!==!1&&r.type!=="exclude";return d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.jsx("span",{className:i?"text-c4a-success":"text-c4a-error",children:i?"✓ 包含":"✗ 排除"}),d.jsx("span",{className:"text-c4a-text-primary",children:t.name??t.description}),d.jsx(Za,{value:t.confidence})]},a)})})}function W3({relation:e}){const t=Ot(),{t:a}=ye(),r=$i(),i=vl(e.confidence),l=e.direction==="incoming"?"←":"→",u=()=>{r?.active?r.navigate("relation",e.id,e.type,"↔"):t(aa.relation(e.id))},f=(m,h)=>{m.stopPropagation(),r?.active?r.navigate("entity",h.id,h.name,"🔹"):t(aa.entity(h.id))};return d.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:[d.jsx(Vt,{variant:"accent",children:e.type}),d.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline cursor-pointer truncate",onClick:m=>f(m,e.from),children:e.from.name}),d.jsx("span",{className:"text-c4a-text-muted text-xs shrink-0",children:l}),d.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline cursor-pointer truncate",onClick:m=>f(m,e.to),children:e.to.name}),e.weight!==void 0&&d.jsxs("span",{className:"text-xs text-c4a-text-muted ml-auto shrink-0",children:["w: ",e.weight]}),i&&d.jsx(Vt,{variant:i.variant,tooltip:`confidence: ${i.value}`,children:a(i.labelKey)})]})}function eD({entityId:e}){const{t}=ye(),[a,r]=_.useState([]),[i,l]=_.useState(!1),[u,f]=_.useState("both"),[m,h]=_.useState(""),[g,y]=_.useState([]);return _.useEffect(()=>{const v={};u!=="both"&&(v.direction=u),m&&(v.type=m),De.get(`/entities/${e}/relations`,v).then(b=>{if(r(b.relations),g.length===0){const w=[...new Set(b.relations.map(N=>N.type))];y(w)}l(!0)}).catch(()=>{l(!0)})},[e,u,m]),i?a.length===0?d.jsx(Cn,{title:t("common.empty.entity_relations.title"),description:t("common.empty.entity_relations.description")}):d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[d.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:[d.jsx("option",{value:"both",children:t("relation.filter.direction.all")}),d.jsx("option",{value:"outgoing",children:t("relation.filter.direction.outgoing")}),d.jsx("option",{value:"incoming",children:t("relation.filter.direction.incoming")})]}),g.length>1&&d.jsxs("select",{value:m,onChange:v=>h(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:[d.jsx("option",{value:"",children:t("relation.filter.type.all")}),g.map(v=>d.jsx("option",{value:v,children:v},v))]})]}),d.jsx("div",{className:"space-y-1",children:a.map(v=>d.jsx(W3,{relation:v},v.id))})]}):d.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function tD(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function pS({content:e}){const{t}=ye(),a=Ot(),r=$i(),i=e.hash_id.slice(0,12),l=()=>{const u=e.source_path??i;r?.active?r.navigate("content",e.hash_id,u,"📄"):a(aa.content(e.hash_id))};return d.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:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"shrink-0",children:"📄"}),d.jsx("span",{className:"font-mono text-xs text-c4a-accent hover:underline truncate",children:i}),e.byte_size!=null&&d.jsx("span",{className:"text-xs text-c4a-text-muted shrink-0",children:tD(e.byte_size)})]}),e.source_path&&d.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted truncate",children:e.source_path}),e.span&&d.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 nD({entityId:e}){const{t}=ye(),[a,r]=_.useState([]),[i,l]=_.useState(!1);return _.useEffect(()=>{De.get(`/entities/${e}/contents`).then(u=>{r(u.contents??[]),l(!0)}).catch(()=>l(!0))},[e]),i?a.length===0?d.jsx(Cn,{title:t("common.empty.entity_contents.title"),description:t("common.empty.entity_contents.description")}):d.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map(u=>d.jsx(pS,{content:u},u.hash_id))}):d.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function aD({entityId:e}){const{t}=ye(),a=Ot(),[r,i]=_.useState([]),[l,u]=_.useState(!1);return _.useEffect(()=>{De.get(`/entities/${e}/referrers`).then(f=>{i(f.referrers??[]),u(!0)}).catch(()=>u(!0))},[e]),l?r.length===0?d.jsx(Cn,{title:t("common.empty.entity_referrers.title"),description:t("common.empty.entity_referrers.description")}):d.jsx("div",{className:"space-y-1",children:r.map(f=>d.jsxs("div",{className:"flex items-center gap-3 py-2 px-3 rounded hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:()=>a(aa.entity(f.id)),children:[d.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline truncate",children:f.name}),d.jsx("span",{className:"text-xs text-c4a-text-muted shrink-0",children:f.type}),d.jsx("span",{className:"text-xs text-c4a-text-muted font-mono ml-auto shrink-0",children:f.ref_field}),d.jsxs("span",{className:"text-xs text-c4a-text-muted shrink-0",children:["(",f.ref_type,")"]})]},`${f.id}-${f.ref_field}`))}):d.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function rD(e,t){var a,r=1;e==null&&(e=0),t==null&&(t=0);function i(){var l,u=a.length,f,m=0,h=0;for(l=0;l<u;++l)f=a[l],m+=f.x,h+=f.y;for(m=(m/u-e)*r,h=(h/u-t)*r,l=0;l<u;++l)f=a[l],f.x-=m,f.y-=h}return i.initialize=function(l){a=l},i.x=function(l){return arguments.length?(e=+l,i):e},i.y=function(l){return arguments.length?(t=+l,i):t},i.strength=function(l){return arguments.length?(r=+l,i):r},i}function sD(e){const t=+this._x.call(null,e),a=+this._y.call(null,e);return gS(this.cover(t,a),t,a,e)}function gS(e,t,a,r){if(isNaN(t)||isNaN(a))return e;var i,l=e._root,u={data:r},f=e._x0,m=e._y0,h=e._x1,g=e._y1,y,v,b,w,N,j,E,R;if(!l)return e._root=u,e;for(;l.length;)if((N=t>=(y=(f+h)/2))?f=y:h=y,(j=a>=(v=(m+g)/2))?m=v:g=v,i=l,!(l=l[E=j<<1|N]))return i[E]=u,e;if(b=+e._x.call(null,l.data),w=+e._y.call(null,l.data),t===b&&a===w)return u.next=l,i?i[E]=u:e._root=u,e;do i=i?i[E]=new Array(4):e._root=new Array(4),(N=t>=(y=(f+h)/2))?f=y:h=y,(j=a>=(v=(m+g)/2))?m=v:g=v;while((E=j<<1|N)===(R=(w>=v)<<1|b>=y));return i[R]=l,i[E]=u,e}function iD(e){var t,a,r=e.length,i,l,u=new Array(r),f=new Array(r),m=1/0,h=1/0,g=-1/0,y=-1/0;for(a=0;a<r;++a)isNaN(i=+this._x.call(null,t=e[a]))||isNaN(l=+this._y.call(null,t))||(u[a]=i,f[a]=l,i<m&&(m=i),i>g&&(g=i),l<h&&(h=l),l>y&&(y=l));if(m>g||h>y)return this;for(this.cover(m,h).cover(g,y),a=0;a<r;++a)gS(this,u[a],f[a],e[a]);return this}function oD(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var a=this._x0,r=this._y0,i=this._x1,l=this._y1;if(isNaN(a))i=(a=Math.floor(e))+1,l=(r=Math.floor(t))+1;else{for(var u=i-a||1,f=this._root,m,h;a>e||e>=i||r>t||t>=l;)switch(h=(t<r)<<1|e<a,m=new Array(4),m[h]=f,f=m,u*=2,h){case 0:i=a+u,l=r+u;break;case 1:a=i-u,l=r+u;break;case 2:i=a+u,r=l-u;break;case 3:a=i-u,r=l-u;break}this._root&&this._root.length&&(this._root=f)}return this._x0=a,this._y0=r,this._x1=i,this._y1=l,this}function lD(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function cD(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 An(e,t,a,r,i){this.node=e,this.x0=t,this.y0=a,this.x1=r,this.y1=i}function uD(e,t,a){var r,i=this._x0,l=this._y0,u,f,m,h,g=this._x1,y=this._y1,v=[],b=this._root,w,N;for(b&&v.push(new An(b,i,l,g,y)),a==null?a=1/0:(i=e-a,l=t-a,g=e+a,y=t+a,a*=a);w=v.pop();)if(!(!(b=w.node)||(u=w.x0)>g||(f=w.y0)>y||(m=w.x1)<i||(h=w.y1)<l))if(b.length){var j=(u+m)/2,E=(f+h)/2;v.push(new An(b[3],j,E,m,h),new An(b[2],u,E,j,h),new An(b[1],j,f,m,E),new An(b[0],u,f,j,E)),(N=(t>=E)<<1|e>=j)&&(w=v[v.length-1],v[v.length-1]=v[v.length-1-N],v[v.length-1-N]=w)}else{var R=e-+this._x.call(null,b.data),k=t-+this._y.call(null,b.data),O=R*R+k*k;if(O<a){var I=Math.sqrt(a=O);i=e-I,l=t-I,g=e+I,y=t+I,r=b.data}}return r}function dD(e){if(isNaN(g=+this._x.call(null,e))||isNaN(y=+this._y.call(null,e)))return this;var t,a=this._root,r,i,l,u=this._x0,f=this._y0,m=this._x1,h=this._y1,g,y,v,b,w,N,j,E;if(!a)return this;if(a.length)for(;;){if((w=g>=(v=(u+m)/2))?u=v:m=v,(N=y>=(b=(f+h)/2))?f=b:h=b,t=a,!(a=a[j=N<<1|w]))return this;if(!a.length)break;(t[j+1&3]||t[j+2&3]||t[j+3&3])&&(r=t,E=j)}for(;a.data!==e;)if(i=a,!(a=a.next))return this;return(l=a.next)&&delete a.next,i?(l?i.next=l:delete i.next,this):t?(l?t[j]=l:delete t[j],(a=t[0]||t[1]||t[2]||t[3])&&a===(t[3]||t[2]||t[1]||t[0])&&!a.length&&(r?r[E]=a:this._root=a),this):(this._root=l,this)}function fD(e){for(var t=0,a=e.length;t<a;++t)this.remove(e[t]);return this}function hD(){return this._root}function mD(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function pD(e){var t=[],a,r=this._root,i,l,u,f,m;for(r&&t.push(new An(r,this._x0,this._y0,this._x1,this._y1));a=t.pop();)if(!e(r=a.node,l=a.x0,u=a.y0,f=a.x1,m=a.y1)&&r.length){var h=(l+f)/2,g=(u+m)/2;(i=r[3])&&t.push(new An(i,h,g,f,m)),(i=r[2])&&t.push(new An(i,l,g,h,m)),(i=r[1])&&t.push(new An(i,h,u,f,g)),(i=r[0])&&t.push(new An(i,l,u,h,g))}return this}function gD(e){var t=[],a=[],r;for(this._root&&t.push(new An(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var l,u=r.x0,f=r.y0,m=r.x1,h=r.y1,g=(u+m)/2,y=(f+h)/2;(l=i[0])&&t.push(new An(l,u,f,g,y)),(l=i[1])&&t.push(new An(l,g,f,m,y)),(l=i[2])&&t.push(new An(l,u,y,g,h)),(l=i[3])&&t.push(new An(l,g,y,m,h))}a.push(r)}for(;r=a.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function xD(e){return e[0]}function yD(e){return arguments.length?(this._x=e,this):this._x}function vD(e){return e[1]}function bD(e){return arguments.length?(this._y=e,this):this._y}function cp(e,t,a){var r=new up(t??xD,a??vD,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function up(e,t,a,r,i,l){this._x=e,this._y=t,this._x0=a,this._y0=r,this._x1=i,this._y1=l,this._root=void 0}function Nb(e){for(var t={data:e.data},a=t;e=e.next;)a=a.next={data:e.data};return t}var Mn=cp.prototype=up.prototype;Mn.copy=function(){var e=new up(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,a,r;if(!t)return e;if(!t.length)return e._root=Nb(t),e;for(a=[{source:t,target:e._root=new Array(4)}];t=a.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?a.push({source:r,target:t.target[i]=new Array(4)}):t.target[i]=Nb(r));return e};Mn.add=sD;Mn.addAll=iD;Mn.cover=oD;Mn.data=lD;Mn.extent=cD;Mn.find=uD;Mn.remove=dD;Mn.removeAll=fD;Mn.root=hD;Mn.size=mD;Mn.visit=pD;Mn.visitAfter=gD;Mn.x=yD;Mn.y=bD;function ks(e){return function(){return e}}function Jr(e){return(e()-.5)*1e-6}function _D(e){return e.x+e.vx}function SD(e){return e.y+e.vy}function wD(e){var t,a,r,i=1,l=1;typeof e!="function"&&(e=ks(e==null?1:+e));function u(){for(var h,g=t.length,y,v,b,w,N,j,E=0;E<l;++E)for(y=cp(t,_D,SD).visitAfter(f),h=0;h<g;++h)v=t[h],N=a[v.index],j=N*N,b=v.x+v.vx,w=v.y+v.vy,y.visit(R);function R(k,O,I,B,H){var T=k.data,P=k.r,X=N+P;if(T){if(T.index>v.index){var de=b-T.x-T.vx,le=w-T.y-T.vy,ce=de*de+le*le;ce<X*X&&(de===0&&(de=Jr(r),ce+=de*de),le===0&&(le=Jr(r),ce+=le*le),ce=(X-(ce=Math.sqrt(ce)))/ce*i,v.vx+=(de*=ce)*(X=(P*=P)/(j+P)),v.vy+=(le*=ce)*X,T.vx-=de*(X=1-X),T.vy-=le*X)}return}return O>b+X||B<b-X||I>w+X||H<w-X}}function f(h){if(h.data)return h.r=a[h.data.index];for(var g=h.r=0;g<4;++g)h[g]&&h[g].r>h.r&&(h.r=h[g].r)}function m(){if(t){var h,g=t.length,y;for(a=new Array(g),h=0;h<g;++h)y=t[h],a[y.index]=+e(y,h,t)}}return u.initialize=function(h,g){t=h,r=g,m()},u.iterations=function(h){return arguments.length?(l=+h,u):l},u.strength=function(h){return arguments.length?(i=+h,u):i},u.radius=function(h){return arguments.length?(e=typeof h=="function"?h:ks(+h),m(),u):e},u}function ND(e){return e.index}function jb(e,t){var a=e.get(t);if(!a)throw new Error("node not found: "+t);return a}function jD(e){var t=ND,a=y,r,i=ks(30),l,u,f,m,h,g=1;e==null&&(e=[]);function y(j){return 1/Math.min(f[j.source.index],f[j.target.index])}function v(j){for(var E=0,R=e.length;E<g;++E)for(var k=0,O,I,B,H,T,P,X;k<R;++k)O=e[k],I=O.source,B=O.target,H=B.x+B.vx-I.x-I.vx||Jr(h),T=B.y+B.vy-I.y-I.vy||Jr(h),P=Math.sqrt(H*H+T*T),P=(P-l[k])/P*j*r[k],H*=P,T*=P,B.vx-=H*(X=m[k]),B.vy-=T*X,I.vx+=H*(X=1-X),I.vy+=T*X}function b(){if(u){var j,E=u.length,R=e.length,k=new Map(u.map((I,B)=>[t(I,B,u),I])),O;for(j=0,f=new Array(E);j<R;++j)O=e[j],O.index=j,typeof O.source!="object"&&(O.source=jb(k,O.source)),typeof O.target!="object"&&(O.target=jb(k,O.target)),f[O.source.index]=(f[O.source.index]||0)+1,f[O.target.index]=(f[O.target.index]||0)+1;for(j=0,m=new Array(R);j<R;++j)O=e[j],m[j]=f[O.source.index]/(f[O.source.index]+f[O.target.index]);r=new Array(R),w(),l=new Array(R),N()}}function w(){if(u)for(var j=0,E=e.length;j<E;++j)r[j]=+a(e[j],j,e)}function N(){if(u)for(var j=0,E=e.length;j<E;++j)l[j]=+i(e[j],j,e)}return v.initialize=function(j,E){u=j,h=E,b()},v.links=function(j){return arguments.length?(e=j,b(),v):e},v.id=function(j){return arguments.length?(t=j,v):t},v.iterations=function(j){return arguments.length?(g=+j,v):g},v.strength=function(j){return arguments.length?(a=typeof j=="function"?j:ks(+j),w(),v):a},v.distance=function(j){return arguments.length?(i=typeof j=="function"?j:ks(+j),N(),v):i},v}var ED={value:()=>{}};function Qu(){for(var e=0,t=arguments.length,a={},r;e<t;++e){if(!(r=arguments[e]+"")||r in a||/[\s.]/.test(r))throw new Error("illegal type: "+r);a[r]=[]}return new cu(a)}function cu(e){this._=e}function CD(e,t){return e.trim().split(/^|\s+/).map(function(a){var r="",i=a.indexOf(".");if(i>=0&&(r=a.slice(i+1),a=a.slice(0,i)),a&&!t.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:r}})}cu.prototype=Qu.prototype={constructor:cu,on:function(e,t){var a=this._,r=CD(e+"",a),i,l=-1,u=r.length;if(arguments.length<2){for(;++l<u;)if((i=(e=r[l]).type)&&(i=kD(a[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(i=(e=r[l]).type)a[i]=Eb(a[i],e.name,t);else if(t==null)for(i in a)a[i]=Eb(a[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var a in t)e[a]=t[a].slice();return new cu(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var a=new Array(i),r=0,i,l;r<i;++r)a[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,i=l.length;r<i;++r)l[r].value.apply(t,a)},apply:function(e,t,a){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,l=r.length;i<l;++i)r[i].value.apply(t,a)}};function kD(e,t){for(var a=0,r=e.length,i;a<r;++a)if((i=e[a]).name===t)return i.value}function Eb(e,t,a){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=ED,e=e.slice(0,r).concat(e.slice(r+1));break}return a!=null&&e.push({name:t,value:a}),e}var Di=0,Fo=0,$o=0,xS=1e3,Cu,Yo,ku=0,Ls=0,Zu=0,cl=typeof performance=="object"&&performance.now?performance:Date,yS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function dp(){return Ls||(yS(RD),Ls=cl.now()+Zu)}function RD(){Ls=0}function Ru(){this._call=this._time=this._next=null}Ru.prototype=fp.prototype={constructor:Ru,restart:function(e,t,a){if(typeof e!="function")throw new TypeError("callback is not a function");a=(a==null?dp():+a)+(t==null?0:+t),!this._next&&Yo!==this&&(Yo?Yo._next=this:Cu=this,Yo=this),this._call=e,this._time=a,Nm()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nm())}};function fp(e,t,a){var r=new Ru;return r.restart(e,t,a),r}function TD(){dp(),++Di;for(var e=Cu,t;e;)(t=Ls-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Di}function Cb(){Ls=(ku=cl.now())+Zu,Di=Fo=0;try{TD()}finally{Di=0,LD(),Ls=0}}function AD(){var e=cl.now(),t=e-ku;t>xS&&(Zu-=t,ku=e)}function LD(){for(var e,t=Cu,a,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(a=t._next,t._next=null,t=e?e._next=a:Cu=a);Yo=e,Nm(r)}function Nm(e){if(!Di){Fo&&(Fo=clearTimeout(Fo));var t=e-Ls;t>24?(e<1/0&&(Fo=setTimeout(Cb,e-cl.now()-Zu)),$o&&($o=clearInterval($o))):($o||(ku=cl.now(),$o=setInterval(AD,xS)),Di=1,yS(Cb))}}function kb(e,t,a){var r=new Ru;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,a),r}const OD=1664525,DD=1013904223,Rb=4294967296;function MD(){let e=1;return()=>(e=(OD*e+DD)%Rb)/Rb}function zD(e){return e.x}function UD(e){return e.y}var $D=10,HD=Math.PI*(3-Math.sqrt(5));function BD(e){var t,a=1,r=.001,i=1-Math.pow(r,1/300),l=0,u=.6,f=new Map,m=fp(y),h=Qu("tick","end"),g=MD();e==null&&(e=[]);function y(){v(),h.call("tick",t),a<r&&(m.stop(),h.call("end",t))}function v(N){var j,E=e.length,R;N===void 0&&(N=1);for(var k=0;k<N;++k)for(a+=(l-a)*i,f.forEach(function(O){O(a)}),j=0;j<E;++j)R=e[j],R.fx==null?R.x+=R.vx*=u:(R.x=R.fx,R.vx=0),R.fy==null?R.y+=R.vy*=u:(R.y=R.fy,R.vy=0);return t}function b(){for(var N=0,j=e.length,E;N<j;++N){if(E=e[N],E.index=N,E.fx!=null&&(E.x=E.fx),E.fy!=null&&(E.y=E.fy),isNaN(E.x)||isNaN(E.y)){var R=$D*Math.sqrt(.5+N),k=N*HD;E.x=R*Math.cos(k),E.y=R*Math.sin(k)}(isNaN(E.vx)||isNaN(E.vy))&&(E.vx=E.vy=0)}}function w(N){return N.initialize&&N.initialize(e,g),N}return b(),t={tick:v,restart:function(){return m.restart(y),t},stop:function(){return m.stop(),t},nodes:function(N){return arguments.length?(e=N,b(),f.forEach(w),t):e},alpha:function(N){return arguments.length?(a=+N,t):a},alphaMin:function(N){return arguments.length?(r=+N,t):r},alphaDecay:function(N){return arguments.length?(i=+N,t):+i},alphaTarget:function(N){return arguments.length?(l=+N,t):l},velocityDecay:function(N){return arguments.length?(u=1-N,t):1-u},randomSource:function(N){return arguments.length?(g=N,f.forEach(w),t):g},force:function(N,j){return arguments.length>1?(j==null?f.delete(N):f.set(N,w(j)),t):f.get(N)},find:function(N,j,E){var R=0,k=e.length,O,I,B,H,T;for(E==null?E=1/0:E*=E,R=0;R<k;++R)H=e[R],O=N-H.x,I=j-H.y,B=O*O+I*I,B<E&&(T=H,E=B);return T},on:function(N,j){return arguments.length>1?(h.on(N,j),t):h.on(N)}}}function ID(){var e,t,a,r,i=ks(-30),l,u=1,f=1/0,m=.81;function h(b){var w,N=e.length,j=cp(e,zD,UD).visitAfter(y);for(r=b,w=0;w<N;++w)t=e[w],j.visit(v)}function g(){if(e){var b,w=e.length,N;for(l=new Array(w),b=0;b<w;++b)N=e[b],l[N.index]=+i(N,b,e)}}function y(b){var w=0,N,j,E=0,R,k,O;if(b.length){for(R=k=O=0;O<4;++O)(N=b[O])&&(j=Math.abs(N.value))&&(w+=N.value,E+=j,R+=j*N.x,k+=j*N.y);b.x=R/E,b.y=k/E}else{N=b,N.x=N.data.x,N.y=N.data.y;do w+=l[N.data.index];while(N=N.next)}b.value=w}function v(b,w,N,j){if(!b.value)return!0;var E=b.x-t.x,R=b.y-t.y,k=j-w,O=E*E+R*R;if(k*k/m<O)return O<f&&(E===0&&(E=Jr(a),O+=E*E),R===0&&(R=Jr(a),O+=R*R),O<u&&(O=Math.sqrt(u*O)),t.vx+=E*b.value*r/O,t.vy+=R*b.value*r/O),!0;if(b.length||O>=f)return;(b.data!==t||b.next)&&(E===0&&(E=Jr(a),O+=E*E),R===0&&(R=Jr(a),O+=R*R),O<u&&(O=Math.sqrt(u*O)));do b.data!==t&&(k=l[b.data.index]*r/O,t.vx+=E*k,t.vy+=R*k);while(b=b.next)}return h.initialize=function(b,w){e=b,a=w,g()},h.strength=function(b){return arguments.length?(i=typeof b=="function"?b:ks(+b),g(),h):i},h.distanceMin=function(b){return arguments.length?(u=b*b,h):Math.sqrt(u)},h.distanceMax=function(b){return arguments.length?(f=b*b,h):Math.sqrt(f)},h.theta=function(b){return arguments.length?(m=b*b,h):Math.sqrt(m)},h}var jm="http://www.w3.org/1999/xhtml";const Tb={svg:"http://www.w3.org/2000/svg",xhtml:jm,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ju(e){var t=e+="",a=t.indexOf(":");return a>=0&&(t=e.slice(0,a))!=="xmlns"&&(e=e.slice(a+1)),Tb.hasOwnProperty(t)?{space:Tb[t],local:e}:e}function PD(e){return function(){var t=this.ownerDocument,a=this.namespaceURI;return a===jm&&t.documentElement.namespaceURI===jm?t.createElement(e):t.createElementNS(a,e)}}function GD(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vS(e){var t=Ju(e);return(t.local?GD:PD)(t)}function VD(){}function hp(e){return e==null?VD:function(){return this.querySelector(e)}}function qD(e){typeof e!="function"&&(e=hp(e));for(var t=this._groups,a=t.length,r=new Array(a),i=0;i<a;++i)for(var l=t[i],u=l.length,f=r[i]=new Array(u),m,h,g=0;g<u;++g)(m=l[g])&&(h=e.call(m,m.__data__,g,l))&&("__data__"in m&&(h.__data__=m.__data__),f[g]=h);return new ra(r,this._parents)}function FD(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function YD(){return[]}function bS(e){return e==null?YD:function(){return this.querySelectorAll(e)}}function KD(e){return function(){return FD(e.apply(this,arguments))}}function XD(e){typeof e=="function"?e=KD(e):e=bS(e);for(var t=this._groups,a=t.length,r=[],i=[],l=0;l<a;++l)for(var u=t[l],f=u.length,m,h=0;h<f;++h)(m=u[h])&&(r.push(e.call(m,m.__data__,h,u)),i.push(m));return new ra(r,i)}function _S(e){return function(){return this.matches(e)}}function SS(e){return function(t){return t.matches(e)}}var QD=Array.prototype.find;function ZD(e){return function(){return QD.call(this.children,e)}}function JD(){return this.firstElementChild}function WD(e){return this.select(e==null?JD:ZD(typeof e=="function"?e:SS(e)))}var eM=Array.prototype.filter;function tM(){return Array.from(this.children)}function nM(e){return function(){return eM.call(this.children,e)}}function aM(e){return this.selectAll(e==null?tM:nM(typeof e=="function"?e:SS(e)))}function rM(e){typeof e!="function"&&(e=_S(e));for(var t=this._groups,a=t.length,r=new Array(a),i=0;i<a;++i)for(var l=t[i],u=l.length,f=r[i]=[],m,h=0;h<u;++h)(m=l[h])&&e.call(m,m.__data__,h,l)&&f.push(m);return new ra(r,this._parents)}function wS(e){return new Array(e.length)}function sM(){return new ra(this._enter||this._groups.map(wS),this._parents)}function Tu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Tu.prototype={constructor:Tu,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 iM(e){return function(){return e}}function oM(e,t,a,r,i,l){for(var u=0,f,m=t.length,h=l.length;u<h;++u)(f=t[u])?(f.__data__=l[u],r[u]=f):a[u]=new Tu(e,l[u]);for(;u<m;++u)(f=t[u])&&(i[u]=f)}function lM(e,t,a,r,i,l,u){var f,m,h=new Map,g=t.length,y=l.length,v=new Array(g),b;for(f=0;f<g;++f)(m=t[f])&&(v[f]=b=u.call(m,m.__data__,f,t)+"",h.has(b)?i[f]=m:h.set(b,m));for(f=0;f<y;++f)b=u.call(e,l[f],f,l)+"",(m=h.get(b))?(r[f]=m,m.__data__=l[f],h.delete(b)):a[f]=new Tu(e,l[f]);for(f=0;f<g;++f)(m=t[f])&&h.get(v[f])===m&&(i[f]=m)}function cM(e){return e.__data__}function uM(e,t){if(!arguments.length)return Array.from(this,cM);var a=t?lM:oM,r=this._parents,i=this._groups;typeof e!="function"&&(e=iM(e));for(var l=i.length,u=new Array(l),f=new Array(l),m=new Array(l),h=0;h<l;++h){var g=r[h],y=i[h],v=y.length,b=dM(e.call(g,g&&g.__data__,h,r)),w=b.length,N=f[h]=new Array(w),j=u[h]=new Array(w),E=m[h]=new Array(v);a(g,y,N,j,E,b,t);for(var R=0,k=0,O,I;R<w;++R)if(O=N[R]){for(R>=k&&(k=R+1);!(I=j[k])&&++k<w;);O._next=I||null}}return u=new ra(u,r),u._enter=f,u._exit=m,u}function dM(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function fM(){return new ra(this._exit||this._groups.map(wS),this._parents)}function hM(e,t,a){var r=this.enter(),i=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),a==null?l.remove():a(l),r&&i?r.merge(i).order():i}function mM(e){for(var t=e.selection?e.selection():e,a=this._groups,r=t._groups,i=a.length,l=r.length,u=Math.min(i,l),f=new Array(i),m=0;m<u;++m)for(var h=a[m],g=r[m],y=h.length,v=f[m]=new Array(y),b,w=0;w<y;++w)(b=h[w]||g[w])&&(v[w]=b);for(;m<i;++m)f[m]=a[m];return new ra(f,this._parents)}function pM(){for(var e=this._groups,t=-1,a=e.length;++t<a;)for(var r=e[t],i=r.length-1,l=r[i],u;--i>=0;)(u=r[i])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function gM(e){e||(e=xM);function t(y,v){return y&&v?e(y.__data__,v.__data__):!y-!v}for(var a=this._groups,r=a.length,i=new Array(r),l=0;l<r;++l){for(var u=a[l],f=u.length,m=i[l]=new Array(f),h,g=0;g<f;++g)(h=u[g])&&(m[g]=h);m.sort(t)}return new ra(i,this._parents).order()}function xM(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function yM(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function vM(){return Array.from(this)}function bM(){for(var e=this._groups,t=0,a=e.length;t<a;++t)for(var r=e[t],i=0,l=r.length;i<l;++i){var u=r[i];if(u)return u}return null}function _M(){let e=0;for(const t of this)++e;return e}function SM(){return!this.node()}function wM(e){for(var t=this._groups,a=0,r=t.length;a<r;++a)for(var i=t[a],l=0,u=i.length,f;l<u;++l)(f=i[l])&&e.call(f,f.__data__,l,i);return this}function NM(e){return function(){this.removeAttribute(e)}}function jM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function EM(e,t){return function(){this.setAttribute(e,t)}}function CM(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function kM(e,t){return function(){var a=t.apply(this,arguments);a==null?this.removeAttribute(e):this.setAttribute(e,a)}}function RM(e,t){return function(){var a=t.apply(this,arguments);a==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,a)}}function TM(e,t){var a=Ju(e);if(arguments.length<2){var r=this.node();return a.local?r.getAttributeNS(a.space,a.local):r.getAttribute(a)}return this.each((t==null?a.local?jM:NM:typeof t=="function"?a.local?RM:kM:a.local?CM:EM)(a,t))}function NS(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function AM(e){return function(){this.style.removeProperty(e)}}function LM(e,t,a){return function(){this.style.setProperty(e,t,a)}}function OM(e,t,a){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,a)}}function DM(e,t,a){return arguments.length>1?this.each((t==null?AM:typeof t=="function"?OM:LM)(e,t,a??"")):Mi(this.node(),e)}function Mi(e,t){return e.style.getPropertyValue(t)||NS(e).getComputedStyle(e,null).getPropertyValue(t)}function MM(e){return function(){delete this[e]}}function zM(e,t){return function(){this[e]=t}}function UM(e,t){return function(){var a=t.apply(this,arguments);a==null?delete this[e]:this[e]=a}}function $M(e,t){return arguments.length>1?this.each((t==null?MM:typeof t=="function"?UM:zM)(e,t)):this.node()[e]}function jS(e){return e.trim().split(/^|\s+/)}function mp(e){return e.classList||new ES(e)}function ES(e){this._node=e,this._names=jS(e.getAttribute("class")||"")}ES.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 CS(e,t){for(var a=mp(e),r=-1,i=t.length;++r<i;)a.add(t[r])}function kS(e,t){for(var a=mp(e),r=-1,i=t.length;++r<i;)a.remove(t[r])}function HM(e){return function(){CS(this,e)}}function BM(e){return function(){kS(this,e)}}function IM(e,t){return function(){(t.apply(this,arguments)?CS:kS)(this,e)}}function PM(e,t){var a=jS(e+"");if(arguments.length<2){for(var r=mp(this.node()),i=-1,l=a.length;++i<l;)if(!r.contains(a[i]))return!1;return!0}return this.each((typeof t=="function"?IM:t?HM:BM)(a,t))}function GM(){this.textContent=""}function VM(e){return function(){this.textContent=e}}function qM(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function FM(e){return arguments.length?this.each(e==null?GM:(typeof e=="function"?qM:VM)(e)):this.node().textContent}function YM(){this.innerHTML=""}function KM(e){return function(){this.innerHTML=e}}function XM(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function QM(e){return arguments.length?this.each(e==null?YM:(typeof e=="function"?XM:KM)(e)):this.node().innerHTML}function ZM(){this.nextSibling&&this.parentNode.appendChild(this)}function JM(){return this.each(ZM)}function WM(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function e5(){return this.each(WM)}function t5(e){var t=typeof e=="function"?e:vS(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function n5(){return null}function a5(e,t){var a=typeof e=="function"?e:vS(e),r=t==null?n5:typeof t=="function"?t:hp(t);return this.select(function(){return this.insertBefore(a.apply(this,arguments),r.apply(this,arguments)||null)})}function r5(){var e=this.parentNode;e&&e.removeChild(this)}function s5(){return this.each(r5)}function i5(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function o5(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function l5(e){return this.select(e?o5:i5)}function c5(e){return arguments.length?this.property("__data__",e):this.node().__data__}function u5(e){return function(t){e.call(this,t,this.__data__)}}function d5(e){return e.trim().split(/^|\s+/).map(function(t){var a="",r=t.indexOf(".");return r>=0&&(a=t.slice(r+1),t=t.slice(0,r)),{type:t,name:a}})}function f5(e){return function(){var t=this.__on;if(t){for(var a=0,r=-1,i=t.length,l;a<i;++a)l=t[a],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function h5(e,t,a){return function(){var r=this.__on,i,l=u5(t);if(r){for(var u=0,f=r.length;u<f;++u)if((i=r[u]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=l,i.options=a),i.value=t;return}}this.addEventListener(e.type,l,a),i={type:e.type,name:e.name,value:t,listener:l,options:a},r?r.push(i):this.__on=[i]}}function m5(e,t,a){var r=d5(e+""),i,l=r.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var m=0,h=f.length,g;m<h;++m)for(i=0,g=f[m];i<l;++i)if((u=r[i]).type===g.type&&u.name===g.name)return g.value}return}for(f=t?h5:f5,i=0;i<l;++i)this.each(f(r[i],t,a));return this}function RS(e,t,a){var r=NS(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,a):(i=r.document.createEvent("Event"),a?(i.initEvent(t,a.bubbles,a.cancelable),i.detail=a.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function p5(e,t){return function(){return RS(this,e,t)}}function g5(e,t){return function(){return RS(this,e,t.apply(this,arguments))}}function x5(e,t){return this.each((typeof t=="function"?g5:p5)(e,t))}function*y5(){for(var e=this._groups,t=0,a=e.length;t<a;++t)for(var r=e[t],i=0,l=r.length,u;i<l;++i)(u=r[i])&&(yield u)}var TS=[null];function ra(e,t){this._groups=e,this._parents=t}function Nl(){return new ra([[document.documentElement]],TS)}function v5(){return this}ra.prototype=Nl.prototype={constructor:ra,select:qD,selectAll:XD,selectChild:WD,selectChildren:aM,filter:rM,data:uM,enter:sM,exit:fM,join:hM,merge:mM,selection:v5,order:pM,sort:gM,call:yM,nodes:vM,node:bM,size:_M,empty:SM,each:wM,attr:TM,style:DM,property:$M,classed:PM,text:FM,html:QM,raise:JM,lower:e5,append:t5,insert:a5,remove:s5,clone:l5,datum:c5,on:m5,dispatch:x5,[Symbol.iterator]:y5};function wa(e){return typeof e=="string"?new ra([[document.querySelector(e)]],[document.documentElement]):new ra([[e]],TS)}function b5(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ss(e,t){if(e=b5(e),t===void 0&&(t=e.currentTarget),t){var a=t.ownerSVGElement||t;if(a.createSVGPoint){var r=a.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Em={capture:!0,passive:!1};function Cm(e){e.preventDefault(),e.stopImmediatePropagation()}function _5(e){var t=e.document.documentElement,a=wa(e).on("dragstart.drag",Cm,Em);"onselectstart"in t?a.on("selectstart.drag",Cm,Em):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function S5(e,t){var a=e.document.documentElement,r=wa(e).on("dragstart.drag",null);t&&(r.on("click.drag",Cm,Em),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in a?r.on("selectstart.drag",null):(a.style.MozUserSelect=a.__noselect,delete a.__noselect)}function pp(e,t,a){e.prototype=t.prototype=a,a.constructor=e}function AS(e,t){var a=Object.create(e.prototype);for(var r in t)a[r]=t[r];return a}function jl(){}var ul=.7,Au=1/ul,Ri="\\s*([+-]?\\d+)\\s*",dl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ya="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",w5=/^#([0-9a-f]{3,8})$/,N5=new RegExp(`^rgb\\(${Ri},${Ri},${Ri}\\)$`),j5=new RegExp(`^rgb\\(${Ya},${Ya},${Ya}\\)$`),E5=new RegExp(`^rgba\\(${Ri},${Ri},${Ri},${dl}\\)$`),C5=new RegExp(`^rgba\\(${Ya},${Ya},${Ya},${dl}\\)$`),k5=new RegExp(`^hsl\\(${dl},${Ya},${Ya}\\)$`),R5=new RegExp(`^hsla\\(${dl},${Ya},${Ya},${dl}\\)$`),Ab={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};pp(jl,fl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Lb,formatHex:Lb,formatHex8:T5,formatHsl:A5,formatRgb:Ob,toString:Ob});function Lb(){return this.rgb().formatHex()}function T5(){return this.rgb().formatHex8()}function A5(){return LS(this).formatHsl()}function Ob(){return this.rgb().formatRgb()}function fl(e){var t,a;return e=(e+"").trim().toLowerCase(),(t=w5.exec(e))?(a=t[1].length,t=parseInt(t[1],16),a===6?Db(t):a===3?new Vn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):a===8?Jc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):a===4?Jc(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=N5.exec(e))?new Vn(t[1],t[2],t[3],1):(t=j5.exec(e))?new Vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=E5.exec(e))?Jc(t[1],t[2],t[3],t[4]):(t=C5.exec(e))?Jc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=k5.exec(e))?Ub(t[1],t[2]/100,t[3]/100,1):(t=R5.exec(e))?Ub(t[1],t[2]/100,t[3]/100,t[4]):Ab.hasOwnProperty(e)?Db(Ab[e]):e==="transparent"?new Vn(NaN,NaN,NaN,0):null}function Db(e){return new Vn(e>>16&255,e>>8&255,e&255,1)}function Jc(e,t,a,r){return r<=0&&(e=t=a=NaN),new Vn(e,t,a,r)}function L5(e){return e instanceof jl||(e=fl(e)),e?(e=e.rgb(),new Vn(e.r,e.g,e.b,e.opacity)):new Vn}function km(e,t,a,r){return arguments.length===1?L5(e):new Vn(e,t,a,r??1)}function Vn(e,t,a,r){this.r=+e,this.g=+t,this.b=+a,this.opacity=+r}pp(Vn,km,AS(jl,{brighter(e){return e=e==null?Au:Math.pow(Au,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ul:Math.pow(ul,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vn(Rs(this.r),Rs(this.g),Rs(this.b),Lu(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:Mb,formatHex:Mb,formatHex8:O5,formatRgb:zb,toString:zb}));function Mb(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}`}function O5(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}${Es((isNaN(this.opacity)?1:this.opacity)*255)}`}function zb(){const e=Lu(this.opacity);return`${e===1?"rgb(":"rgba("}${Rs(this.r)}, ${Rs(this.g)}, ${Rs(this.b)}${e===1?")":`, ${e})`}`}function Lu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Es(e){return e=Rs(e),(e<16?"0":"")+e.toString(16)}function Ub(e,t,a,r){return r<=0?e=t=a=NaN:a<=0||a>=1?e=t=NaN:t<=0&&(e=NaN),new Oa(e,t,a,r)}function LS(e){if(e instanceof Oa)return new Oa(e.h,e.s,e.l,e.opacity);if(e instanceof jl||(e=fl(e)),!e)return new Oa;if(e instanceof Oa)return e;e=e.rgb();var t=e.r/255,a=e.g/255,r=e.b/255,i=Math.min(t,a,r),l=Math.max(t,a,r),u=NaN,f=l-i,m=(l+i)/2;return f?(t===l?u=(a-r)/f+(a<r)*6:a===l?u=(r-t)/f+2:u=(t-a)/f+4,f/=m<.5?l+i:2-l-i,u*=60):f=m>0&&m<1?0:u,new Oa(u,f,m,e.opacity)}function D5(e,t,a,r){return arguments.length===1?LS(e):new Oa(e,t,a,r??1)}function Oa(e,t,a,r){this.h=+e,this.s=+t,this.l=+a,this.opacity=+r}pp(Oa,D5,AS(jl,{brighter(e){return e=e==null?Au:Math.pow(Au,e),new Oa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ul:Math.pow(ul,e),new Oa(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,a=this.l,r=a+(a<.5?a:1-a)*t,i=2*a-r;return new Vn(Ph(e>=240?e-240:e+120,i,r),Ph(e,i,r),Ph(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Oa($b(this.h),Wc(this.s),Wc(this.l),Lu(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=Lu(this.opacity);return`${e===1?"hsl(":"hsla("}${$b(this.h)}, ${Wc(this.s)*100}%, ${Wc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $b(e){return e=(e||0)%360,e<0?e+360:e}function Wc(e){return Math.max(0,Math.min(1,e||0))}function Ph(e,t,a){return(e<60?t+(a-t)*e/60:e<180?a:e<240?t+(a-t)*(240-e)/60:t)*255}const OS=e=>()=>e;function M5(e,t){return function(a){return e+a*t}}function z5(e,t,a){return e=Math.pow(e,a),t=Math.pow(t,a)-e,a=1/a,function(r){return Math.pow(e+r*t,a)}}function U5(e){return(e=+e)==1?DS:function(t,a){return a-t?z5(t,a,e):OS(isNaN(t)?a:t)}}function DS(e,t){var a=t-e;return a?M5(e,a):OS(isNaN(e)?t:e)}const Hb=(function e(t){var a=U5(t);function r(i,l){var u=a((i=km(i)).r,(l=km(l)).r),f=a(i.g,l.g),m=a(i.b,l.b),h=DS(i.opacity,l.opacity);return function(g){return i.r=u(g),i.g=f(g),i.b=m(g),i.opacity=h(g),i+""}}return r.gamma=e,r})(1);function Yr(e,t){return e=+e,t=+t,function(a){return e*(1-a)+t*a}}var Rm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gh=new RegExp(Rm.source,"g");function $5(e){return function(){return e}}function H5(e){return function(t){return e(t)+""}}function B5(e,t){var a=Rm.lastIndex=Gh.lastIndex=0,r,i,l,u=-1,f=[],m=[];for(e=e+"",t=t+"";(r=Rm.exec(e))&&(i=Gh.exec(t));)(l=i.index)>a&&(l=t.slice(a,l),f[u]?f[u]+=l:f[++u]=l),(r=r[0])===(i=i[0])?f[u]?f[u]+=i:f[++u]=i:(f[++u]=null,m.push({i:u,x:Yr(r,i)})),a=Gh.lastIndex;return a<t.length&&(l=t.slice(a),f[u]?f[u]+=l:f[++u]=l),f.length<2?m[0]?H5(m[0].x):$5(t):(t=m.length,function(h){for(var g=0,y;g<t;++g)f[(y=m[g]).i]=y.x(h);return f.join("")})}var Bb=180/Math.PI,Tm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function MS(e,t,a,r,i,l){var u,f,m;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(m=e*a+t*r)&&(a-=e*m,r-=t*m),(f=Math.sqrt(a*a+r*r))&&(a/=f,r/=f,m/=f),e*r<t*a&&(e=-e,t=-t,m=-m,u=-u),{translateX:i,translateY:l,rotate:Math.atan2(t,e)*Bb,skewX:Math.atan(m)*Bb,scaleX:u,scaleY:f}}var eu;function I5(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Tm:MS(t.a,t.b,t.c,t.d,t.e,t.f)}function P5(e){return e==null||(eu||(eu=document.createElementNS("http://www.w3.org/2000/svg","g")),eu.setAttribute("transform",e),!(e=eu.transform.baseVal.consolidate()))?Tm:(e=e.matrix,MS(e.a,e.b,e.c,e.d,e.e,e.f))}function zS(e,t,a,r){function i(h){return h.length?h.pop()+" ":""}function l(h,g,y,v,b,w){if(h!==y||g!==v){var N=b.push("translate(",null,t,null,a);w.push({i:N-4,x:Yr(h,y)},{i:N-2,x:Yr(g,v)})}else(y||v)&&b.push("translate("+y+t+v+a)}function u(h,g,y,v){h!==g?(h-g>180?g+=360:g-h>180&&(h+=360),v.push({i:y.push(i(y)+"rotate(",null,r)-2,x:Yr(h,g)})):g&&y.push(i(y)+"rotate("+g+r)}function f(h,g,y,v){h!==g?v.push({i:y.push(i(y)+"skewX(",null,r)-2,x:Yr(h,g)}):g&&y.push(i(y)+"skewX("+g+r)}function m(h,g,y,v,b,w){if(h!==y||g!==v){var N=b.push(i(b)+"scale(",null,",",null,")");w.push({i:N-4,x:Yr(h,y)},{i:N-2,x:Yr(g,v)})}else(y!==1||v!==1)&&b.push(i(b)+"scale("+y+","+v+")")}return function(h,g){var y=[],v=[];return h=e(h),g=e(g),l(h.translateX,h.translateY,g.translateX,g.translateY,y,v),u(h.rotate,g.rotate,y,v),f(h.skewX,g.skewX,y,v),m(h.scaleX,h.scaleY,g.scaleX,g.scaleY,y,v),h=g=null,function(b){for(var w=-1,N=v.length,j;++w<N;)y[(j=v[w]).i]=j.x(b);return y.join("")}}}var G5=zS(I5,"px, ","px)","deg)"),V5=zS(P5,", ",")",")"),q5=1e-12;function Ib(e){return((e=Math.exp(e))+1/e)/2}function F5(e){return((e=Math.exp(e))-1/e)/2}function Y5(e){return((e=Math.exp(2*e))-1)/(e+1)}const K5=(function e(t,a,r){function i(l,u){var f=l[0],m=l[1],h=l[2],g=u[0],y=u[1],v=u[2],b=g-f,w=y-m,N=b*b+w*w,j,E;if(N<q5)E=Math.log(v/h)/t,j=function(H){return[f+H*b,m+H*w,h*Math.exp(t*H*E)]};else{var R=Math.sqrt(N),k=(v*v-h*h+r*N)/(2*h*a*R),O=(v*v-h*h-r*N)/(2*v*a*R),I=Math.log(Math.sqrt(k*k+1)-k),B=Math.log(Math.sqrt(O*O+1)-O);E=(B-I)/t,j=function(H){var T=H*E,P=Ib(I),X=h/(a*R)*(P*Y5(t*T+I)-F5(I));return[f+X*b,m+X*w,h*P/Ib(t*T+I)]}}return j.duration=E*1e3*t/Math.SQRT2,j}return i.rho=function(l){var u=Math.max(.001,+l),f=u*u,m=f*f;return e(u,f,m)},i})(Math.SQRT2,2,4);var X5=Qu("start","end","cancel","interrupt"),Q5=[],US=0,Pb=1,Am=2,uu=3,Gb=4,Lm=5,du=6;function Wu(e,t,a,r,i,l){var u=e.__transition;if(!u)e.__transition={};else if(a in u)return;Z5(e,a,{name:t,index:r,group:i,on:X5,tween:Q5,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:US})}function gp(e,t){var a=Ma(e,t);if(a.state>US)throw new Error("too late; already scheduled");return a}function Ja(e,t){var a=Ma(e,t);if(a.state>uu)throw new Error("too late; already running");return a}function Ma(e,t){var a=e.__transition;if(!a||!(a=a[t]))throw new Error("transition not found");return a}function Z5(e,t,a){var r=e.__transition,i;r[t]=a,a.timer=fp(l,0,a.time);function l(h){a.state=Pb,a.timer.restart(u,a.delay,a.time),a.delay<=h&&u(h-a.delay)}function u(h){var g,y,v,b;if(a.state!==Pb)return m();for(g in r)if(b=r[g],b.name===a.name){if(b.state===uu)return kb(u);b.state===Gb?(b.state=du,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[g]):+g<t&&(b.state=du,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete r[g])}if(kb(function(){a.state===uu&&(a.state=Gb,a.timer.restart(f,a.delay,a.time),f(h))}),a.state=Am,a.on.call("start",e,e.__data__,a.index,a.group),a.state===Am){for(a.state=uu,i=new Array(v=a.tween.length),g=0,y=-1;g<v;++g)(b=a.tween[g].value.call(e,e.__data__,a.index,a.group))&&(i[++y]=b);i.length=y+1}}function f(h){for(var g=h<a.duration?a.ease.call(null,h/a.duration):(a.timer.restart(m),a.state=Lm,1),y=-1,v=i.length;++y<v;)i[y].call(e,g);a.state===Lm&&(a.on.call("end",e,e.__data__,a.index,a.group),m())}function m(){a.state=du,a.timer.stop(),delete r[t];for(var h in r)return;delete e.__transition}}function fu(e,t){var a=e.__transition,r,i,l=!0,u;if(a){t=t==null?null:t+"";for(u in a){if((r=a[u]).name!==t){l=!1;continue}i=r.state>Am&&r.state<Lm,r.state=du,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete a[u]}l&&delete e.__transition}}function J5(e){return this.each(function(){fu(this,e)})}function W5(e,t){var a,r;return function(){var i=Ja(this,e),l=i.tween;if(l!==a){r=a=l;for(var u=0,f=r.length;u<f;++u)if(r[u].name===t){r=r.slice(),r.splice(u,1);break}}i.tween=r}}function ez(e,t,a){var r,i;if(typeof a!="function")throw new Error;return function(){var l=Ja(this,e),u=l.tween;if(u!==r){i=(r=u).slice();for(var f={name:t,value:a},m=0,h=i.length;m<h;++m)if(i[m].name===t){i[m]=f;break}m===h&&i.push(f)}l.tween=i}}function tz(e,t){var a=this._id;if(e+="",arguments.length<2){for(var r=Ma(this.node(),a).tween,i=0,l=r.length,u;i<l;++i)if((u=r[i]).name===e)return u.value;return null}return this.each((t==null?W5:ez)(a,e,t))}function xp(e,t,a){var r=e._id;return e.each(function(){var i=Ja(this,r);(i.value||(i.value={}))[t]=a.apply(this,arguments)}),function(i){return Ma(i,r).value[t]}}function $S(e,t){var a;return(typeof t=="number"?Yr:t instanceof fl?Hb:(a=fl(t))?(t=a,Hb):B5)(e,t)}function nz(e){return function(){this.removeAttribute(e)}}function az(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rz(e,t,a){var r,i=a+"",l;return function(){var u=this.getAttribute(e);return u===i?null:u===r?l:l=t(r=u,a)}}function sz(e,t,a){var r,i=a+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===i?null:u===r?l:l=t(r=u,a)}}function iz(e,t,a){var r,i,l;return function(){var u,f=a(this),m;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),m=f+"",u===m?null:u===r&&m===i?l:(i=m,l=t(r=u,f)))}}function oz(e,t,a){var r,i,l;return function(){var u,f=a(this),m;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),m=f+"",u===m?null:u===r&&m===i?l:(i=m,l=t(r=u,f)))}}function lz(e,t){var a=Ju(e),r=a==="transform"?V5:$S;return this.attrTween(e,typeof t=="function"?(a.local?oz:iz)(a,r,xp(this,"attr."+e,t)):t==null?(a.local?az:nz)(a):(a.local?sz:rz)(a,r,t))}function cz(e,t){return function(a){this.setAttribute(e,t.call(this,a))}}function uz(e,t){return function(a){this.setAttributeNS(e.space,e.local,t.call(this,a))}}function dz(e,t){var a,r;function i(){var l=t.apply(this,arguments);return l!==r&&(a=(r=l)&&uz(e,l)),a}return i._value=t,i}function fz(e,t){var a,r;function i(){var l=t.apply(this,arguments);return l!==r&&(a=(r=l)&&cz(e,l)),a}return i._value=t,i}function hz(e,t){var a="attr."+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;var r=Ju(e);return this.tween(a,(r.local?dz:fz)(r,t))}function mz(e,t){return function(){gp(this,e).delay=+t.apply(this,arguments)}}function pz(e,t){return t=+t,function(){gp(this,e).delay=t}}function gz(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?mz:pz)(t,e)):Ma(this.node(),t).delay}function xz(e,t){return function(){Ja(this,e).duration=+t.apply(this,arguments)}}function yz(e,t){return t=+t,function(){Ja(this,e).duration=t}}function vz(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?xz:yz)(t,e)):Ma(this.node(),t).duration}function bz(e,t){if(typeof t!="function")throw new Error;return function(){Ja(this,e).ease=t}}function _z(e){var t=this._id;return arguments.length?this.each(bz(t,e)):Ma(this.node(),t).ease}function Sz(e,t){return function(){var a=t.apply(this,arguments);if(typeof a!="function")throw new Error;Ja(this,e).ease=a}}function wz(e){if(typeof e!="function")throw new Error;return this.each(Sz(this._id,e))}function Nz(e){typeof e!="function"&&(e=_S(e));for(var t=this._groups,a=t.length,r=new Array(a),i=0;i<a;++i)for(var l=t[i],u=l.length,f=r[i]=[],m,h=0;h<u;++h)(m=l[h])&&e.call(m,m.__data__,h,l)&&f.push(m);return new _r(r,this._parents,this._name,this._id)}function jz(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,a=e._groups,r=t.length,i=a.length,l=Math.min(r,i),u=new Array(r),f=0;f<l;++f)for(var m=t[f],h=a[f],g=m.length,y=u[f]=new Array(g),v,b=0;b<g;++b)(v=m[b]||h[b])&&(y[b]=v);for(;f<r;++f)u[f]=t[f];return new _r(u,this._parents,this._name,this._id)}function Ez(e){return(e+"").trim().split(/^|\s+/).every(function(t){var a=t.indexOf(".");return a>=0&&(t=t.slice(0,a)),!t||t==="start"})}function Cz(e,t,a){var r,i,l=Ez(t)?gp:Ja;return function(){var u=l(this,e),f=u.on;f!==r&&(i=(r=f).copy()).on(t,a),u.on=i}}function kz(e,t){var a=this._id;return arguments.length<2?Ma(this.node(),a).on.on(e):this.each(Cz(a,e,t))}function Rz(e){return function(){var t=this.parentNode;for(var a in this.__transition)if(+a!==e)return;t&&t.removeChild(this)}}function Tz(){return this.on("end.remove",Rz(this._id))}function Az(e){var t=this._name,a=this._id;typeof e!="function"&&(e=hp(e));for(var r=this._groups,i=r.length,l=new Array(i),u=0;u<i;++u)for(var f=r[u],m=f.length,h=l[u]=new Array(m),g,y,v=0;v<m;++v)(g=f[v])&&(y=e.call(g,g.__data__,v,f))&&("__data__"in g&&(y.__data__=g.__data__),h[v]=y,Wu(h[v],t,a,v,h,Ma(g,a)));return new _r(l,this._parents,t,a)}function Lz(e){var t=this._name,a=this._id;typeof e!="function"&&(e=bS(e));for(var r=this._groups,i=r.length,l=[],u=[],f=0;f<i;++f)for(var m=r[f],h=m.length,g,y=0;y<h;++y)if(g=m[y]){for(var v=e.call(g,g.__data__,y,m),b,w=Ma(g,a),N=0,j=v.length;N<j;++N)(b=v[N])&&Wu(b,t,a,N,v,w);l.push(v),u.push(g)}return new _r(l,u,t,a)}var Oz=Nl.prototype.constructor;function Dz(){return new Oz(this._groups,this._parents)}function Mz(e,t){var a,r,i;return function(){var l=Mi(this,e),u=(this.style.removeProperty(e),Mi(this,e));return l===u?null:l===a&&u===r?i:i=t(a=l,r=u)}}function HS(e){return function(){this.style.removeProperty(e)}}function zz(e,t,a){var r,i=a+"",l;return function(){var u=Mi(this,e);return u===i?null:u===r?l:l=t(r=u,a)}}function Uz(e,t,a){var r,i,l;return function(){var u=Mi(this,e),f=a(this),m=f+"";return f==null&&(m=f=(this.style.removeProperty(e),Mi(this,e))),u===m?null:u===r&&m===i?l:(i=m,l=t(r=u,f))}}function $z(e,t){var a,r,i,l="style."+t,u="end."+l,f;return function(){var m=Ja(this,e),h=m.on,g=m.value[l]==null?f||(f=HS(t)):void 0;(h!==a||i!==g)&&(r=(a=h).copy()).on(u,i=g),m.on=r}}function Hz(e,t,a){var r=(e+="")=="transform"?G5:$S;return t==null?this.styleTween(e,Mz(e,r)).on("end.style."+e,HS(e)):typeof t=="function"?this.styleTween(e,Uz(e,r,xp(this,"style."+e,t))).each($z(this._id,e)):this.styleTween(e,zz(e,r,t),a).on("end.style."+e,null)}function Bz(e,t,a){return function(r){this.style.setProperty(e,t.call(this,r),a)}}function Iz(e,t,a){var r,i;function l(){var u=t.apply(this,arguments);return u!==i&&(r=(i=u)&&Bz(e,u,a)),r}return l._value=t,l}function Pz(e,t,a){var r="style."+(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;return this.tween(r,Iz(e,t,a??""))}function Gz(e){return function(){this.textContent=e}}function Vz(e){return function(){var t=e(this);this.textContent=t??""}}function qz(e){return this.tween("text",typeof e=="function"?Vz(xp(this,"text",e)):Gz(e==null?"":e+""))}function Fz(e){return function(t){this.textContent=e.call(this,t)}}function Yz(e){var t,a;function r(){var i=e.apply(this,arguments);return i!==a&&(t=(a=i)&&Fz(i)),t}return r._value=e,r}function Kz(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,Yz(e))}function Xz(){for(var e=this._name,t=this._id,a=BS(),r=this._groups,i=r.length,l=0;l<i;++l)for(var u=r[l],f=u.length,m,h=0;h<f;++h)if(m=u[h]){var g=Ma(m,t);Wu(m,e,a,h,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new _r(r,this._parents,e,a)}function Qz(){var e,t,a=this,r=a._id,i=a.size();return new Promise(function(l,u){var f={value:u},m={value:function(){--i===0&&l()}};a.each(function(){var h=Ja(this,r),g=h.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(m)),h.on=t}),i===0&&l()})}var Zz=0;function _r(e,t,a,r){this._groups=e,this._parents=t,this._name=a,this._id=r}function BS(){return++Zz}var gr=Nl.prototype;_r.prototype={constructor:_r,select:Az,selectAll:Lz,selectChild:gr.selectChild,selectChildren:gr.selectChildren,filter:Nz,merge:jz,selection:Dz,transition:Xz,call:gr.call,nodes:gr.nodes,node:gr.node,size:gr.size,empty:gr.empty,each:gr.each,on:kz,attr:lz,attrTween:hz,style:Hz,styleTween:Pz,text:qz,textTween:Kz,remove:Tz,tween:tz,delay:gz,duration:vz,ease:_z,easeVarying:wz,end:Qz,[Symbol.iterator]:gr[Symbol.iterator]};function Jz(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Wz={time:null,delay:0,duration:250,ease:Jz};function e6(e,t){for(var a;!(a=e.__transition)||!(a=a[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return a}function t6(e){var t,a;e instanceof _r?(t=e._id,e=e._name):(t=BS(),(a=Wz).time=dp(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,l=0;l<i;++l)for(var u=r[l],f=u.length,m,h=0;h<f;++h)(m=u[h])&&Wu(m,e,t,h,u,a||e6(m,t));return new _r(r,this._parents,e,t)}Nl.prototype.interrupt=J5;Nl.prototype.transition=t6;const tu=e=>()=>e;function n6(e,{sourceEvent:t,target:a,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function vr(e,t,a){this.k=e,this.x=t,this.y=a}vr.prototype={constructor:vr,scale:function(e){return e===1?this:new vr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new vr(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 yp=new vr(1,0,0);vr.prototype;function Vh(e){e.stopImmediatePropagation()}function Ho(e){e.preventDefault(),e.stopImmediatePropagation()}function a6(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function r6(){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 Vb(){return this.__zoom||yp}function s6(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function i6(){return navigator.maxTouchPoints||"ontouchstart"in this}function o6(e,t,a){var r=e.invertX(t[0][0])-a[0][0],i=e.invertX(t[1][0])-a[1][0],l=e.invertY(t[0][1])-a[0][1],u=e.invertY(t[1][1])-a[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function l6(){var e=a6,t=r6,a=o6,r=s6,i=i6,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,m=K5,h=Qu("start","zoom","end"),g,y,v,b=500,w=150,N=0,j=10;function E(D){D.property("__zoom",Vb).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",X).filter(i).on("touchstart.zoom",de).on("touchmove.zoom",le).on("touchend.zoom touchcancel.zoom",ce).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(D,F,A,G){var ae=D.selection?D.selection():D;ae.property("__zoom",Vb),D!==ae?I(D,F,A,G):ae.interrupt().each(function(){B(this,arguments).event(G).start().zoom(null,typeof F=="function"?F.apply(this,arguments):F).end()})},E.scaleBy=function(D,F,A,G){E.scaleTo(D,function(){var ae=this.__zoom.k,ee=typeof F=="function"?F.apply(this,arguments):F;return ae*ee},A,G)},E.scaleTo=function(D,F,A,G){E.transform(D,function(){var ae=t.apply(this,arguments),ee=this.__zoom,J=A==null?O(ae):typeof A=="function"?A.apply(this,arguments):A,L=ee.invert(J),q=typeof F=="function"?F.apply(this,arguments):F;return a(k(R(ee,q),J,L),ae,u)},A,G)},E.translateBy=function(D,F,A,G){E.transform(D,function(){return a(this.__zoom.translate(typeof F=="function"?F.apply(this,arguments):F,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),u)},null,G)},E.translateTo=function(D,F,A,G,ae){E.transform(D,function(){var ee=t.apply(this,arguments),J=this.__zoom,L=G==null?O(ee):typeof G=="function"?G.apply(this,arguments):G;return a(yp.translate(L[0],L[1]).scale(J.k).translate(typeof F=="function"?-F.apply(this,arguments):-F,typeof A=="function"?-A.apply(this,arguments):-A),ee,u)},G,ae)};function R(D,F){return F=Math.max(l[0],Math.min(l[1],F)),F===D.k?D:new vr(F,D.x,D.y)}function k(D,F,A){var G=F[0]-A[0]*D.k,ae=F[1]-A[1]*D.k;return G===D.x&&ae===D.y?D:new vr(D.k,G,ae)}function O(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function I(D,F,A,G){D.on("start.zoom",function(){B(this,arguments).event(G).start()}).on("interrupt.zoom end.zoom",function(){B(this,arguments).event(G).end()}).tween("zoom",function(){var ae=this,ee=arguments,J=B(ae,ee).event(G),L=t.apply(ae,ee),q=A==null?O(L):typeof A=="function"?A.apply(ae,ee):A,re=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),ie=ae.__zoom,ge=typeof F=="function"?F.apply(ae,ee):F,xe=m(ie.invert(q).concat(re/ie.k),ge.invert(q).concat(re/ge.k));return function(Ee){if(Ee===1)Ee=ge;else{var Me=xe(Ee),qe=re/Me[2];Ee=new vr(qe,q[0]-Me[0]*qe,q[1]-Me[1]*qe)}J.zoom(null,Ee)}})}function B(D,F,A){return!A&&D.__zooming||new H(D,F)}function H(D,F){this.that=D,this.args=F,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,F),this.taps=0}H.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,F){return this.mouse&&D!=="mouse"&&(this.mouse[1]=F.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=F.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=F.invert(this.touch1[0])),this.that.__zoom=F,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var F=wa(this.that).datum();h.call(D,this.that,new n6(D,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:h}),F)}};function T(D,...F){if(!e.apply(this,arguments))return;var A=B(this,F).event(D),G=this.__zoom,ae=Math.max(l[0],Math.min(l[1],G.k*Math.pow(2,r.apply(this,arguments)))),ee=Ss(D);if(A.wheel)(A.mouse[0][0]!==ee[0]||A.mouse[0][1]!==ee[1])&&(A.mouse[1]=G.invert(A.mouse[0]=ee)),clearTimeout(A.wheel);else{if(G.k===ae)return;A.mouse=[ee,G.invert(ee)],fu(this),A.start()}Ho(D),A.wheel=setTimeout(J,w),A.zoom("mouse",a(k(R(G,ae),A.mouse[0],A.mouse[1]),A.extent,u));function J(){A.wheel=null,A.end()}}function P(D,...F){if(v||!e.apply(this,arguments))return;var A=D.currentTarget,G=B(this,F,!0).event(D),ae=wa(D.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",re,!0),ee=Ss(D,A),J=D.clientX,L=D.clientY;_5(D.view),Vh(D),G.mouse=[ee,this.__zoom.invert(ee)],fu(this),G.start();function q(ie){if(Ho(ie),!G.moved){var ge=ie.clientX-J,xe=ie.clientY-L;G.moved=ge*ge+xe*xe>N}G.event(ie).zoom("mouse",a(k(G.that.__zoom,G.mouse[0]=Ss(ie,A),G.mouse[1]),G.extent,u))}function re(ie){ae.on("mousemove.zoom mouseup.zoom",null),S5(ie.view,G.moved),Ho(ie),G.event(ie).end()}}function X(D,...F){if(e.apply(this,arguments)){var A=this.__zoom,G=Ss(D.changedTouches?D.changedTouches[0]:D,this),ae=A.invert(G),ee=A.k*(D.shiftKey?.5:2),J=a(k(R(A,ee),G,ae),t.apply(this,F),u);Ho(D),f>0?wa(this).transition().duration(f).call(I,J,G,D):wa(this).call(E.transform,J,G,D)}}function de(D,...F){if(e.apply(this,arguments)){var A=D.touches,G=A.length,ae=B(this,F,D.changedTouches.length===G).event(D),ee,J,L,q;for(Vh(D),J=0;J<G;++J)L=A[J],q=Ss(L,this),q=[q,this.__zoom.invert(q),L.identifier],ae.touch0?!ae.touch1&&ae.touch0[2]!==q[2]&&(ae.touch1=q,ae.taps=0):(ae.touch0=q,ee=!0,ae.taps=1+!!g);g&&(g=clearTimeout(g)),ee&&(ae.taps<2&&(y=q[0],g=setTimeout(function(){g=null},b)),fu(this),ae.start())}}function le(D,...F){if(this.__zooming){var A=B(this,F).event(D),G=D.changedTouches,ae=G.length,ee,J,L,q;for(Ho(D),ee=0;ee<ae;++ee)J=G[ee],L=Ss(J,this),A.touch0&&A.touch0[2]===J.identifier?A.touch0[0]=L:A.touch1&&A.touch1[2]===J.identifier&&(A.touch1[0]=L);if(J=A.that.__zoom,A.touch1){var re=A.touch0[0],ie=A.touch0[1],ge=A.touch1[0],xe=A.touch1[1],Ee=(Ee=ge[0]-re[0])*Ee+(Ee=ge[1]-re[1])*Ee,Me=(Me=xe[0]-ie[0])*Me+(Me=xe[1]-ie[1])*Me;J=R(J,Math.sqrt(Ee/Me)),L=[(re[0]+ge[0])/2,(re[1]+ge[1])/2],q=[(ie[0]+xe[0])/2,(ie[1]+xe[1])/2]}else if(A.touch0)L=A.touch0[0],q=A.touch0[1];else return;A.zoom("touch",a(k(J,L,q),A.extent,u))}}function ce(D,...F){if(this.__zooming){var A=B(this,F).event(D),G=D.changedTouches,ae=G.length,ee,J;for(Vh(D),v&&clearTimeout(v),v=setTimeout(function(){v=null},b),ee=0;ee<ae;++ee)J=G[ee],A.touch0&&A.touch0[2]===J.identifier?delete A.touch0:A.touch1&&A.touch1[2]===J.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(J=Ss(J,this),Math.hypot(y[0]-J[0],y[1]-J[1])<j)){var L=wa(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return E.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:tu(+D),E):r},E.filter=function(D){return arguments.length?(e=typeof D=="function"?D:tu(!!D),E):e},E.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:tu(!!D),E):i},E.extent=function(D){return arguments.length?(t=typeof D=="function"?D:tu([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),E):t},E.scaleExtent=function(D){return arguments.length?(l[0]=+D[0],l[1]=+D[1],E):[l[0],l[1]]},E.translateExtent=function(D){return arguments.length?(u[0][0]=+D[0][0],u[1][0]=+D[1][0],u[0][1]=+D[0][1],u[1][1]=+D[1][1],E):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},E.constrain=function(D){return arguments.length?(a=D,E):a},E.duration=function(D){return arguments.length?(f=+D,E):f},E.interpolate=function(D){return arguments.length?(m=D,E):m},E.on=function(){var D=h.on.apply(h,arguments);return D===h?E:D},E.clickDistance=function(D){return arguments.length?(N=(D=+D)*D,E):Math.sqrt(N)},E.tapDistance=function(D){return arguments.length?(j=+D,E):j},E}const c6=new Set(["CONTAINS","IMPLEMENTS","CORRESPONDS"]),u6=new Set(["REFERENCES","MENTIONS"]);function d6(e){return c6.has(e)?"skeleton":u6.has(e)?"weak":"standard"}const f6=30,nu=800,Bo=500;function h6({centerNode:e,neighbors:t}){const[a,r]=_.useState(t.length>f6?"table":"graph");return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-end gap-1 mb-3",children:[d.jsx("button",{onClick:()=>r("graph"),className:`p-1.5 rounded transition-colors ${a==="graph"?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,title:"力导向图",children:d.jsx(bC,{size:16})}),d.jsx("button",{onClick:()=>r("table"),className:`p-1.5 rounded transition-colors ${a==="table"?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,title:"表格模式",children:d.jsx(jC,{size:16})})]}),a==="graph"?d.jsx(m6,{centerNode:e,neighbors:t}):d.jsx(p6,{neighbors:t})]})}function m6({centerNode:e,neighbors:t}){const a=_.useRef(null),r=Ot(),{t:i}=ye(),l=_.useCallback(f=>r(aa.entity(f)),[r]),u=_.useCallback(f=>r(aa.relation(f)),[r]);return _.useEffect(()=>{const f=a.current;if(!f)return;const m=wa(f);m.selectAll("*").remove();const h=new Map;h.set(e.id,{id:e.id,name:e.name,type:e.type,kind:e.kind,isCenter:!0,x:nu/2,y:Bo/2});for(const k of t)h.has(k.neighbor.id)||h.set(k.neighbor.id,{id:k.neighbor.id,name:k.neighbor.name,type:k.neighbor.type,kind:k.neighbor.kind,isCenter:!1});const g=Array.from(h.values()),y=t.map(k=>{const O={id:k.id,type:k.type,edgeClass:d6(k.type),source:k.direction==="outgoing"?e.id:k.neighbor.id,target:k.direction==="outgoing"?k.neighbor.id:e.id};return k.confidence!==void 0&&(O.confidence=k.confidence),O});m.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 b=m.append("g"),w=l6().scaleExtent([.3,3]).on("zoom",k=>{b.attr("transform",k.transform)});m.call(w).call(w.transform,yp);const N=b.selectAll("line.link").data(y).join("line").attr("class","link").attr("stroke",k=>k.edgeClass==="skeleton"?"var(--c4a-text-secondary)":"var(--c4a-border-subtle)").attr("stroke-width",k=>k.edgeClass==="skeleton"?2:1).attr("stroke-dasharray",k=>k.edgeClass==="weak"?"4 3":null).attr("opacity",k=>k.edgeClass==="weak"?.6:1).attr("marker-end","url(#arrow)").style("cursor","pointer").on("click",(k,O)=>u(O.id)).on("mouseenter",function(){wa(this).attr("stroke","var(--c4a-accent)").attr("stroke-width",function(){return Number(wa(this).attr("stroke-width"))+1})}).on("mouseleave",function(k,O){wa(this).attr("stroke",O.edgeClass==="skeleton"?"var(--c4a-text-secondary)":"var(--c4a-border-subtle)").attr("stroke-width",O.edgeClass==="skeleton"?2:1)});N.append("title").text(k=>{const O=vl(k.confidence);return O?`${k.type} · ${i(O.labelKey)}`:k.type});const j=b.selectAll("text.link-label").data(y).join("text").attr("class","link-label").text(k=>k.type).attr("font-family","var(--font-mono)").attr("font-size",9).attr("fill","var(--c4a-text-muted)").attr("text-anchor","middle").attr("dy",-4),E=b.selectAll("g.node").data(g,k=>k.id).join("g").attr("class","node").style("cursor","pointer").on("click",(k,O)=>l(O.id));E.append("circle").attr("r",k=>k.isCenter?24:18).attr("fill",k=>k.isCenter?"var(--c4a-accent)":"var(--c4a-bg-elevated)").attr("stroke",k=>k.isCenter?"#fff":"var(--c4a-border-default)").attr("stroke-width",k=>k.isCenter?2:1),E.append("text").text(k=>k.name.length>12?k.name.slice(0,12)+"…":k.name).attr("font-family","var(--font-mono)").attr("font-size",10).attr("fill","var(--c4a-text-primary)").attr("text-anchor","middle").attr("dy",k=>k.isCenter?36:30),E.append("title").text(k=>{let O=`${k.name}
|
|
192
|
+
type: ${k.type}`;return k.kind&&(O+=`
|
|
193
|
+
kind: ${k.kind}`),O});const R=BD(g).force("link",jD(y).id(k=>k.id).distance(120)).force("charge",ID().strength(-300)).force("center",rD(nu/2,Bo/2)).force("collide",wD(30)).on("tick",()=>{N.attr("x1",k=>k.source.x??0).attr("y1",k=>k.source.y??0).attr("x2",k=>k.target.x??0).attr("y2",k=>k.target.y??0),j.attr("x",k=>{const O=k.source.x??0,I=k.target.x??0;return(O+I)/2}).attr("y",k=>{const O=k.source.y??0,I=k.target.y??0;return(O+I)/2}),E.attr("transform",k=>`translate(${k.x??0},${k.y??0})`)});return E.each(function(k,O){const I=wa(this);let B=!1;I.on("mousedown.drag",H=>{H.stopPropagation(),B=!0;const T=g[O],P=f.getBoundingClientRect(),X=le=>{if(!B)return;const ce=b.attr("transform");let D=0,F=0,A=1;if(ce){const ee=ce.match(/translate\(([-\d.e+]+)[, ]([-\d.e+]+)\)\s*scale\(([-\d.e+]+)\)/);ee&&(D=parseFloat(ee[1]),F=parseFloat(ee[2]),A=parseFloat(ee[3]))}const G=(le.clientX-P.left)/P.width*nu,ae=(le.clientY-P.top)/P.height*Bo;T.fx=(G-D)/A,T.fy=(ae-F)/A,R.alpha(.3).restart()},de=()=>{B=!1,T.fx=null,T.fy=null,document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",de)};document.addEventListener("mousemove",X),document.addEventListener("mouseup",de)})}),()=>{R.stop()}},[e,t,l,u]),d.jsx("svg",{ref:a,width:"100%",height:Bo,viewBox:`0 0 ${nu} ${Bo}`,className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface"})}function p6({neighbors:e}){const t=Ot();return d.jsx("div",{className:"rounded border border-c4a-border-subtle overflow-auto",children:d.jsxs("table",{className:"w-full text-xs font-mono",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-c4a-border-subtle bg-c4a-bg-surface text-c4a-text-muted text-left",children:[d.jsx("th",{className:"px-3 py-2",children:"NAME"}),d.jsx("th",{className:"px-3 py-2",children:"TYPE"}),d.jsx("th",{className:"px-3 py-2",children:"KIND"}),d.jsx("th",{className:"px-3 py-2",children:"EDGE"}),d.jsx("th",{className:"px-3 py-2",children:"DIRECTION"})]})}),d.jsx("tbody",{children:e.map(a=>d.jsxs("tr",{className:"border-b border-c4a-border-subtle hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:()=>t(aa.entity(a.neighbor.id)),children:[d.jsx("td",{className:"px-3 py-2 text-c4a-accent",children:a.neighbor.name}),d.jsx("td",{className:"px-3 py-2 text-c4a-text-secondary",children:a.neighbor.type}),d.jsx("td",{className:"px-3 py-2 text-c4a-text-muted",children:a.neighbor.kind??"—"}),d.jsx("td",{className:"px-3 py-2",children:d.jsx(Vt,{variant:"accent",children:a.type})}),d.jsx("td",{className:"px-3 py-2 text-c4a-text-muted",children:a.direction==="outgoing"?"→":"←"})]},a.id))})]})})}function g6({entityId:e,centerNode:t}){const{t:a}=ye(),[r,i]=_.useState([]),[l,u]=_.useState(!1);return _.useEffect(()=>{De.get(`/entities/${e}/neighbors`).then(f=>{const m=[];for(const h of f.neighbors)for(const g of h.via)m.push({id:g.relation_id,type:g.type,direction:g.direction,neighbor:{id:h.id,name:h.name,type:h.type,...h.kind?{kind:h.kind}:{}},...g.weight!==void 0?{weight:g.weight}:{},...g.confidence!==void 0?{confidence:g.confidence}:{}});i(m),u(!0)}).catch(()=>u(!0))},[e]),l?r.length===0?d.jsx(Cn,{title:a("common.empty.entity_neighbors.title"),description:a("common.empty.entity_neighbors.description")}):d.jsx(h6,{centerNode:t,neighbors:r}):d.jsx("p",{className:"text-sm text-c4a-text-muted",children:a("common.loading")})}const x6={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function y6({entityId:e}){const{t}=ye(),[a,r]=_.useState(null),[i,l]=_.useState(null),[u,f]=_.useState("overview");if(_.useEffect(()=>{e&&(l(null),r(null),f("overview"),De.get(`/entities/${e}`).then(r).catch(N=>{N instanceof Ln&&N.status===404?l("not_found"):l("load_failed")}))},[e]),i)return d.jsx(Cn,{title:t(`common.error.${i}`),description:t(`common.error.${i}_description`)});if(!a)return d.jsx("div",{className:"flex items-center justify-center p-8",children:d.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})});const m=x6[a.type]??"🔹",h=a._links,g=h?.relations?.count,y=h?.contents?.count,v=h?.referrers?.count,{atoms:b,...w}=a.data;return d.jsxs("div",{className:"flex flex-1 flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xl",children:m}),d.jsx("h2",{className:"font-mono text-xl font-bold text-c4a-text-primary",children:a.name})]}),d.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[d.jsx(Vt,{children:a.type}),a.kind&&d.jsx(Vt,{variant:"muted",children:a.kind})]}),(a.perspective||a.scope)&&d.jsxs("div",{className:"mt-1 flex flex-wrap items-baseline gap-4 text-xs text-c4a-text-muted",children:[a.perspective&&d.jsxs("span",{children:[t("entity.detail.perspective"),":"," ",d.jsx("span",{className:"text-c4a-text-secondary",children:a.perspective})]}),a.scope&&d.jsxs("span",{children:[t("entity.detail.scope"),":"," ",d.jsx("span",{className:"text-c4a-text-secondary",children:a.scope})]})]}),d.jsxs(Km,{value:u,onChange:N=>f(N),children:[d.jsx("div",{className:"mt-3",children:d.jsxs(Xm,{children:[d.jsx(Va,{value:"overview",children:t("entity.detail.tab.overview")}),d.jsxs(Va,{value:"relations",children:[t("entity.detail.tab.relations"),g!==void 0&&` (${g})`]}),d.jsxs(Va,{value:"contents",children:[t("entity.detail.tab.contents"),y!==void 0&&` (${y})`]}),d.jsxs(Va,{value:"referrers",children:[t("entity.detail.tab.referrers"),v!==void 0&&` (${v})`]}),d.jsx(Va,{value:"neighbors",children:t("entity.detail.tab.neighbors")})]})}),d.jsxs("div",{className:"mt-4 flex-1",children:[d.jsx(Sa,{value:"overview",children:d.jsx(H3,{data:w,atoms:b})}),d.jsx(Sa,{value:"relations",children:d.jsx(eD,{entityId:a.id})}),d.jsx(Sa,{value:"contents",children:d.jsx(nD,{entityId:a.id})}),d.jsx(Sa,{value:"referrers",children:d.jsx(aD,{entityId:a.id})}),d.jsx(Sa,{value:"neighbors",children:d.jsx(g6,{entityId:a.id,centerNode:{id:a.id,name:a.name,type:a.type,...a.kind?{kind:a.kind}:{}}})})]})]})]})}const IS={Component:"🏗",SoR:"📋",Product:"📦",Container:"📂",Contract:"📝",Epic:"🎯"};function v6(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return e}}function b6({relationId:e}){const{t}=ye(),a=Ot(),r=$i(),[i,l]=_.useState(null),[u,f]=_.useState(null),[m,h]=_.useState([]),[g,y]=_.useState(!1);_.useEffect(()=>{e&&(f(null),l(null),h([]),y(!1),De.get(`/relations/${e}`).then(N=>{l(N),De.get(`/relations/${e}/contents`).then(j=>{h(j.contents??[]),y(!0)}).catch(()=>y(!0))}).catch(N=>{N instanceof Ln&&N.status===404?f("not_found"):f("load_failed")}))},[e]);const v=N=>{const j=IS[N.type]??"🔹";r?.active?r.navigate("entity",N.id,N.name,j):a(aa.entity(N.id))};if(u)return d.jsx(Cn,{title:t(`common.error.${u}`),description:t(`common.error.${u}_description`)});if(!i)return d.jsx("div",{className:"flex items-center justify-center p-8",children:d.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})});const b=vl(i.confidence),w=i.metadata?._source==="field_sync"?t("relation.detail.source_field_sync"):t("relation.detail.source_explicit");return d.jsxs("div",{className:"flex flex-1 flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("h2",{className:"font-mono text-xl font-bold text-c4a-text-primary",children:i.type}),b&&d.jsx(Vt,{variant:b.variant,tooltip:`confidence: ${b.value}`,children:t(b.labelKey)})]}),d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-4",children:[d.jsx(qb,{label:t("relation.detail.from"),entity:i.from,onClick:()=>v(i.from)}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-c4a-text-muted text-lg",children:"→"}),d.jsx(Vt,{variant:"accent",children:i.type}),d.jsx("span",{className:"text-c4a-text-muted text-lg",children:"→"})]}),d.jsx(qb,{label:t("relation.detail.to"),entity:i.to,onClick:()=>v(i.to)})]}),!!i.data.description&&d.jsxs("div",{className:"mt-4",children:[d.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.description")}),d.jsx("p",{className:"text-sm text-c4a-text-secondary",children:String(i.data.description)})]}),Object.keys(i.data).filter(N=>N!=="description").length>0&&d.jsxs("div",{className:"mt-4",children:[d.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.data")}),d.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3",children:d.jsx(Oi,{data:Object.fromEntries(Object.entries(i.data).filter(([N])=>N!=="description")),defaultExpanded:2})})]}),g&&m.length>0&&d.jsxs("div",{className:"mt-4",children:[d.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.source_refs")}),d.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:m.map(N=>d.jsx(pS,{content:{hash_id:N.hash_id,...N.source_path?{source_path:N.source_path}:{},...N.span?{span:N.span}:{}}},N.hash_id))})]}),d.jsxs("div",{className:"mt-4",children:[d.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.meta")}),d.jsxs("div",{className:"flex flex-wrap gap-4 text-xs",children:[d.jsxs("span",{className:"text-c4a-text-muted",children:[t("relation.detail.source_label"),":",d.jsx("span",{className:"text-c4a-text-secondary ml-1",children:w})]}),i.metadata?.created_at&&d.jsxs("span",{className:"text-c4a-text-muted",children:[t("content.detail.created_at"),":",d.jsx("span",{className:"text-c4a-text-secondary ml-1",children:v6(String(i.metadata.created_at))})]})]})]})]})}function qb({label:e,entity:t,onClick:a}){const r=IS[t.type]??"🔹";return d.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:a,children:[d.jsx("p",{className:"text-[10px] font-mono uppercase text-c4a-text-muted mb-1",children:e}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{children:r}),d.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:t.name})]}),d.jsxs("div",{className:"mt-1 flex items-center gap-1",children:[d.jsx(Vt,{children:t.type}),t.kind&&d.jsx(Vt,{variant:"muted",children:t.kind})]})]})}function _6({anchor:e,children:t}){const{t:a}=ye(),r=Vo(w=>w.tabs),i=Vo(w=>w.activeTabId),l=Vo(w=>w.mode),{reset:u,setAnchor:f,activateTab:m,closeTab:h,closeAll:g,toggleMode:y}=Vo.getState();_.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=r.find(w=>w.id===i),b=r.length>1;return d.jsx(gT,{children:d.jsxs("div",{className:"flex flex-1 flex-col",children:[d.jsx("div",{className:"flex flex-1 flex-col",children:!v||v.isAnchor?t:d.jsx(S6,{tab:v})}),b&&d.jsxs("div",{className:"flex h-5 items-center border-t border-c4a-border-subtle bg-c4a-bg-surface",children:[d.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:r.map(w=>{const N=w.id===i;return d.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 ${N?"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:()=>m(w.id),children:[w.icon&&d.jsx("span",{className:"shrink-0 text-[10px]",children:w.icon}),d.jsx("span",{className:"truncate",children:w.label}),!w.isAnchor&&d.jsx("button",{type:"button",className:"ml-0.5 shrink-0 text-c4a-text-muted hover:text-c4a-text-primary",onClick:j=>{j.stopPropagation(),h(w.id)},children:d.jsx(br,{className:"h-2 w-2"})})]},w.id)})}),d.jsxs("div",{className:"flex items-center gap-0.5 px-1 shrink-0",children:[d.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:a(l==="append"?"explorer.mode.append_tooltip":"explorer.mode.replace_tooltip"),onClick:y,children:d.jsx("span",{className:"text-[10px]",children:l==="append"?"📑":"📌"})}),d.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:a("explorer.close_all"),onClick:g,children:d.jsx(br,{className:"h-2.5 w-2.5"})})]})]})]})})}function S6({tab:e}){switch(e.type){case"content":return d.jsx(mS,{hashId:e.resourceId,sourcePath:e.label});case"entity":return d.jsx(y6,{entityId:e.resourceId});case"relation":return d.jsx(b6,{relationId:e.resourceId});default:return null}}function Fb(e){if(!e)return"";try{const t=new Date(e),a=new Date,r=t.getFullYear()===a.getFullYear(),i=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 r?`${i}-${l} ${u}:${f}`:`${t.getFullYear()}-${i}-${l} ${u}:${f}`}catch{return""}}function w6({versions:e,currentHashId:t,onChange:a}){const[r,i]=_.useState(!1),l=_.useRef(null),u=_.useRef(null),f=_.useCallback(v=>{l.current&&!l.current.contains(v.target)&&i(!1)},[]);_.useEffect(()=>{if(r)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[r,f]);const m=_.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),e.length>1&&i(!0)},[e.length]),h=_.useCallback(()=>{u.current=setTimeout(()=>i(!1),150)},[]),g=e.find(v=>v.hash_id===t)??e[0],y=Fb(g?.created_at);return d.jsxs("div",{ref:l,className:"relative",onMouseEnter:m,onMouseLeave:h,children:[d.jsxs("button",{type:"button",onClick:e.length>1?()=>i(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:[d.jsxs("span",{children:[d.jsx("span",{className:"font-extrabold",children:g?.version_label}),y?` ${y}`:""]}),e.length>1&&d.jsx(rn,{size:12,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${r?"rotate-90":""}`})]}),r&&d.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 b=v.hash_id===t,w=Fb(v.created_at);return d.jsx("div",{className:`flex cursor-pointer items-center px-2 py-1 font-mono text-[10px] transition-colors hover:bg-c4a-bg-hover ${b?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,onClick:()=>{a(v.hash_id),i(!1)},children:d.jsxs("span",{children:[d.jsx("span",{className:"font-extrabold",children:v.version_label}),w?` ${w}`:""]})},v.hash_id)})})]})}const N6={none:"bg-c4a-bg-hover text-c4a-text-muted",indexed:"bg-c4a-success/10 text-c4a-success",stale:"bg-c4a-warning/10 text-c4a-warning"};function j6({sourceId:e,sourcePath:t,status:a,loading:r,onIndexed:i}){const{t:l}=ye(),[u,f]=_.useState(!1),[m,h]=_.useState(null),[g,y]=_.useState(null),v=_.useCallback(async()=>{f(!0),h(null);try{const N=await De.post(`/sources/${e}/index`,{paths:[t]});if(N.errors&&N.errors.length>0){const j=N.errors[0];if(j.error==="unsupported_type"){const E=t.slice(t.lastIndexOf("."));h(l("cas.unsupported_type",{ext:E}))}else h(j.error)}else{if(N.indexed?.every(E=>E.status==="exists"))y(l("cas.index_no_change"));else{const E=N.indexed?.filter(R=>R.status==="created").length??0;y(l("cas.index_success",{count:E})),i()}setTimeout(()=>y(null),3e3)}}catch{h(l("cas.index_failed"))}finally{f(!1)}},[e,t,l,i]),b=l(a==="indexed"?"sources.status.indexed":a==="stale"?"sources.status.stale":"sources.status.none"),w=l(a==="none"?"sources.status.go_index":"cas.reindex");return r?null:d.jsxs(d.Fragment,{children:[u?d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm bg-c4a-accent px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",children:[d.jsx(sn,{size:10,className:"animate-spin"}),l("cas.indexing")]}):d.jsxs("span",{className:`group/idx relative inline-block cursor-pointer rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${N6[a]} hover:bg-c4a-accent hover:text-white`,onClick:v,children:[d.jsx("span",{className:"group-hover/idx:hidden",children:b}),d.jsx("span",{className:"hidden group-hover/idx:inline",children:w})]}),m&&d.jsx("span",{className:"font-mono text-[10px] text-c4a-error",children:m}),g&&d.jsx("span",{className:"font-mono text-[10px] text-c4a-success",children:g})]})}function E6(){const{t:e}=ye(),{sourceUuid:t}=xl(),[a]=$u(),r=a.get("path")||"",i=Ot(),{currentRoot:l,loading:u,error:f,fetchRootSource:m}=Iu(),h=Wt(Ds(Ui)),[g,y]=_.useState("original"),[v,b]=_.useState(null),[w,N]=_.useState([]),[j,E]=_.useState(!1),[R,k]=_.useState("");_.useEffect(()=>{t&&m(t).catch(()=>{})},[t,m]);const O=_.useMemo(()=>l?r?Bu(l.tree,r):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,r]),I=h.find(ee=>ee.id===l?.library_id),B=l?.id,H=l?.kind==="source"&&!r,T=_.useCallback(async()=>{if(!B||!O)return;const ee=H?"":r||O.path;if(ee!==void 0){E(!0),b(null),N([]);try{const J=await De.get(`/sources/${B}/files`,{path:ee});b(J.hash_id),k(J.hash_id);try{const L=await De.get(`/sources/${B}/files/versions`,{path:ee});N(L.versions??[])}catch{N([{version:J.version,version_label:J.version_label,hash_id:J.hash_id,created_at:J.created_at??null}])}}catch(J){J instanceof Ln&&J.status===404&&(b(null),N([]))}finally{E(!1)}}},[B,O,r,H]);_.useEffect(()=>{T()},[T]);const P=O?.metadata,X=P?Object.fromEntries(Object.entries(P).map(([ee,J])=>[ee,String(J??"")])):null,de=O?.source_type==="code",le=O?.name??l?.name??"",ce=O?.source_type??null,D=_.useMemo(()=>{if(!l||!I)return[];const ee=l.kind==="source"&&!r,J=[{label:I.is_default?e("sources.library.default_cloud_name"):I.name,to:`/studio/sources/${I.id}`},{label:l.name,...ee?{}:{to:`/studio/sources/${I.id}?rootId=${l.id}`}}];if(r){const L=Go(l.tree,r);for(let q=0;q<L.length-1;q++){const re=L[q];J.push({label:re.name,to:`/studio/sources/${I.id}?rootId=${l.id}&path=${encodeURIComponent(re.path)}`})}L.length>0&&J.push({label:L[L.length-1].name})}return J},[l,I,r,e]),F=[{key:"original",label:e(de?"sources.detail.tab.overview":"sources.detail.tab.original")},{key:"digest",label:e("sources.detail.tab.digest")},{key:"modeling",label:e("sources.detail.tab.modeling")}];if(!u&&f)return d.jsx("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:d.jsx(Cn,{fullPage:!0,title:e("sources.detail.not_found_title"),description:e("sources.detail.not_found_desc"),action:d.jsx("button",{className:"rounded bg-c4a-accent px-4 py-2 text-sm font-medium text-white hover:bg-c4a-accent/90",onClick:()=>i("/studio/sources"),children:e("common.back")})})});if(u||!l||!O)return d.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[d.jsx(As,{segments:[]}),d.jsxs("div",{className:"mt-3 mb-3 flex items-center gap-2",children:[d.jsx("div",{className:"h-5 w-5 shrink-0 animate-pulse rounded bg-c4a-bg-hover"}),d.jsx("div",{className:"h-6 w-56 animate-pulse rounded bg-c4a-bg-hover"})]}),d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx(sn,{size:24,className:"animate-spin text-c4a-text-muted"})})]});const A=v!==null&&!j,G=j?"none":v!==null?O?.index_status==="stale"?"stale":"indexed":"none",ae=H?O?.name??"":r||O?.path||O?.name||"";return d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto c4a-scrollbar p-4 pb-8 md:p-6 md:pb-10",children:[d.jsx(As,{segments:D}),d.jsxs("div",{className:"mt-3 mb-3 flex items-end gap-3",children:[d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[de?d.jsx(Ei,{size:20,className:"shrink-0 text-c4a-accent"}):d.jsx(Wr,{size:20,className:"shrink-0 text-c4a-accent"}),d.jsx("h1",{className:"mb-[0.125rem] min-w-0 break-all font-mono text-xl font-bold leading-none text-c4a-text-primary",children:le})]}),B&&d.jsx(j6,{sourceId:B,sourcePath:ae,status:G,loading:j,onIndexed:T}),d.jsxs("span",{className:"group relative cursor-default",children:[d.jsx(Vt,{variant:"muted",children:e(ce==="code"?"sources.type.code":"sources.type.doc")}),d.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:d.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-[10px]",children:[d.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.origin")}),d.jsxs("dd",{className:"text-c4a-text-secondary",children:[I?.is_default?e("sources.library.default_cloud_name"):I?.name," / ",l?.name]}),d.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.type")}),d.jsx("dd",{className:"text-c4a-text-secondary uppercase",children:le.includes(".")?le.slice(le.lastIndexOf(".")+1):ce??"—"})]})})]}),d.jsx("div",{className:"flex-1"}),A&&w.length>0&&d.jsx("div",{className:"self-center",children:d.jsx(w6,{versions:w,currentHashId:R,onChange:k})})]}),de&&X&&d.jsx("div",{className:"mt-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:d.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-xs md:grid-cols-4",children:[X.repo_name&&d.jsx(au,{label:e("sources.detail.repo"),value:X.repo_name}),X.pinned_branch&&d.jsx(au,{label:e("sources.detail.branch"),value:X.pinned_branch}),X.pinned_hash&&d.jsx(au,{label:e("sources.detail.commit"),value:X.pinned_hash.slice(0,7)}),X.tech_stack&&d.jsx(au,{label:e("sources.detail.tech_stack"),value:X.tech_stack})]})}),A&&R?d.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:d.jsx(_6,{anchor:{id:`content:${R}`,type:"content",resourceId:R,label:le,icon:de?"📦":"📄"},children:d.jsx(mS,{hashId:R,sourcePath:ae})})}):d.jsxs(Km,{value:g,onChange:ee=>y(ee),children:[d.jsx("div",{className:"mt-3",children:d.jsx(Xm,{children:F.map(ee=>d.jsx(Va,{value:ee.key,children:ee.label},ee.key))})}),d.jsxs("div",{className:"mt-4 flex flex-1 flex-col",children:[d.jsx(Sa,{value:"original",children:d.jsx(C6,{node:O,isCode:de})}),d.jsx(Sa,{value:"digest",children:d.jsx(Yb,{message:e("sources.detail.digest_placeholder")})}),d.jsx(Sa,{value:"modeling",children:d.jsx(Yb,{message:e("sources.detail.modeling_placeholder")})})]})]})]})}function au({label:e,value:t}){return d.jsxs("div",{children:[d.jsx("span",{className:"text-c4a-text-muted",children:e}),d.jsx("p",{className:"mt-0.5 font-mono text-c4a-text-primary",children:t})]})}function C6({node:e,isCode:t}){const{t:a}=ye(),r=e.metadata;return t?d.jsxs("div",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[!!r?.description&&d.jsx("p",{children:String(r.description)}),!!r?.dependencies&&d.jsxs("div",{children:[d.jsx("h4",{className:"font-mono text-xs font-bold uppercase text-c4a-text-primary",children:a("sources.detail.dependencies")}),d.jsx("div",{className:"mt-2 rounded bg-c4a-bg-surface p-3 font-mono text-xs",children:Object.entries(r.dependencies).map(([i,l])=>d.jsxs("div",{className:"flex justify-between py-0.5",children:[d.jsx("span",{className:"text-c4a-text-primary",children:i}),d.jsx("span",{className:"text-c4a-text-muted",children:l})]},i))})]}),!r?.description&&!r?.dependencies&&d.jsx("p",{className:"text-c4a-text-muted",children:a("sources.detail.original_code_placeholder")})]}):d.jsx("div",{className:"prose prose-invert max-w-none text-sm text-c4a-text-secondary",children:d.jsx("p",{className:"text-c4a-text-muted",children:a("sources.detail.original_doc_placeholder")})})}function Yb({message:e}){return d.jsx("div",{className:"flex flex-1 items-center justify-center rounded border border-dashed border-c4a-border-subtle p-12",children:d.jsx("p",{className:"text-center text-sm text-c4a-text-muted",children:e})})}const k6=_.lazy(()=>ne(()=>import("./ContentDetail-CeycCxX9.js"),[]).then(e=>({default:e.ContentDetail}))),R6=_.lazy(()=>ne(()=>import("./EntityDetail-Cbkby_pm.js"),[]).then(e=>({default:e.EntityDetail}))),T6=_.lazy(()=>ne(()=>import("./RelationDetail-BhPm2sEi.js"),[]).then(e=>({default:e.RelationDetail}))),A6=NE([{element:d.jsx(Ok,{}),errorElement:d.jsx(Ev,{}),children:[{path:"/",element:d.jsx(Pk,{})},{path:"/login",element:d.jsx(qk,{})},{path:"/auth/callback",element:d.jsx(Yk,{})},{path:"/docs",element:d.jsx(Kk,{})}]},{path:"/studio",element:d.jsx(Ik,{}),errorElement:d.jsx(Ev,{}),children:[{index:!0,element:d.jsx(Jj,{to:"/studio/sources",replace:!0})},{path:"sources",element:d.jsx($R,{})},{path:"sources/add-client",element:d.jsx(hT,{})},{path:"sources/import/:libId",element:d.jsx(eT,{})},{path:"sources/import-dir/:libId",element:d.jsx(sT,{})},{path:"sources/import-remote/:libId",element:d.jsx(fT,{})},{path:"sources/:libId",element:d.jsx(UR,{})},{path:"source/:sourceUuid",element:d.jsx(E6,{})},{path:"contents/:hashId",element:d.jsx(_.Suspense,{fallback:null,children:d.jsx(k6,{})})},{path:"entities/:entityId",element:d.jsx(_.Suspense,{fallback:null,children:d.jsx(R6,{})})},{path:"relations/:relationId",element:d.jsx(_.Suspense,{fallback:null,children:d.jsx(T6,{})})},{path:"modeling",element:d.jsx(Qk,{})},{path:"modeling/code/setup",element:d.jsx(iR,{})},{path:"modeling/code/compile",element:d.jsx(oR,{})},{path:"modeling/code/review",element:d.jsx(lR,{})},{path:"modeling/code/result",element:d.jsx(cR,{})},{path:"brain",element:d.jsx(Zk,{})},{path:"discovery",element:d.jsx(Jk,{})},{path:"sharing",element:d.jsx(Wk,{})},{path:"collaboration",element:d.jsx(eR,{})},{path:"settings/api-keys",element:d.jsx(tR,{})}]},{path:"*",element:d.jsx(Xk,{})}]);function L6(){return _.useEffect(()=>{qn.getState().init(),nl.getState().init();const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return Ea.connect(t),()=>{Ea.disconnect()}},[]),d.jsx(Xj,{router:A6})}u2.createRoot(document.getElementById("root")).render(d.jsx(_.StrictMode,{children:d.jsx(L6,{})}));export{mS as C,y6 as E,b6 as R,ye as a,xl as b,Oe as c,d as j,Ot as u};
|