@c4a/server-cli 0.4.11 → 0.4.12-alpha.1
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/index.js +795 -3402
- package/package.json +1 -1
- package/serve.js +3223 -4193
- package/web/assets/index--UyZtsHr.js +238 -0
- package/web/assets/index-15FuETM5.js +238 -0
- package/web/assets/index-1O90ZcBt.js +238 -0
- package/web/assets/index-2ZaXHlEm.js +12 -0
- package/web/assets/index-5SgaIe6K.js +238 -0
- package/web/assets/index-69TE-Dt9.js +238 -0
- package/web/assets/index-6qWMAJjW.js +12 -0
- package/web/assets/index-8bavzcKH.js +238 -0
- package/web/assets/index-B2JcVRax.js +238 -0
- package/web/assets/index-B3a1j3cz.js +238 -0
- package/web/assets/index-B6EqO_Cg.js +12 -0
- package/web/assets/index-B7OJ5sV_.js +238 -0
- package/web/assets/index-B9YWtkC-.js +12 -0
- package/web/assets/index-BD162a_1.js +238 -0
- package/web/assets/index-BF50bkqY.css +1 -0
- package/web/assets/index-BPMcNaXa.css +1 -0
- package/web/assets/index-BPlwhwPb.css +1 -0
- package/web/assets/index-BW9aouHt.js +238 -0
- package/web/assets/index-BbZvxZvZ.css +1 -0
- package/web/assets/index-BkYFml7g.css +1 -0
- package/web/assets/index-Bnn0CunM.js +238 -0
- package/web/assets/index-BosC7CbW.css +1 -0
- package/web/assets/index-BrJa-9jA.css +1 -0
- package/web/assets/index-C63Z-8cw.js +238 -0
- package/web/assets/index-C6ydhyiL.js +238 -0
- package/web/assets/index-CAXoXe3-.css +1 -0
- package/web/assets/index-CDG7D9Wo.css +1 -0
- package/web/assets/index-CNruo9jb.js +238 -0
- package/web/assets/index-CUGq5bZG.js +12 -0
- package/web/assets/index-CVB_F0xd.js +238 -0
- package/web/assets/index-CVct6UjO.css +1 -0
- package/web/assets/index-CX2QKHgP.js +12 -0
- package/web/assets/index-Cok56quU.css +1 -0
- package/web/assets/index-Ct-X2M8U.js +12 -0
- package/web/assets/index-CtnVCeI7.css +1 -0
- package/web/assets/index-Cu6ttPtz.js +12 -0
- package/web/assets/index-CvTLDILA.css +1 -0
- package/web/assets/index-D0x9zuj2.js +238 -0
- package/web/assets/index-D3-qG0Hp.js +238 -0
- package/web/assets/index-D3UsEQTE.css +1 -0
- package/web/assets/index-D5WvCk3U.js +238 -0
- package/web/assets/index-D6QqUdMz.css +1 -0
- package/web/assets/index-D7EkgIsu.js +12 -0
- package/web/assets/index-DB_YWOXK.js +12 -0
- package/web/assets/index-DBaysFVi.css +1 -0
- package/web/assets/index-DGYdHfUt.js +238 -0
- package/web/assets/index-DIzfj2PR.css +1 -0
- package/web/assets/index-DJiYLRIW.css +1 -0
- package/web/assets/index-DQcztEye.js +238 -0
- package/web/assets/index-DSnxWXVs.css +1 -0
- package/web/assets/index-DX1UQEJF.css +1 -0
- package/web/assets/index-DgtV8nwc.js +238 -0
- package/web/assets/index-DqdyIshw.js +12 -0
- package/web/assets/index-DyF2kEj9.js +238 -0
- package/web/assets/index-H6Rs5Fbq.js +12 -0
- package/web/assets/index-O5LI2GNV.js +238 -0
- package/web/assets/index-SnFvyzm_.css +1 -0
- package/web/assets/index-bnfl0N-T.css +1 -0
- package/web/assets/index-cMgxghVE.css +1 -0
- package/web/assets/index-dDuVahj-.js +12 -0
- package/web/assets/index-fG23cf-l.js +238 -0
- package/web/assets/index-it-5oMch.css +1 -0
- package/web/assets/index-yq497d-W.js +12 -0
- package/web/index.html +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function Av(n,i){for(var r=0;r<i.length;r++){const s=i[r];if(typeof s!="string"&&!Array.isArray(s)){for(const c in s)if(c!=="default"&&!(c in n)){const d=Object.getOwnPropertyDescriptor(s,c);d&&Object.defineProperty(n,c,d.get?d:{enumerable:!0,get:()=>s[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function r(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function s(c){if(c.ep)return;c.ep=!0;const d=r(c);fetch(c.href,d)}})();function Lv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var wu={exports:{}},ar={};var Pm;function kv(){if(Pm)return ar;Pm=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(s,c,d){var h=null;if(d!==void 0&&(h=""+d),c.key!==void 0&&(h=""+c.key),"key"in c){d={};for(var m in c)m!=="key"&&(d[m]=c[m])}else d=c;return c=d.ref,{$$typeof:n,type:s,key:h,ref:c!==void 0?c:null,props:d}}return ar.Fragment=i,ar.jsx=r,ar.jsxs=r,ar}var Im;function Uv(){return Im||(Im=1,wu.exports=kv()),wu.exports}var f=Uv();const Re=n=>typeof n=="string",nr=()=>{let n,i;const r=new Promise((s,c)=>{n=s,i=c});return r.resolve=n,r.reject=i,r},ep=n=>n==null?"":""+n,Hv=(n,i,r)=>{n.forEach(s=>{i[s]&&(r[s]=i[s])})},Bv=/###/g,tp=n=>n&&n.indexOf("###")>-1?n.replace(Bv,"."):n,ap=n=>!n||Re(n),dr=(n,i,r)=>{const s=Re(i)?i.split("."):i;let c=0;for(;c<s.length-1;){if(ap(n))return{};const d=tp(s[c]);!n[d]&&r&&(n[d]=new r),Object.prototype.hasOwnProperty.call(n,d)?n=n[d]:n={},++c}return ap(n)?{}:{obj:n,k:tp(s[c])}},np=(n,i,r)=>{const{obj:s,k:c}=dr(n,i,Object);if(s!==void 0||i.length===1){s[c]=r;return}let d=i[i.length-1],h=i.slice(0,i.length-1),m=dr(n,h,Object);for(;m.obj===void 0&&h.length;)d=`${h[h.length-1]}.${d}`,h=h.slice(0,h.length-1),m=dr(n,h,Object),m?.obj&&typeof m.obj[`${m.k}.${d}`]<"u"&&(m.obj=void 0);m.obj[`${m.k}.${d}`]=r},qv=(n,i,r,s)=>{const{obj:c,k:d}=dr(n,i,Object);c[d]=c[d]||[],c[d].push(r)},eo=(n,i)=>{const{obj:r,k:s}=dr(n,i);if(r&&Object.prototype.hasOwnProperty.call(r,s))return r[s]},Yv=(n,i,r)=>{const s=eo(n,r);return s!==void 0?s:eo(i,r)},Ng=(n,i,r)=>{for(const s in i)s!=="__proto__"&&s!=="constructor"&&(s in n?Re(n[s])||n[s]instanceof String||Re(i[s])||i[s]instanceof String?r&&(n[s]=i[s]):Ng(n[s],i[s],r):n[s]=i[s]);return n},ml=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Vv={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Gv=n=>Re(n)?n.replace(/[&<>"'\/]/g,i=>Vv[i]):n;class Kv{constructor(i){this.capacity=i,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(i){const r=this.regExpMap.get(i);if(r!==void 0)return r;const s=new RegExp(i);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(i,s),this.regExpQueue.push(i),s}}const $v=[" ",",","?","!",";"],Xv=new Kv(20),Qv=(n,i,r)=>{i=i||"",r=r||"";const s=$v.filter(h=>i.indexOf(h)<0&&r.indexOf(h)<0);if(s.length===0)return!0;const c=Xv.getRegExp(`(${s.map(h=>h==="?"?"\\?":h).join("|")})`);let d=!c.test(n);if(!d){const h=n.indexOf(r);h>0&&!c.test(n.substring(0,h))&&(d=!0)}return d},Xu=(n,i,r=".")=>{if(!n)return;if(n[i])return Object.prototype.hasOwnProperty.call(n,i)?n[i]:void 0;const s=i.split(r);let c=n;for(let d=0;d<s.length;){if(!c||typeof c!="object")return;let h,m="";for(let y=d;y<s.length;++y)if(y!==d&&(m+=r),m+=s[y],h=c[m],h!==void 0){if(["string","number","boolean"].indexOf(typeof h)>-1&&y<s.length-1)continue;d+=y-d+1;break}c=h}return c},mr=n=>n?.replace("_","-"),Zv={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,i){console?.[n]?.apply?.(console,i)}};class to{constructor(i,r={}){this.init(i,r)}init(i,r={}){this.prefix=r.prefix||"i18next:",this.logger=i||Zv,this.options=r,this.debug=r.debug}log(...i){return this.forward(i,"log","",!0)}warn(...i){return this.forward(i,"warn","",!0)}error(...i){return this.forward(i,"error","")}deprecate(...i){return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}forward(i,r,s,c){return c&&!this.debug?null:(Re(i[0])&&(i[0]=`${s}${this.prefix} ${i[0]}`),this.logger[r](i))}create(i){return new to(this.logger,{prefix:`${this.prefix}:${i}:`,...this.options})}clone(i){return i=i||this.options,i.prefix=i.prefix||this.prefix,new to(this.logger,i)}}var Ba=new to;class io{constructor(){this.observers={}}on(i,r){return i.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const c=this.observers[s].get(r)||0;this.observers[s].set(r,c+1)}),this}off(i,r){if(this.observers[i]){if(!r){delete this.observers[i];return}this.observers[i].delete(r)}}emit(i,...r){this.observers[i]&&Array.from(this.observers[i].entries()).forEach(([c,d])=>{for(let h=0;h<d;h++)c(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([c,d])=>{for(let h=0;h<d;h++)c.apply(c,[i,...r])})}}class lp extends io{constructor(i,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=i||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}removeNamespaces(i){const r=this.options.ns.indexOf(i);r>-1&&this.options.ns.splice(r,1)}getResource(i,r,s,c={}){const d=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,h=c.ignoreJSONStructure!==void 0?c.ignoreJSONStructure:this.options.ignoreJSONStructure;let m;i.indexOf(".")>-1?m=i.split("."):(m=[i,r],s&&(Array.isArray(s)?m.push(...s):Re(s)&&d?m.push(...s.split(d)):m.push(s)));const y=eo(this.data,m);return!y&&!r&&!s&&i.indexOf(".")>-1&&(i=m[0],r=m[1],s=m.slice(2).join(".")),y||!h||!Re(s)?y:Xu(this.data?.[i]?.[r],s,d)}addResource(i,r,s,c,d={silent:!1}){const h=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator;let m=[i,r];s&&(m=m.concat(h?s.split(h):s)),i.indexOf(".")>-1&&(m=i.split("."),c=r,r=m[1]),this.addNamespaces(r),np(this.data,m,c),d.silent||this.emit("added",i,r,s,c)}addResources(i,r,s,c={silent:!1}){for(const d in s)(Re(s[d])||Array.isArray(s[d]))&&this.addResource(i,r,d,s[d],{silent:!0});c.silent||this.emit("added",i,r,s)}addResourceBundle(i,r,s,c,d,h={silent:!1,skipCopy:!1}){let m=[i,r];i.indexOf(".")>-1&&(m=i.split("."),c=s,s=r,r=m[1]),this.addNamespaces(r);let y=eo(this.data,m)||{};h.skipCopy||(s=JSON.parse(JSON.stringify(s))),c?Ng(y,s,d):y={...y,...s},np(this.data,m,y),h.silent||this.emit("added",i,r,s)}removeResourceBundle(i,r){this.hasResourceBundle(i,r)&&delete this.data[i][r],this.removeNamespaces(r),this.emit("removed",i,r)}hasResourceBundle(i,r){return this.getResource(i,r)!==void 0}getResourceBundle(i,r){return r||(r=this.options.defaultNS),this.getResource(i,r)}getDataByLanguage(i){return this.data[i]}hasLanguageSomeTranslations(i){const r=this.getDataByLanguage(i);return!!(r&&Object.keys(r)||[]).find(c=>r[c]&&Object.keys(r[c]).length>0)}toJSON(){return this.data}}var Eg={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,i,r,s,c){return n.forEach(d=>{i=this.processors[d]?.process(i,r,s,c)??i}),i}};const wg=Symbol("i18next/PATH_KEY");function Fv(){const n=[],i=Object.create(null);let r;return i.get=(s,c)=>(r?.revoke?.(),c===wg?n:(n.push(c),r=Proxy.revocable(s,i),r.proxy)),Proxy.revocable(Object.create(null),i).proxy}function Qu(n,i){const{[wg]:r}=n(Fv());return r.join(i?.keySeparator??".")}const ip={},Cu=n=>!Re(n)&&typeof n!="boolean"&&typeof n!="number";class ao extends io{constructor(i,r={}){super(),Hv(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ba.create("translator")}changeLanguage(i){i&&(this.language=i)}exists(i,r={interpolation:{}}){const s={...r};if(i==null)return!1;const c=this.resolve(i,s);if(c?.res===void 0)return!1;const d=Cu(c.res);return!(s.returnObjects===!1&&d)}extractFromKey(i,r){let s=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const c=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let d=r.ns||this.options.defaultNS||[];const h=s&&i.indexOf(s)>-1,m=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!Qv(i,s,c);if(h&&!m){const y=i.match(this.interpolator.nestingRegexp);if(y&&y.length>0)return{key:i,namespaces:Re(d)?[d]:d};const p=i.split(s);(s!==c||s===c&&this.options.ns.indexOf(p[0])>-1)&&(d=p.shift()),i=p.join(c)}return{key:i,namespaces:Re(d)?[d]:d}}translate(i,r,s){let c=typeof r=="object"?{...r}:r;if(typeof c!="object"&&this.options.overloadTranslationOptionHandler&&(c=this.options.overloadTranslationOptionHandler(arguments)),typeof c=="object"&&(c={...c}),c||(c={}),i==null)return"";typeof i=="function"&&(i=Qu(i,{...this.options,...c})),Array.isArray(i)||(i=[String(i)]);const d=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,h=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,{key:m,namespaces:y}=this.extractFromKey(i[i.length-1],c),p=y[y.length-1];let S=c.nsSeparator!==void 0?c.nsSeparator:this.options.nsSeparator;S===void 0&&(S=":");const x=c.lng||this.language,_=c.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(x?.toLowerCase()==="cimode")return _?d?{res:`${p}${S}${m}`,usedKey:m,exactUsedKey:m,usedLng:x,usedNS:p,usedParams:this.getUsedParamsDetails(c)}:`${p}${S}${m}`:d?{res:m,usedKey:m,exactUsedKey:m,usedLng:x,usedNS:p,usedParams:this.getUsedParamsDetails(c)}:m;const N=this.resolve(i,c);let z=N?.res;const D=N?.usedKey||m,k=N?.exactUsedKey||m,W=["[object Number]","[object Function]","[object RegExp]"],X=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,I=!this.i18nFormat||this.i18nFormat.handleAsObject,se=c.count!==void 0&&!Re(c.count),de=ao.hasDefaultValue(c),V=se?this.pluralResolver.getSuffix(x,c.count,c):"",B=c.ordinal&&se?this.pluralResolver.getSuffix(x,c.count,{ordinal:!1}):"",E=se&&!c.ordinal&&c.count===0,$=E&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${V}`]||c[`defaultValue${B}`]||c.defaultValue;let ne=z;I&&!z&&de&&(ne=$);const ae=Cu(ne),Q=Object.prototype.toString.apply(ne);if(I&&ne&&ae&&W.indexOf(Q)<0&&!(Re(X)&&Array.isArray(ne))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const xe=this.options.returnedObjectHandler?this.options.returnedObjectHandler(D,ne,{...c,ns:y}):`key '${m} (${this.language})' returned an object instead of string.`;return d?(N.res=xe,N.usedParams=this.getUsedParamsDetails(c),N):xe}if(h){const xe=Array.isArray(ne),F=xe?[]:{},ie=xe?k:D;for(const M in ne)if(Object.prototype.hasOwnProperty.call(ne,M)){const P=`${ie}${h}${M}`;de&&!z?F[M]=this.translate(P,{...c,defaultValue:Cu($)?$[M]:void 0,joinArrays:!1,ns:y}):F[M]=this.translate(P,{...c,joinArrays:!1,ns:y}),F[M]===P&&(F[M]=ne[M])}z=F}}else if(I&&Re(X)&&Array.isArray(z))z=z.join(X),z&&(z=this.extendTranslation(z,i,c,s));else{let xe=!1,F=!1;!this.isValidLookup(z)&&de&&(xe=!0,z=$),this.isValidLookup(z)||(F=!0,z=m);const M=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&F?void 0:z,P=de&&$!==z&&this.options.updateMissing;if(F||xe||P){if(this.logger.log(P?"updateKey":"missingKey",x,p,m,P?$:z),h){const j=this.resolve(m,{...c,keySeparator:!1});j&&j.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ue=[];const ce=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ce&&ce[0])for(let j=0;j<ce.length;j++)ue.push(ce[j]);else this.options.saveMissingTo==="all"?ue=this.languageUtils.toResolveHierarchy(c.lng||this.language):ue.push(c.lng||this.language);const ee=(j,q,G)=>{const le=de&&G!==z?G:M;this.options.missingKeyHandler?this.options.missingKeyHandler(j,p,q,le,P,c):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(j,p,q,le,P,c),this.emit("missingKey",j,p,q,z)};this.options.saveMissing&&(this.options.saveMissingPlurals&&se?ue.forEach(j=>{const q=this.pluralResolver.getSuffixes(j,c);E&&c[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(G=>{ee([j],m+G,c[`defaultValue${G}`]||$)})}):ee(ue,m,$))}z=this.extendTranslation(z,i,c,N,s),F&&z===m&&this.options.appendNamespaceToMissingKey&&(z=`${p}${S}${m}`),(F||xe)&&this.options.parseMissingKeyHandler&&(z=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${S}${m}`:m,xe?z:void 0,c))}return d?(N.res=z,N.usedParams=this.getUsedParamsDetails(c),N):z}extendTranslation(i,r,s,c,d){if(this.i18nFormat?.parse)i=this.i18nFormat.parse(i,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||c.usedLng,c.usedNS,c.usedKey,{resolved:c});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const y=Re(i)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(y){const x=i.match(this.interpolator.nestingRegexp);p=x&&x.length}let S=s.replace&&!Re(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(S={...this.options.interpolation.defaultVariables,...S}),i=this.interpolator.interpolate(i,S,s.lng||this.language||c.usedLng,s),y){const x=i.match(this.interpolator.nestingRegexp),_=x&&x.length;p<_&&(s.nest=!1)}!s.lng&&c&&c.res&&(s.lng=this.language||c.usedLng),s.nest!==!1&&(i=this.interpolator.nest(i,(...x)=>d?.[0]===x[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${r[0]}`),null):this.translate(...x,r),s)),s.interpolation&&this.interpolator.reset()}const h=s.postProcess||this.options.postProcess,m=Re(h)?[h]:h;return i!=null&&m?.length&&s.applyPostProcessor!==!1&&(i=Eg.handle(m,i,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...c,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),i}resolve(i,r={}){let s,c,d,h,m;return Re(i)&&(i=[i]),i.forEach(y=>{if(this.isValidLookup(s))return;const p=this.extractFromKey(y,r),S=p.key;c=S;let x=p.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const _=r.count!==void 0&&!Re(r.count),N=_&&!r.ordinal&&r.count===0,z=r.context!==void 0&&(Re(r.context)||typeof r.context=="number")&&r.context!=="",D=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);x.forEach(k=>{this.isValidLookup(s)||(m=k,!ip[`${D[0]}-${k}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(m)&&(ip[`${D[0]}-${k}`]=!0,this.logger.warn(`key "${c}" for languages "${D.join(", ")}" won't get resolved as namespace "${m}" 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!!!")),D.forEach(W=>{if(this.isValidLookup(s))return;h=W;const X=[S];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(X,S,W,k,r);else{let se;_&&(se=this.pluralResolver.getSuffix(W,r.count,r));const de=`${this.options.pluralSeparator}zero`,V=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(_&&(r.ordinal&&se.indexOf(V)===0&&X.push(S+se.replace(V,this.options.pluralSeparator)),X.push(S+se),N&&X.push(S+de)),z){const B=`${S}${this.options.contextSeparator||"_"}${r.context}`;X.push(B),_&&(r.ordinal&&se.indexOf(V)===0&&X.push(B+se.replace(V,this.options.pluralSeparator)),X.push(B+se),N&&X.push(B+de))}}let I;for(;I=X.pop();)this.isValidLookup(s)||(d=I,s=this.getResource(W,k,I,r))}))})}),{res:s,usedKey:c,exactUsedKey:d,usedLng:h,usedNS:m}}isValidLookup(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}getResource(i,r,s,c={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(i,r,s,c):this.resourceStore.getResource(i,r,s,c)}getUsedParamsDetails(i={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=i.replace&&!Re(i.replace);let c=s?i.replace:i;if(s&&typeof i.count<"u"&&(c.count=i.count),this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),!s){c={...c};for(const d of r)delete c[d]}return c}static hasDefaultValue(i){const r="defaultValue";for(const s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&r===s.substring(0,r.length)&&i[s]!==void 0)return!0;return!1}}class rp{constructor(i){this.options=i,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ba.create("languageUtils")}getScriptPartFromCode(i){if(i=mr(i),!i||i.indexOf("-")<0)return null;const r=i.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(i){if(i=mr(i),!i||i.indexOf("-")<0)return i;const r=i.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(i){if(Re(i)&&i.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(i)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?i.toLowerCase():i)}return this.options.cleanCode||this.options.lowerCaseLng?i.toLowerCase():i}isSupportedCode(i){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(i=this.getLanguagePartFromCode(i)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(i)>-1}getBestMatchFromCodes(i){if(!i)return null;let r;return i.forEach(s=>{if(r)return;const c=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(c))&&(r=c)}),!r&&this.options.supportedLngs&&i.forEach(s=>{if(r)return;const c=this.getScriptPartFromCode(s);if(this.isSupportedCode(c))return r=c;const d=this.getLanguagePartFromCode(s);if(this.isSupportedCode(d))return r=d;r=this.options.supportedLngs.find(h=>{if(h===d)return h;if(!(h.indexOf("-")<0&&d.indexOf("-")<0)&&(h.indexOf("-")>0&&d.indexOf("-")<0&&h.substring(0,h.indexOf("-"))===d||h.indexOf(d)===0&&d.length>1))return h})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(i,r){if(!i)return[];if(typeof i=="function"&&(i=i(r)),Re(i)&&(i=[i]),Array.isArray(i))return i;if(!r)return i.default||[];let s=i[r];return s||(s=i[this.getScriptPartFromCode(r)]),s||(s=i[this.formatLanguageCode(r)]),s||(s=i[this.getLanguagePartFromCode(r)]),s||(s=i.default),s||[]}toResolveHierarchy(i,r){const s=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],i),c=[],d=h=>{h&&(this.isSupportedCode(h)?c.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return Re(i)&&(i.indexOf("-")>-1||i.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&d(this.formatLanguageCode(i)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&d(this.getScriptPartFromCode(i)),this.options.load!=="currentOnly"&&d(this.getLanguagePartFromCode(i))):Re(i)&&d(this.formatLanguageCode(i)),s.forEach(h=>{c.indexOf(h)<0&&d(this.formatLanguageCode(h))}),c}}const sp={zero:0,one:1,two:2,few:3,many:4,other:5},op={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Jv{constructor(i,r={}){this.languageUtils=i,this.options=r,this.logger=Ba.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(i,r={}){const s=mr(i==="dev"?"en":i),c=r.ordinal?"ordinal":"cardinal",d=JSON.stringify({cleanedCode:s,type:c});if(d in this.pluralRulesCache)return this.pluralRulesCache[d];let h;try{h=new Intl.PluralRules(s,{type:c})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),op;if(!i.match(/-|_/))return op;const y=this.languageUtils.getLanguagePartFromCode(i);h=this.getRule(y,r)}return this.pluralRulesCache[d]=h,h}needsPlural(i,r={}){let s=this.getRule(i,r);return s||(s=this.getRule("dev",r)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(i,r,s={}){return this.getSuffixes(i,s).map(c=>`${r}${c}`)}getSuffixes(i,r={}){let s=this.getRule(i,r);return s||(s=this.getRule("dev",r)),s?s.resolvedOptions().pluralCategories.sort((c,d)=>sp[c]-sp[d]).map(c=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${c}`):[]}getSuffix(i,r,s={}){const c=this.getRule(i,s);return c?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${c.select(r)}`:(this.logger.warn(`no plural rule found for: ${i}`),this.getSuffix("dev",r,s))}}const cp=(n,i,r,s=".",c=!0)=>{let d=Yv(n,i,r);return!d&&c&&Re(r)&&(d=Xu(n,r,s),d===void 0&&(d=Xu(i,r,s))),d},Ru=n=>n.replace(/\$/g,"$$$$");class up{constructor(i={}){this.logger=Ba.create("interpolator"),this.options=i,this.format=i?.interpolation?.format||(r=>r),this.init(i)}init(i={}){i.interpolation||(i.interpolation={escapeValue:!0});const{escape:r,escapeValue:s,useRawValueToEscape:c,prefix:d,prefixEscaped:h,suffix:m,suffixEscaped:y,formatSeparator:p,unescapeSuffix:S,unescapePrefix:x,nestingPrefix:_,nestingPrefixEscaped:N,nestingSuffix:z,nestingSuffixEscaped:D,nestingOptionsSeparator:k,maxReplaces:W,alwaysFormat:X}=i.interpolation;this.escape=r!==void 0?r:Gv,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=c!==void 0?c:!1,this.prefix=d?ml(d):h||"{{",this.suffix=m?ml(m):y||"}}",this.formatSeparator=p||",",this.unescapePrefix=S?"":x||"-",this.unescapeSuffix=this.unescapePrefix?"":S||"",this.nestingPrefix=_?ml(_):N||ml("$t("),this.nestingSuffix=z?ml(z):D||ml(")"),this.nestingOptionsSeparator=k||",",this.maxReplaces=W||1e3,this.alwaysFormat=X!==void 0?X:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const i=(r,s)=>r?.source===s?(r.lastIndex=0,r):new RegExp(s,"g");this.regexp=i(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=i(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=i(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(i,r,s,c){let d,h,m;const y=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=N=>{if(N.indexOf(this.formatSeparator)<0){const W=cp(r,y,N,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(W,void 0,s,{...c,...r,interpolationkey:N}):W}const z=N.split(this.formatSeparator),D=z.shift().trim(),k=z.join(this.formatSeparator).trim();return this.format(cp(r,y,D,this.options.keySeparator,this.options.ignoreJSONStructure),k,s,{...c,...r,interpolationkey:D})};this.resetRegExp();const S=c?.missingInterpolationHandler||this.options.missingInterpolationHandler,x=c?.interpolation?.skipOnVariables!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:N=>Ru(N)},{regex:this.regexp,safeValue:N=>this.escapeValue?Ru(this.escape(N)):Ru(N)}].forEach(N=>{for(m=0;d=N.regex.exec(i);){const z=d[1].trim();if(h=p(z),h===void 0)if(typeof S=="function"){const k=S(i,d,c);h=Re(k)?k:""}else if(c&&Object.prototype.hasOwnProperty.call(c,z))h="";else if(x){h=d[0];continue}else this.logger.warn(`missed to pass in variable ${z} for interpolating ${i}`),h="";else!Re(h)&&!this.useRawValueToEscape&&(h=ep(h));const D=N.safeValue(h);if(i=i.replace(d[0],D),x?(N.regex.lastIndex+=h.length,N.regex.lastIndex-=d[0].length):N.regex.lastIndex=0,m++,m>=this.maxReplaces)break}}),i}nest(i,r,s={}){let c,d,h;const m=(y,p)=>{const S=this.nestingOptionsSeparator;if(y.indexOf(S)<0)return y;const x=y.split(new RegExp(`${ml(S)}[ ]*{`));let _=`{${x[1]}`;y=x[0],_=this.interpolate(_,h);const N=_.match(/'/g),z=_.match(/"/g);((N?.length??0)%2===0&&!z||(z?.length??0)%2!==0)&&(_=_.replace(/'/g,'"'));try{h=JSON.parse(_),p&&(h={...p,...h})}catch(D){return this.logger.warn(`failed parsing options string in nesting for key ${y}`,D),`${y}${S}${_}`}return h.defaultValue&&h.defaultValue.indexOf(this.prefix)>-1&&delete h.defaultValue,y};for(;c=this.nestingRegexp.exec(i);){let y=[];h={...s},h=h.replace&&!Re(h.replace)?h.replace:h,h.applyPostProcessor=!1,delete h.defaultValue;const p=/{.*}/.test(c[1])?c[1].lastIndexOf("}")+1:c[1].indexOf(this.formatSeparator);if(p!==-1&&(y=c[1].slice(p).split(this.formatSeparator).map(S=>S.trim()).filter(Boolean),c[1]=c[1].slice(0,p)),d=r(m.call(this,c[1].trim(),h),h),d&&c[0]===i&&!Re(d))return d;Re(d)||(d=ep(d)),d||(this.logger.warn(`missed to resolve ${c[1]} for nesting ${i}`),d=""),y.length&&(d=y.reduce((S,x)=>this.format(S,x,s.lng,{...s,interpolationkey:c[1].trim()}),d.trim())),i=i.replace(c[0],d),this.regexp.lastIndex=0}return i}}const Wv=n=>{let i=n.toLowerCase().trim();const r={};if(n.indexOf("(")>-1){const s=n.split("(");i=s[0].toLowerCase().trim();const c=s[1].substring(0,s[1].length-1);i==="currency"&&c.indexOf(":")<0?r.currency||(r.currency=c.trim()):i==="relativetime"&&c.indexOf(":")<0?r.range||(r.range=c.trim()):c.split(";").forEach(h=>{if(h){const[m,...y]=h.split(":"),p=y.join(":").trim().replace(/^'+|'+$/g,""),S=m.trim();r[S]||(r[S]=p),p==="false"&&(r[S]=!1),p==="true"&&(r[S]=!0),isNaN(p)||(r[S]=parseInt(p,10))}})}return{formatName:i,formatOptions:r}},dp=n=>{const i={};return(r,s,c)=>{let d=c;c&&c.interpolationkey&&c.formatParams&&c.formatParams[c.interpolationkey]&&c[c.interpolationkey]&&(d={...d,[c.interpolationkey]:void 0});const h=s+JSON.stringify(d);let m=i[h];return m||(m=n(mr(s),c),i[h]=m),m(r)}},Pv=n=>(i,r,s)=>n(mr(r),s)(i);class Iv{constructor(i={}){this.logger=Ba.create("formatter"),this.options=i,this.init(i)}init(i,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const s=r.cacheInBuiltFormats?dp:Pv;this.formats={number:s((c,d)=>{const h=new Intl.NumberFormat(c,{...d});return m=>h.format(m)}),currency:s((c,d)=>{const h=new Intl.NumberFormat(c,{...d,style:"currency"});return m=>h.format(m)}),datetime:s((c,d)=>{const h=new Intl.DateTimeFormat(c,{...d});return m=>h.format(m)}),relativetime:s((c,d)=>{const h=new Intl.RelativeTimeFormat(c,{...d});return m=>h.format(m,d.range||"day")}),list:s((c,d)=>{const h=new Intl.ListFormat(c,{...d});return m=>h.format(m)})}}add(i,r){this.formats[i.toLowerCase().trim()]=r}addCached(i,r){this.formats[i.toLowerCase().trim()]=dp(r)}format(i,r,s,c={}){const d=r.split(this.formatSeparator);if(d.length>1&&d[0].indexOf("(")>1&&d[0].indexOf(")")<0&&d.find(m=>m.indexOf(")")>-1)){const m=d.findIndex(y=>y.indexOf(")")>-1);d[0]=[d[0],...d.splice(1,m)].join(this.formatSeparator)}return d.reduce((m,y)=>{const{formatName:p,formatOptions:S}=Wv(y);if(this.formats[p]){let x=m;try{const _=c?.formatParams?.[c.interpolationkey]||{},N=_.locale||_.lng||c.locale||c.lng||s;x=this.formats[p](m,N,{...S,...c,..._})}catch(_){this.logger.warn(_)}return x}else this.logger.warn(`there was no format function for ${p}`);return m},i)}}const eb=(n,i)=>{n.pending[i]!==void 0&&(delete n.pending[i],n.pendingCount--)};class tb extends io{constructor(i,r,s,c={}){super(),this.backend=i,this.store=r,this.services=s,this.languageUtils=s.languageUtils,this.options=c,this.logger=Ba.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=c.maxParallelReads||10,this.readingCalls=0,this.maxRetries=c.maxRetries>=0?c.maxRetries:5,this.retryTimeout=c.retryTimeout>=1?c.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,c.backend,c)}queueLoad(i,r,s,c){const d={},h={},m={},y={};return i.forEach(p=>{let S=!0;r.forEach(x=>{const _=`${p}|${x}`;!s.reload&&this.store.hasResourceBundle(p,x)?this.state[_]=2:this.state[_]<0||(this.state[_]===1?h[_]===void 0&&(h[_]=!0):(this.state[_]=1,S=!1,h[_]===void 0&&(h[_]=!0),d[_]===void 0&&(d[_]=!0),y[x]===void 0&&(y[x]=!0)))}),S||(m[p]=!0)}),(Object.keys(d).length||Object.keys(h).length)&&this.queue.push({pending:h,pendingCount:Object.keys(h).length,loaded:{},errors:[],callback:c}),{toLoad:Object.keys(d),pending:Object.keys(h),toLoadLanguages:Object.keys(m),toLoadNamespaces:Object.keys(y)}}loaded(i,r,s){const c=i.split("|"),d=c[0],h=c[1];r&&this.emit("failedLoading",d,h,r),!r&&s&&this.store.addResourceBundle(d,h,s,void 0,void 0,{skipCopy:!0}),this.state[i]=r?-1:2,r&&s&&(this.state[i]=0);const m={};this.queue.forEach(y=>{qv(y.loaded,[d],h),eb(y,i),r&&y.errors.push(r),y.pendingCount===0&&!y.done&&(Object.keys(y.loaded).forEach(p=>{m[p]||(m[p]={});const S=y.loaded[p];S.length&&S.forEach(x=>{m[p][x]===void 0&&(m[p][x]=!0)})}),y.done=!0,y.errors.length?y.callback(y.errors):y.callback())}),this.emit("loaded",m),this.queue=this.queue.filter(y=>!y.done)}read(i,r,s,c=0,d=this.retryTimeout,h){if(!i.length)return h(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:r,fcName:s,tried:c,wait:d,callback:h});return}this.readingCalls++;const m=(p,S)=>{if(this.readingCalls--,this.waitingReads.length>0){const x=this.waitingReads.shift();this.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(p&&S&&c<this.maxRetries){setTimeout(()=>{this.read.call(this,i,r,s,c+1,d*2,h)},d);return}h(p,S)},y=this.backend[s].bind(this.backend);if(y.length===2){try{const p=y(i,r);p&&typeof p.then=="function"?p.then(S=>m(null,S)).catch(m):m(null,p)}catch(p){m(p)}return}return y(i,r,m)}prepareLoading(i,r,s={},c){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),c&&c();Re(i)&&(i=this.languageUtils.toResolveHierarchy(i)),Re(r)&&(r=[r]);const d=this.queueLoad(i,r,s,c);if(!d.toLoad.length)return d.pending.length||c(),null;d.toLoad.forEach(h=>{this.loadOne(h)})}load(i,r,s){this.prepareLoading(i,r,{},s)}reload(i,r,s){this.prepareLoading(i,r,{reload:!0},s)}loadOne(i,r=""){const s=i.split("|"),c=s[0],d=s[1];this.read(c,d,"read",void 0,void 0,(h,m)=>{h&&this.logger.warn(`${r}loading namespace ${d} for language ${c} failed`,h),!h&&m&&this.logger.log(`${r}loaded namespace ${d} for language ${c}`,m),this.loaded(i,h,m)})}saveMissing(i,r,s,c,d,h={},m=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${s}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend?.create){const y={...h,isUpdate:d},p=this.backend.create.bind(this.backend);if(p.length<6)try{let S;p.length===5?S=p(i,r,s,c,y):S=p(i,r,s,c),S&&typeof S.then=="function"?S.then(x=>m(null,x)).catch(m):m(null,S)}catch(S){m(S)}else p(i,r,s,c,m,y)}!i||!i[0]||this.store.addResource(i[0],r,s,c)}}}const zu=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let i={};if(typeof n[1]=="object"&&(i=n[1]),Re(n[1])&&(i.defaultValue=n[1]),Re(n[2])&&(i.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const r=n[3]||n[2];Object.keys(r).forEach(s=>{i[s]=r[s]})}return i},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),fp=n=>(Re(n.ns)&&(n.ns=[n.ns]),Re(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),Re(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),Gs=()=>{},ab=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(r=>{typeof n[r]=="function"&&(n[r]=n[r].bind(n))})},Cg="__i18next_supportNoticeShown",nb=()=>typeof globalThis<"u"&&!!globalThis[Cg],lb=()=>{typeof globalThis<"u"&&(globalThis[Cg]=!0)},ib=n=>!!(n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some(i=>i?.name?.indexOf("Locize")>0||i?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(i=>i?.projectId));class fr extends io{constructor(i={},r){if(super(),this.options=fp(i),this.services={},this.logger=Ba,this.modules={external:[]},ab(this),r&&!this.isInitialized&&!i.isClone){if(!this.options.initAsync)return this.init(i,r),this;setTimeout(()=>{this.init(i,r)},0)}}init(i={},r){this.isInitializing=!0,typeof i=="function"&&(r=i,i={}),i.defaultNS==null&&i.ns&&(Re(i.ns)?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));const s=zu();this.options={...s,...this.options,...fp(i)},this.options.interpolation={...s.interpolation,...this.options.interpolation},i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!ib(this)&&!nb()&&(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 💙"),lb());const c=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?Ba.init(c(this.modules.logger),this.options):Ba.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=Iv;const S=new rp(this.options);this.store=new lp(this.options.resources,this.options);const x=this.services;x.logger=Ba,x.resourceStore=this.store,x.languageUtils=S,x.pluralResolver=new Jv(S,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),p&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(x.formatter=c(p),x.formatter.init&&x.formatter.init(x,this.options),this.options.interpolation.format=x.formatter.format.bind(x.formatter)),x.interpolator=new up(this.options),x.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},x.backendConnector=new tb(c(this.modules.backend),x.resourceStore,x,this.options),x.backendConnector.on("*",(N,...z)=>{this.emit(N,...z)}),this.modules.languageDetector&&(x.languageDetector=c(this.modules.languageDetector),x.languageDetector.init&&x.languageDetector.init(x,this.options.detection,this.options)),this.modules.i18nFormat&&(x.i18nFormat=c(this.modules.i18nFormat),x.i18nFormat.init&&x.i18nFormat.init(this)),this.translator=new ao(this.services,this.options),this.translator.on("*",(N,...z)=>{this.emit(N,...z)}),this.modules.external.forEach(N=>{N.init&&N.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Gs),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=(...S)=>this.store[p](...S)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...S)=>(this.store[p](...S),this)});const m=nr(),y=()=>{const p=(S,x)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),m.resolve(x),r(S,x)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?y():setTimeout(y,0),m}loadResources(i,r=Gs){let s=r;const c=Re(i)?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(c?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const d=[],h=m=>{if(!m||m==="cimode")return;this.services.languageUtils.toResolveHierarchy(m).forEach(p=>{p!=="cimode"&&d.indexOf(p)<0&&d.push(p)})};c?h(c):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(y=>h(y)),this.options.preload?.forEach?.(m=>h(m)),this.services.backendConnector.load(d,this.options.ns,m=>{!m&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(m)})}else s(null)}reloadResources(i,r,s){const c=nr();return typeof i=="function"&&(s=i,i=void 0),typeof r=="function"&&(s=r,r=void 0),i||(i=this.languages),r||(r=this.options.ns),s||(s=Gs),this.services.backendConnector.reload(i,r,d=>{c.resolve(),s(d)}),c}use(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&Eg.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}setResolvedLanguage(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1)){for(let r=0;r<this.languages.length;r++){const s=this.languages[r];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(i)<0&&this.store.hasLanguageSomeTranslations(i)&&(this.resolvedLanguage=i,this.languages.unshift(i))}}changeLanguage(i,r){this.isLanguageChangingTo=i;const s=nr();this.emit("languageChanging",i);const c=m=>{this.language=m,this.languages=this.services.languageUtils.toResolveHierarchy(m),this.resolvedLanguage=void 0,this.setResolvedLanguage(m)},d=(m,y)=>{y?this.isLanguageChangingTo===i&&(c(y),this.translator.changeLanguage(y),this.isLanguageChangingTo=void 0,this.emit("languageChanged",y),this.logger.log("languageChanged",y)):this.isLanguageChangingTo=void 0,s.resolve((...p)=>this.t(...p)),r&&r(m,(...p)=>this.t(...p))},h=m=>{!i&&!m&&this.services.languageDetector&&(m=[]);const y=Re(m)?m:m&&m[0],p=this.store.hasLanguageSomeTranslations(y)?y:this.services.languageUtils.getBestMatchFromCodes(Re(m)?[m]:m);p&&(this.language||c(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector?.cacheUserLanguage?.(p)),this.loadResources(p,S=>{d(S,p)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?h(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(h):this.services.languageDetector.detect(h):h(i),s}getFixedT(i,r,s){const c=(d,h,...m)=>{let y;typeof h!="object"?y=this.options.overloadTranslationOptionHandler([d,h].concat(m)):y={...h},y.lng=y.lng||c.lng,y.lngs=y.lngs||c.lngs,y.ns=y.ns||c.ns,y.keyPrefix!==""&&(y.keyPrefix=y.keyPrefix||s||c.keyPrefix);const p=this.options.keySeparator||".";let S;return y.keyPrefix&&Array.isArray(d)?S=d.map(x=>(typeof x=="function"&&(x=Qu(x,{...this.options,...h})),`${y.keyPrefix}${p}${x}`)):(typeof d=="function"&&(d=Qu(d,{...this.options,...h})),S=y.keyPrefix?`${y.keyPrefix}${p}${d}`:d),this.t(S,y)};return Re(i)?c.lng=i:c.lngs=i,c.ns=r,c.keyPrefix=s,c}t(...i){return this.translator?.translate(...i)}exists(...i){return this.translator?.exists(...i)}setDefaultNamespace(i){this.options.defaultNS=i}hasLoadedNamespace(i,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=r.lng||this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,d=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const h=(m,y)=>{const p=this.services.backendConnector.state[`${m}|${y}`];return p===-1||p===0||p===2};if(r.precheck){const m=r.precheck(this,h);if(m!==void 0)return m}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||h(s,i)&&(!c||h(d,i)))}loadNamespaces(i,r){const s=nr();return this.options.ns?(Re(i)&&(i=[i]),i.forEach(c=>{this.options.ns.indexOf(c)<0&&this.options.ns.push(c)}),this.loadResources(c=>{s.resolve(),r&&r(c)}),s):(r&&r(),Promise.resolve())}loadLanguages(i,r){const s=nr();Re(i)&&(i=[i]);const c=this.options.preload||[],d=i.filter(h=>c.indexOf(h)<0&&this.services.languageUtils.isSupportedCode(h));return d.length?(this.options.preload=c.concat(d),this.loadResources(h=>{s.resolve(),r&&r(h)}),s):(r&&r(),Promise.resolve())}dir(i){if(i||(i=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!i)return"rtl";try{const c=new Intl.Locale(i);if(c&&c.getTextInfo){const d=c.getTextInfo();if(d&&d.direction)return d.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services?.languageUtils||new rp(zu());return i.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(s.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(i={},r){const s=new fr(i,r);return s.createInstance=fr.createInstance,s}cloneInstance(i={},r=Gs){const s=i.forkResourceStore;s&&delete i.forkResourceStore;const c={...this.options,...i,isClone:!0},d=new fr(c);if((i.debug!==void 0||i.prefix!==void 0)&&(d.logger=d.logger.clone(i)),["store","services","language"].forEach(m=>{d[m]=this[m]}),d.services={...this.services},d.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},s){const m=Object.keys(this.store.data).reduce((y,p)=>(y[p]={...this.store.data[p]},y[p]=Object.keys(y[p]).reduce((S,x)=>(S[x]={...y[p][x]},S),y[p]),y),{});d.store=new lp(m,c),d.services.resourceStore=d.store}if(i.interpolation){const y={...zu().interpolation,...this.options.interpolation,...i.interpolation},p={...c,interpolation:y};d.services.interpolator=new up(p)}return d.translator=new ao(d.services,c),d.translator.on("*",(m,...y)=>{d.emit(m,...y)}),d.init(c,r),d.translator.options=c,d.translator.backendConnector.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},d}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Vt=fr.createInstance();Vt.createInstance;Vt.dir;Vt.init;Vt.loadResources;Vt.reloadResources;Vt.use;Vt.changeLanguage;Vt.getFixedT;Vt.t;Vt.exists;Vt.setDefaultNamespace;Vt.hasLoadedNamespace;Vt.loadNamespaces;Vt.loadLanguages;var Ou={exports:{}},ze={};var hp;function rb(){if(hp)return ze;hp=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),_=Symbol.iterator;function N(j){return j===null||typeof j!="object"?null:(j=_&&j[_]||j["@@iterator"],typeof j=="function"?j:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,k={};function W(j,q,G){this.props=j,this.context=q,this.refs=k,this.updater=G||z}W.prototype.isReactComponent={},W.prototype.setState=function(j,q){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,q,"setState")},W.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function X(){}X.prototype=W.prototype;function I(j,q,G){this.props=j,this.context=q,this.refs=k,this.updater=G||z}var se=I.prototype=new X;se.constructor=I,D(se,W.prototype),se.isPureReactComponent=!0;var de=Array.isArray;function V(){}var B={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function $(j,q,G){var le=G.ref;return{$$typeof:n,type:j,key:q,ref:le!==void 0?le:null,props:G}}function ne(j,q){return $(j.type,q,j.props)}function ae(j){return typeof j=="object"&&j!==null&&j.$$typeof===n}function Q(j){var q={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(G){return q[G]})}var xe=/\/+/g;function F(j,q){return typeof j=="object"&&j!==null&&j.key!=null?Q(""+j.key):q.toString(36)}function ie(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(V,V):(j.status="pending",j.then(function(q){j.status==="pending"&&(j.status="fulfilled",j.value=q)},function(q){j.status==="pending"&&(j.status="rejected",j.reason=q)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function M(j,q,G,le,ge){var je=typeof j;(je==="undefined"||je==="boolean")&&(j=null);var Ne=!1;if(j===null)Ne=!0;else switch(je){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(j.$$typeof){case n:case i:Ne=!0;break;case S:return Ne=j._init,M(Ne(j._payload),q,G,le,ge)}}if(Ne)return ge=ge(j),Ne=le===""?"."+F(j,0):le,de(ge)?(G="",Ne!=null&&(G=Ne.replace(xe,"$&/")+"/"),M(ge,q,G,"",function(Va){return Va})):ge!=null&&(ae(ge)&&(ge=ne(ge,G+(ge.key==null||j&&j.key===ge.key?"":(""+ge.key).replace(xe,"$&/")+"/")+Ne)),q.push(ge)),1;Ne=0;var et=le===""?".":le+":";if(de(j))for(var Ke=0;Ke<j.length;Ke++)le=j[Ke],je=et+F(le,Ke),Ne+=M(le,q,G,je,ge);else if(Ke=N(j),typeof Ke=="function")for(j=Ke.call(j),Ke=0;!(le=j.next()).done;)le=le.value,je=et+F(le,Ke++),Ne+=M(le,q,G,je,ge);else if(je==="object"){if(typeof j.then=="function")return M(ie(j),q,G,le,ge);throw q=String(j),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function P(j,q,G){if(j==null)return j;var le=[],ge=0;return M(j,le,"","",function(je){return q.call(G,je,ge++)}),le}function ue(j){if(j._status===-1){var q=j._result;q=q(),q.then(function(G){(j._status===0||j._status===-1)&&(j._status=1,j._result=G)},function(G){(j._status===0||j._status===-1)&&(j._status=2,j._result=G)}),j._status===-1&&(j._status=0,j._result=q)}if(j._status===1)return j._result.default;throw j._result}var ce=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},ee={map:P,forEach:function(j,q,G){P(j,function(){q.apply(this,arguments)},G)},count:function(j){var q=0;return P(j,function(){q++}),q},toArray:function(j){return P(j,function(q){return q})||[]},only:function(j){if(!ae(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return ze.Activity=x,ze.Children=ee,ze.Component=W,ze.Fragment=r,ze.Profiler=c,ze.PureComponent=I,ze.StrictMode=s,ze.Suspense=y,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,ze.__COMPILER_RUNTIME={__proto__:null,c:function(j){return B.H.useMemoCache(j)}},ze.cache=function(j){return function(){return j.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(j,q,G){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var le=D({},j.props),ge=j.key;if(q!=null)for(je in q.key!==void 0&&(ge=""+q.key),q)!E.call(q,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&q.ref===void 0||(le[je]=q[je]);var je=arguments.length-2;if(je===1)le.children=G;else if(1<je){for(var Ne=Array(je),et=0;et<je;et++)Ne[et]=arguments[et+2];le.children=Ne}return $(j.type,ge,le)},ze.createContext=function(j){return j={$$typeof:h,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:d,_context:j},j},ze.createElement=function(j,q,G){var le,ge={},je=null;if(q!=null)for(le in q.key!==void 0&&(je=""+q.key),q)E.call(q,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(ge[le]=q[le]);var Ne=arguments.length-2;if(Ne===1)ge.children=G;else if(1<Ne){for(var et=Array(Ne),Ke=0;Ke<Ne;Ke++)et[Ke]=arguments[Ke+2];ge.children=et}if(j&&j.defaultProps)for(le in Ne=j.defaultProps,Ne)ge[le]===void 0&&(ge[le]=Ne[le]);return $(j,je,ge)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(j){return{$$typeof:m,render:j}},ze.isValidElement=ae,ze.lazy=function(j){return{$$typeof:S,_payload:{_status:-1,_result:j},_init:ue}},ze.memo=function(j,q){return{$$typeof:p,type:j,compare:q===void 0?null:q}},ze.startTransition=function(j){var q=B.T,G={};B.T=G;try{var le=j(),ge=B.S;ge!==null&&ge(G,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(V,ce)}catch(je){ce(je)}finally{q!==null&&G.types!==null&&(q.types=G.types),B.T=q}},ze.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},ze.use=function(j){return B.H.use(j)},ze.useActionState=function(j,q,G){return B.H.useActionState(j,q,G)},ze.useCallback=function(j,q){return B.H.useCallback(j,q)},ze.useContext=function(j){return B.H.useContext(j)},ze.useDebugValue=function(){},ze.useDeferredValue=function(j,q){return B.H.useDeferredValue(j,q)},ze.useEffect=function(j,q){return B.H.useEffect(j,q)},ze.useEffectEvent=function(j){return B.H.useEffectEvent(j)},ze.useId=function(){return B.H.useId()},ze.useImperativeHandle=function(j,q,G){return B.H.useImperativeHandle(j,q,G)},ze.useInsertionEffect=function(j,q){return B.H.useInsertionEffect(j,q)},ze.useLayoutEffect=function(j,q){return B.H.useLayoutEffect(j,q)},ze.useMemo=function(j,q){return B.H.useMemo(j,q)},ze.useOptimistic=function(j,q){return B.H.useOptimistic(j,q)},ze.useReducer=function(j,q,G){return B.H.useReducer(j,q,G)},ze.useRef=function(j){return B.H.useRef(j)},ze.useState=function(j){return B.H.useState(j)},ze.useSyncExternalStore=function(j,q,G){return B.H.useSyncExternalStore(j,q,G)},ze.useTransition=function(){return B.H.useTransition()},ze.version="19.2.4",ze}var mp;function ro(){return mp||(mp=1,Ou.exports=rb()),Ou.exports}var v=ro();const ri=Lv(v),sb=Av({__proto__:null,default:ri},[v]),ob=(n,i,r,s)=>{const c=[r,{code:i,...s||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(c,"warn","react-i18next::",!0);gl(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...c):console?.warn&&console.warn(...c)},pp={},Rg=(n,i,r,s)=>{gl(r)&&pp[r]||(gl(r)&&(pp[r]=new Date),ob(n,i,r,s))},zg=(n,i)=>()=>{if(n.isInitialized)i();else{const r=()=>{setTimeout(()=>{n.off("initialized",r)},0),i()};n.on("initialized",r)}},Zu=(n,i,r)=>{n.loadNamespaces(i,zg(n,r))},gp=(n,i,r,s)=>{if(gl(r)&&(r=[r]),n.options.preload&&n.options.preload.indexOf(i)>-1)return Zu(n,r,s);r.forEach(c=>{n.options.ns.indexOf(c)<0&&n.options.ns.push(c)}),n.loadLanguages(i,zg(n,s))},cb=(n,i,r={})=>!i.languages||!i.languages.length?(Rg(i,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:i.languages}),!0):i.hasLoadedNamespace(n,{lng:r.lng,precheck:(s,c)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!c(s.isLanguageChangingTo,n))return!1}}),gl=n=>typeof n=="string",ub=n=>typeof n=="object"&&n!==null,db=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,fb={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},hb=n=>fb[n],mb=n=>n.replace(db,hb);let Fu={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:mb,transDefaultProps:void 0};const pb=(n={})=>{Fu={...Fu,...n}},gb=()=>Fu;let Og;const yb=n=>{Og=n},xb=()=>Og,vb={type:"3rdParty",init(n){pb(n.options.react),yb(n)}},bb=v.createContext();class Sb{constructor(){this.usedNamespaces={}}addUsedNamespaces(i){i.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Tu={exports:{}},Du={};var yp;function _b(){if(yp)return Du;yp=1;var n=ro();function i(x,_){return x===_&&(x!==0||1/x===1/_)||x!==x&&_!==_}var r=typeof Object.is=="function"?Object.is:i,s=n.useState,c=n.useEffect,d=n.useLayoutEffect,h=n.useDebugValue;function m(x,_){var N=_(),z=s({inst:{value:N,getSnapshot:_}}),D=z[0].inst,k=z[1];return d(function(){D.value=N,D.getSnapshot=_,y(D)&&k({inst:D})},[x,N,_]),c(function(){return y(D)&&k({inst:D}),x(function(){y(D)&&k({inst:D})})},[x]),h(N),N}function y(x){var _=x.getSnapshot;x=x.value;try{var N=_();return!r(x,N)}catch{return!0}}function p(x,_){return _()}var S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:m;return Du.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:S,Du}var xp;function jb(){return xp||(xp=1,Tu.exports=_b()),Tu.exports}var Nb=jb();const Eb=(n,i)=>gl(i)?i:ub(i)&&gl(i.defaultValue)?i.defaultValue:Array.isArray(n)?n[n.length-1]:n,wb={t:Eb,ready:!1},Cb=()=>()=>{},we=(n,i={})=>{const{i18n:r}=i,{i18n:s,defaultNS:c}=v.useContext(bb)||{},d=r||s||xb();d&&!d.reportNamespaces&&(d.reportNamespaces=new Sb),d||Rg(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const h=v.useMemo(()=>({...gb(),...d?.options?.react,...i}),[d,i]),{useSuspense:m,keyPrefix:y}=h,p=c||d?.options?.defaultNS,S=gl(p)?[p]:p||["translation"],x=v.useMemo(()=>S,S);d?.reportNamespaces?.addUsedNamespaces?.(x);const _=v.useRef(0),N=v.useCallback($=>{if(!d)return Cb;const{bindI18n:ne,bindI18nStore:ae}=h,Q=()=>{_.current+=1,$()};return ne&&d.on(ne,Q),ae&&d.store.on(ae,Q),()=>{ne&&ne.split(" ").forEach(xe=>d.off(xe,Q)),ae&&ae.split(" ").forEach(xe=>d.store.off(xe,Q))}},[d,h]),z=v.useRef(),D=v.useCallback(()=>{if(!d)return wb;const $=!!(d.isInitialized||d.initializedStoreOnce)&&x.every(ie=>cb(ie,d,h)),ne=i.lng||d.language,ae=_.current,Q=z.current;if(Q&&Q.ready===$&&Q.lng===ne&&Q.keyPrefix===y&&Q.revision===ae)return Q;const F={t:d.getFixedT(ne,h.nsMode==="fallback"?x:x[0],y),ready:$,lng:ne,keyPrefix:y,revision:ae};return z.current=F,F},[d,x,y,h,i.lng]),[k,W]=v.useState(0),{t:X,ready:I}=Nb.useSyncExternalStore(N,D,D);v.useEffect(()=>{if(d&&!I&&!m){const $=()=>W(ne=>ne+1);i.lng?gp(d,i.lng,x,$):Zu(d,x,$)}},[d,i.lng,x,I,m,k]);const se=d||{},de=v.useRef(null),V=v.useRef(),B=$=>{const ne=Object.getOwnPropertyDescriptors($);ne.__original&&delete ne.__original;const ae=Object.create(Object.getPrototypeOf($),ne);if(!Object.prototype.hasOwnProperty.call(ae,"__original"))try{Object.defineProperty(ae,"__original",{value:$,writable:!1,enumerable:!1,configurable:!1})}catch{}return ae},E=v.useMemo(()=>{const $=se,ne=$?.language;let ae=$;$&&(de.current&&de.current.__original===$?V.current!==ne?(ae=B($),de.current=ae,V.current=ne):ae=de.current:(ae=B($),de.current=ae,V.current=ne));const Q=[X,ae,I];return Q.t=X,Q.i18n=ae,Q.ready=I,Q},[X,se,I,se.resolvedLanguage,se.language,se.languages]);if(d&&m&&!I)throw new Promise($=>{const ne=()=>$();i.lng?gp(d,i.lng,x,ne):Zu(d,x,ne)});return E},{slice:Rb,forEach:zb}=[];function Ob(n){return zb.call(Rb.call(arguments,1),i=>{if(i)for(const r in i)n[r]===void 0&&(n[r]=i[r])}),n}function Tb(n){return typeof n!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(r=>r.test(n))}const vp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Db=function(n,i){const s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},c=encodeURIComponent(i);let d=`${n}=${c}`;if(s.maxAge>0){const h=s.maxAge-0;if(Number.isNaN(h))throw new Error("maxAge should be a Number");d+=`; Max-Age=${Math.floor(h)}`}if(s.domain){if(!vp.test(s.domain))throw new TypeError("option domain is invalid");d+=`; Domain=${s.domain}`}if(s.path){if(!vp.test(s.path))throw new TypeError("option path is invalid");d+=`; Path=${s.path}`}if(s.expires){if(typeof s.expires.toUTCString!="function")throw new TypeError("option expires is invalid");d+=`; Expires=${s.expires.toUTCString()}`}if(s.httpOnly&&(d+="; HttpOnly"),s.secure&&(d+="; Secure"),s.sameSite)switch(typeof s.sameSite=="string"?s.sameSite.toLowerCase():s.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s.partitioned&&(d+="; Partitioned"),d},bp={create(n,i,r,s){let c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(c.expires=new Date,c.expires.setTime(c.expires.getTime()+r*60*1e3)),s&&(c.domain=s),document.cookie=Db(n,i,c)},read(n){const i=`${n}=`,r=document.cookie.split(";");for(let s=0;s<r.length;s++){let c=r[s];for(;c.charAt(0)===" ";)c=c.substring(1,c.length);if(c.indexOf(i)===0)return c.substring(i.length,c.length)}return null},remove(n,i){this.create(n,"",-1,i)}};var Mb={name:"cookie",lookup(n){let{lookupCookie:i}=n;if(i&&typeof document<"u")return bp.read(i)||void 0},cacheUserLanguage(n,i){let{lookupCookie:r,cookieMinutes:s,cookieDomain:c,cookieOptions:d}=i;r&&typeof document<"u"&&bp.create(r,n,s,c,d)}},Ab={name:"querystring",lookup(n){let{lookupQuerystring:i}=n,r;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const d=s.substring(1).split("&");for(let h=0;h<d.length;h++){const m=d[h].indexOf("=");m>0&&d[h].substring(0,m)===i&&(r=d[h].substring(m+1))}}return r}},Lb={name:"hash",lookup(n){let{lookupHash:i,lookupFromHashIndex:r}=n,s;if(typeof window<"u"){const{hash:c}=window.location;if(c&&c.length>2){const d=c.substring(1);if(i){const h=d.split("&");for(let m=0;m<h.length;m++){const y=h[m].indexOf("=");y>0&&h[m].substring(0,y)===i&&(s=h[m].substring(y+1))}}if(s)return s;if(!s&&r>-1){const h=c.match(/\/([a-zA-Z-]*)/g);return Array.isArray(h)?h[typeof r=="number"?r:0]?.replace("/",""):void 0}}}return s}};let ni=null;const Sp=()=>{if(ni!==null)return ni;try{if(ni=typeof window<"u"&&window.localStorage!==null,!ni)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{ni=!1}return ni};var kb={name:"localStorage",lookup(n){let{lookupLocalStorage:i}=n;if(i&&Sp())return window.localStorage.getItem(i)||void 0},cacheUserLanguage(n,i){let{lookupLocalStorage:r}=i;r&&Sp()&&window.localStorage.setItem(r,n)}};let li=null;const _p=()=>{if(li!==null)return li;try{if(li=typeof window<"u"&&window.sessionStorage!==null,!li)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{li=!1}return li};var Ub={name:"sessionStorage",lookup(n){let{lookupSessionStorage:i}=n;if(i&&_p())return window.sessionStorage.getItem(i)||void 0},cacheUserLanguage(n,i){let{lookupSessionStorage:r}=i;r&&_p()&&window.sessionStorage.setItem(r,n)}},Hb={name:"navigator",lookup(n){const i=[];if(typeof navigator<"u"){const{languages:r,userLanguage:s,language:c}=navigator;if(r)for(let d=0;d<r.length;d++)i.push(r[d]);s&&i.push(s),c&&i.push(c)}return i.length>0?i:void 0}},Bb={name:"htmlTag",lookup(n){let{htmlTag:i}=n,r;const s=i||(typeof document<"u"?document.documentElement:null);return s&&typeof s.getAttribute=="function"&&(r=s.getAttribute("lang")),r}},qb={name:"path",lookup(n){let{lookupFromPathIndex:i}=n;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof i=="number"?i:0]?.replace("/",""):void 0}},Yb={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:i}=n;const r=typeof i=="number"?i+1:1,s=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[r]}};let Tg=!1;try{document.cookie,Tg=!0}catch{}const Dg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Tg||Dg.splice(1,1);const Vb=()=>({order:Dg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class Mg{constructor(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(i,r)}init(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=i,this.options=Ob(r,this.options||{},Vb()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=c=>c.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=s,this.addDetector(Mb),this.addDetector(Ab),this.addDetector(kb),this.addDetector(Ub),this.addDetector(Hb),this.addDetector(Bb),this.addDetector(qb),this.addDetector(Yb),this.addDetector(Lb)}addDetector(i){return this.detectors[i.name]=i,this}detect(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return i.forEach(s=>{if(this.detectors[s]){let c=this.detectors[s].lookup(this.options);c&&typeof c=="string"&&(c=[c]),c&&(r=r.concat(c))}}),r=r.filter(s=>s!=null&&!Tb(s)).map(s=>this.options.convertDetectedLanguage(s)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(i){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(i)>-1||r.forEach(s=>{this.detectors[s]&&this.detectors[s].cacheUserLanguage(i,this.options)}))}}Mg.type="languageDetector";const Gb={"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.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.","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","sources.menu.add_client":"Add Client","sources.menu.online":"online","sources.menu.offline":"offline","sources.library.default_cloud_name":"Personal Cloud","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":"Stale","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":"Version Selection","sources.import.step.confirm":"Confirm Import","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.importing":"Importing...","sources.import.success":"Import complete","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.step3":"Wait for connection","sources.add_client.step3_desc":"This page will update automatically once connected.","sources.add_client.waiting":"Waiting for 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.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_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_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_path":"Directory Path","sources.import.dir_files":"Files","sources.import.dir_subdirs":"Subdirectories","sources.import.dir_git_repos":"Git Repositories","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_doc_files":"Documents","sources.import.dir_total_files":"Total Files","sources.import.dir_total_dirs":"Directories","sources.import.dir_git_skip_hint":"{{count}} Git repo(s) will be skipped. Import them via 'Import Repository'.","sources.actions.upload":"Upload","sources.actions.upload_md":"Markdown 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."},Kb={"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.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":"身份验证与用户管理。","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":"返回首页","sources.menu.add_client":"添加客户端","sources.menu.online":"在线","sources.menu.offline":"离线","sources.library.default_cloud_name":"个人云","sources.library.rename":"重命名","sources.library.rename_placeholder":"输入名称","sources.header.daemon_status":"{{online}}/{{total}} 在线","sources.header.all_offline":"全部离线","sources.actions.new_folder":"新文件夹","sources.folder.name_placeholder":"输入文件夹名称","sources.actions.import_repo":"导入仓库","sources.actions.rename":"重命名","sources.actions.move_to":"移动到...","sources.actions.delete":"删除","sources.filter.all":"全部","sources.filter.indexed":"已索引","sources.filter.not_indexed":"未索引","sources.status.none":"未索引","sources.status.indexed":"已索引","sources.status.stale":"索引过期","sources.type.code":"代码","sources.type.doc":"文档","sources.empty.cloud.title":"这里是你专属的知识输入区","sources.empty.cloud.description":"创建文件夹来整理你的文档和材料。这些内容仅你个人可见,将成为后续推演、构建数字大脑的基础。","sources.empty.daemon.title":"连接你的本地代码资产","sources.empty.daemon.description":"导入本地代码仓库,系统会自动提取代码结构与技术文档,将其转化为结构化知识。","sources.empty.indexed.title":"这些知识尚未被索引","sources.empty.indexed.description":"选择资源并完成索引后,它们将转化为结构化摘要,为你后续的推演提供素材。","sources.empty.folder.title":"当前文件夹还没有内容","sources.empty.folder.daemon_description":"你可以在本地进行文档新增、编辑后查看。","sources.safety.notice.repo":"在本地模式下,你的代码保有绝对隐私,源代码永远不会离开你的电脑,系统仅提取用于知识建模的结构化摘要(函数签名、依赖关系等)。","sources.safety.notice.dir":"系统会提取用于知识建模的文档内容及摘要,尽管会过滤不安全的文本内容,但请确保敏感数据不要参与索引及建模。","sources.import.title":"导入代码仓库","sources.import.step.select":"选择仓库","sources.import.step.version":"版本选择","sources.import.step.confirm":"确认导入","sources.import.daemon_offline":"客户端 {{name}} 未连接,请先启动本地 Daemon 并连接到服务器后再导入仓库。","sources.import.view_guide":"查看连接指引","sources.import.select_root":"选择仓库根目录","sources.import.current_path":"当前路径","sources.import.not_git":"该目录不是 Git 仓库,请选择包含 .git 的目录。","sources.import.branch":"分支","sources.import.commit":"提交","sources.import.branch_warning":"当前基于 {{branch}} 分支的 HEAD","sources.import.uncommitted_warning":"未提交的修改不会被采集","sources.import.recognized":"已识别 {{packages}} 个包和 {{docs}} 篇文档","sources.import.no_packages":"未识别到包结构,将作为单包仓库导入。","sources.import.confirm_heading":"即将导入以下仓库到 {{name}}:","sources.import.packages":"包数","sources.import.documents":"文档","sources.import.importing":"导入中...","sources.import.success":"导入完成","sources.add_client.title":"接入本地知识源","sources.add_client.description":"在本地计算机上启动客户端 (Daemon),即可将本地代码仓库作为输入材料,挂载到你的数字大脑中。","sources.add_client.step1":"安装 Daemon","sources.add_client.step2":"启动 Daemon","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.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_impact_generic":"文件夹内的所有子文件夹和知识源将被递归删除。","sources.delete.irreversible":"此操作不可撤销。","sources.delete.repo":"确定要从 {{library}} 中移除仓库 {{name}}?","sources.delete.repo_impact":"将删除:{{packages}} 个包的索引记录、{{docs}} 篇文档的索引记录。","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_path":"目录路径","sources.import.dir_files":"文件数","sources.import.dir_subdirs":"子目录数","sources.import.dir_git_repos":"Git 仓库","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_doc_files":"文档","sources.import.dir_total_files":"文件总数","sources.import.dir_total_dirs":"目录","sources.import.dir_git_skip_hint":"{{count}} 个 Git 仓库将被跳过,请通过「导入仓库」单独导入。","sources.actions.upload":"上传","sources.actions.upload_md":"Markdown 文档","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 版本中推出,敬请期待。"};Vt.use(Mg).use(vb).init({resources:{en:{translation:Gb},zh:{translation:Kb}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var Mu={exports:{}},lr={},Au={exports:{}},Lu={};var jp;function $b(){return jp||(jp=1,(function(n){function i(M,P){var ue=M.length;M.push(P);e:for(;0<ue;){var ce=ue-1>>>1,ee=M[ce];if(0<c(ee,P))M[ce]=P,M[ue]=ee,ue=ce;else break e}}function r(M){return M.length===0?null:M[0]}function s(M){if(M.length===0)return null;var P=M[0],ue=M.pop();if(ue!==P){M[0]=ue;e:for(var ce=0,ee=M.length,j=ee>>>1;ce<j;){var q=2*(ce+1)-1,G=M[q],le=q+1,ge=M[le];if(0>c(G,ue))le<ee&&0>c(ge,G)?(M[ce]=ge,M[le]=ue,ce=le):(M[ce]=G,M[q]=ue,ce=q);else if(le<ee&&0>c(ge,ue))M[ce]=ge,M[le]=ue,ce=le;else break e}}return P}function c(M,P){var ue=M.sortIndex-P.sortIndex;return ue!==0?ue:M.id-P.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();n.unstable_now=function(){return h.now()-m}}var y=[],p=[],S=1,x=null,_=3,N=!1,z=!1,D=!1,k=!1,W=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function se(M){for(var P=r(p);P!==null;){if(P.callback===null)s(p);else if(P.startTime<=M)s(p),P.sortIndex=P.expirationTime,i(y,P);else break;P=r(p)}}function de(M){if(D=!1,se(M),!z)if(r(y)!==null)z=!0,V||(V=!0,Q());else{var P=r(p);P!==null&&ie(de,P.startTime-M)}}var V=!1,B=-1,E=5,$=-1;function ne(){return k?!0:!(n.unstable_now()-$<E)}function ae(){if(k=!1,V){var M=n.unstable_now();$=M;var P=!0;try{e:{z=!1,D&&(D=!1,X(B),B=-1),N=!0;var ue=_;try{t:{for(se(M),x=r(y);x!==null&&!(x.expirationTime>M&&ne());){var ce=x.callback;if(typeof ce=="function"){x.callback=null,_=x.priorityLevel;var ee=ce(x.expirationTime<=M);if(M=n.unstable_now(),typeof ee=="function"){x.callback=ee,se(M),P=!0;break t}x===r(y)&&s(y),se(M)}else s(y);x=r(y)}if(x!==null)P=!0;else{var j=r(p);j!==null&&ie(de,j.startTime-M),P=!1}}break e}finally{x=null,_=ue,N=!1}P=void 0}}finally{P?Q():V=!1}}}var Q;if(typeof I=="function")Q=function(){I(ae)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,F=xe.port2;xe.port1.onmessage=ae,Q=function(){F.postMessage(null)}}else Q=function(){W(ae,0)};function ie(M,P){B=W(function(){M(n.unstable_now())},P)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(M){M.callback=null},n.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<M?Math.floor(1e3/M):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_next=function(M){switch(_){case 1:case 2:case 3:var P=3;break;default:P=_}var ue=_;_=P;try{return M()}finally{_=ue}},n.unstable_requestPaint=function(){k=!0},n.unstable_runWithPriority=function(M,P){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var ue=_;_=M;try{return P()}finally{_=ue}},n.unstable_scheduleCallback=function(M,P,ue){var ce=n.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?ce+ue:ce):ue=ce,M){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=ue+ee,M={id:S++,callback:P,priorityLevel:M,startTime:ue,expirationTime:ee,sortIndex:-1},ue>ce?(M.sortIndex=ue,i(p,M),r(y)===null&&M===r(p)&&(D?(X(B),B=-1):D=!0,ie(de,ue-ce))):(M.sortIndex=ee,i(y,M),z||N||(z=!0,V||(V=!0,Q()))),M},n.unstable_shouldYield=ne,n.unstable_wrapCallback=function(M){var P=_;return function(){var ue=_;_=P;try{return M.apply(this,arguments)}finally{_=ue}}}})(Lu)),Lu}var Np;function Xb(){return Np||(Np=1,Au.exports=$b()),Au.exports}var ku={exports:{}},Ut={};var Ep;function Qb(){if(Ep)return Ut;Ep=1;var n=ro();function i(y){var p="https://react.dev/errors/"+y;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)p+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+y+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},c=Symbol.for("react.portal");function d(y,p,S){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:x==null?null:""+x,children:y,containerInfo:p,implementation:S}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(y,p){if(y==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Ut.createPortal=function(y,p){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(i(299));return d(y,p,null,S)},Ut.flushSync=function(y){var p=h.T,S=s.p;try{if(h.T=null,s.p=2,y)return y()}finally{h.T=p,s.p=S,s.d.f()}},Ut.preconnect=function(y,p){typeof y=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(y,p))},Ut.prefetchDNS=function(y){typeof y=="string"&&s.d.D(y)},Ut.preinit=function(y,p){if(typeof y=="string"&&p&&typeof p.as=="string"){var S=p.as,x=m(S,p.crossOrigin),_=typeof p.integrity=="string"?p.integrity:void 0,N=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;S==="style"?s.d.S(y,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:_,fetchPriority:N}):S==="script"&&s.d.X(y,{crossOrigin:x,integrity:_,fetchPriority:N,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Ut.preinitModule=function(y,p){if(typeof y=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var S=m(p.as,p.crossOrigin);s.d.M(y,{crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(y)},Ut.preload=function(y,p){if(typeof y=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var S=p.as,x=m(S,p.crossOrigin);s.d.L(y,S,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Ut.preloadModule=function(y,p){if(typeof y=="string")if(p){var S=m(p.as,p.crossOrigin);s.d.m(y,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(y)},Ut.requestFormReset=function(y){s.d.r(y)},Ut.unstable_batchedUpdates=function(y,p){return y(p)},Ut.useFormState=function(y,p,S){return h.H.useFormState(y,p,S)},Ut.useFormStatus=function(){return h.H.useHostTransitionStatus()},Ut.version="19.2.4",Ut}var wp;function Zb(){if(wp)return ku.exports;wp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),ku.exports=Qb(),ku.exports}var Cp;function Fb(){if(Cp)return lr;Cp=1;var n=Xb(),i=ro(),r=Zb();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(d(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(s(188));return t!==e?null:e}for(var a=e,l=t;;){var o=a.return;if(o===null)break;var u=o.alternate;if(u===null){if(l=o.return,l!==null){a=l;continue}break}if(o.child===u.child){for(u=o.child;u;){if(u===a)return y(o),e;if(u===l)return y(o),t;u=u.sibling}throw Error(s(188))}if(a.return!==l.return)a=o,l=u;else{for(var g=!1,b=o.child;b;){if(b===a){g=!0,a=o,l=u;break}if(b===l){g=!0,l=o,a=u;break}b=b.sibling}if(!g){for(b=u.child;b;){if(b===a){g=!0,a=u,l=o;break}if(b===l){g=!0,l=u,a=o;break}b=b.sibling}if(!g)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?e:t}function S(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=S(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,_=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),I=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),de=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Symbol.for("react.client.reference");function F(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case W:return"Profiler";case k:return"StrictMode";case de:return"Suspense";case V:return"SuspenseList";case $:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case z:return"Portal";case I:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return t=e.displayName||null,t!==null?t:F(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return F(e(t))}catch{}}return null}var ie=Array.isArray,M=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},ce=[],ee=-1;function j(e){return{current:e}}function q(e){0>ee||(e.current=ce[ee],ce[ee]=null,ee--)}function G(e,t){ee++,ce[ee]=e.current,e.current=t}var le=j(null),ge=j(null),je=j(null),Ne=j(null);function et(e,t){switch(G(je,t),G(ge,e),G(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Sm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Sm(t),e=_m(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(le),G(le,e)}function Ke(){q(le),q(ge),q(je)}function Va(e){e.memoizedState!==null&&G(Ne,e);var t=le.current,a=_m(t,e.type);t!==a&&(G(ge,e),G(le,a))}function Ga(e){ge.current===e&&(q(le),q(ge)),Ne.current===e&&(q(Ne),Pi._currentValue=ue)}var hn,ht;function At(e){if(hn===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);hn=t&&t[1]||"",ht=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+hn+e+ht}var mn=!1;function Qn(e,t){if(!e||mn)return"";mn=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(Y){var U=Y}Reflect.construct(e,[],J)}else{try{J.call()}catch(Y){U=Y}e.call(J.prototype)}}else{try{throw Error()}catch(Y){U=Y}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(Y){if(Y&&U&&typeof Y.stack=="string")return[Y.stack,U.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=l.DetermineComponentFrameRoot(),g=u[0],b=u[1];if(g&&b){var w=g.split(`
|
|
4
|
+
`),L=b.split(`
|
|
5
|
+
`);for(o=l=0;l<w.length&&!w[l].includes("DetermineComponentFrameRoot");)l++;for(;o<L.length&&!L[o].includes("DetermineComponentFrameRoot");)o++;if(l===w.length||o===L.length)for(l=w.length-1,o=L.length-1;1<=l&&0<=o&&w[l]!==L[o];)o--;for(;1<=l&&0<=o;l--,o--)if(w[l]!==L[o]){if(l!==1||o!==1)do if(l--,o--,0>o||w[l]!==L[o]){var K=`
|
|
6
|
+
`+w[l].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=l&&0<=o);break}}}finally{mn=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?At(a):""}function Sa(e,t){switch(e.tag){case 26:case 27:case 5:return At(e.type);case 16:return At("Lazy");case 13:return e.child!==t&&t!==null?At("Suspense Fallback"):At("Suspense");case 19:return At("SuspenseList");case 0:case 15:return Qn(e.type,!1);case 11:return Qn(e.type.render,!1);case 1:return Qn(e.type,!0);case 31:return At("Activity");default:return""}}function vl(e){try{var t="",a=null;do t+=Sa(e,a),a=e,e=e.return;while(e);return t}catch(l){return`
|
|
7
|
+
Error generating stack: `+l.message+`
|
|
8
|
+
`+l.stack}}var Ce=Object.prototype.hasOwnProperty,Ve=n.unstable_scheduleCallback,He=n.unstable_cancelCallback,_a=n.unstable_shouldYield,fi=n.unstable_requestPaint,Rt=n.unstable_now,ja=n.unstable_getCurrentPriorityLevel,yt=n.unstable_ImmediatePriority,hi=n.unstable_UserBlockingPriority,pn=n.unstable_NormalPriority,Na=n.unstable_LowPriority,sa=n.unstable_IdlePriority,wr=n.log,yo=n.unstable_setDisableYieldValue,Ka=null,qt=null;function Et(e){if(typeof wr=="function"&&yo(e),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(Ka,e)}catch{}}var Lt=Math.clz32?Math.clz32:xo,Cr=Math.log,Rr=Math.LN2;function xo(e){return e>>>=0,e===0?32:31-(Cr(e)/Rr|0)|0}var Zn=256,$a=262144,Fn=4194304;function Ea(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function bl(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var o=0,u=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var b=l&134217727;return b!==0?(l=b&~u,l!==0?o=Ea(l):(g&=b,g!==0?o=Ea(g):a||(a=b&~e,a!==0&&(o=Ea(a))))):(b=l&~u,b!==0?o=Ea(b):g!==0?o=Ea(g):a||(a=l&~e,a!==0&&(o=Ea(a)))),o===0?0:t!==0&&t!==o&&(t&u)===0&&(u=o&-o,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:o}function gn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vo(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 mi(){var e=Fn;return Fn<<=1,(Fn&62914560)===0&&(Fn=4194304),e}function yn(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Da(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function zr(e,t,a,l,o,u){var g=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var b=e.entanglements,w=e.expirationTimes,L=e.hiddenUpdates;for(a=g&~a;0<a;){var K=31-Lt(a),J=1<<K;b[K]=0,w[K]=-1;var U=L[K];if(U!==null)for(L[K]=null,K=0;K<U.length;K++){var Y=U[K];Y!==null&&(Y.lane&=-536870913)}a&=~J}l!==0&&Or(e,l,0),u!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=u&~(g&~t))}function Or(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Lt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function Tr(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-Lt(a),o=1<<l;o&t|e[l]&t&&(e[l]|=t),a&=~o}}function C(e,t){var a=t&-t;return a=(a&42)!==0?1:O(a),(a&(e.suspendedLanes|t))!==0?0:a}function O(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function H(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function te(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:$m(e.type))}function re(e,t){var a=P.p;try{return P.p=e,t()}finally{P.p=a}}var me=Math.random().toString(36).slice(2),oe="__reactFiber$"+me,fe="__reactProps$"+me,he="__reactContainer$"+me,be="__reactEvents$"+me,_e="__reactListeners$"+me,ve="__reactHandles$"+me,$e="__reactResources$"+me,Ae="__reactMarker$"+me;function tt(e){delete e[oe],delete e[fe],delete e[be],delete e[_e],delete e[ve]}function lt(e){var t=e[oe];if(t)return t;for(var a=e.parentNode;a;){if(t=a[he]||a[oe]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=zm(e);e!==null;){if(a=e[oe])return a;e=zm(e)}return t}e=a,a=e.parentNode}return null}function ct(e){if(e=e[oe]||e[he]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ge(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function jt(e){var t=e[$e];return t||(t=e[$e]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[Ae]=!0}var xn=new Set,wa={};function wt(e,t){Ma(e,t),Ma(e+"Capture",t)}function Ma(e,t){for(wa[e]=t,e=0;e<t.length;e++)xn.add(t[e])}var Jn=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]*$"),Aa={},Wn={};function Sl(e){return Ce.call(Wn,e)?!0:Ce.call(Aa,e)?!1:Jn.test(e)?Wn[e]=!0:(Aa[e]=!0,!1)}function Le(e,t,a){if(Sl(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function mt(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function kt(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function it(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _l(e,t,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var o=l.get,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(g){a=""+g,u.call(this,g)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(g){a=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jl(e){if(!e._valueTracker){var t=it(e)?"checked":"value";e._valueTracker=_l(e,t,""+e[t])}}function Dr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=it(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function Mr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ry=/[\n"\\]/g;function oa(e){return e.replace(Ry,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function bo(e,t,a,l,o,u,g,b){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?So(e,g,xt(t)):a!=null?So(e,g,xt(a)):l!=null&&e.removeAttribute("value"),o==null&&u!=null&&(e.defaultChecked=!!u),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+xt(b):e.removeAttribute("name")}function md(e,t,a,l,o,u,g,b){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){jl(e);return}a=a!=null?""+xt(a):"",t=t!=null?""+xt(t):a,b||t===e.value||(e.value=t),e.defaultValue=t}l=l??o,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=b?e.checked:!!l,e.defaultChecked=!!l,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),jl(e)}function So(e,t,a){t==="number"&&Mr(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Nl(e,t,a,l){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&l&&(e[a].defaultSelected=!0)}else{for(a=""+xt(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,l&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function pd(e,t,a){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+xt(a):""}function gd(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(s(92));if(ie(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=xt(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),jl(e)}function El(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var zy=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 yd(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||zy.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function xd(e,t,a){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var o in t)l=t[o],t.hasOwnProperty(o)&&a[o]!==l&&yd(e,o,l)}else for(var u in t)t.hasOwnProperty(u)&&yd(e,u,t[u])}function _o(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Oy=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"]]),Ty=/^[\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 Ar(e){return Ty.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xa(){}var jo=null;function No(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wl=null,Cl=null;function vd(e){var t=ct(e);if(t&&(e=t.stateNode)){var a=e[fe]||null;e:switch(e=t.stateNode,t.type){case"input":if(bo(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+oa(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var o=l[fe]||null;if(!o)throw Error(s(90));bo(l,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Dr(l)}break e;case"textarea":pd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Nl(e,!!a.multiple,t,!1)}}}var Eo=!1;function bd(e,t,a){if(Eo)return e(t,a);Eo=!0;try{var l=e(t);return l}finally{if(Eo=!1,(wl!==null||Cl!==null)&&(Ss(),wl&&(t=wl,e=Cl,Cl=wl=null,vd(t),e)))for(t=0;t<e.length;t++)vd(e[t])}}function pi(e,t){var a=e.stateNode;if(a===null)return null;var l=a[fe]||null;if(l===null)return null;a=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(s(231,t,typeof a));return a}var Qa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wo=!1;if(Qa)try{var gi={};Object.defineProperty(gi,"passive",{get:function(){wo=!0}}),window.addEventListener("test",gi,gi),window.removeEventListener("test",gi,gi)}catch{wo=!1}var vn=null,Co=null,Lr=null;function Sd(){if(Lr)return Lr;var e,t=Co,a=t.length,l,o="value"in vn?vn.value:vn.textContent,u=o.length;for(e=0;e<a&&t[e]===o[e];e++);var g=a-e;for(l=1;l<=g&&t[a-l]===o[u-l];l++);return Lr=o.slice(e,1<l?1-l:void 0)}function kr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ur(){return!0}function _d(){return!1}function Gt(e){function t(a,l,o,u,g){this._reactName=a,this._targetInst=o,this.type=l,this.nativeEvent=u,this.target=g,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(a=e[b],this[b]=a?a(u):u[b]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Ur:_d,this.isPropagationStopped=_d,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ur)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ur)},persist:function(){},isPersistent:Ur}),t}var Pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hr=Gt(Pn),yi=x({},Pn,{view:0,detail:0}),Dy=Gt(yi),Ro,zo,xi,Br=x({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:To,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==xi&&(xi&&e.type==="mousemove"?(Ro=e.screenX-xi.screenX,zo=e.screenY-xi.screenY):zo=Ro=0,xi=e),Ro)},movementY:function(e){return"movementY"in e?e.movementY:zo}}),jd=Gt(Br),My=x({},Br,{dataTransfer:0}),Ay=Gt(My),Ly=x({},yi,{relatedTarget:0}),Oo=Gt(Ly),ky=x({},Pn,{animationName:0,elapsedTime:0,pseudoElement:0}),Uy=Gt(ky),Hy=x({},Pn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),By=Gt(Hy),qy=x({},Pn,{data:0}),Nd=Gt(qy),Yy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vy={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"},Gy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ky(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gy[e])?!!t[e]:!1}function To(){return Ky}var $y=x({},yi,{key:function(e){if(e.key){var t=Yy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=kr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:To,charCode:function(e){return e.type==="keypress"?kr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?kr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Xy=Gt($y),Qy=x({},Br,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ed=Gt(Qy),Zy=x({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:To}),Fy=Gt(Zy),Jy=x({},Pn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wy=Gt(Jy),Py=x({},Br,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Iy=Gt(Py),ex=x({},Pn,{newState:0,oldState:0}),tx=Gt(ex),ax=[9,13,27,32],Do=Qa&&"CompositionEvent"in window,vi=null;Qa&&"documentMode"in document&&(vi=document.documentMode);var nx=Qa&&"TextEvent"in window&&!vi,wd=Qa&&(!Do||vi&&8<vi&&11>=vi),Cd=" ",Rd=!1;function zd(e,t){switch(e){case"keyup":return ax.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Od(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rl=!1;function lx(e,t){switch(e){case"compositionend":return Od(t);case"keypress":return t.which!==32?null:(Rd=!0,Cd);case"textInput":return e=t.data,e===Cd&&Rd?null:e;default:return null}}function ix(e,t){if(Rl)return e==="compositionend"||!Do&&zd(e,t)?(e=Sd(),Lr=Co=vn=null,Rl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return wd&&t.locale!=="ko"?null:t.data;default:return null}}var rx={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 Td(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rx[e.type]:t==="textarea"}function Dd(e,t,a,l){wl?Cl?Cl.push(l):Cl=[l]:wl=l,t=Rs(t,"onChange"),0<t.length&&(a=new Hr("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var bi=null,Si=null;function sx(e){pm(e,0)}function qr(e){var t=Ge(e);if(Dr(t))return e}function Md(e,t){if(e==="change")return t}var Ad=!1;if(Qa){var Mo;if(Qa){var Ao="oninput"in document;if(!Ao){var Ld=document.createElement("div");Ld.setAttribute("oninput","return;"),Ao=typeof Ld.oninput=="function"}Mo=Ao}else Mo=!1;Ad=Mo&&(!document.documentMode||9<document.documentMode)}function kd(){bi&&(bi.detachEvent("onpropertychange",Ud),Si=bi=null)}function Ud(e){if(e.propertyName==="value"&&qr(Si)){var t=[];Dd(t,Si,e,No(e)),bd(sx,t)}}function ox(e,t,a){e==="focusin"?(kd(),bi=t,Si=a,bi.attachEvent("onpropertychange",Ud)):e==="focusout"&&kd()}function cx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qr(Si)}function ux(e,t){if(e==="click")return qr(t)}function dx(e,t){if(e==="input"||e==="change")return qr(t)}function fx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jt=typeof Object.is=="function"?Object.is:fx;function _i(e,t){if(Jt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var o=a[l];if(!Ce.call(t,o)||!Jt(e[o],t[o]))return!1}return!0}function Hd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bd(e,t){var a=Hd(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Hd(a)}}function qd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mr(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Mr(e.document)}return t}function Lo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var hx=Qa&&"documentMode"in document&&11>=document.documentMode,zl=null,ko=null,ji=null,Uo=!1;function Vd(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Uo||zl==null||zl!==Mr(l)||(l=zl,"selectionStart"in l&&Lo(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ji&&_i(ji,l)||(ji=l,l=Rs(ko,"onSelect"),0<l.length&&(t=new Hr("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=zl)))}function In(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Ol={animationend:In("Animation","AnimationEnd"),animationiteration:In("Animation","AnimationIteration"),animationstart:In("Animation","AnimationStart"),transitionrun:In("Transition","TransitionRun"),transitionstart:In("Transition","TransitionStart"),transitioncancel:In("Transition","TransitionCancel"),transitionend:In("Transition","TransitionEnd")},Ho={},Gd={};Qa&&(Gd=document.createElement("div").style,"AnimationEvent"in window||(delete Ol.animationend.animation,delete Ol.animationiteration.animation,delete Ol.animationstart.animation),"TransitionEvent"in window||delete Ol.transitionend.transition);function el(e){if(Ho[e])return Ho[e];if(!Ol[e])return e;var t=Ol[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Gd)return Ho[e]=t[a];return e}var Kd=el("animationend"),$d=el("animationiteration"),Xd=el("animationstart"),mx=el("transitionrun"),px=el("transitionstart"),gx=el("transitioncancel"),Qd=el("transitionend"),Zd=new Map,Bo="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(" ");Bo.push("scrollEnd");function Ca(e,t){Zd.set(e,t),wt(t,[e])}var Yr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ca=[],Tl=0,qo=0;function Vr(){for(var e=Tl,t=qo=Tl=0;t<e;){var a=ca[t];ca[t++]=null;var l=ca[t];ca[t++]=null;var o=ca[t];ca[t++]=null;var u=ca[t];if(ca[t++]=null,l!==null&&o!==null){var g=l.pending;g===null?o.next=o:(o.next=g.next,g.next=o),l.pending=o}u!==0&&Fd(a,o,u)}}function Gr(e,t,a,l){ca[Tl++]=e,ca[Tl++]=t,ca[Tl++]=a,ca[Tl++]=l,qo|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Yo(e,t,a,l){return Gr(e,t,a,l),Kr(e)}function tl(e,t){return Gr(e,null,null,t),Kr(e)}function Fd(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var o=!1,u=e.return;u!==null;)u.childLanes|=a,l=u.alternate,l!==null&&(l.childLanes|=a),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(o=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,o&&t!==null&&(o=31-Lt(a),e=u.hiddenUpdates,l=e[o],l===null?e[o]=[t]:l.push(t),t.lane=a|536870912),u):null}function Kr(e){if(50<$i)throw $i=0,Jc=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Dl={};function yx(e,t,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wt(e,t,a,l){return new yx(e,t,a,l)}function Vo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Za(e,t){var a=e.alternate;return a===null?(a=Wt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Jd(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function $r(e,t,a,l,o,u){var g=0;if(l=e,typeof e=="function")Vo(e)&&(g=1);else if(typeof e=="string")g=_v(e,a,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=Wt(31,a,t,o),e.elementType=$,e.lanes=u,e;case D:return al(a.children,o,u,t);case k:g=8,o|=24;break;case W:return e=Wt(12,a,t,o|2),e.elementType=W,e.lanes=u,e;case de:return e=Wt(13,a,t,o),e.elementType=de,e.lanes=u,e;case V:return e=Wt(19,a,t,o),e.elementType=V,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I:g=10;break e;case X:g=9;break e;case se:g=11;break e;case B:g=14;break e;case E:g=16,l=null;break e}g=29,a=Error(s(130,e===null?"null":typeof e,"")),l=null}return t=Wt(g,a,t,o),t.elementType=e,t.type=l,t.lanes=u,t}function al(e,t,a,l){return e=Wt(7,e,l,t),e.lanes=a,e}function Go(e,t,a){return e=Wt(6,e,null,t),e.lanes=a,e}function Wd(e){var t=Wt(18,null,null,0);return t.stateNode=e,t}function Ko(e,t,a){return t=Wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pd=new WeakMap;function ua(e,t){if(typeof e=="object"&&e!==null){var a=Pd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:vl(t)},Pd.set(e,t),t)}return{value:e,source:t,stack:vl(t)}}var Ml=[],Al=0,Xr=null,Ni=0,da=[],fa=0,bn=null,La=1,ka="";function Fa(e,t){Ml[Al++]=Ni,Ml[Al++]=Xr,Xr=e,Ni=t}function Id(e,t,a){da[fa++]=La,da[fa++]=ka,da[fa++]=bn,bn=e;var l=La;e=ka;var o=32-Lt(l)-1;l&=~(1<<o),a+=1;var u=32-Lt(t)+o;if(30<u){var g=o-o%5;u=(l&(1<<g)-1).toString(32),l>>=g,o-=g,La=1<<32-Lt(t)+o|a<<o|l,ka=u+e}else La=1<<u|a<<o|l,ka=e}function $o(e){e.return!==null&&(Fa(e,1),Id(e,1,0))}function Xo(e){for(;e===Xr;)Xr=Ml[--Al],Ml[Al]=null,Ni=Ml[--Al],Ml[Al]=null;for(;e===bn;)bn=da[--fa],da[fa]=null,ka=da[--fa],da[fa]=null,La=da[--fa],da[fa]=null}function ef(e,t){da[fa++]=La,da[fa++]=ka,da[fa++]=bn,La=t.id,ka=t.overflow,bn=e}var zt=null,rt=null,Ye=!1,Sn=null,ha=!1,Qo=Error(s(519));function _n(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ei(ua(t,e)),Qo}function tf(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[oe]=e,t[fe]=l,a){case"dialog":Ue("cancel",t),Ue("close",t);break;case"iframe":case"object":case"embed":Ue("load",t);break;case"video":case"audio":for(a=0;a<Qi.length;a++)Ue(Qi[a],t);break;case"source":Ue("error",t);break;case"img":case"image":case"link":Ue("error",t),Ue("load",t);break;case"details":Ue("toggle",t);break;case"input":Ue("invalid",t),md(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ue("invalid",t);break;case"textarea":Ue("invalid",t),gd(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||vm(t.textContent,a)?(l.popover!=null&&(Ue("beforetoggle",t),Ue("toggle",t)),l.onScroll!=null&&Ue("scroll",t),l.onScrollEnd!=null&&Ue("scrollend",t),l.onClick!=null&&(t.onclick=Xa),t=!0):t=!1,t||_n(e,!0)}function af(e){for(zt=e.return;zt;)switch(zt.tag){case 5:case 31:case 13:ha=!1;return;case 27:case 3:ha=!0;return;default:zt=zt.return}}function Ll(e){if(e!==zt)return!1;if(!Ye)return af(e),Ye=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||du(e.type,e.memoizedProps)),a=!a),a&&rt&&_n(e),af(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));rt=Rm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));rt=Rm(e)}else t===27?(t=rt,kn(e.type)?(e=gu,gu=null,rt=e):rt=t):rt=zt?pa(e.stateNode.nextSibling):null;return!0}function nl(){rt=zt=null,Ye=!1}function Zo(){var e=Sn;return e!==null&&(Qt===null?Qt=e:Qt.push.apply(Qt,e),Sn=null),e}function Ei(e){Sn===null?Sn=[e]:Sn.push(e)}var Fo=j(null),ll=null,Ja=null;function jn(e,t,a){G(Fo,t._currentValue),t._currentValue=a}function Wa(e){e._currentValue=Fo.current,q(Fo)}function Jo(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function Wo(e,t,a,l){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var u=o.dependencies;if(u!==null){var g=o.child;u=u.firstContext;e:for(;u!==null;){var b=u;u=o;for(var w=0;w<t.length;w++)if(b.context===t[w]){u.lanes|=a,b=u.alternate,b!==null&&(b.lanes|=a),Jo(u.return,a,e),l||(g=null);break e}u=b.next}}else if(o.tag===18){if(g=o.return,g===null)throw Error(s(341));g.lanes|=a,u=g.alternate,u!==null&&(u.lanes|=a),Jo(g,a,e),g=null}else g=o.child;if(g!==null)g.return=o;else for(g=o;g!==null;){if(g===e){g=null;break}if(o=g.sibling,o!==null){o.return=g.return,g=o;break}g=g.return}o=g}}function kl(e,t,a,l){e=null;for(var o=t,u=!1;o!==null;){if(!u){if((o.flags&524288)!==0)u=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var g=o.alternate;if(g===null)throw Error(s(387));if(g=g.memoizedProps,g!==null){var b=o.type;Jt(o.pendingProps.value,g.value)||(e!==null?e.push(b):e=[b])}}else if(o===Ne.current){if(g=o.alternate,g===null)throw Error(s(387));g.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Pi):e=[Pi])}o=o.return}e!==null&&Wo(t,e,a,l),t.flags|=262144}function Qr(e){for(e=e.firstContext;e!==null;){if(!Jt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function il(e){ll=e,Ja=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ot(e){return nf(ll,e)}function Zr(e,t){return ll===null&&il(e),nf(e,t)}function nf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Ja===null){if(e===null)throw Error(s(308));Ja=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ja=Ja.next=t;return a}var xx=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},vx=n.unstable_scheduleCallback,bx=n.unstable_NormalPriority,vt={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Po(){return{controller:new xx,data:new Map,refCount:0}}function wi(e){e.refCount--,e.refCount===0&&vx(bx,function(){e.controller.abort()})}var Ci=null,Io=0,Ul=0,Hl=null;function Sx(e,t){if(Ci===null){var a=Ci=[];Io=0,Ul=au(),Hl={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Io++,t.then(lf,lf),t}function lf(){if(--Io===0&&Ci!==null){Hl!==null&&(Hl.status="fulfilled");var e=Ci;Ci=null,Ul=0,Hl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _x(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(o){a.push(o)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var o=0;o<a.length;o++)(0,a[o])(t)},function(o){for(l.status="rejected",l.reason=o,o=0;o<a.length;o++)(0,a[o])(void 0)}),l}var rf=M.S;M.S=function(e,t){Gh=Rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Sx(e,t),rf!==null&&rf(e,t)};var rl=j(null);function ec(){var e=rl.current;return e!==null?e:at.pooledCache}function Fr(e,t){t===null?G(rl,rl.current):G(rl,t.pool)}function sf(){var e=ec();return e===null?null:{parent:vt._currentValue,pool:e}}var Bl=Error(s(460)),tc=Error(s(474)),Jr=Error(s(542)),Wr={then:function(){}};function of(e){return e=e.status,e==="fulfilled"||e==="rejected"}function cf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Xa,Xa),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,df(e),e;default:if(typeof t.status=="string")t.then(Xa,Xa);else{if(e=at,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=l}},function(l){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,df(e),e}throw ol=t,Bl}}function sl(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ol=a,Bl):a}}var ol=null;function uf(){if(ol===null)throw Error(s(459));var e=ol;return ol=null,e}function df(e){if(e===Bl||e===Jr)throw Error(s(483))}var ql=null,Ri=0;function Pr(e){var t=Ri;return Ri+=1,ql===null&&(ql=[]),cf(ql,e,t)}function zi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ir(e,t){throw t.$$typeof===_?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ff(e){function t(T,R){if(e){var A=T.deletions;A===null?(T.deletions=[R],T.flags|=16):A.push(R)}}function a(T,R){if(!e)return null;for(;R!==null;)t(T,R),R=R.sibling;return null}function l(T){for(var R=new Map;T!==null;)T.key!==null?R.set(T.key,T):R.set(T.index,T),T=T.sibling;return R}function o(T,R){return T=Za(T,R),T.index=0,T.sibling=null,T}function u(T,R,A){return T.index=A,e?(A=T.alternate,A!==null?(A=A.index,A<R?(T.flags|=67108866,R):A):(T.flags|=67108866,R)):(T.flags|=1048576,R)}function g(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function b(T,R,A,Z){return R===null||R.tag!==6?(R=Go(A,T.mode,Z),R.return=T,R):(R=o(R,A),R.return=T,R)}function w(T,R,A,Z){var Se=A.type;return Se===D?K(T,R,A.props.children,Z,A.key):R!==null&&(R.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===E&&sl(Se)===R.type)?(R=o(R,A.props),zi(R,A),R.return=T,R):(R=$r(A.type,A.key,A.props,null,T.mode,Z),zi(R,A),R.return=T,R)}function L(T,R,A,Z){return R===null||R.tag!==4||R.stateNode.containerInfo!==A.containerInfo||R.stateNode.implementation!==A.implementation?(R=Ko(A,T.mode,Z),R.return=T,R):(R=o(R,A.children||[]),R.return=T,R)}function K(T,R,A,Z,Se){return R===null||R.tag!==7?(R=al(A,T.mode,Z,Se),R.return=T,R):(R=o(R,A),R.return=T,R)}function J(T,R,A){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Go(""+R,T.mode,A),R.return=T,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case N:return A=$r(R.type,R.key,R.props,null,T.mode,A),zi(A,R),A.return=T,A;case z:return R=Ko(R,T.mode,A),R.return=T,R;case E:return R=sl(R),J(T,R,A)}if(ie(R)||Q(R))return R=al(R,T.mode,A,null),R.return=T,R;if(typeof R.then=="function")return J(T,Pr(R),A);if(R.$$typeof===I)return J(T,Zr(T,R),A);Ir(T,R)}return null}function U(T,R,A,Z){var Se=R!==null?R.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return Se!==null?null:b(T,R,""+A,Z);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case N:return A.key===Se?w(T,R,A,Z):null;case z:return A.key===Se?L(T,R,A,Z):null;case E:return A=sl(A),U(T,R,A,Z)}if(ie(A)||Q(A))return Se!==null?null:K(T,R,A,Z,null);if(typeof A.then=="function")return U(T,R,Pr(A),Z);if(A.$$typeof===I)return U(T,R,Zr(T,A),Z);Ir(T,A)}return null}function Y(T,R,A,Z,Se){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return T=T.get(A)||null,b(R,T,""+Z,Se);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case N:return T=T.get(Z.key===null?A:Z.key)||null,w(R,T,Z,Se);case z:return T=T.get(Z.key===null?A:Z.key)||null,L(R,T,Z,Se);case E:return Z=sl(Z),Y(T,R,A,Z,Se)}if(ie(Z)||Q(Z))return T=T.get(A)||null,K(R,T,Z,Se,null);if(typeof Z.then=="function")return Y(T,R,A,Pr(Z),Se);if(Z.$$typeof===I)return Y(T,R,A,Zr(R,Z),Se);Ir(R,Z)}return null}function pe(T,R,A,Z){for(var Se=null,Xe=null,ye=R,Te=R=0,qe=null;ye!==null&&Te<A.length;Te++){ye.index>Te?(qe=ye,ye=null):qe=ye.sibling;var Qe=U(T,ye,A[Te],Z);if(Qe===null){ye===null&&(ye=qe);break}e&&ye&&Qe.alternate===null&&t(T,ye),R=u(Qe,R,Te),Xe===null?Se=Qe:Xe.sibling=Qe,Xe=Qe,ye=qe}if(Te===A.length)return a(T,ye),Ye&&Fa(T,Te),Se;if(ye===null){for(;Te<A.length;Te++)ye=J(T,A[Te],Z),ye!==null&&(R=u(ye,R,Te),Xe===null?Se=ye:Xe.sibling=ye,Xe=ye);return Ye&&Fa(T,Te),Se}for(ye=l(ye);Te<A.length;Te++)qe=Y(ye,T,Te,A[Te],Z),qe!==null&&(e&&qe.alternate!==null&&ye.delete(qe.key===null?Te:qe.key),R=u(qe,R,Te),Xe===null?Se=qe:Xe.sibling=qe,Xe=qe);return e&&ye.forEach(function(Yn){return t(T,Yn)}),Ye&&Fa(T,Te),Se}function Ee(T,R,A,Z){if(A==null)throw Error(s(151));for(var Se=null,Xe=null,ye=R,Te=R=0,qe=null,Qe=A.next();ye!==null&&!Qe.done;Te++,Qe=A.next()){ye.index>Te?(qe=ye,ye=null):qe=ye.sibling;var Yn=U(T,ye,Qe.value,Z);if(Yn===null){ye===null&&(ye=qe);break}e&&ye&&Yn.alternate===null&&t(T,ye),R=u(Yn,R,Te),Xe===null?Se=Yn:Xe.sibling=Yn,Xe=Yn,ye=qe}if(Qe.done)return a(T,ye),Ye&&Fa(T,Te),Se;if(ye===null){for(;!Qe.done;Te++,Qe=A.next())Qe=J(T,Qe.value,Z),Qe!==null&&(R=u(Qe,R,Te),Xe===null?Se=Qe:Xe.sibling=Qe,Xe=Qe);return Ye&&Fa(T,Te),Se}for(ye=l(ye);!Qe.done;Te++,Qe=A.next())Qe=Y(ye,T,Te,Qe.value,Z),Qe!==null&&(e&&Qe.alternate!==null&&ye.delete(Qe.key===null?Te:Qe.key),R=u(Qe,R,Te),Xe===null?Se=Qe:Xe.sibling=Qe,Xe=Qe);return e&&ye.forEach(function(Mv){return t(T,Mv)}),Ye&&Fa(T,Te),Se}function Ie(T,R,A,Z){if(typeof A=="object"&&A!==null&&A.type===D&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case N:e:{for(var Se=A.key;R!==null;){if(R.key===Se){if(Se=A.type,Se===D){if(R.tag===7){a(T,R.sibling),Z=o(R,A.props.children),Z.return=T,T=Z;break e}}else if(R.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===E&&sl(Se)===R.type){a(T,R.sibling),Z=o(R,A.props),zi(Z,A),Z.return=T,T=Z;break e}a(T,R);break}else t(T,R);R=R.sibling}A.type===D?(Z=al(A.props.children,T.mode,Z,A.key),Z.return=T,T=Z):(Z=$r(A.type,A.key,A.props,null,T.mode,Z),zi(Z,A),Z.return=T,T=Z)}return g(T);case z:e:{for(Se=A.key;R!==null;){if(R.key===Se)if(R.tag===4&&R.stateNode.containerInfo===A.containerInfo&&R.stateNode.implementation===A.implementation){a(T,R.sibling),Z=o(R,A.children||[]),Z.return=T,T=Z;break e}else{a(T,R);break}else t(T,R);R=R.sibling}Z=Ko(A,T.mode,Z),Z.return=T,T=Z}return g(T);case E:return A=sl(A),Ie(T,R,A,Z)}if(ie(A))return pe(T,R,A,Z);if(Q(A)){if(Se=Q(A),typeof Se!="function")throw Error(s(150));return A=Se.call(A),Ee(T,R,A,Z)}if(typeof A.then=="function")return Ie(T,R,Pr(A),Z);if(A.$$typeof===I)return Ie(T,R,Zr(T,A),Z);Ir(T,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,R!==null&&R.tag===6?(a(T,R.sibling),Z=o(R,A),Z.return=T,T=Z):(a(T,R),Z=Go(A,T.mode,Z),Z.return=T,T=Z),g(T)):a(T,R)}return function(T,R,A,Z){try{Ri=0;var Se=Ie(T,R,A,Z);return ql=null,Se}catch(ye){if(ye===Bl||ye===Jr)throw ye;var Xe=Wt(29,ye,null,T.mode);return Xe.lanes=Z,Xe.return=T,Xe}}}var cl=ff(!0),hf=ff(!1),Nn=!1;function ac(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function En(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wn(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ze&2)!==0){var o=l.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),l.pending=t,t=Kr(e),Fd(e,null,a),t}return Gr(e,l,t,a),Kr(e)}function Oi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Tr(e,a)}}function lc(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var o=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var g={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?o=u=g:u=u.next=g,a=a.next}while(a!==null);u===null?o=u=t:u=u.next=t}else o=u=t;a={baseState:l.baseState,firstBaseUpdate:o,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var ic=!1;function Ti(){if(ic){var e=Hl;if(e!==null)throw e}}function Di(e,t,a,l){ic=!1;var o=e.updateQueue;Nn=!1;var u=o.firstBaseUpdate,g=o.lastBaseUpdate,b=o.shared.pending;if(b!==null){o.shared.pending=null;var w=b,L=w.next;w.next=null,g===null?u=L:g.next=L,g=w;var K=e.alternate;K!==null&&(K=K.updateQueue,b=K.lastBaseUpdate,b!==g&&(b===null?K.firstBaseUpdate=L:b.next=L,K.lastBaseUpdate=w))}if(u!==null){var J=o.baseState;g=0,K=L=w=null,b=u;do{var U=b.lane&-536870913,Y=U!==b.lane;if(Y?(Be&U)===U:(l&U)===U){U!==0&&U===Ul&&(ic=!0),K!==null&&(K=K.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var pe=e,Ee=b;U=t;var Ie=a;switch(Ee.tag){case 1:if(pe=Ee.payload,typeof pe=="function"){J=pe.call(Ie,J,U);break e}J=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Ee.payload,U=typeof pe=="function"?pe.call(Ie,J,U):pe,U==null)break e;J=x({},J,U);break e;case 2:Nn=!0}}U=b.callback,U!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=o.callbacks,Y===null?o.callbacks=[U]:Y.push(U))}else Y={lane:U,tag:b.tag,payload:b.payload,callback:b.callback,next:null},K===null?(L=K=Y,w=J):K=K.next=Y,g|=U;if(b=b.next,b===null){if(b=o.shared.pending,b===null)break;Y=b,b=Y.next,Y.next=null,o.lastBaseUpdate=Y,o.shared.pending=null}}while(!0);K===null&&(w=J),o.baseState=w,o.firstBaseUpdate=L,o.lastBaseUpdate=K,u===null&&(o.shared.lanes=0),Tn|=g,e.lanes=g,e.memoizedState=J}}function mf(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function pf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)mf(a[e],t)}var Yl=j(null),es=j(0);function gf(e,t){e=sn,G(es,e),G(Yl,t),sn=e|t.baseLanes}function rc(){G(es,sn),G(Yl,Yl.current)}function sc(){sn=es.current,q(Yl),q(es)}var Pt=j(null),ma=null;function Cn(e){var t=e.alternate;G(pt,pt.current&1),G(Pt,e),ma===null&&(t===null||Yl.current!==null||t.memoizedState!==null)&&(ma=e)}function oc(e){G(pt,pt.current),G(Pt,e),ma===null&&(ma=e)}function yf(e){e.tag===22?(G(pt,pt.current),G(Pt,e),ma===null&&(ma=e)):Rn()}function Rn(){G(pt,pt.current),G(Pt,Pt.current)}function It(e){q(Pt),ma===e&&(ma=null),q(pt)}var pt=j(0);function ts(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||mu(a)||pu(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pa=0,Oe=null,We=null,bt=null,as=!1,Vl=!1,ul=!1,ns=0,Mi=0,Gl=null,jx=0;function ut(){throw Error(s(321))}function cc(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Jt(e[a],t[a]))return!1;return!0}function uc(e,t,a,l,o,u){return Pa=u,Oe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?eh:Ec,ul=!1,u=a(l,o),ul=!1,Vl&&(u=vf(t,a,l,o)),xf(e),u}function xf(e){M.H=ki;var t=We!==null&&We.next!==null;if(Pa=0,bt=We=Oe=null,as=!1,Mi=0,Gl=null,t)throw Error(s(300));e===null||St||(e=e.dependencies,e!==null&&Qr(e)&&(St=!0))}function vf(e,t,a,l){Oe=e;var o=0;do{if(Vl&&(Gl=null),Mi=0,Vl=!1,25<=o)throw Error(s(301));if(o+=1,bt=We=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}M.H=th,u=t(a,l)}while(Vl);return u}function Nx(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?Ai(t):t,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(Oe.flags|=1024),t}function dc(){var e=ns!==0;return ns=0,e}function fc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function hc(e){if(as){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}as=!1}Pa=0,bt=We=Oe=null,Vl=!1,Mi=ns=0,Gl=null}function Yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Oe.memoizedState=bt=e:bt=bt.next=e,bt}function gt(){if(We===null){var e=Oe.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=bt===null?Oe.memoizedState:bt.next;if(t!==null)bt=t,We=e;else{if(e===null)throw Oe.alternate===null?Error(s(467)):Error(s(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},bt===null?Oe.memoizedState=bt=e:bt=bt.next=e}return bt}function ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ai(e){var t=Mi;return Mi+=1,Gl===null&&(Gl=[]),e=cf(Gl,e,t),t=Oe,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?eh:Ec),e}function is(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ai(e);if(e.$$typeof===I)return Ot(e)}throw Error(s(438,String(e)))}function mc(e){var t=null,a=Oe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=Oe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=ls(),Oe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=ne;return t.index++,a}function Ia(e,t){return typeof t=="function"?t(e):t}function rs(e){var t=gt();return pc(t,We,e)}function pc(e,t,a){var l=e.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var o=e.baseQueue,u=l.pending;if(u!==null){if(o!==null){var g=o.next;o.next=u.next,u.next=g}t.baseQueue=o=u,l.pending=null}if(u=e.baseState,o===null)e.memoizedState=u;else{t=o.next;var b=g=null,w=null,L=t,K=!1;do{var J=L.lane&-536870913;if(J!==L.lane?(Be&J)===J:(Pa&J)===J){var U=L.revertLane;if(U===0)w!==null&&(w=w.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),J===Ul&&(K=!0);else if((Pa&U)===U){L=L.next,U===Ul&&(K=!0);continue}else J={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},w===null?(b=w=J,g=u):w=w.next=J,Oe.lanes|=U,Tn|=U;J=L.action,ul&&a(u,J),u=L.hasEagerState?L.eagerState:a(u,J)}else U={lane:J,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},w===null?(b=w=U,g=u):w=w.next=U,Oe.lanes|=J,Tn|=J;L=L.next}while(L!==null&&L!==t);if(w===null?g=u:w.next=b,!Jt(u,e.memoizedState)&&(St=!0,K&&(a=Hl,a!==null)))throw a;e.memoizedState=u,e.baseState=g,e.baseQueue=w,l.lastRenderedState=u}return o===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function gc(e){var t=gt(),a=t.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var l=a.dispatch,o=a.pending,u=t.memoizedState;if(o!==null){a.pending=null;var g=o=o.next;do u=e(u,g.action),g=g.next;while(g!==o);Jt(u,t.memoizedState)||(St=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),a.lastRenderedState=u}return[u,l]}function bf(e,t,a){var l=Oe,o=gt(),u=Ye;if(u){if(a===void 0)throw Error(s(407));a=a()}else a=t();var g=!Jt((We||o).memoizedState,a);if(g&&(o.memoizedState=a,St=!0),o=o.queue,vc(jf.bind(null,l,o,e),[e]),o.getSnapshot!==t||g||bt!==null&&bt.memoizedState.tag&1){if(l.flags|=2048,Kl(9,{destroy:void 0},_f.bind(null,l,o,a,t),null),at===null)throw Error(s(349));u||(Pa&127)!==0||Sf(l,t,a)}return a}function Sf(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Oe.updateQueue,t===null?(t=ls(),Oe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function _f(e,t,a,l){t.value=a,t.getSnapshot=l,Nf(t)&&Ef(e)}function jf(e,t,a){return a(function(){Nf(t)&&Ef(e)})}function Nf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Jt(e,a)}catch{return!0}}function Ef(e){var t=tl(e,2);t!==null&&Zt(t,e,2)}function yc(e){var t=Yt();if(typeof e=="function"){var a=e;if(e=a(),ul){Et(!0);try{a()}finally{Et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:e},t}function wf(e,t,a,l){return e.baseState=a,pc(e,We,typeof l=="function"?l:Ia)}function Ex(e,t,a,l,o){if(cs(e))throw Error(s(485));if(e=t.action,e!==null){var u={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){u.listeners.push(g)}};M.T!==null?a(!0):u.isTransition=!1,l(u),a=t.pending,a===null?(u.next=t.pending=u,Cf(t,u)):(u.next=a.next,t.pending=a.next=u)}}function Cf(e,t){var a=t.action,l=t.payload,o=e.state;if(t.isTransition){var u=M.T,g={};M.T=g;try{var b=a(o,l),w=M.S;w!==null&&w(g,b),Rf(e,t,b)}catch(L){xc(e,t,L)}finally{u!==null&&g.types!==null&&(u.types=g.types),M.T=u}}else try{u=a(o,l),Rf(e,t,u)}catch(L){xc(e,t,L)}}function Rf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){zf(e,t,l)},function(l){return xc(e,t,l)}):zf(e,t,a)}function zf(e,t,a){t.status="fulfilled",t.value=a,Of(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Cf(e,a)))}function xc(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,Of(t),t=t.next;while(t!==l)}e.action=null}function Of(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Tf(e,t){return t}function Df(e,t){if(Ye){var a=at.formState;if(a!==null){e:{var l=Oe;if(Ye){if(rt){t:{for(var o=rt,u=ha;o.nodeType!==8;){if(!u){o=null;break t}if(o=pa(o.nextSibling),o===null){o=null;break t}}u=o.data,o=u==="F!"||u==="F"?o:null}if(o){rt=pa(o.nextSibling),l=o.data==="F!";break e}}_n(l)}l=!1}l&&(t=a[0])}}return a=Yt(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tf,lastRenderedState:t},a.queue=l,a=Wf.bind(null,Oe,l),l.dispatch=a,l=yc(!1),u=Nc.bind(null,Oe,!1,l.queue),l=Yt(),o={state:t,dispatch:null,action:e,pending:null},l.queue=o,a=Ex.bind(null,Oe,o,u,a),o.dispatch=a,l.memoizedState=e,[t,a,!1]}function Mf(e){var t=gt();return Af(t,We,e)}function Af(e,t,a){if(t=pc(e,t,Tf)[0],e=rs(Ia)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ai(t)}catch(g){throw g===Bl?Jr:g}else l=t;t=gt();var o=t.queue,u=o.dispatch;return a!==t.memoizedState&&(Oe.flags|=2048,Kl(9,{destroy:void 0},wx.bind(null,o,a),null)),[l,u,e]}function wx(e,t){e.action=t}function Lf(e){var t=gt(),a=We;if(a!==null)return Af(t,a,e);gt(),t=t.memoizedState,a=gt();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function Kl(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=Oe.updateQueue,t===null&&(t=ls(),Oe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function kf(){return gt().memoizedState}function ss(e,t,a,l){var o=Yt();Oe.flags|=e,o.memoizedState=Kl(1|t,{destroy:void 0},a,l===void 0?null:l)}function os(e,t,a,l){var o=gt();l=l===void 0?null:l;var u=o.memoizedState.inst;We!==null&&l!==null&&cc(l,We.memoizedState.deps)?o.memoizedState=Kl(t,u,a,l):(Oe.flags|=e,o.memoizedState=Kl(1|t,u,a,l))}function Uf(e,t){ss(8390656,8,e,t)}function vc(e,t){os(2048,8,e,t)}function Cx(e){Oe.flags|=4;var t=Oe.updateQueue;if(t===null)t=ls(),Oe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Hf(e){var t=gt().memoizedState;return Cx({ref:t,nextImpl:e}),function(){if((Ze&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function Bf(e,t){return os(4,2,e,t)}function qf(e,t){return os(4,4,e,t)}function Yf(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Vf(e,t,a){a=a!=null?a.concat([e]):null,os(4,4,Yf.bind(null,t,e),a)}function bc(){}function Gf(e,t){var a=gt();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&cc(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function Kf(e,t){var a=gt();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&cc(t,l[1]))return l[0];if(l=e(),ul){Et(!0);try{e()}finally{Et(!1)}}return a.memoizedState=[l,t],l}function Sc(e,t,a){return a===void 0||(Pa&1073741824)!==0&&(Be&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=$h(),Oe.lanes|=e,Tn|=e,a)}function $f(e,t,a,l){return Jt(a,t)?a:Yl.current!==null?(e=Sc(e,a,l),Jt(e,t)||(St=!0),e):(Pa&42)===0||(Pa&1073741824)!==0&&(Be&261930)===0?(St=!0,e.memoizedState=a):(e=$h(),Oe.lanes|=e,Tn|=e,t)}function Xf(e,t,a,l,o){var u=P.p;P.p=u!==0&&8>u?u:8;var g=M.T,b={};M.T=b,Nc(e,!1,t,a);try{var w=o(),L=M.S;if(L!==null&&L(b,w),w!==null&&typeof w=="object"&&typeof w.then=="function"){var K=_x(w,l);Li(e,t,K,aa(e))}else Li(e,t,l,aa(e))}catch(J){Li(e,t,{then:function(){},status:"rejected",reason:J},aa())}finally{P.p=u,g!==null&&b.types!==null&&(g.types=b.types),M.T=g}}function Rx(){}function _c(e,t,a,l){if(e.tag!==5)throw Error(s(476));var o=Qf(e).queue;Xf(e,o,t,ue,a===null?Rx:function(){return Zf(e),a(l)})}function Qf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:ue},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Zf(e){var t=Qf(e);t.next===null&&(t=e.alternate.memoizedState),Li(e,t.next.queue,{},aa())}function jc(){return Ot(Pi)}function Ff(){return gt().memoizedState}function Jf(){return gt().memoizedState}function zx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=aa();e=En(a);var l=wn(t,e,a);l!==null&&(Zt(l,t,a),Oi(l,t,a)),t={cache:Po()},e.payload=t;return}t=t.return}}function Ox(e,t,a){var l=aa();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},cs(e)?Pf(t,a):(a=Yo(e,t,a,l),a!==null&&(Zt(a,e,l),If(a,t,l)))}function Wf(e,t,a){var l=aa();Li(e,t,a,l)}function Li(e,t,a,l){var o={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(cs(e))Pf(t,o);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var g=t.lastRenderedState,b=u(g,a);if(o.hasEagerState=!0,o.eagerState=b,Jt(b,g))return Gr(e,t,o,0),at===null&&Vr(),!1}catch{}if(a=Yo(e,t,o,l),a!==null)return Zt(a,e,l),If(a,t,l),!0}return!1}function Nc(e,t,a,l){if(l={lane:2,revertLane:au(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},cs(e)){if(t)throw Error(s(479))}else t=Yo(e,a,l,2),t!==null&&Zt(t,e,2)}function cs(e){var t=e.alternate;return e===Oe||t!==null&&t===Oe}function Pf(e,t){Vl=as=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function If(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Tr(e,a)}}var ki={readContext:Ot,use:is,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};ki.useEffectEvent=ut;var eh={readContext:Ot,use:is,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:Ot,useEffect:Uf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ss(4194308,4,Yf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){ss(4,2,e,t)},useMemo:function(e,t){var a=Yt();t=t===void 0?null:t;var l=e();if(ul){Et(!0);try{e()}finally{Et(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=Yt();if(a!==void 0){var o=a(t);if(ul){Et(!0);try{a(t)}finally{Et(!1)}}}else o=t;return l.memoizedState=l.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},l.queue=e,e=e.dispatch=Ox.bind(null,Oe,e),[l.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,a=Wf.bind(null,Oe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:bc,useDeferredValue:function(e,t){var a=Yt();return Sc(a,e,t)},useTransition:function(){var e=yc(!1);return e=Xf.bind(null,Oe,e.queue,!0,!1),Yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=Oe,o=Yt();if(Ye){if(a===void 0)throw Error(s(407));a=a()}else{if(a=t(),at===null)throw Error(s(349));(Be&127)!==0||Sf(l,t,a)}o.memoizedState=a;var u={value:a,getSnapshot:t};return o.queue=u,Uf(jf.bind(null,l,u,e),[e]),l.flags|=2048,Kl(9,{destroy:void 0},_f.bind(null,l,u,a,t),null),a},useId:function(){var e=Yt(),t=at.identifierPrefix;if(Ye){var a=ka,l=La;a=(l&~(1<<32-Lt(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=ns++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=jx++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:jc,useFormState:Df,useActionState:Df,useOptimistic:function(e){var t=Yt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Nc.bind(null,Oe,!0,a),a.dispatch=t,[e,t]},useMemoCache:mc,useCacheRefresh:function(){return Yt().memoizedState=zx.bind(null,Oe)},useEffectEvent:function(e){var t=Yt(),a={impl:e};return t.memoizedState=a,function(){if((Ze&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Ec={readContext:Ot,use:is,useCallback:Gf,useContext:Ot,useEffect:vc,useImperativeHandle:Vf,useInsertionEffect:Bf,useLayoutEffect:qf,useMemo:Kf,useReducer:rs,useRef:kf,useState:function(){return rs(Ia)},useDebugValue:bc,useDeferredValue:function(e,t){var a=gt();return $f(a,We.memoizedState,e,t)},useTransition:function(){var e=rs(Ia)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Ai(e),t]},useSyncExternalStore:bf,useId:Ff,useHostTransitionStatus:jc,useFormState:Mf,useActionState:Mf,useOptimistic:function(e,t){var a=gt();return wf(a,We,e,t)},useMemoCache:mc,useCacheRefresh:Jf};Ec.useEffectEvent=Hf;var th={readContext:Ot,use:is,useCallback:Gf,useContext:Ot,useEffect:vc,useImperativeHandle:Vf,useInsertionEffect:Bf,useLayoutEffect:qf,useMemo:Kf,useReducer:gc,useRef:kf,useState:function(){return gc(Ia)},useDebugValue:bc,useDeferredValue:function(e,t){var a=gt();return We===null?Sc(a,e,t):$f(a,We.memoizedState,e,t)},useTransition:function(){var e=gc(Ia)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Ai(e),t]},useSyncExternalStore:bf,useId:Ff,useHostTransitionStatus:jc,useFormState:Lf,useActionState:Lf,useOptimistic:function(e,t){var a=gt();return We!==null?wf(a,We,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:mc,useCacheRefresh:Jf};th.useEffectEvent=Hf;function wc(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:x({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Cc={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=aa(),o=En(l);o.payload=t,a!=null&&(o.callback=a),t=wn(e,o,l),t!==null&&(Zt(t,e,l),Oi(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=aa(),o=En(l);o.tag=1,o.payload=t,a!=null&&(o.callback=a),t=wn(e,o,l),t!==null&&(Zt(t,e,l),Oi(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=aa(),l=En(a);l.tag=2,t!=null&&(l.callback=t),t=wn(e,l,a),t!==null&&(Zt(t,e,a),Oi(t,e,a))}};function ah(e,t,a,l,o,u,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,u,g):t.prototype&&t.prototype.isPureReactComponent?!_i(a,l)||!_i(o,u):!0}function nh(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Cc.enqueueReplaceState(t,t.state,null)}function dl(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=x({},a));for(var o in e)a[o]===void 0&&(a[o]=e[o])}return a}function lh(e){Yr(e)}function ih(e){console.error(e)}function rh(e){Yr(e)}function us(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function sh(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Rc(e,t,a){return a=En(a),a.tag=3,a.payload={element:null},a.callback=function(){us(e,t)},a}function oh(e){return e=En(e),e.tag=3,e}function ch(e,t,a,l){var o=a.type.getDerivedStateFromError;if(typeof o=="function"){var u=l.value;e.payload=function(){return o(u)},e.callback=function(){sh(t,a,l)}}var g=a.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){sh(t,a,l),typeof o!="function"&&(Dn===null?Dn=new Set([this]):Dn.add(this));var b=l.stack;this.componentDidCatch(l.value,{componentStack:b!==null?b:""})})}function Tx(e,t,a,l,o){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&kl(t,a,o,!0),a=Pt.current,a!==null){switch(a.tag){case 31:case 13:return ma===null?_s():a.alternate===null&&dt===0&&(dt=3),a.flags&=-257,a.flags|=65536,a.lanes=o,l===Wr?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),Ic(e,l,o)),!1;case 22:return a.flags|=65536,l===Wr?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),Ic(e,l,o)),!1}throw Error(s(435,a.tag))}return Ic(e,l,o),_s(),!1}if(Ye)return t=Pt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,l!==Qo&&(e=Error(s(422),{cause:l}),Ei(ua(e,a)))):(l!==Qo&&(t=Error(s(423),{cause:l}),Ei(ua(t,a))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,l=ua(l,a),o=Rc(e.stateNode,l,o),lc(e,o),dt!==4&&(dt=2)),!1;var u=Error(s(520),{cause:l});if(u=ua(u,a),Ki===null?Ki=[u]:Ki.push(u),dt!==4&&(dt=2),t===null)return!0;l=ua(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=o&-o,a.lanes|=e,e=Rc(a.stateNode,l,e),lc(a,e),!1;case 1:if(t=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Dn===null||!Dn.has(u))))return a.flags|=65536,o&=-o,a.lanes|=o,o=oh(o),ch(o,e,a,l),lc(a,o),!1}a=a.return}while(a!==null);return!1}var zc=Error(s(461)),St=!1;function Tt(e,t,a,l){t.child=e===null?hf(t,null,a,l):cl(t,e.child,a,l)}function uh(e,t,a,l,o){a=a.render;var u=t.ref;if("ref"in l){var g={};for(var b in l)b!=="ref"&&(g[b]=l[b])}else g=l;return il(t),l=uc(e,t,a,g,u,o),b=dc(),e!==null&&!St?(fc(e,t,o),en(e,t,o)):(Ye&&b&&$o(t),t.flags|=1,Tt(e,t,l,o),t.child)}function dh(e,t,a,l,o){if(e===null){var u=a.type;return typeof u=="function"&&!Vo(u)&&u.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=u,fh(e,t,u,l,o)):(e=$r(a.type,null,l,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Uc(e,o)){var g=u.memoizedProps;if(a=a.compare,a=a!==null?a:_i,a(g,l)&&e.ref===t.ref)return en(e,t,o)}return t.flags|=1,e=Za(u,l),e.ref=t.ref,e.return=t,t.child=e}function fh(e,t,a,l,o){if(e!==null){var u=e.memoizedProps;if(_i(u,l)&&e.ref===t.ref)if(St=!1,t.pendingProps=l=u,Uc(e,o))(e.flags&131072)!==0&&(St=!0);else return t.lanes=e.lanes,en(e,t,o)}return Oc(e,t,a,l,o)}function hh(e,t,a,l){var o=l.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|a:a,e!==null){for(l=t.child=e.child,o=0;l!==null;)o=o|l.lanes|l.childLanes,l=l.sibling;l=o&~u}else l=0,t.child=null;return mh(e,t,u,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fr(t,u!==null?u.cachePool:null),u!==null?gf(t,u):rc(),yf(t);else return l=t.lanes=536870912,mh(e,t,u!==null?u.baseLanes|a:a,a,l)}else u!==null?(Fr(t,u.cachePool),gf(t,u),Rn(),t.memoizedState=null):(e!==null&&Fr(t,null),rc(),Rn());return Tt(e,t,o,a),t.child}function Ui(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function mh(e,t,a,l,o){var u=ec();return u=u===null?null:{parent:vt._currentValue,pool:u},t.memoizedState={baseLanes:a,cachePool:u},e!==null&&Fr(t,null),rc(),yf(t),e!==null&&kl(e,t,l,!0),t.childLanes=o,null}function ds(e,t){return t=hs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ph(e,t,a){return cl(t,e.child,null,a),e=ds(t,t.pendingProps),e.flags|=2,It(t),t.memoizedState=null,e}function Dx(e,t,a){var l=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ye){if(l.mode==="hidden")return e=ds(t,l),t.lanes=536870912,Ui(null,e);if(oc(t),(e=rt)?(e=Cm(e,ha),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bn!==null?{id:La,overflow:ka}:null,retryLane:536870912,hydrationErrors:null},a=Wd(e),a.return=t,t.child=a,zt=t,rt=null)):e=null,e===null)throw _n(t);return t.lanes=536870912,null}return ds(t,l)}var u=e.memoizedState;if(u!==null){var g=u.dehydrated;if(oc(t),o)if(t.flags&256)t.flags&=-257,t=ph(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(St||kl(e,t,a,!1),o=(a&e.childLanes)!==0,St||o){if(l=at,l!==null&&(g=C(l,a),g!==0&&g!==u.retryLane))throw u.retryLane=g,tl(e,g),Zt(l,e,g),zc;_s(),t=ph(e,t,a)}else e=u.treeContext,rt=pa(g.nextSibling),zt=t,Ye=!0,Sn=null,ha=!1,e!==null&&ef(t,e),t=ds(t,l),t.flags|=4096;return t}return e=Za(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fs(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Oc(e,t,a,l,o){return il(t),a=uc(e,t,a,l,void 0,o),l=dc(),e!==null&&!St?(fc(e,t,o),en(e,t,o)):(Ye&&l&&$o(t),t.flags|=1,Tt(e,t,a,o),t.child)}function gh(e,t,a,l,o,u){return il(t),t.updateQueue=null,a=vf(t,l,a,o),xf(e),l=dc(),e!==null&&!St?(fc(e,t,u),en(e,t,u)):(Ye&&l&&$o(t),t.flags|=1,Tt(e,t,a,u),t.child)}function yh(e,t,a,l,o){if(il(t),t.stateNode===null){var u=Dl,g=a.contextType;typeof g=="object"&&g!==null&&(u=Ot(g)),u=new a(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Cc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},ac(t),g=a.contextType,u.context=typeof g=="object"&&g!==null?Ot(g):Dl,u.state=t.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(wc(t,a,g,l),u.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(g=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),g!==u.state&&Cc.enqueueReplaceState(u,u.state,null),Di(t,l,u,o),Ti(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var b=t.memoizedProps,w=dl(a,b);u.props=w;var L=u.context,K=a.contextType;g=Dl,typeof K=="object"&&K!==null&&(g=Ot(K));var J=a.getDerivedStateFromProps;K=typeof J=="function"||typeof u.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,K||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(b||L!==g)&&nh(t,u,l,g),Nn=!1;var U=t.memoizedState;u.state=U,Di(t,l,u,o),Ti(),L=t.memoizedState,b||U!==L||Nn?(typeof J=="function"&&(wc(t,a,J,l),L=t.memoizedState),(w=Nn||ah(t,a,w,l,U,L,g))?(K||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=L),u.props=l,u.state=L,u.context=g,l=w):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,nc(e,t),g=t.memoizedProps,K=dl(a,g),u.props=K,J=t.pendingProps,U=u.context,L=a.contextType,w=Dl,typeof L=="object"&&L!==null&&(w=Ot(L)),b=a.getDerivedStateFromProps,(L=typeof b=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==J||U!==w)&&nh(t,u,l,w),Nn=!1,U=t.memoizedState,u.state=U,Di(t,l,u,o),Ti();var Y=t.memoizedState;g!==J||U!==Y||Nn||e!==null&&e.dependencies!==null&&Qr(e.dependencies)?(typeof b=="function"&&(wc(t,a,b,l),Y=t.memoizedState),(K=Nn||ah(t,a,K,l,U,Y,w)||e!==null&&e.dependencies!==null&&Qr(e.dependencies))?(L||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(l,Y,w),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(l,Y,w)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Y),u.props=l,u.state=Y,u.context=w,l=K):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,fs(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=cl(t,e.child,null,o),t.child=cl(t,null,a,o)):Tt(e,t,a,o),t.memoizedState=u.state,e=t.child):e=en(e,t,o),e}function xh(e,t,a,l){return nl(),t.flags|=256,Tt(e,t,a,l),t.child}var Tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dc(e){return{baseLanes:e,cachePool:sf()}}function Mc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ta),e}function vh(e,t,a){var l=t.pendingProps,o=!1,u=(t.flags&128)!==0,g;if((g=u)||(g=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),g&&(o=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(o?Cn(t):Rn(),(e=rt)?(e=Cm(e,ha),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bn!==null?{id:La,overflow:ka}:null,retryLane:536870912,hydrationErrors:null},a=Wd(e),a.return=t,t.child=a,zt=t,rt=null)):e=null,e===null)throw _n(t);return pu(e)?t.lanes=32:t.lanes=536870912,null}var b=l.children;return l=l.fallback,o?(Rn(),o=t.mode,b=hs({mode:"hidden",children:b},o),l=al(l,o,a,null),b.return=t,l.return=t,b.sibling=l,t.child=b,l=t.child,l.memoizedState=Dc(a),l.childLanes=Mc(e,g,a),t.memoizedState=Tc,Ui(null,l)):(Cn(t),Ac(t,b))}var w=e.memoizedState;if(w!==null&&(b=w.dehydrated,b!==null)){if(u)t.flags&256?(Cn(t),t.flags&=-257,t=Lc(e,t,a)):t.memoizedState!==null?(Rn(),t.child=e.child,t.flags|=128,t=null):(Rn(),b=l.fallback,o=t.mode,l=hs({mode:"visible",children:l.children},o),b=al(b,o,a,null),b.flags|=2,l.return=t,b.return=t,l.sibling=b,t.child=l,cl(t,e.child,null,a),l=t.child,l.memoizedState=Dc(a),l.childLanes=Mc(e,g,a),t.memoizedState=Tc,t=Ui(null,l));else if(Cn(t),pu(b)){if(g=b.nextSibling&&b.nextSibling.dataset,g)var L=g.dgst;g=L,l=Error(s(419)),l.stack="",l.digest=g,Ei({value:l,source:null,stack:null}),t=Lc(e,t,a)}else if(St||kl(e,t,a,!1),g=(a&e.childLanes)!==0,St||g){if(g=at,g!==null&&(l=C(g,a),l!==0&&l!==w.retryLane))throw w.retryLane=l,tl(e,l),Zt(g,e,l),zc;mu(b)||_s(),t=Lc(e,t,a)}else mu(b)?(t.flags|=192,t.child=e.child,t=null):(e=w.treeContext,rt=pa(b.nextSibling),zt=t,Ye=!0,Sn=null,ha=!1,e!==null&&ef(t,e),t=Ac(t,l.children),t.flags|=4096);return t}return o?(Rn(),b=l.fallback,o=t.mode,w=e.child,L=w.sibling,l=Za(w,{mode:"hidden",children:l.children}),l.subtreeFlags=w.subtreeFlags&65011712,L!==null?b=Za(L,b):(b=al(b,o,a,null),b.flags|=2),b.return=t,l.return=t,l.sibling=b,t.child=l,Ui(null,l),l=t.child,b=e.child.memoizedState,b===null?b=Dc(a):(o=b.cachePool,o!==null?(w=vt._currentValue,o=o.parent!==w?{parent:w,pool:w}:o):o=sf(),b={baseLanes:b.baseLanes|a,cachePool:o}),l.memoizedState=b,l.childLanes=Mc(e,g,a),t.memoizedState=Tc,Ui(e.child,l)):(Cn(t),a=e.child,e=a.sibling,a=Za(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=a,t.memoizedState=null,a)}function Ac(e,t){return t=hs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function hs(e,t){return e=Wt(22,e,null,t),e.lanes=0,e}function Lc(e,t,a){return cl(t,e.child,null,a),e=Ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bh(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Jo(e.return,t,a)}function kc(e,t,a,l,o,u){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:o,treeForkCount:u}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=a,g.tailMode=o,g.treeForkCount=u)}function Sh(e,t,a){var l=t.pendingProps,o=l.revealOrder,u=l.tail;l=l.children;var g=pt.current,b=(g&2)!==0;if(b?(g=g&1|2,t.flags|=128):g&=1,G(pt,g),Tt(e,t,l,a),l=Ye?Ni:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bh(e,a,t);else if(e.tag===19)bh(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&ts(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),kc(t,!1,o,a,u,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&ts(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}kc(t,!0,a,null,u,l);break;case"together":kc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function en(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Tn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(kl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,a=Za(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Za(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Uc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Qr(e)))}function Mx(e,t,a){switch(t.tag){case 3:et(t,t.stateNode.containerInfo),jn(t,vt,e.memoizedState.cache),nl();break;case 27:case 5:Va(t);break;case 4:et(t,t.stateNode.containerInfo);break;case 10:jn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Cn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?vh(e,t,a):(Cn(t),e=en(e,t,a),e!==null?e.sibling:null);Cn(t);break;case 19:var o=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(kl(e,t,a,!1),l=(a&t.childLanes)!==0),o){if(l)return Sh(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),G(pt,pt.current),l)break;return null;case 22:return t.lanes=0,hh(e,t,a,t.pendingProps);case 24:jn(t,vt,e.memoizedState.cache)}return en(e,t,a)}function _h(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)St=!0;else{if(!Uc(e,a)&&(t.flags&128)===0)return St=!1,Mx(e,t,a);St=(e.flags&131072)!==0}else St=!1,Ye&&(t.flags&1048576)!==0&&Id(t,Ni,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=sl(t.elementType),t.type=e,typeof e=="function")Vo(e)?(l=dl(e,l),t.tag=1,t=yh(null,t,e,l,a)):(t.tag=0,t=Oc(null,t,e,l,a));else{if(e!=null){var o=e.$$typeof;if(o===se){t.tag=11,t=uh(null,t,e,l,a);break e}else if(o===B){t.tag=14,t=dh(null,t,e,l,a);break e}}throw t=F(e)||e,Error(s(306,t,""))}}return t;case 0:return Oc(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,o=dl(l,t.pendingProps),yh(e,t,l,o,a);case 3:e:{if(et(t,t.stateNode.containerInfo),e===null)throw Error(s(387));l=t.pendingProps;var u=t.memoizedState;o=u.element,nc(e,t),Di(t,l,null,a);var g=t.memoizedState;if(l=g.cache,jn(t,vt,l),l!==u.cache&&Wo(t,[vt],a,!0),Ti(),l=g.element,u.isDehydrated)if(u={element:l,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=xh(e,t,l,a);break e}else if(l!==o){o=ua(Error(s(424)),t),Ei(o),t=xh(e,t,l,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,rt=pa(e.firstChild),zt=t,Ye=!0,Sn=null,ha=!0,a=hf(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(nl(),l===o){t=en(e,t,a);break e}Tt(e,t,l,a)}t=t.child}return t;case 26:return fs(e,t),e===null?(a=Mm(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ye||(a=t.type,e=t.pendingProps,l=zs(je.current).createElement(a),l[oe]=t,l[fe]=e,Dt(l,a,e),nt(l),t.stateNode=l):t.memoizedState=Mm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Va(t),e===null&&Ye&&(l=t.stateNode=Om(t.type,t.pendingProps,je.current),zt=t,ha=!0,o=rt,kn(t.type)?(gu=o,rt=pa(l.firstChild)):rt=o),Tt(e,t,t.pendingProps.children,a),fs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((o=l=rt)&&(l=cv(l,t.type,t.pendingProps,ha),l!==null?(t.stateNode=l,zt=t,rt=pa(l.firstChild),ha=!1,o=!0):o=!1),o||_n(t)),Va(t),o=t.type,u=t.pendingProps,g=e!==null?e.memoizedProps:null,l=u.children,du(o,u)?l=null:g!==null&&du(o,g)&&(t.flags|=32),t.memoizedState!==null&&(o=uc(e,t,Nx,null,null,a),Pi._currentValue=o),fs(e,t),Tt(e,t,l,a),t.child;case 6:return e===null&&Ye&&((e=a=rt)&&(a=uv(a,t.pendingProps,ha),a!==null?(t.stateNode=a,zt=t,rt=null,e=!0):e=!1),e||_n(t)),null;case 13:return vh(e,t,a);case 4:return et(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=cl(t,null,l,a):Tt(e,t,l,a),t.child;case 11:return uh(e,t,t.type,t.pendingProps,a);case 7:return Tt(e,t,t.pendingProps,a),t.child;case 8:return Tt(e,t,t.pendingProps.children,a),t.child;case 12:return Tt(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,jn(t,t.type,l.value),Tt(e,t,l.children,a),t.child;case 9:return o=t.type._context,l=t.pendingProps.children,il(t),o=Ot(o),l=l(o),t.flags|=1,Tt(e,t,l,a),t.child;case 14:return dh(e,t,t.type,t.pendingProps,a);case 15:return fh(e,t,t.type,t.pendingProps,a);case 19:return Sh(e,t,a);case 31:return Dx(e,t,a);case 22:return hh(e,t,a,t.pendingProps);case 24:return il(t),l=Ot(vt),e===null?(o=ec(),o===null&&(o=at,u=Po(),o.pooledCache=u,u.refCount++,u!==null&&(o.pooledCacheLanes|=a),o=u),t.memoizedState={parent:l,cache:o},ac(t),jn(t,vt,o)):((e.lanes&a)!==0&&(nc(e,t),Di(t,null,null,a),Ti()),o=e.memoizedState,u=t.memoizedState,o.parent!==l?(o={parent:l,cache:l},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),jn(t,vt,l)):(l=u.cache,jn(t,vt,l),l!==o.cache&&Wo(t,[vt],a,!0))),Tt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function tn(e){e.flags|=4}function Hc(e,t,a,l,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(Fh())e.flags|=8192;else throw ol=Wr,tc}else e.flags&=-16777217}function jh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Hm(t))if(Fh())e.flags|=8192;else throw ol=Wr,tc}function ms(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?mi():536870912,e.lanes|=t,Zl|=t)}function Hi(e,t){if(!Ye)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function st(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,l|=o.subtreeFlags&65011712,l|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,l|=o.subtreeFlags,l|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function Ax(e,t,a){var l=t.pendingProps;switch(Xo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return st(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Wa(vt),Ke(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ll(t)?tn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zo())),st(t),null;case 26:var o=t.type,u=t.memoizedState;return e===null?(tn(t),u!==null?(st(t),jh(t,u)):(st(t),Hc(t,o,null,l,a))):u?u!==e.memoizedState?(tn(t),st(t),jh(t,u)):(st(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&tn(t),st(t),Hc(t,o,e,l,a)),null;case 27:if(Ga(t),a=je.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&tn(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return st(t),null}e=le.current,Ll(t)?tf(t):(e=Om(o,l,a),t.stateNode=e,tn(t))}return st(t),null;case 5:if(Ga(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&tn(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return st(t),null}if(u=le.current,Ll(t))tf(t);else{var g=zs(je.current);switch(u){case 1:u=g.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:u=g.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":u=g.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":u=g.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":u=g.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof l.is=="string"?g.createElement("select",{is:l.is}):g.createElement("select"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is=="string"?g.createElement(o,{is:l.is}):g.createElement(o)}}u[oe]=t,u[fe]=l;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)u.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=u;e:switch(Dt(u,o,l),o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&tn(t)}}return st(t),Hc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&tn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(e=je.current,Ll(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,o=zt,o!==null)switch(o.tag){case 27:case 5:l=o.memoizedProps}e[oe]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||vm(e.nodeValue,a)),e||_n(t,!0)}else e=zs(e).createTextNode(l),e[oe]=t,t.stateNode=e}return st(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=Ll(t),a!==null){if(e===null){if(!l)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[oe]=t}else nl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),e=!1}else a=Zo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(It(t),t):(It(t),null);if((t.flags&128)!==0)throw Error(s(558))}return st(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Ll(t),l!==null&&l.dehydrated!==null){if(e===null){if(!o)throw Error(s(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(s(317));o[oe]=t}else nl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),o=!1}else o=Zo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(It(t),t):(It(t),null)}return It(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,o=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(o=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==o&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),ms(t,t.updateQueue),st(t),null);case 4:return Ke(),e===null&&ru(t.stateNode.containerInfo),st(t),null;case 10:return Wa(t.type),st(t),null;case 19:if(q(pt),l=t.memoizedState,l===null)return st(t),null;if(o=(t.flags&128)!==0,u=l.rendering,u===null)if(o)Hi(l,!1);else{if(dt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=ts(e),u!==null){for(t.flags|=128,Hi(l,!1),e=u.updateQueue,t.updateQueue=e,ms(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Jd(a,e),a=a.sibling;return G(pt,pt.current&1|2),Ye&&Fa(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Rt()>vs&&(t.flags|=128,o=!0,Hi(l,!1),t.lanes=4194304)}else{if(!o)if(e=ts(u),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,ms(t,e),Hi(l,!0),l.tail===null&&l.tailMode==="hidden"&&!u.alternate&&!Ye)return st(t),null}else 2*Rt()-l.renderingStartTime>vs&&a!==536870912&&(t.flags|=128,o=!0,Hi(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Rt(),e.sibling=null,a=pt.current,G(pt,o?a&1|2:a&1),Ye&&Fa(t,l.treeForkCount),e):(st(t),null);case 22:case 23:return It(t),sc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),a=t.updateQueue,a!==null&&ms(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&q(rl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Wa(vt),st(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function Lx(e,t){switch(Xo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wa(vt),Ke(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ga(t),null;case 31:if(t.memoizedState!==null){if(It(t),t.alternate===null)throw Error(s(340));nl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(It(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));nl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(pt),null;case 4:return Ke(),null;case 10:return Wa(t.type),null;case 22:case 23:return It(t),sc(),e!==null&&q(rl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wa(vt),null;case 25:return null;default:return null}}function Nh(e,t){switch(Xo(t),t.tag){case 3:Wa(vt),Ke();break;case 26:case 27:case 5:Ga(t);break;case 4:Ke();break;case 31:t.memoizedState!==null&&It(t);break;case 13:It(t);break;case 19:q(pt);break;case 10:Wa(t.type);break;case 22:case 23:It(t),sc(),e!==null&&q(rl);break;case 24:Wa(vt)}}function Bi(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var o=l.next;a=o;do{if((a.tag&e)===e){l=void 0;var u=a.create,g=a.inst;l=u(),g.destroy=l}a=a.next}while(a!==o)}}catch(b){Je(t,t.return,b)}}function zn(e,t,a){try{var l=t.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var u=o.next;l=u;do{if((l.tag&e)===e){var g=l.inst,b=g.destroy;if(b!==void 0){g.destroy=void 0,o=t;var w=a,L=b;try{L()}catch(K){Je(o,w,K)}}}l=l.next}while(l!==u)}}catch(K){Je(t,t.return,K)}}function Eh(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{pf(t,a)}catch(l){Je(e,e.return,l)}}}function wh(e,t,a){a.props=dl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Je(e,t,l)}}function qi(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(o){Je(e,t,o)}}function Ua(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(o){Je(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(o){Je(e,t,o)}else a.current=null}function Ch(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(o){Je(e,e.return,o)}}function Bc(e,t,a){try{var l=e.stateNode;nv(l,e.type,a,t),l[fe]=t}catch(o){Je(e,e.return,o)}}function Rh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kn(e.type)||e.tag===4}function qc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&kn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yc(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Xa));else if(l!==4&&(l===27&&kn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,a),e=e.sibling;e!==null;)Yc(e,t,a),e=e.sibling}function ps(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&kn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ps(e,t,a),e=e.sibling;e!==null;)ps(e,t,a),e=e.sibling}function zh(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Dt(t,l,a),t[oe]=e,t[fe]=a}catch(u){Je(e,e.return,u)}}var an=!1,_t=!1,Vc=!1,Oh=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function kx(e,t){if(e=e.containerInfo,cu=ks,e=Yd(e),Lo(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var o=l.anchorOffset,u=l.focusNode;l=l.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var g=0,b=-1,w=-1,L=0,K=0,J=e,U=null;t:for(;;){for(var Y;J!==a||o!==0&&J.nodeType!==3||(b=g+o),J!==u||l!==0&&J.nodeType!==3||(w=g+l),J.nodeType===3&&(g+=J.nodeValue.length),(Y=J.firstChild)!==null;)U=J,J=Y;for(;;){if(J===e)break t;if(U===a&&++L===o&&(b=g),U===u&&++K===l&&(w=g),(Y=J.nextSibling)!==null)break;J=U,U=J.parentNode}J=Y}a=b===-1||w===-1?null:{start:b,end:w}}else a=null}a=a||{start:0,end:0}}else a=null;for(uu={focusedElem:e,selectionRange:a},ks=!1,Ct=t;Ct!==null;)if(t=Ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ct=e;else for(;Ct!==null;){switch(t=Ct,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)o=e[a],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,a=t,o=u.memoizedProps,u=u.memoizedState,l=a.stateNode;try{var pe=dl(a.type,o);e=l.getSnapshotBeforeUpdate(pe,u),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){Je(a,a.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)hu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":hu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,Ct=e;break}Ct=t.return}}function Th(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:ln(e,a),l&4&&Bi(5,a);break;case 1:if(ln(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(g){Je(a,a.return,g)}else{var o=dl(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){Je(a,a.return,g)}}l&64&&Eh(a),l&512&&qi(a,a.return);break;case 3:if(ln(e,a),l&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{pf(e,t)}catch(g){Je(a,a.return,g)}}break;case 27:t===null&&l&4&&zh(a);case 26:case 5:ln(e,a),t===null&&l&4&&Ch(a),l&512&&qi(a,a.return);break;case 12:ln(e,a);break;case 31:ln(e,a),l&4&&Ah(e,a);break;case 13:ln(e,a),l&4&&Lh(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=$x.bind(null,a),dv(e,a))));break;case 22:if(l=a.memoizedState!==null||an,!l){t=t!==null&&t.memoizedState!==null||_t,o=an;var u=_t;an=l,(_t=t)&&!u?rn(e,a,(a.subtreeFlags&8772)!==0):ln(e,a),an=o,_t=u}break;case 30:break;default:ln(e,a)}}function Dh(e){var t=e.alternate;t!==null&&(e.alternate=null,Dh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&tt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ot=null,Kt=!1;function nn(e,t,a){for(a=a.child;a!==null;)Mh(e,t,a),a=a.sibling}function Mh(e,t,a){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(Ka,a)}catch{}switch(a.tag){case 26:_t||Ua(a,t),nn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:_t||Ua(a,t);var l=ot,o=Kt;kn(a.type)&&(ot=a.stateNode,Kt=!1),nn(e,t,a),Fi(a.stateNode),ot=l,Kt=o;break;case 5:_t||Ua(a,t);case 6:if(l=ot,o=Kt,ot=null,nn(e,t,a),ot=l,Kt=o,ot!==null)if(Kt)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(a.stateNode)}catch(u){Je(a,t,u)}else try{ot.removeChild(a.stateNode)}catch(u){Je(a,t,u)}break;case 18:ot!==null&&(Kt?(e=ot,Em(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),ai(e)):Em(ot,a.stateNode));break;case 4:l=ot,o=Kt,ot=a.stateNode.containerInfo,Kt=!0,nn(e,t,a),ot=l,Kt=o;break;case 0:case 11:case 14:case 15:zn(2,a,t),_t||zn(4,a,t),nn(e,t,a);break;case 1:_t||(Ua(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&wh(a,t,l)),nn(e,t,a);break;case 21:nn(e,t,a);break;case 22:_t=(l=_t)||a.memoizedState!==null,nn(e,t,a),_t=l;break;default:nn(e,t,a)}}function Ah(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ai(e)}catch(a){Je(t,t.return,a)}}}function Lh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ai(e)}catch(a){Je(t,t.return,a)}}function Ux(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Oh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Oh),t;default:throw Error(s(435,e.tag))}}function gs(e,t){var a=Ux(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var o=Xx.bind(null,e,l);l.then(o,o)}})}function $t(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var o=a[l],u=e,g=t,b=g;e:for(;b!==null;){switch(b.tag){case 27:if(kn(b.type)){ot=b.stateNode,Kt=!1;break e}break;case 5:ot=b.stateNode,Kt=!1;break e;case 3:case 4:ot=b.stateNode.containerInfo,Kt=!0;break e}b=b.return}if(ot===null)throw Error(s(160));Mh(u,g,o),ot=null,Kt=!1,u=o.alternate,u!==null&&(u.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kh(t,e),t=t.sibling}var Ra=null;function kh(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:$t(t,e),Xt(e),l&4&&(zn(3,e,e.return),Bi(3,e),zn(5,e,e.return));break;case 1:$t(t,e),Xt(e),l&512&&(_t||a===null||Ua(a,a.return)),l&64&&an&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var o=Ra;if($t(t,e),Xt(e),l&512&&(_t||a===null||Ua(a,a.return)),l&4){var u=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,o=o.ownerDocument||o;t:switch(l){case"title":u=o.getElementsByTagName("title")[0],(!u||u[Ae]||u[oe]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=o.createElement(l),o.head.insertBefore(u,o.querySelector("head > title"))),Dt(u,l,a),u[oe]=e,nt(u),l=u;break e;case"link":var g=km("link","href",o).get(l+(a.href||""));if(g){for(var b=0;b<g.length;b++)if(u=g[b],u.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&u.getAttribute("rel")===(a.rel==null?null:a.rel)&&u.getAttribute("title")===(a.title==null?null:a.title)&&u.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){g.splice(b,1);break t}}u=o.createElement(l),Dt(u,l,a),o.head.appendChild(u);break;case"meta":if(g=km("meta","content",o).get(l+(a.content||""))){for(b=0;b<g.length;b++)if(u=g[b],u.getAttribute("content")===(a.content==null?null:""+a.content)&&u.getAttribute("name")===(a.name==null?null:a.name)&&u.getAttribute("property")===(a.property==null?null:a.property)&&u.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&u.getAttribute("charset")===(a.charSet==null?null:a.charSet)){g.splice(b,1);break t}}u=o.createElement(l),Dt(u,l,a),o.head.appendChild(u);break;default:throw Error(s(468,l))}u[oe]=e,nt(u),l=u}e.stateNode=l}else Um(o,e.type,e.stateNode);else e.stateNode=Lm(o,l,e.memoizedProps);else u!==l?(u===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):u.count--,l===null?Um(o,e.type,e.stateNode):Lm(o,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Bc(e,e.memoizedProps,a.memoizedProps)}break;case 27:$t(t,e),Xt(e),l&512&&(_t||a===null||Ua(a,a.return)),a!==null&&l&4&&Bc(e,e.memoizedProps,a.memoizedProps);break;case 5:if($t(t,e),Xt(e),l&512&&(_t||a===null||Ua(a,a.return)),e.flags&32){o=e.stateNode;try{El(o,"")}catch(pe){Je(e,e.return,pe)}}l&4&&e.stateNode!=null&&(o=e.memoizedProps,Bc(e,o,a!==null?a.memoizedProps:o)),l&1024&&(Vc=!0);break;case 6:if($t(t,e),Xt(e),l&4){if(e.stateNode===null)throw Error(s(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(pe){Je(e,e.return,pe)}}break;case 3:if(Ds=null,o=Ra,Ra=Os(t.containerInfo),$t(t,e),Ra=o,Xt(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{ai(t.containerInfo)}catch(pe){Je(e,e.return,pe)}Vc&&(Vc=!1,Uh(e));break;case 4:l=Ra,Ra=Os(e.stateNode.containerInfo),$t(t,e),Xt(e),Ra=l;break;case 12:$t(t,e),Xt(e);break;case 31:$t(t,e),Xt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gs(e,l)));break;case 13:$t(t,e),Xt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(xs=Rt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gs(e,l)));break;case 22:o=e.memoizedState!==null;var w=a!==null&&a.memoizedState!==null,L=an,K=_t;if(an=L||o,_t=K||w,$t(t,e),_t=K,an=L,Xt(e),l&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(a===null||w||an||_t||fl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){w=a=t;try{if(u=w.stateNode,o)g=u.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{b=w.stateNode;var J=w.memoizedProps.style,U=J!=null&&J.hasOwnProperty("display")?J.display:null;b.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(pe){Je(w,w.return,pe)}}}else if(t.tag===6){if(a===null){w=t;try{w.stateNode.nodeValue=o?"":w.memoizedProps}catch(pe){Je(w,w.return,pe)}}}else if(t.tag===18){if(a===null){w=t;try{var Y=w.stateNode;o?wm(Y,!0):wm(w.stateNode,!1)}catch(pe){Je(w,w.return,pe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,gs(e,a))));break;case 19:$t(t,e),Xt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,gs(e,l)));break;case 30:break;case 21:break;default:$t(t,e),Xt(e)}}function Xt(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if(Rh(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var o=a.stateNode,u=qc(e);ps(e,u,o);break;case 5:var g=a.stateNode;a.flags&32&&(El(g,""),a.flags&=-33);var b=qc(e);ps(e,b,g);break;case 3:case 4:var w=a.stateNode.containerInfo,L=qc(e);Yc(e,L,w);break;default:throw Error(s(161))}}catch(K){Je(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Uh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Uh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ln(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Th(e,t.alternate,t),t=t.sibling}function fl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zn(4,t,t.return),fl(t);break;case 1:Ua(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&wh(t,t.return,a),fl(t);break;case 27:Fi(t.stateNode);case 26:case 5:Ua(t,t.return),fl(t);break;case 22:t.memoizedState===null&&fl(t);break;case 30:fl(t);break;default:fl(t)}e=e.sibling}}function rn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,o=e,u=t,g=u.flags;switch(u.tag){case 0:case 11:case 15:rn(o,u,a),Bi(4,u);break;case 1:if(rn(o,u,a),l=u,o=l.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(L){Je(l,l.return,L)}if(l=u,o=l.updateQueue,o!==null){var b=l.stateNode;try{var w=o.shared.hiddenCallbacks;if(w!==null)for(o.shared.hiddenCallbacks=null,o=0;o<w.length;o++)mf(w[o],b)}catch(L){Je(l,l.return,L)}}a&&g&64&&Eh(u),qi(u,u.return);break;case 27:zh(u);case 26:case 5:rn(o,u,a),a&&l===null&&g&4&&Ch(u),qi(u,u.return);break;case 12:rn(o,u,a);break;case 31:rn(o,u,a),a&&g&4&&Ah(o,u);break;case 13:rn(o,u,a),a&&g&4&&Lh(o,u);break;case 22:u.memoizedState===null&&rn(o,u,a),qi(u,u.return);break;case 30:break;default:rn(o,u,a)}t=t.sibling}}function Gc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&wi(a))}function Kc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wi(e))}function za(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Hh(e,t,a,l),t=t.sibling}function Hh(e,t,a,l){var o=t.flags;switch(t.tag){case 0:case 11:case 15:za(e,t,a,l),o&2048&&Bi(9,t);break;case 1:za(e,t,a,l);break;case 3:za(e,t,a,l),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wi(e)));break;case 12:if(o&2048){za(e,t,a,l),e=t.stateNode;try{var u=t.memoizedProps,g=u.id,b=u.onPostCommit;typeof b=="function"&&b(g,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(w){Je(t,t.return,w)}}else za(e,t,a,l);break;case 31:za(e,t,a,l);break;case 13:za(e,t,a,l);break;case 23:break;case 22:u=t.stateNode,g=t.alternate,t.memoizedState!==null?u._visibility&2?za(e,t,a,l):Yi(e,t):u._visibility&2?za(e,t,a,l):(u._visibility|=2,$l(e,t,a,l,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Gc(g,t);break;case 24:za(e,t,a,l),o&2048&&Kc(t.alternate,t);break;default:za(e,t,a,l)}}function $l(e,t,a,l,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,g=t,b=a,w=l,L=g.flags;switch(g.tag){case 0:case 11:case 15:$l(u,g,b,w,o),Bi(8,g);break;case 23:break;case 22:var K=g.stateNode;g.memoizedState!==null?K._visibility&2?$l(u,g,b,w,o):Yi(u,g):(K._visibility|=2,$l(u,g,b,w,o)),o&&L&2048&&Gc(g.alternate,g);break;case 24:$l(u,g,b,w,o),o&&L&2048&&Kc(g.alternate,g);break;default:$l(u,g,b,w,o)}t=t.sibling}}function Yi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,o=l.flags;switch(l.tag){case 22:Yi(a,l),o&2048&&Gc(l.alternate,l);break;case 24:Yi(a,l),o&2048&&Kc(l.alternate,l);break;default:Yi(a,l)}t=t.sibling}}var Vi=8192;function Xl(e,t,a){if(e.subtreeFlags&Vi)for(e=e.child;e!==null;)Bh(e,t,a),e=e.sibling}function Bh(e,t,a){switch(e.tag){case 26:Xl(e,t,a),e.flags&Vi&&e.memoizedState!==null&&jv(a,Ra,e.memoizedState,e.memoizedProps);break;case 5:Xl(e,t,a);break;case 3:case 4:var l=Ra;Ra=Os(e.stateNode.containerInfo),Xl(e,t,a),Ra=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Vi,Vi=16777216,Xl(e,t,a),Vi=l):Xl(e,t,a));break;default:Xl(e,t,a)}}function qh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Gi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Ct=l,Vh(l,e)}qh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yh(e),e=e.sibling}function Yh(e){switch(e.tag){case 0:case 11:case 15:Gi(e),e.flags&2048&&zn(9,e,e.return);break;case 3:Gi(e);break;case 12:Gi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ys(e)):Gi(e);break;default:Gi(e)}}function ys(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Ct=l,Vh(l,e)}qh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zn(8,t,t.return),ys(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,ys(t));break;default:ys(t)}e=e.sibling}}function Vh(e,t){for(;Ct!==null;){var a=Ct;switch(a.tag){case 0:case 11:case 15:zn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:wi(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Ct=l;else e:for(a=e;Ct!==null;){l=Ct;var o=l.sibling,u=l.return;if(Dh(l),l===a){Ct=null;break e}if(o!==null){o.return=u,Ct=o;break e}Ct=u}}}var Hx={getCacheForType:function(e){var t=Ot(vt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Ot(vt).controller.signal}},Bx=typeof WeakMap=="function"?WeakMap:Map,Ze=0,at=null,ke=null,Be=0,Fe=0,ea=null,On=!1,Ql=!1,$c=!1,sn=0,dt=0,Tn=0,hl=0,Xc=0,ta=0,Zl=0,Ki=null,Qt=null,Qc=!1,xs=0,Gh=0,vs=1/0,bs=null,Dn=null,Nt=0,Mn=null,Fl=null,on=0,Zc=0,Fc=null,Kh=null,$i=0,Jc=null;function aa(){return(Ze&2)!==0&&Be!==0?Be&-Be:M.T!==null?au():te()}function $h(){if(ta===0)if((Be&536870912)===0||Ye){var e=$a;$a<<=1,($a&3932160)===0&&($a=262144),ta=e}else ta=536870912;return e=Pt.current,e!==null&&(e.flags|=32),ta}function Zt(e,t,a){(e===at&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)&&(Jl(e,0),An(e,Be,ta,!1)),Da(e,a),((Ze&2)===0||e!==at)&&(e===at&&((Ze&2)===0&&(hl|=a),dt===4&&An(e,Be,ta,!1)),Ha(e))}function Xh(e,t,a){if((Ze&6)!==0)throw Error(s(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||gn(e,t),o=l?Vx(e,t):Pc(e,t,!0),u=l;do{if(o===0){Ql&&!l&&An(e,t,0,!1);break}else{if(a=e.current.alternate,u&&!qx(a)){o=Pc(e,t,!1),u=!1;continue}if(o===2){if(u=t,e.errorRecoveryDisabledLanes&u)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var b=e;o=Ki;var w=b.current.memoizedState.isDehydrated;if(w&&(Jl(b,g).flags|=256),g=Pc(b,g,!1),g!==2){if($c&&!w){b.errorRecoveryDisabledLanes|=u,hl|=u,o=4;break e}u=Qt,Qt=o,u!==null&&(Qt===null?Qt=u:Qt.push.apply(Qt,u))}o=g}if(u=!1,o!==2)continue}}if(o===1){Jl(e,0),An(e,t,0,!0);break}e:{switch(l=e,u=o,u){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:An(l,t,ta,!On);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(o=xs+300-Rt(),10<o)){if(An(l,t,ta,!On),bl(l,0,!0)!==0)break e;on=t,l.timeoutHandle=jm(Qh.bind(null,l,a,Qt,bs,Qc,t,ta,hl,Zl,On,u,"Throttled",-0,0),o);break e}Qh(l,a,Qt,bs,Qc,t,ta,hl,Zl,On,u,null,-0,0)}}break}while(!0);Ha(e)}function Qh(e,t,a,l,o,u,g,b,w,L,K,J,U,Y){if(e.timeoutHandle=-1,J=t.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xa},Bh(t,u,J);var pe=(u&62914560)===u?xs-Rt():(u&4194048)===u?Gh-Rt():0;if(pe=Nv(J,pe),pe!==null){on=u,e.cancelPendingCommit=pe(tm.bind(null,e,t,u,a,l,o,g,b,w,K,J,null,U,Y)),An(e,u,g,!L);return}}tm(e,t,u,a,l,o,g,b,w)}function qx(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var o=a[l],u=o.getSnapshot;o=o.value;try{if(!Jt(u(),o))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function An(e,t,a,l){t&=~Xc,t&=~hl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var o=t;0<o;){var u=31-Lt(o),g=1<<u;l[u]=-1,o&=~g}a!==0&&Or(e,a,t)}function Ss(){return(Ze&6)===0?(Xi(0),!1):!0}function Wc(){if(ke!==null){if(Fe===0)var e=ke.return;else e=ke,Ja=ll=null,hc(e),ql=null,Ri=0,e=ke;for(;e!==null;)Nh(e.alternate,e),e=e.return;ke=null}}function Jl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,rv(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),on=0,Wc(),at=e,ke=a=Za(e.current,null),Be=t,Fe=0,ea=null,On=!1,Ql=gn(e,t),$c=!1,Zl=ta=Xc=hl=Tn=dt=0,Qt=Ki=null,Qc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var o=31-Lt(l),u=1<<o;t|=e[o],l&=~u}return sn=t,Vr(),a}function Zh(e,t){Oe=null,M.H=ki,t===Bl||t===Jr?(t=uf(),Fe=3):t===tc?(t=uf(),Fe=4):Fe=t===zc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ea=t,ke===null&&(dt=1,us(e,ua(t,e.current)))}function Fh(){var e=Pt.current;return e===null?!0:(Be&4194048)===Be?ma===null:(Be&62914560)===Be||(Be&536870912)!==0?e===ma:!1}function Jh(){var e=M.H;return M.H=ki,e===null?ki:e}function Wh(){var e=M.A;return M.A=Hx,e}function _s(){dt=4,On||(Be&4194048)!==Be&&Pt.current!==null||(Ql=!0),(Tn&134217727)===0&&(hl&134217727)===0||at===null||An(at,Be,ta,!1)}function Pc(e,t,a){var l=Ze;Ze|=2;var o=Jh(),u=Wh();(at!==e||Be!==t)&&(bs=null,Jl(e,t)),t=!1;var g=dt;e:do try{if(Fe!==0&&ke!==null){var b=ke,w=ea;switch(Fe){case 8:Wc(),g=6;break e;case 3:case 2:case 9:case 6:Pt.current===null&&(t=!0);var L=Fe;if(Fe=0,ea=null,Wl(e,b,w,L),a&&Ql){g=0;break e}break;default:L=Fe,Fe=0,ea=null,Wl(e,b,w,L)}}Yx(),g=dt;break}catch(K){Zh(e,K)}while(!0);return t&&e.shellSuspendCounter++,Ja=ll=null,Ze=l,M.H=o,M.A=u,ke===null&&(at=null,Be=0,Vr()),g}function Yx(){for(;ke!==null;)Ph(ke)}function Vx(e,t){var a=Ze;Ze|=2;var l=Jh(),o=Wh();at!==e||Be!==t?(bs=null,vs=Rt()+500,Jl(e,t)):Ql=gn(e,t);e:do try{if(Fe!==0&&ke!==null){t=ke;var u=ea;t:switch(Fe){case 1:Fe=0,ea=null,Wl(e,t,u,1);break;case 2:case 9:if(of(u)){Fe=0,ea=null,Ih(t);break}t=function(){Fe!==2&&Fe!==9||at!==e||(Fe=7),Ha(e)},u.then(t,t);break e;case 3:Fe=7;break e;case 4:Fe=5;break e;case 7:of(u)?(Fe=0,ea=null,Ih(t)):(Fe=0,ea=null,Wl(e,t,u,7));break;case 5:var g=null;switch(ke.tag){case 26:g=ke.memoizedState;case 5:case 27:var b=ke;if(g?Hm(g):b.stateNode.complete){Fe=0,ea=null;var w=b.sibling;if(w!==null)ke=w;else{var L=b.return;L!==null?(ke=L,js(L)):ke=null}break t}}Fe=0,ea=null,Wl(e,t,u,5);break;case 6:Fe=0,ea=null,Wl(e,t,u,6);break;case 8:Wc(),dt=6;break e;default:throw Error(s(462))}}Gx();break}catch(K){Zh(e,K)}while(!0);return Ja=ll=null,M.H=l,M.A=o,Ze=a,ke!==null?0:(at=null,Be=0,Vr(),dt)}function Gx(){for(;ke!==null&&!_a();)Ph(ke)}function Ph(e){var t=_h(e.alternate,e,sn);e.memoizedProps=e.pendingProps,t===null?js(e):ke=t}function Ih(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=gh(a,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=gh(a,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:hc(t);default:Nh(a,t),t=ke=Jd(t,sn),t=_h(a,t,sn)}e.memoizedProps=e.pendingProps,t===null?js(e):ke=t}function Wl(e,t,a,l){Ja=ll=null,hc(t),ql=null,Ri=0;var o=t.return;try{if(Tx(e,o,t,a,Be)){dt=1,us(e,ua(a,e.current)),ke=null;return}}catch(u){if(o!==null)throw ke=o,u;dt=1,us(e,ua(a,e.current)),ke=null;return}t.flags&32768?(Ye||l===1?e=!0:Ql||(Be&536870912)!==0?e=!1:(On=e=!0,(l===2||l===9||l===3||l===6)&&(l=Pt.current,l!==null&&l.tag===13&&(l.flags|=16384))),em(t,e)):js(t)}function js(e){var t=e;do{if((t.flags&32768)!==0){em(t,On);return}e=t.return;var a=Ax(t.alternate,t,sn);if(a!==null){ke=a;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);dt===0&&(dt=5)}function em(e,t){do{var a=Lx(e.alternate,e);if(a!==null){a.flags&=32767,ke=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){ke=e;return}ke=e=a}while(e!==null);dt=6,ke=null}function tm(e,t,a,l,o,u,g,b,w){e.cancelPendingCommit=null;do Ns();while(Nt!==0);if((Ze&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(u=t.lanes|t.childLanes,u|=qo,zr(e,a,u,g,b,w),e===at&&(ke=at=null,Be=0),Fl=t,Mn=e,on=a,Zc=u,Fc=o,Kh=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Qx(pn,function(){return rm(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=M.T,M.T=null,o=P.p,P.p=2,g=Ze,Ze|=4;try{kx(e,t,a)}finally{Ze=g,P.p=o,M.T=l}}Nt=1,am(),nm(),lm()}}function am(){if(Nt===1){Nt=0;var e=Mn,t=Fl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=M.T,M.T=null;var l=P.p;P.p=2;var o=Ze;Ze|=4;try{kh(t,e);var u=uu,g=Yd(e.containerInfo),b=u.focusedElem,w=u.selectionRange;if(g!==b&&b&&b.ownerDocument&&qd(b.ownerDocument.documentElement,b)){if(w!==null&&Lo(b)){var L=w.start,K=w.end;if(K===void 0&&(K=L),"selectionStart"in b)b.selectionStart=L,b.selectionEnd=Math.min(K,b.value.length);else{var J=b.ownerDocument||document,U=J&&J.defaultView||window;if(U.getSelection){var Y=U.getSelection(),pe=b.textContent.length,Ee=Math.min(w.start,pe),Ie=w.end===void 0?Ee:Math.min(w.end,pe);!Y.extend&&Ee>Ie&&(g=Ie,Ie=Ee,Ee=g);var T=Bd(b,Ee),R=Bd(b,Ie);if(T&&R&&(Y.rangeCount!==1||Y.anchorNode!==T.node||Y.anchorOffset!==T.offset||Y.focusNode!==R.node||Y.focusOffset!==R.offset)){var A=J.createRange();A.setStart(T.node,T.offset),Y.removeAllRanges(),Ee>Ie?(Y.addRange(A),Y.extend(R.node,R.offset)):(A.setEnd(R.node,R.offset),Y.addRange(A))}}}}for(J=[],Y=b;Y=Y.parentNode;)Y.nodeType===1&&J.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<J.length;b++){var Z=J[b];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}ks=!!cu,uu=cu=null}finally{Ze=o,P.p=l,M.T=a}}e.current=t,Nt=2}}function nm(){if(Nt===2){Nt=0;var e=Mn,t=Fl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=M.T,M.T=null;var l=P.p;P.p=2;var o=Ze;Ze|=4;try{Th(e,t.alternate,t)}finally{Ze=o,P.p=l,M.T=a}}Nt=3}}function lm(){if(Nt===4||Nt===3){Nt=0,fi();var e=Mn,t=Fl,a=on,l=Kh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nt=5:(Nt=0,Fl=Mn=null,im(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Dn=null),H(a),t=t.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(Ka,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=M.T,o=P.p,P.p=2,M.T=null;try{for(var u=e.onRecoverableError,g=0;g<l.length;g++){var b=l[g];u(b.value,{componentStack:b.stack})}}finally{M.T=t,P.p=o}}(on&3)!==0&&Ns(),Ha(e),o=e.pendingLanes,(a&261930)!==0&&(o&42)!==0?e===Jc?$i++:($i=0,Jc=e):$i=0,Xi(0)}}function im(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,wi(t)))}function Ns(){return am(),nm(),lm(),rm()}function rm(){if(Nt!==5)return!1;var e=Mn,t=Zc;Zc=0;var a=H(on),l=M.T,o=P.p;try{P.p=32>a?32:a,M.T=null,a=Fc,Fc=null;var u=Mn,g=on;if(Nt=0,Fl=Mn=null,on=0,(Ze&6)!==0)throw Error(s(331));var b=Ze;if(Ze|=4,Yh(u.current),Hh(u,u.current,g,a),Ze=b,Xi(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(Ka,u)}catch{}return!0}finally{P.p=o,M.T=l,im(e,t)}}function sm(e,t,a){t=ua(a,t),t=Rc(e.stateNode,t,2),e=wn(e,t,2),e!==null&&(Da(e,2),Ha(e))}function Je(e,t,a){if(e.tag===3)sm(e,e,a);else for(;t!==null;){if(t.tag===3){sm(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Dn===null||!Dn.has(l))){e=ua(a,e),a=oh(2),l=wn(t,a,2),l!==null&&(ch(a,l,t,e),Da(l,2),Ha(l));break}}t=t.return}}function Ic(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new Bx;var o=new Set;l.set(t,o)}else o=l.get(t),o===void 0&&(o=new Set,l.set(t,o));o.has(a)||($c=!0,o.add(a),e=Kx.bind(null,e,t,a),t.then(e,e))}function Kx(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,at===e&&(Be&a)===a&&(dt===4||dt===3&&(Be&62914560)===Be&&300>Rt()-xs?(Ze&2)===0&&Jl(e,0):Xc|=a,Zl===Be&&(Zl=0)),Ha(e)}function om(e,t){t===0&&(t=mi()),e=tl(e,t),e!==null&&(Da(e,t),Ha(e))}function $x(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),om(e,a)}function Xx(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(t),om(e,a)}function Qx(e,t){return Ve(e,t)}var Es=null,Pl=null,eu=!1,ws=!1,tu=!1,Ln=0;function Ha(e){e!==Pl&&e.next===null&&(Pl===null?Es=Pl=e:Pl=Pl.next=e),ws=!0,eu||(eu=!0,Fx())}function Xi(e,t){if(!tu&&ws){tu=!0;do for(var a=!1,l=Es;l!==null;){if(e!==0){var o=l.pendingLanes;if(o===0)var u=0;else{var g=l.suspendedLanes,b=l.pingedLanes;u=(1<<31-Lt(42|e)+1)-1,u&=o&~(g&~b),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,fm(l,u))}else u=Be,u=bl(l,l===at?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||gn(l,u)||(a=!0,fm(l,u));l=l.next}while(a);tu=!1}}function Zx(){cm()}function cm(){ws=eu=!1;var e=0;Ln!==0&&iv()&&(e=Ln);for(var t=Rt(),a=null,l=Es;l!==null;){var o=l.next,u=um(l,t);u===0?(l.next=null,a===null?Es=o:a.next=o,o===null&&(Pl=a)):(a=l,(e!==0||(u&3)!==0)&&(ws=!0)),l=o}Nt!==0&&Nt!==5||Xi(e),Ln!==0&&(Ln=0)}function um(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,o=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var g=31-Lt(u),b=1<<g,w=o[g];w===-1?((b&a)===0||(b&l)!==0)&&(o[g]=vo(b,t)):w<=t&&(e.expiredLanes|=b),u&=~b}if(t=at,a=Be,a=bl(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&He(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||gn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&He(l),H(a)){case 2:case 8:a=hi;break;case 32:a=pn;break;case 268435456:a=sa;break;default:a=pn}return l=dm.bind(null,e),a=Ve(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&He(l),e.callbackPriority=2,e.callbackNode=null,2}function dm(e,t){if(Nt!==0&&Nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ns()&&e.callbackNode!==a)return null;var l=Be;return l=bl(e,e===at?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Xh(e,l,t),um(e,Rt()),e.callbackNode!=null&&e.callbackNode===a?dm.bind(null,e):null)}function fm(e,t){if(Ns())return null;Xh(e,t,!0)}function Fx(){sv(function(){(Ze&6)!==0?Ve(yt,Zx):cm()})}function au(){if(Ln===0){var e=Ul;e===0&&(e=Zn,Zn<<=1,(Zn&261888)===0&&(Zn=256)),Ln=e}return Ln}function hm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ar(""+e)}function mm(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Jx(e,t,a,l,o){if(t==="submit"&&a&&a.stateNode===o){var u=hm((o[fe]||null).action),g=l.submitter;g&&(t=(t=g[fe]||null)?hm(t.formAction):g.getAttribute("formAction"),t!==null&&(u=t,g=null));var b=new Hr("action","action",null,l,o);e.push({event:b,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ln!==0){var w=g?mm(o,g):new FormData(o);_c(a,{pending:!0,data:w,method:o.method,action:u},null,w)}}else typeof u=="function"&&(b.preventDefault(),w=g?mm(o,g):new FormData(o),_c(a,{pending:!0,data:w,method:o.method,action:u},u,w))},currentTarget:o}]})}}for(var nu=0;nu<Bo.length;nu++){var lu=Bo[nu],Wx=lu.toLowerCase(),Px=lu[0].toUpperCase()+lu.slice(1);Ca(Wx,"on"+Px)}Ca(Kd,"onAnimationEnd"),Ca($d,"onAnimationIteration"),Ca(Xd,"onAnimationStart"),Ca("dblclick","onDoubleClick"),Ca("focusin","onFocus"),Ca("focusout","onBlur"),Ca(mx,"onTransitionRun"),Ca(px,"onTransitionStart"),Ca(gx,"onTransitionCancel"),Ca(Qd,"onTransitionEnd"),Ma("onMouseEnter",["mouseout","mouseover"]),Ma("onMouseLeave",["mouseout","mouseover"]),Ma("onPointerEnter",["pointerout","pointerover"]),Ma("onPointerLeave",["pointerout","pointerover"]),wt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),wt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),wt("onBeforeInput",["compositionend","keypress","textInput","paste"]),wt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),wt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),wt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qi="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(" "),Ix=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qi));function pm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],o=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var g=l.length-1;0<=g;g--){var b=l[g],w=b.instance,L=b.currentTarget;if(b=b.listener,w!==u&&o.isPropagationStopped())break e;u=b,o.currentTarget=L;try{u(o)}catch(K){Yr(K)}o.currentTarget=null,u=w}else for(g=0;g<l.length;g++){if(b=l[g],w=b.instance,L=b.currentTarget,b=b.listener,w!==u&&o.isPropagationStopped())break e;u=b,o.currentTarget=L;try{u(o)}catch(K){Yr(K)}o.currentTarget=null,u=w}}}}function Ue(e,t){var a=t[be];a===void 0&&(a=t[be]=new Set);var l=e+"__bubble";a.has(l)||(gm(t,e,2,!1),a.add(l))}function iu(e,t,a){var l=0;t&&(l|=4),gm(a,e,l,t)}var Cs="_reactListening"+Math.random().toString(36).slice(2);function ru(e){if(!e[Cs]){e[Cs]=!0,xn.forEach(function(a){a!=="selectionchange"&&(Ix.has(a)||iu(a,!1,e),iu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cs]||(t[Cs]=!0,iu("selectionchange",!1,t))}}function gm(e,t,a,l){switch($m(t)){case 2:var o=Cv;break;case 8:o=Rv;break;default:o=Su}a=o.bind(null,t,a,e),o=void 0,!wo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),l?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function su(e,t,a,l,o){var u=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var g=l.tag;if(g===3||g===4){var b=l.stateNode.containerInfo;if(b===o)break;if(g===4)for(g=l.return;g!==null;){var w=g.tag;if((w===3||w===4)&&g.stateNode.containerInfo===o)return;g=g.return}for(;b!==null;){if(g=lt(b),g===null)return;if(w=g.tag,w===5||w===6||w===26||w===27){l=u=g;continue e}b=b.parentNode}}l=l.return}bd(function(){var L=u,K=No(a),J=[];e:{var U=Zd.get(e);if(U!==void 0){var Y=Hr,pe=e;switch(e){case"keypress":if(kr(a)===0)break e;case"keydown":case"keyup":Y=Xy;break;case"focusin":pe="focus",Y=Oo;break;case"focusout":pe="blur",Y=Oo;break;case"beforeblur":case"afterblur":Y=Oo;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=jd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=Ay;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Fy;break;case Kd:case $d:case Xd:Y=Uy;break;case Qd:Y=Wy;break;case"scroll":case"scrollend":Y=Dy;break;case"wheel":Y=Iy;break;case"copy":case"cut":case"paste":Y=By;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Ed;break;case"toggle":case"beforetoggle":Y=tx}var Ee=(t&4)!==0,Ie=!Ee&&(e==="scroll"||e==="scrollend"),T=Ee?U!==null?U+"Capture":null:U;Ee=[];for(var R=L,A;R!==null;){var Z=R;if(A=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||A===null||T===null||(Z=pi(R,T),Z!=null&&Ee.push(Zi(R,Z,A))),Ie)break;R=R.return}0<Ee.length&&(U=new Y(U,pe,null,a,K),J.push({event:U,listeners:Ee}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",Y=e==="mouseout"||e==="pointerout",U&&a!==jo&&(pe=a.relatedTarget||a.fromElement)&&(lt(pe)||pe[he]))break e;if((Y||U)&&(U=K.window===K?K:(U=K.ownerDocument)?U.defaultView||U.parentWindow:window,Y?(pe=a.relatedTarget||a.toElement,Y=L,pe=pe?lt(pe):null,pe!==null&&(Ie=d(pe),Ee=pe.tag,pe!==Ie||Ee!==5&&Ee!==27&&Ee!==6)&&(pe=null)):(Y=null,pe=L),Y!==pe)){if(Ee=jd,Z="onMouseLeave",T="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=Ed,Z="onPointerLeave",T="onPointerEnter",R="pointer"),Ie=Y==null?U:Ge(Y),A=pe==null?U:Ge(pe),U=new Ee(Z,R+"leave",Y,a,K),U.target=Ie,U.relatedTarget=A,Z=null,lt(K)===L&&(Ee=new Ee(T,R+"enter",pe,a,K),Ee.target=A,Ee.relatedTarget=Ie,Z=Ee),Ie=Z,Y&&pe)t:{for(Ee=ev,T=Y,R=pe,A=0,Z=T;Z;Z=Ee(Z))A++;Z=0;for(var Se=R;Se;Se=Ee(Se))Z++;for(;0<A-Z;)T=Ee(T),A--;for(;0<Z-A;)R=Ee(R),Z--;for(;A--;){if(T===R||R!==null&&T===R.alternate){Ee=T;break t}T=Ee(T),R=Ee(R)}Ee=null}else Ee=null;Y!==null&&ym(J,U,Y,Ee,!1),pe!==null&&Ie!==null&&ym(J,Ie,pe,Ee,!0)}}e:{if(U=L?Ge(L):window,Y=U.nodeName&&U.nodeName.toLowerCase(),Y==="select"||Y==="input"&&U.type==="file")var Xe=Md;else if(Td(U))if(Ad)Xe=dx;else{Xe=cx;var ye=ox}else Y=U.nodeName,!Y||Y.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?L&&_o(L.elementType)&&(Xe=Md):Xe=ux;if(Xe&&(Xe=Xe(e,L))){Dd(J,Xe,a,K);break e}ye&&ye(e,U,L),e==="focusout"&&L&&U.type==="number"&&L.memoizedProps.value!=null&&So(U,"number",U.value)}switch(ye=L?Ge(L):window,e){case"focusin":(Td(ye)||ye.contentEditable==="true")&&(zl=ye,ko=L,ji=null);break;case"focusout":ji=ko=zl=null;break;case"mousedown":Uo=!0;break;case"contextmenu":case"mouseup":case"dragend":Uo=!1,Vd(J,a,K);break;case"selectionchange":if(hx)break;case"keydown":case"keyup":Vd(J,a,K)}var Te;if(Do)e:{switch(e){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Rl?zd(e,a)&&(qe="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(qe="onCompositionStart");qe&&(wd&&a.locale!=="ko"&&(Rl||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Rl&&(Te=Sd()):(vn=K,Co="value"in vn?vn.value:vn.textContent,Rl=!0)),ye=Rs(L,qe),0<ye.length&&(qe=new Nd(qe,e,null,a,K),J.push({event:qe,listeners:ye}),Te?qe.data=Te:(Te=Od(a),Te!==null&&(qe.data=Te)))),(Te=nx?lx(e,a):ix(e,a))&&(qe=Rs(L,"onBeforeInput"),0<qe.length&&(ye=new Nd("onBeforeInput","beforeinput",null,a,K),J.push({event:ye,listeners:qe}),ye.data=Te)),Jx(J,e,L,a,K)}pm(J,t)})}function Zi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Rs(e,t){for(var a=t+"Capture",l=[];e!==null;){var o=e,u=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||u===null||(o=pi(e,a),o!=null&&l.unshift(Zi(e,o,u)),o=pi(e,t),o!=null&&l.push(Zi(e,o,u))),e.tag===3)return l;e=e.return}return[]}function ev(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ym(e,t,a,l,o){for(var u=t._reactName,g=[];a!==null&&a!==l;){var b=a,w=b.alternate,L=b.stateNode;if(b=b.tag,w!==null&&w===l)break;b!==5&&b!==26&&b!==27||L===null||(w=L,o?(L=pi(a,u),L!=null&&g.unshift(Zi(a,L,w))):o||(L=pi(a,u),L!=null&&g.push(Zi(a,L,w)))),a=a.return}g.length!==0&&e.push({event:t,listeners:g})}var tv=/\r\n?/g,av=/\u0000|\uFFFD/g;function xm(e){return(typeof e=="string"?e:""+e).replace(tv,`
|
|
9
|
+
`).replace(av,"")}function vm(e,t){return t=xm(t),xm(e)===t}function Pe(e,t,a,l,o,u){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||El(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&El(e,""+l);break;case"className":mt(e,"class",l);break;case"tabIndex":mt(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":mt(e,a,l);break;case"style":xd(e,l,u);break;case"data":if(t!=="object"){mt(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Ar(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"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 u=="function"&&(a==="formAction"?(t!=="input"&&Pe(e,t,"name",o.name,o,null),Pe(e,t,"formEncType",o.formEncType,o,null),Pe(e,t,"formMethod",o.formMethod,o,null),Pe(e,t,"formTarget",o.formTarget,o,null)):(Pe(e,t,"encType",o.encType,o,null),Pe(e,t,"method",o.method,o,null),Pe(e,t,"target",o.target,o,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Ar(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=Xa);break;case"onScroll":l!=null&&Ue("scroll",e);break;case"onScrollEnd":l!=null&&Ue("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(o.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=Ar(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):e.removeAttribute(a);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":Ue("beforetoggle",e),Ue("toggle",e),Le(e,"popover",l);break;case"xlinkActuate":kt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":kt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":kt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":kt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":kt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":kt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":kt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":kt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":kt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Le(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Oy.get(a)||a,Le(e,a,l))}}function ou(e,t,a,l,o,u){switch(a){case"style":xd(e,l,u);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(o.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"children":typeof l=="string"?El(e,l):(typeof l=="number"||typeof l=="bigint")&&El(e,""+l);break;case"onScroll":l!=null&&Ue("scroll",e);break;case"onScrollEnd":l!=null&&Ue("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Xa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wa.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(o=a.endsWith("Capture"),t=a.slice(2,o?a.length-7:void 0),u=e[fe]||null,u=u!=null?u[a]:null,typeof u=="function"&&e.removeEventListener(t,u,o),typeof l=="function")){typeof u!="function"&&u!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,o);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):Le(e,a,l)}}}function Dt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",e),Ue("load",e);var l=!1,o=!1,u;for(u in a)if(a.hasOwnProperty(u)){var g=a[u];if(g!=null)switch(u){case"src":l=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Pe(e,t,u,g,a,null)}}o&&Pe(e,t,"srcSet",a.srcSet,a,null),l&&Pe(e,t,"src",a.src,a,null);return;case"input":Ue("invalid",e);var b=u=g=o=null,w=null,L=null;for(l in a)if(a.hasOwnProperty(l)){var K=a[l];if(K!=null)switch(l){case"name":o=K;break;case"type":g=K;break;case"checked":w=K;break;case"defaultChecked":L=K;break;case"value":u=K;break;case"defaultValue":b=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(s(137,t));break;default:Pe(e,t,l,K,a,null)}}md(e,u,b,w,L,g,o,!1);return;case"select":Ue("invalid",e),l=g=u=null;for(o in a)if(a.hasOwnProperty(o)&&(b=a[o],b!=null))switch(o){case"value":u=b;break;case"defaultValue":g=b;break;case"multiple":l=b;default:Pe(e,t,o,b,a,null)}t=u,a=g,e.multiple=!!l,t!=null?Nl(e,!!l,t,!1):a!=null&&Nl(e,!!l,a,!0);return;case"textarea":Ue("invalid",e),u=o=l=null;for(g in a)if(a.hasOwnProperty(g)&&(b=a[g],b!=null))switch(g){case"value":l=b;break;case"defaultValue":o=b;break;case"children":u=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(s(91));break;default:Pe(e,t,g,b,a,null)}gd(e,l,o,u);return;case"option":for(w in a)a.hasOwnProperty(w)&&(l=a[w],l!=null)&&(w==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":Pe(e,t,w,l,a,null));return;case"dialog":Ue("beforetoggle",e),Ue("toggle",e),Ue("cancel",e),Ue("close",e);break;case"iframe":case"object":Ue("load",e);break;case"video":case"audio":for(l=0;l<Qi.length;l++)Ue(Qi[l],e);break;case"image":Ue("error",e),Ue("load",e);break;case"details":Ue("toggle",e);break;case"embed":case"source":case"link":Ue("error",e),Ue("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in a)if(a.hasOwnProperty(L)&&(l=a[L],l!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Pe(e,t,L,l,a,null)}return;default:if(_o(t)){for(K in a)a.hasOwnProperty(K)&&(l=a[K],l!==void 0&&ou(e,t,K,l,a,void 0));return}}for(b in a)a.hasOwnProperty(b)&&(l=a[b],l!=null&&Pe(e,t,b,l,a,null))}function nv(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,u=null,g=null,b=null,w=null,L=null,K=null;for(Y in a){var J=a[Y];if(a.hasOwnProperty(Y)&&J!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":w=J;default:l.hasOwnProperty(Y)||Pe(e,t,Y,null,l,J)}}for(var U in l){var Y=l[U];if(J=a[U],l.hasOwnProperty(U)&&(Y!=null||J!=null))switch(U){case"type":u=Y;break;case"name":o=Y;break;case"checked":L=Y;break;case"defaultChecked":K=Y;break;case"value":g=Y;break;case"defaultValue":b=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(137,t));break;default:Y!==J&&Pe(e,t,U,Y,l,J)}}bo(e,g,b,w,L,K,u,o);return;case"select":Y=g=b=U=null;for(u in a)if(w=a[u],a.hasOwnProperty(u)&&w!=null)switch(u){case"value":break;case"multiple":Y=w;default:l.hasOwnProperty(u)||Pe(e,t,u,null,l,w)}for(o in l)if(u=l[o],w=a[o],l.hasOwnProperty(o)&&(u!=null||w!=null))switch(o){case"value":U=u;break;case"defaultValue":b=u;break;case"multiple":g=u;default:u!==w&&Pe(e,t,o,u,l,w)}t=b,a=g,l=Y,U!=null?Nl(e,!!a,U,!1):!!l!=!!a&&(t!=null?Nl(e,!!a,t,!0):Nl(e,!!a,a?[]:"",!1));return;case"textarea":Y=U=null;for(b in a)if(o=a[b],a.hasOwnProperty(b)&&o!=null&&!l.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Pe(e,t,b,null,l,o)}for(g in l)if(o=l[g],u=a[g],l.hasOwnProperty(g)&&(o!=null||u!=null))switch(g){case"value":U=o;break;case"defaultValue":Y=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(s(91));break;default:o!==u&&Pe(e,t,g,o,l,u)}pd(e,U,Y);return;case"option":for(var pe in a)U=a[pe],a.hasOwnProperty(pe)&&U!=null&&!l.hasOwnProperty(pe)&&(pe==="selected"?e.selected=!1:Pe(e,t,pe,null,l,U));for(w in l)U=l[w],Y=a[w],l.hasOwnProperty(w)&&U!==Y&&(U!=null||Y!=null)&&(w==="selected"?e.selected=U&&typeof U!="function"&&typeof U!="symbol":Pe(e,t,w,U,l,Y));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 Ee in a)U=a[Ee],a.hasOwnProperty(Ee)&&U!=null&&!l.hasOwnProperty(Ee)&&Pe(e,t,Ee,null,l,U);for(L in l)if(U=l[L],Y=a[L],l.hasOwnProperty(L)&&U!==Y&&(U!=null||Y!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(s(137,t));break;default:Pe(e,t,L,U,l,Y)}return;default:if(_o(t)){for(var Ie in a)U=a[Ie],a.hasOwnProperty(Ie)&&U!==void 0&&!l.hasOwnProperty(Ie)&&ou(e,t,Ie,void 0,l,U);for(K in l)U=l[K],Y=a[K],!l.hasOwnProperty(K)||U===Y||U===void 0&&Y===void 0||ou(e,t,K,U,l,Y);return}}for(var T in a)U=a[T],a.hasOwnProperty(T)&&U!=null&&!l.hasOwnProperty(T)&&Pe(e,t,T,null,l,U);for(J in l)U=l[J],Y=a[J],!l.hasOwnProperty(J)||U===Y||U==null&&Y==null||Pe(e,t,J,U,l,Y)}function bm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var o=a[l],u=o.transferSize,g=o.initiatorType,b=o.duration;if(u&&b&&bm(g)){for(g=0,b=o.responseEnd,l+=1;l<a.length;l++){var w=a[l],L=w.startTime;if(L>b)break;var K=w.transferSize,J=w.initiatorType;K&&bm(J)&&(w=w.responseEnd,g+=K*(w<b?1:(b-L)/(w-L)))}if(--l,t+=8*(u+g)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var cu=null,uu=null;function zs(e){return e.nodeType===9?e:e.ownerDocument}function Sm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function _m(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function du(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var fu=null;function iv(){var e=window.event;return e&&e.type==="popstate"?e===fu?!1:(fu=e,!0):(fu=null,!1)}var jm=typeof setTimeout=="function"?setTimeout:void 0,rv=typeof clearTimeout=="function"?clearTimeout:void 0,Nm=typeof Promise=="function"?Promise:void 0,sv=typeof queueMicrotask=="function"?queueMicrotask:typeof Nm<"u"?function(e){return Nm.resolve(null).then(e).catch(ov)}:jm;function ov(e){setTimeout(function(){throw e})}function kn(e){return e==="head"}function Em(e,t){var a=t,l=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(o),ai(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")Fi(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Fi(a);for(var u=a.firstChild;u;){var g=u.nextSibling,b=u.nodeName;u[Ae]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&u.rel.toLowerCase()==="stylesheet"||a.removeChild(u),u=g}}else a==="body"&&Fi(e.ownerDocument.body);a=o}while(a);ai(t)}function wm(e,t){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function hu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":hu(a),tt(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function cv(e,t,a,l){for(;e.nodeType===1;){var o=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ae])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=pa(e.nextSibling),e===null)break}return null}function uv(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=pa(e.nextSibling),e===null))return null;return e}function Cm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=pa(e.nextSibling),e===null))return null;return e}function mu(e){return e.data==="$?"||e.data==="$~"}function pu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function dv(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function pa(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var gu=null;function Rm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return pa(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function zm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Om(e,t,a){switch(t=zs(a),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Fi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);tt(e)}var ga=new Map,Tm=new Set;function Os(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var cn=P.d;P.d={f:fv,r:hv,D:mv,C:pv,L:gv,m:yv,X:vv,S:xv,M:bv};function fv(){var e=cn.f(),t=Ss();return e||t}function hv(e){var t=ct(e);t!==null&&t.tag===5&&t.type==="form"?Zf(t):cn.r(e)}var Il=typeof document>"u"?null:document;function Dm(e,t,a){var l=Il;if(l&&typeof t=="string"&&t){var o=oa(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof a=="string"&&(o+='[crossorigin="'+a+'"]'),Tm.has(o)||(Tm.add(o),e={rel:e,crossOrigin:a,href:t},l.querySelector(o)===null&&(t=l.createElement("link"),Dt(t,"link",e),nt(t),l.head.appendChild(t)))}}function mv(e){cn.D(e),Dm("dns-prefetch",e,null)}function pv(e,t){cn.C(e,t),Dm("preconnect",e,t)}function gv(e,t,a){cn.L(e,t,a);var l=Il;if(l&&e&&t){var o='link[rel="preload"][as="'+oa(t)+'"]';t==="image"&&a&&a.imageSrcSet?(o+='[imagesrcset="'+oa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(o+='[imagesizes="'+oa(a.imageSizes)+'"]')):o+='[href="'+oa(e)+'"]';var u=o;switch(t){case"style":u=ei(e);break;case"script":u=ti(e)}ga.has(u)||(e=x({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ga.set(u,e),l.querySelector(o)!==null||t==="style"&&l.querySelector(Ji(u))||t==="script"&&l.querySelector(Wi(u))||(t=l.createElement("link"),Dt(t,"link",e),nt(t),l.head.appendChild(t)))}}function yv(e,t){cn.m(e,t);var a=Il;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+oa(l)+'"][href="'+oa(e)+'"]',u=o;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=ti(e)}if(!ga.has(u)&&(e=x({rel:"modulepreload",href:e},t),ga.set(u,e),a.querySelector(o)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Wi(u)))return}l=a.createElement("link"),Dt(l,"link",e),nt(l),a.head.appendChild(l)}}}function xv(e,t,a){cn.S(e,t,a);var l=Il;if(l&&e){var o=jt(l).hoistableStyles,u=ei(e);t=t||"default";var g=o.get(u);if(!g){var b={loading:0,preload:null};if(g=l.querySelector(Ji(u)))b.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ga.get(u))&&yu(e,a);var w=g=l.createElement("link");nt(w),Dt(w,"link",e),w._p=new Promise(function(L,K){w.onload=L,w.onerror=K}),w.addEventListener("load",function(){b.loading|=1}),w.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Ts(g,t,l)}g={type:"stylesheet",instance:g,count:1,state:b},o.set(u,g)}}}function vv(e,t){cn.X(e,t);var a=Il;if(a&&e){var l=jt(a).hoistableScripts,o=ti(e),u=l.get(o);u||(u=a.querySelector(Wi(o)),u||(e=x({src:e,async:!0},t),(t=ga.get(o))&&xu(e,t),u=a.createElement("script"),nt(u),Dt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(o,u))}}function bv(e,t){cn.M(e,t);var a=Il;if(a&&e){var l=jt(a).hoistableScripts,o=ti(e),u=l.get(o);u||(u=a.querySelector(Wi(o)),u||(e=x({src:e,async:!0,type:"module"},t),(t=ga.get(o))&&xu(e,t),u=a.createElement("script"),nt(u),Dt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(o,u))}}function Mm(e,t,a,l){var o=(o=je.current)?Os(o):null;if(!o)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=ei(a.href),a=jt(o).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=ei(a.href);var u=jt(o).hoistableStyles,g=u.get(e);if(g||(o=o.ownerDocument||o,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,g),(u=o.querySelector(Ji(e)))&&!u._p&&(g.instance=u,g.state.loading=5),ga.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ga.set(e,a),u||Sv(o,e,a,g.state))),t&&l===null)throw Error(s(528,""));return g}if(t&&l!==null)throw Error(s(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ti(a),a=jt(o).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function ei(e){return'href="'+oa(e)+'"'}function Ji(e){return'link[rel="stylesheet"]['+e+"]"}function Am(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function Sv(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Dt(t,"link",a),nt(t),e.head.appendChild(t))}function ti(e){return'[src="'+oa(e)+'"]'}function Wi(e){return"script[async]"+e}function Lm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+oa(a.href)+'"]');if(l)return t.instance=l,nt(l),l;var o=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),nt(l),Dt(l,"style",o),Ts(l,a.precedence,e),t.instance=l;case"stylesheet":o=ei(a.href);var u=e.querySelector(Ji(o));if(u)return t.state.loading|=4,t.instance=u,nt(u),u;l=Am(a),(o=ga.get(o))&&yu(l,o),u=(e.ownerDocument||e).createElement("link"),nt(u);var g=u;return g._p=new Promise(function(b,w){g.onload=b,g.onerror=w}),Dt(u,"link",l),t.state.loading|=4,Ts(u,a.precedence,e),t.instance=u;case"script":return u=ti(a.src),(o=e.querySelector(Wi(u)))?(t.instance=o,nt(o),o):(l=a,(o=ga.get(u))&&(l=x({},a),xu(l,o)),e=e.ownerDocument||e,o=e.createElement("script"),nt(o),Dt(o,"link",l),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Ts(l,a.precedence,e));return t.instance}function Ts(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=l.length?l[l.length-1]:null,u=o,g=0;g<l.length;g++){var b=l[g];if(b.dataset.precedence===t)u=b;else if(u!==o)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function yu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function xu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ds=null;function km(e,t,a){if(Ds===null){var l=new Map,o=Ds=new Map;o.set(a,l)}else o=Ds,l=o.get(a),l||(l=new Map,o.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),o=0;o<a.length;o++){var u=a[o];if(!(u[Ae]||u[oe]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var g=u.getAttribute(t)||"";g=e+g;var b=l.get(g);b?b.push(u):l.set(g,[u])}}return l}function Um(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function _v(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Hm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function jv(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var o=ei(l.href),u=t.querySelector(Ji(o));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ms.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=u,nt(u);return}u=t.ownerDocument||t,l=Am(l),(o=ga.get(o))&&yu(l,o),u=u.createElement("link"),nt(u);var g=u;g._p=new Promise(function(b,w){g.onload=b,g.onerror=w}),Dt(u,"link",l),a.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Ms.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var vu=0;function Nv(e,t){return e.stylesheets&&e.count===0&&Ls(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&Ls(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&vu===0&&(vu=62500*lv());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ls(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>vu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(o)}}:null}function Ms(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ls(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var As=null;function Ls(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,As=new Map,t.forEach(Ev,e),As=null,Ms.call(e))}function Ev(e,t){if(!(t.state.loading&4)){var a=As.get(e);if(a)var l=a.get(null);else{a=new Map,As.set(e,a);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<o.length;u++){var g=o[u];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(a.set(g.dataset.precedence,g),l=g)}l&&a.set(null,l)}o=t.instance,g=o.getAttribute("data-precedence"),u=a.get(g)||l,u===l&&a.set(null,o),a.set(g,o),this.count++,l=Ms.bind(this),o.addEventListener("load",l),o.addEventListener("error",l),u?u.parentNode.insertBefore(o,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var Pi={$$typeof:I,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function wv(e,t,a,l,o,u,g,b,w){this.tag=1,this.containerInfo=e,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=yn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yn(0),this.hiddenUpdates=yn(null),this.identifierPrefix=l,this.onUncaughtError=o,this.onCaughtError=u,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function Bm(e,t,a,l,o,u,g,b,w,L,K,J){return e=new wv(e,t,a,g,w,L,K,J,b),t=1,u===!0&&(t|=24),u=Wt(3,null,null,t),e.current=u,u.stateNode=e,t=Po(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:a,cache:t},ac(u),e}function qm(e){return e?(e=Dl,e):Dl}function Ym(e,t,a,l,o,u){o=qm(o),l.context===null?l.context=o:l.pendingContext=o,l=En(t),l.payload={element:a},u=u===void 0?null:u,u!==null&&(l.callback=u),a=wn(e,l,t),a!==null&&(Zt(a,e,t),Oi(a,e,t))}function Vm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function bu(e,t){Vm(e,t),(e=e.alternate)&&Vm(e,t)}function Gm(e){if(e.tag===13||e.tag===31){var t=tl(e,67108864);t!==null&&Zt(t,e,67108864),bu(e,67108864)}}function Km(e){if(e.tag===13||e.tag===31){var t=aa();t=O(t);var a=tl(e,t);a!==null&&Zt(a,e,t),bu(e,t)}}var ks=!0;function Cv(e,t,a,l){var o=M.T;M.T=null;var u=P.p;try{P.p=2,Su(e,t,a,l)}finally{P.p=u,M.T=o}}function Rv(e,t,a,l){var o=M.T;M.T=null;var u=P.p;try{P.p=8,Su(e,t,a,l)}finally{P.p=u,M.T=o}}function Su(e,t,a,l){if(ks){var o=_u(l);if(o===null)su(e,t,l,Us,a),Xm(e,l);else if(Ov(o,e,t,a,l))l.stopPropagation();else if(Xm(e,l),t&4&&-1<zv.indexOf(e)){for(;o!==null;){var u=ct(o);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var g=Ea(u.pendingLanes);if(g!==0){var b=u;for(b.pendingLanes|=2,b.entangledLanes|=2;g;){var w=1<<31-Lt(g);b.entanglements[1]|=w,g&=~w}Ha(u),(Ze&6)===0&&(vs=Rt()+500,Xi(0))}}break;case 31:case 13:b=tl(u,2),b!==null&&Zt(b,u,2),Ss(),bu(u,2)}if(u=_u(l),u===null&&su(e,t,l,Us,a),u===o)break;o=u}o!==null&&l.stopPropagation()}else su(e,t,l,null,a)}}function _u(e){return e=No(e),ju(e)}var Us=null;function ju(e){if(Us=null,e=lt(e),e!==null){var t=d(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=h(t),e!==null)return e;e=null}else if(a===31){if(e=m(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Us=e,null}function $m(e){switch(e){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(ja()){case yt:return 2;case hi:return 8;case pn:case Na:return 32;case sa:return 268435456;default:return 32}default:return 32}}var Nu=!1,Un=null,Hn=null,Bn=null,Ii=new Map,er=new Map,qn=[],zv="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 Xm(e,t){switch(e){case"focusin":case"focusout":Un=null;break;case"dragenter":case"dragleave":Hn=null;break;case"mouseover":case"mouseout":Bn=null;break;case"pointerover":case"pointerout":Ii.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":er.delete(t.pointerId)}}function tr(e,t,a,l,o,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:u,targetContainers:[o]},t!==null&&(t=ct(t),t!==null&&Gm(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Ov(e,t,a,l,o){switch(t){case"focusin":return Un=tr(Un,e,t,a,l,o),!0;case"dragenter":return Hn=tr(Hn,e,t,a,l,o),!0;case"mouseover":return Bn=tr(Bn,e,t,a,l,o),!0;case"pointerover":var u=o.pointerId;return Ii.set(u,tr(Ii.get(u)||null,e,t,a,l,o)),!0;case"gotpointercapture":return u=o.pointerId,er.set(u,tr(er.get(u)||null,e,t,a,l,o)),!0}return!1}function Qm(e){var t=lt(e.target);if(t!==null){var a=d(t);if(a!==null){if(t=a.tag,t===13){if(t=h(a),t!==null){e.blockedOn=t,re(e.priority,function(){Km(a)});return}}else if(t===31){if(t=m(a),t!==null){e.blockedOn=t,re(e.priority,function(){Km(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=_u(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);jo=l,a.target.dispatchEvent(l),jo=null}else return t=ct(a),t!==null&&Gm(t),e.blockedOn=a,!1;t.shift()}return!0}function Zm(e,t,a){Hs(e)&&a.delete(t)}function Tv(){Nu=!1,Un!==null&&Hs(Un)&&(Un=null),Hn!==null&&Hs(Hn)&&(Hn=null),Bn!==null&&Hs(Bn)&&(Bn=null),Ii.forEach(Zm),er.forEach(Zm)}function Bs(e,t){e.blockedOn===t&&(e.blockedOn=null,Nu||(Nu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Tv)))}var qs=null;function Fm(e){qs!==e&&(qs=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){qs===e&&(qs=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],o=e[t+2];if(typeof l!="function"){if(ju(l||a)===null)continue;break}var u=ct(a);u!==null&&(e.splice(t,3),t-=3,_c(u,{pending:!0,data:o,method:a.method,action:l},l,o))}}))}function ai(e){function t(w){return Bs(w,e)}Un!==null&&Bs(Un,e),Hn!==null&&Bs(Hn,e),Bn!==null&&Bs(Bn,e),Ii.forEach(t),er.forEach(t);for(var a=0;a<qn.length;a++){var l=qn[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<qn.length&&(a=qn[0],a.blockedOn===null);)Qm(a),a.blockedOn===null&&qn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var o=a[l],u=a[l+1],g=o[fe]||null;if(typeof u=="function")g||Fm(a);else if(g){var b=null;if(u&&u.hasAttribute("formAction")){if(o=u,g=u[fe]||null)b=g.formAction;else if(ju(o)!==null)continue}else b=g.action;typeof b=="function"?a[l+1]=b:(a.splice(l,3),l-=3),Fm(a)}}}function Jm(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(g){return o=g})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Eu(e){this._internalRoot=e}Ys.prototype.render=Eu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var a=t.current,l=aa();Ym(a,l,e,t,null,null)},Ys.prototype.unmount=Eu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ym(e.current,2,null,e,null,null),Ss(),t[he]=null}};function Ys(e){this._internalRoot=e}Ys.prototype.unstable_scheduleHydration=function(e){if(e){var t=te();e={blockedOn:null,target:e,priority:t};for(var a=0;a<qn.length&&t!==0&&t<qn[a].priority;a++);qn.splice(a,0,e),a===0&&Qm(e)}};var Wm=i.version;if(Wm!=="19.2.4")throw Error(s(527,Wm,"19.2.4"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=p(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var Dv={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vs.isDisabled&&Vs.supportsFiber)try{Ka=Vs.inject(Dv),qt=Vs}catch{}}return lr.createRoot=function(e,t){if(!c(e))throw Error(s(299));var a=!1,l="",o=lh,u=ih,g=rh;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=Bm(e,1,!1,null,null,a,l,null,o,u,g,Jm),e[he]=t.current,ru(e),new Eu(t)},lr.hydrateRoot=function(e,t,a){if(!c(e))throw Error(s(299));var l=!1,o="",u=lh,g=ih,b=rh,w=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(o=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError),a.formState!==void 0&&(w=a.formState)),t=Bm(e,1,!0,t,a??null,l,o,w,u,g,b,Jm),t.context=qm(null),a=t.current,l=aa(),l=O(l),o=En(l),o.callback=null,wn(a,o,l),a=l,t.current.lanes=a,Da(t,a),Ha(t),e[he]=t.current,ru(e),new Ys(t)},lr.version="19.2.4",lr}var Rp;function Jb(){if(Rp)return Mu.exports;Rp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Mu.exports=Fb(),Mu.exports}var Wb=Jb();var Ag=n=>{throw TypeError(n)},Pb=(n,i,r)=>i.has(n)||Ag("Cannot "+r),Uu=(n,i,r)=>(Pb(n,i,"read from private field"),r?r.call(n):i.get(n)),Ib=(n,i,r)=>i.has(n)?Ag("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(n):i.set(n,r),zp="popstate";function Op(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function e0(n={}){function i(s,c){let d=c.state?.masked,{pathname:h,search:m,hash:y}=d||s.location;return pr("",{pathname:h,search:m,hash:y},c.state&&c.state.usr||null,c.state&&c.state.key||"default",d?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function r(s,c){return typeof c=="string"?c:qa(c)}return a0(i,r,null,n)}function De(n,i){if(n===!1||n===null||typeof n>"u")throw new Error(i)}function ft(n,i){if(!n){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function t0(){return Math.random().toString(36).substring(2,10)}function Tp(n,i){return{usr:n.state,key:n.key,idx:i,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function pr(n,i,r=null,s,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof i=="string"?fn(i):i,state:r,key:i&&i.key||s||t0(),unstable_mask:c}}function qa({pathname:n="/",search:i="",hash:r=""}){return i&&i!=="?"&&(n+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(n+=r.charAt(0)==="#"?r:"#"+r),n}function fn(n){let i={};if(n){let r=n.indexOf("#");r>=0&&(i.hash=n.substring(r),n=n.substring(0,r));let s=n.indexOf("?");s>=0&&(i.search=n.substring(s),n=n.substring(0,s)),n&&(i.pathname=n)}return i}function a0(n,i,r,s={}){let{window:c=document.defaultView,v5Compat:d=!1}=s,h=c.history,m="POP",y=null,p=S();p==null&&(p=0,h.replaceState({...h.state,idx:p},""));function S(){return(h.state||{idx:null}).idx}function x(){m="POP";let k=S(),W=k==null?null:k-p;p=k,y&&y({action:m,location:D.location,delta:W})}function _(k,W){m="PUSH";let X=Op(k)?k:pr(D.location,k,W);p=S()+1;let I=Tp(X,p),se=D.createHref(X.unstable_mask||X);try{h.pushState(I,"",se)}catch(de){if(de instanceof DOMException&&de.name==="DataCloneError")throw de;c.location.assign(se)}d&&y&&y({action:m,location:D.location,delta:1})}function N(k,W){m="REPLACE";let X=Op(k)?k:pr(D.location,k,W);p=S();let I=Tp(X,p),se=D.createHref(X.unstable_mask||X);h.replaceState(I,"",se),d&&y&&y({action:m,location:D.location,delta:0})}function z(k){return Lg(k)}let D={get action(){return m},get location(){return n(c,h)},listen(k){if(y)throw new Error("A history only accepts one active listener");return c.addEventListener(zp,x),y=k,()=>{c.removeEventListener(zp,x),y=null}},createHref(k){return i(c,k)},createURL:z,encodeLocation(k){let W=z(k);return{pathname:W.pathname,search:W.search,hash:W.hash}},push:_,replace:N,go(k){return h.go(k)}};return D}function Lg(n,i=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),De(r,"No window.location.(origin|href) available to create URL");let s=typeof n=="string"?n:qa(n);return s=s.replace(/ $/,"%20"),!i&&s.startsWith("//")&&(s=r+s),new URL(s,r)}var cr,Dp=class{constructor(n){if(Ib(this,cr,new Map),n)for(let[i,r]of n)this.set(i,r)}get(n){if(Uu(this,cr).has(n))return Uu(this,cr).get(n);if(n.defaultValue!==void 0)return n.defaultValue;throw new Error("No value found for context")}set(n,i){Uu(this,cr).set(n,i)}};cr=new WeakMap;var n0=new Set(["lazy","caseSensitive","path","id","index","children"]);function l0(n){return n0.has(n)}var i0=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function r0(n){return i0.has(n)}function s0(n){return n.index===!0}function gr(n,i,r=[],s={},c=!1){return n.map((d,h)=>{let m=[...r,String(h)],y=typeof d.id=="string"?d.id:m.join("-");if(De(d.index!==!0||!d.children,"Cannot specify children on an index route"),De(c||!s[y],`Found a route id collision on id "${y}". Route id's must be globally unique within Data Router usages`),s0(d)){let p={...d,id:y};return s[y]=Mp(p,i(p)),p}else{let p={...d,id:y,children:void 0};return s[y]=Mp(p,i(p)),d.children&&(p.children=gr(d.children,i,m,s,c)),p}})}function Mp(n,i){return Object.assign(n,{...i,...typeof i.lazy=="object"&&i.lazy!=null?{lazy:{...n.lazy,...i.lazy}}:{}})}function Gn(n,i,r="/"){return ur(n,i,r,!1)}function ur(n,i,r,s){let c=typeof i=="string"?fn(i):i,d=xa(c.pathname||"/",r);if(d==null)return null;let h=kg(n);c0(h);let m=null;for(let y=0;m==null&&y<h.length;++y){let p=b0(d);m=x0(h[y],p,s)}return m}function o0(n,i){let{route:r,pathname:s,params:c}=n;return{id:r.id,pathname:s,params:c,data:i[r.id],loaderData:i[r.id],handle:r.handle}}function kg(n,i=[],r=[],s="",c=!1){let d=(h,m,y=c,p)=>{let S={relativePath:p===void 0?h.path||"":p,caseSensitive:h.caseSensitive===!0,childrenIndex:m,route:h};if(S.relativePath.startsWith("/")){if(!S.relativePath.startsWith(s)&&y)return;De(S.relativePath.startsWith(s),`Absolute route path "${S.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),S.relativePath=S.relativePath.slice(s.length)}let x=Oa([s,S.relativePath]),_=r.concat(S);h.children&&h.children.length>0&&(De(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),kg(h.children,i,_,x,y)),!(h.path==null&&!h.index)&&i.push({path:x,score:g0(x,h.index),routesMeta:_})};return n.forEach((h,m)=>{if(h.path===""||!h.path?.includes("?"))d(h,m);else for(let y of Ug(h.path))d(h,m,!0,y)}),i}function Ug(n){let i=n.split("/");if(i.length===0)return[];let[r,...s]=i,c=r.endsWith("?"),d=r.replace(/\?$/,"");if(s.length===0)return c?[d,""]:[d];let h=Ug(s.join("/")),m=[];return m.push(...h.map(y=>y===""?d:[d,y].join("/"))),c&&m.push(...h),m.map(y=>n.startsWith("/")&&y===""?"/":y)}function c0(n){n.sort((i,r)=>i.score!==r.score?r.score-i.score:y0(i.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}var u0=/^:[\w-]+$/,d0=3,f0=2,h0=1,m0=10,p0=-2,Ap=n=>n==="*";function g0(n,i){let r=n.split("/"),s=r.length;return r.some(Ap)&&(s+=p0),i&&(s+=f0),r.filter(c=>!Ap(c)).reduce((c,d)=>c+(u0.test(d)?d0:d===""?h0:m0),s)}function y0(n,i){return n.length===i.length&&n.slice(0,-1).every((s,c)=>s===i[c])?n[n.length-1]-i[i.length-1]:0}function x0(n,i,r=!1){let{routesMeta:s}=n,c={},d="/",h=[];for(let m=0;m<s.length;++m){let y=s[m],p=m===s.length-1,S=d==="/"?i:i.slice(d.length)||"/",x=no({path:y.relativePath,caseSensitive:y.caseSensitive,end:p},S),_=y.route;if(!x&&p&&r&&!s[s.length-1].route.index&&(x=no({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},S)),!x)return null;Object.assign(c,x.params),h.push({params:c,pathname:Oa([d,x.pathname]),pathnameBase:j0(Oa([d,x.pathnameBase])),route:_}),x.pathnameBase!=="/"&&(d=Oa([d,x.pathnameBase]))}return h}function no(n,i){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[r,s]=v0(n.path,n.caseSensitive,n.end),c=i.match(r);if(!c)return null;let d=c[0],h=d.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:s.reduce((p,{paramName:S,isOptional:x},_)=>{if(S==="*"){let z=m[_]||"";h=d.slice(0,d.length-z.length).replace(/(.)\/+$/,"$1")}const N=m[_];return x&&!N?p[S]=void 0:p[S]=(N||"").replace(/%2F/g,"/"),p},{}),pathname:d,pathnameBase:h,pattern:n}}function v0(n,i=!1,r=!0){ft(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let s=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,y,p,S)=>{if(s.push({paramName:m,isOptional:y!=null}),y){let x=S.charAt(p+h.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(s.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,i?void 0:"i"),s]}function b0(n){try{return n.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return ft(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),n}}function xa(n,i){if(i==="/")return n;if(!n.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,s=n.charAt(r);return s&&s!=="/"?null:n.slice(r)||"/"}function S0({basename:n,pathname:i}){return i==="/"?n:Oa([n,i])}var Hg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,td=n=>Hg.test(n);function _0(n,i="/"){let{pathname:r,search:s="",hash:c=""}=typeof n=="string"?fn(n):n,d;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?d=Lp(r.substring(1),"/"):d=Lp(r,i)):d=i,{pathname:d,search:N0(s),hash:E0(c)}}function Lp(n,i){let r=i.replace(/\/+$/,"").split("/");return n.split("/").forEach(c=>{c===".."?r.length>1&&r.pop():c!=="."&&r.push(c)}),r.length>1?r.join("/"):"/"}function Hu(n,i,r,s){return`Cannot include a '${n}' character in a manually specified \`to.${i}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Bg(n){return n.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function so(n){let i=Bg(n);return i.map((r,s)=>s===i.length-1?r.pathname:r.pathnameBase)}function vr(n,i,r,s=!1){let c;typeof n=="string"?c=fn(n):(c={...n},De(!c.pathname||!c.pathname.includes("?"),Hu("?","pathname","search",c)),De(!c.pathname||!c.pathname.includes("#"),Hu("#","pathname","hash",c)),De(!c.search||!c.search.includes("#"),Hu("#","search","hash",c)));let d=n===""||c.pathname==="",h=d?"/":c.pathname,m;if(h==null)m=r;else{let x=i.length-1;if(!s&&h.startsWith("..")){let _=h.split("/");for(;_[0]==="..";)_.shift(),x-=1;c.pathname=_.join("/")}m=x>=0?i[x]:"/"}let y=_0(c,m),p=h&&h!=="/"&&h.endsWith("/"),S=(d||h===".")&&r.endsWith("/");return!y.pathname.endsWith("/")&&(p||S)&&(y.pathname+="/"),y}var Oa=n=>n.join("/").replace(/\/\/+/g,"/"),j0=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),N0=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,E0=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,br=class{constructor(n,i,r,s=!1){this.status=n,this.statusText=i||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function yr(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Sr(n){return n.map(i=>i.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var qg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Yg(n,i){let r=n;if(typeof r!="string"||!Hg.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let s=r,c=!1;if(qg)try{let d=new URL(window.location.href),h=r.startsWith("//")?new URL(d.protocol+r):new URL(r),m=xa(h.pathname,i);h.origin===d.origin&&m!=null?r=m+h.search+h.hash:c=!0}catch{ft(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:c,to:r}}var $n=Symbol("Uninstrumented");function w0(n,i){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};n.forEach(c=>c({id:i.id,index:i.index,path:i.path,instrument(d){let h=Object.keys(r);for(let m of h)d[m]&&r[m].push(d[m])}}));let s={};if(typeof i.lazy=="function"&&r.lazy.length>0){let c=si(r.lazy,i.lazy,()=>{});c&&(s.lazy=c)}if(typeof i.lazy=="object"){let c=i.lazy;["middleware","loader","action"].forEach(d=>{let h=c[d],m=r[`lazy.${d}`];if(typeof h=="function"&&m.length>0){let y=si(m,h,()=>{});y&&(s.lazy=Object.assign(s.lazy||{},{[d]:y}))}})}return["loader","action"].forEach(c=>{let d=i[c];if(typeof d=="function"&&r[c].length>0){let h=d[$n]??d,m=si(r[c],h,(...y)=>kp(y[0]));m&&(c==="loader"&&h.hydrate===!0&&(m.hydrate=!0),m[$n]=h,s[c]=m)}}),i.middleware&&i.middleware.length>0&&r.middleware.length>0&&(s.middleware=i.middleware.map(c=>{let d=c[$n]??c,h=si(r.middleware,d,(...m)=>kp(m[0]));return h?(h[$n]=d,h):c})),s}function C0(n,i){let r={navigate:[],fetch:[]};if(i.forEach(s=>s({instrument(c){let d=Object.keys(c);for(let h of d)c[h]&&r[h].push(c[h])}})),r.navigate.length>0){let s=n.navigate[$n]??n.navigate,c=si(r.navigate,s,(...d)=>{let[h,m]=d;return{to:typeof h=="number"||typeof h=="string"?h:h?qa(h):".",...Up(n,m??{})}});c&&(c[$n]=s,n.navigate=c)}if(r.fetch.length>0){let s=n.fetch[$n]??n.fetch,c=si(r.fetch,s,(...d)=>{let[h,,m,y]=d;return{href:m??".",fetcherKey:h,...Up(n,y??{})}});c&&(c[$n]=s,n.fetch=c)}return n}function si(n,i,r){return n.length===0?null:async(...s)=>{let c=await Vg(n,r(...s),()=>i(...s),n.length-1);if(c.type==="error")throw c.value;return c.value}}async function Vg(n,i,r,s){let c=n[s],d;if(c){let h,m=async()=>(h?console.error("You cannot call instrumented handlers more than once"):h=Vg(n,i,r,s-1),d=await h,De(d,"Expected a result"),d.type==="error"&&d.value instanceof Error?{status:"error",error:d.value}:{status:"success",error:void 0});try{await c(m,i)}catch(y){console.error("An instrumentation function threw an error:",y)}h||await m(),await h}else try{d={type:"success",value:await r()}}catch(h){d={type:"error",value:h}}return d||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function kp(n){let{request:i,context:r,params:s,unstable_pattern:c}=n;return{request:R0(i),params:{...s},unstable_pattern:c,context:z0(r)}}function Up(n,i){return{currentUrl:qa(n.state.location),..."formMethod"in i?{formMethod:i.formMethod}:{},..."formEncType"in i?{formEncType:i.formEncType}:{},..."formData"in i?{formData:i.formData}:{},..."body"in i?{body:i.body}:{}}}function R0(n){return{method:n.method,url:n.url,headers:{get:(...i)=>n.headers.get(...i)}}}function z0(n){if(T0(n)){let i={...n};return Object.freeze(i),i}else return{get:i=>n.get(i)}}var O0=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function T0(n){if(n===null||typeof n!="object")return!1;const i=Object.getPrototypeOf(n);return i===Object.prototype||i===null||Object.getOwnPropertyNames(i).sort().join("\0")===O0}var Gg=["POST","PUT","PATCH","DELETE"],D0=new Set(Gg),M0=["GET",...Gg],A0=new Set(M0),Kg=new Set([301,302,303,307,308]),L0=new Set([307,308]),Bu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},k0={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ir={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},U0=n=>({hasErrorBoundary:!!n.hasErrorBoundary}),$g="remix-router-transitions",Xg=Symbol("ResetLoaderData");function H0(n){const i=n.window?n.window:typeof window<"u"?window:void 0,r=typeof i<"u"&&typeof i.document<"u"&&typeof i.document.createElement<"u";De(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=n.hydrationRouteProperties||[],c=n.mapRouteProperties||U0,d=c;if(n.unstable_instrumentations){let C=n.unstable_instrumentations;d=O=>({...c(O),...w0(C.map(H=>H.route).filter(Boolean),O)})}let h={},m=gr(n.routes,d,void 0,h),y,p=n.basename||"/";p.startsWith("/")||(p=`/${p}`);let S=n.dataStrategy||G0,x={...n.future},_=null,N=new Set,z=null,D=null,k=null,W=n.hydrationData!=null,X=Gn(m,n.history.location,p),I=!1,se=null,de,V;if(X==null&&!n.patchRoutesOnNavigation){let C=ya(404,{pathname:n.history.location.pathname}),{matches:O,route:H}=Ks(m);de=!0,V=!de,X=O,se={[H.id]:C}}else if(X&&!n.hydrationData&&yn(X,m,n.history.location.pathname).active&&(X=null),X)if(X.some(C=>C.route.lazy))de=!1,V=!de;else if(!X.some(C=>ad(C.route)))de=!0,V=!de;else{let C=n.hydrationData?n.hydrationData.loaderData:null,O=n.hydrationData?n.hydrationData.errors:null,H=X;if(O){let te=X.findIndex(re=>O[re.route.id]!==void 0);H=H.slice(0,te+1)}V=!1,de=H.every(te=>{let re=Qg(te.route,C,O);return V=V||re.renderFallback,!re.shouldLoad})}else{de=!1,V=!de,X=[];let C=yn(null,m,n.history.location.pathname);C.active&&C.matches&&(I=!0,X=C.matches)}let B,E={historyAction:n.history.action,location:n.history.location,matches:X,initialized:de,renderFallback:V,navigation:Bu,restoreScrollPosition:n.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:n.hydrationData&&n.hydrationData.loaderData||{},actionData:n.hydrationData&&n.hydrationData.actionData||null,errors:n.hydrationData&&n.hydrationData.errors||se,fetchers:new Map,blockers:new Map},$="POP",ne=null,ae=!1,Q,xe=!1,F=new Map,ie=null,M=!1,P=!1,ue=new Set,ce=new Map,ee=0,j=-1,q=new Map,G=new Set,le=new Map,ge=new Map,je=new Set,Ne=new Map,et,Ke=null;function Va(){if(_=n.history.listen(({action:C,location:O,delta:H})=>{if(et){et(),et=void 0;return}ft(Ne.size===0||H!=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 te=Fn({currentLocation:E.location,nextLocation:O,historyAction:C});if(te&&H!=null){let re=new Promise(me=>{et=me});n.history.go(H*-1),$a(te,{state:"blocked",location:O,proceed(){$a(te,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),re.then(()=>n.history.go(H))},reset(){let me=new Map(E.blockers);me.set(te,ir),ht({blockers:me})}}),ne?.resolve(),ne=null;return}return Sa(C,O)}),r){s1(i,F);let C=()=>o1(i,F);i.addEventListener("pagehide",C),ie=()=>i.removeEventListener("pagehide",C)}return E.initialized||Sa("POP",E.location,{initialHydration:!0}),B}function Ga(){_&&_(),ie&&ie(),N.clear(),Q&&Q.abort(),E.fetchers.forEach((C,O)=>Ka(O)),E.blockers.forEach((C,O)=>Zn(O))}function hn(C){return N.add(C),()=>N.delete(C)}function ht(C,O={}){C.matches&&(C.matches=C.matches.map(re=>{let me=h[re.route.id],oe=re.route;return oe.element!==me.element||oe.errorElement!==me.errorElement||oe.hydrateFallbackElement!==me.hydrateFallbackElement?{...re,route:me}:re})),E={...E,...C};let H=[],te=[];E.fetchers.forEach((re,me)=>{re.state==="idle"&&(je.has(me)?H.push(me):te.push(me))}),je.forEach(re=>{!E.fetchers.has(re)&&!ce.has(re)&&H.push(re)}),[...N].forEach(re=>re(E,{deletedFetchers:H,newErrors:C.errors??null,viewTransitionOpts:O.viewTransitionOpts,flushSync:O.flushSync===!0})),H.forEach(re=>Ka(re)),te.forEach(re=>E.fetchers.delete(re))}function At(C,O,{flushSync:H}={}){let te=E.actionData!=null&&E.navigation.formMethod!=null&&Ht(E.navigation.formMethod)&&E.navigation.state==="loading"&&C.state?._isRedirect!==!0,re;O.actionData?Object.keys(O.actionData).length>0?re=O.actionData:re=null:te?re=E.actionData:re=null;let me=O.loaderData?Qp(E.loaderData,O.loaderData,O.matches||[],O.errors):E.loaderData,oe=E.blockers;oe.size>0&&(oe=new Map(oe),oe.forEach((_e,ve)=>oe.set(ve,ir)));let fe=M?!1:mi(C,O.matches||E.matches),he=ae===!0||E.navigation.formMethod!=null&&Ht(E.navigation.formMethod)&&C.state?._isRedirect!==!0;y&&(m=y,y=void 0),M||$==="POP"||($==="PUSH"?n.history.push(C,C.state):$==="REPLACE"&&n.history.replace(C,C.state));let be;if($==="POP"){let _e=F.get(E.location.pathname);_e&&_e.has(C.pathname)?be={currentLocation:E.location,nextLocation:C}:F.has(C.pathname)&&(be={currentLocation:C,nextLocation:E.location})}else if(xe){let _e=F.get(E.location.pathname);_e?_e.add(C.pathname):(_e=new Set([C.pathname]),F.set(E.location.pathname,_e)),be={currentLocation:E.location,nextLocation:C}}ht({...O,actionData:re,loaderData:me,historyAction:$,location:C,initialized:!0,renderFallback:!1,navigation:Bu,revalidation:"idle",restoreScrollPosition:fe,preventScrollReset:he,blockers:oe},{viewTransitionOpts:be,flushSync:H===!0}),$="POP",ae=!1,xe=!1,M=!1,P=!1,ne?.resolve(),ne=null,Ke?.resolve(),Ke=null}async function mn(C,O){if(ne?.resolve(),ne=null,typeof C=="number"){ne||(ne=Wp());let tt=ne.promise;return n.history.go(C),tt}let H=Ju(E.location,E.matches,p,C,O?.fromRouteId,O?.relative),{path:te,submission:re,error:me}=Hp(!1,H,O),oe;O?.unstable_mask&&(oe={pathname:"",search:"",hash:"",...typeof O.unstable_mask=="string"?fn(O.unstable_mask):{...E.location.unstable_mask,...O.unstable_mask}});let fe=E.location,he=pr(fe,te,O&&O.state,void 0,oe);he={...he,...n.history.encodeLocation(he)};let be=O&&O.replace!=null?O.replace:void 0,_e="PUSH";be===!0?_e="REPLACE":be===!1||re!=null&&Ht(re.formMethod)&&re.formAction===E.location.pathname+E.location.search&&(_e="REPLACE");let ve=O&&"preventScrollReset"in O?O.preventScrollReset===!0:void 0,$e=(O&&O.flushSync)===!0,Ae=Fn({currentLocation:fe,nextLocation:he,historyAction:_e});if(Ae){$a(Ae,{state:"blocked",location:he,proceed(){$a(Ae,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),mn(C,O)},reset(){let tt=new Map(E.blockers);tt.set(Ae,ir),ht({blockers:tt})}});return}await Sa(_e,he,{submission:re,pendingError:me,preventScrollReset:ve,replace:O&&O.replace,enableViewTransition:O&&O.viewTransition,flushSync:$e,callSiteDefaultShouldRevalidate:O&&O.unstable_defaultShouldRevalidate})}function Qn(){Ke||(Ke=Wp()),pn(),ht({revalidation:"loading"});let C=Ke.promise;return E.navigation.state==="submitting"?C:E.navigation.state==="idle"?(Sa(E.historyAction,E.location,{startUninterruptedRevalidation:!0}),C):(Sa($||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:xe===!0}),C)}async function Sa(C,O,H){Q&&Q.abort(),Q=null,$=C,M=(H&&H.startUninterruptedRevalidation)===!0,vo(E.location,E.matches),ae=(H&&H.preventScrollReset)===!0,xe=(H&&H.enableViewTransition)===!0;let te=y||m,re=H&&H.overrideNavigation,me=H?.initialHydration&&E.matches&&E.matches.length>0&&!I?E.matches:Gn(te,O,p),oe=(H&&H.flushSync)===!0;if(me&&E.initialized&&!P&&W0(E.location,O)&&!(H&&H.submission&&Ht(H.submission.formMethod))){At(O,{matches:me},{flushSync:oe});return}let fe=yn(me,te,O.pathname);if(fe.active&&fe.matches&&(me=fe.matches),!me){let{error:lt,notFoundMatches:ct,route:Ge}=Ea(O.pathname);At(O,{matches:ct,loaderData:{},errors:{[Ge.id]:lt}},{flushSync:oe});return}Q=new AbortController;let he=ii(n.history,O,Q.signal,H&&H.submission),be=n.getContext?await n.getContext():new Dp,_e;if(H&&H.pendingError)_e=[Kn(me).route.id,{type:"error",error:H.pendingError}];else if(H&&H.submission&&Ht(H.submission.formMethod)){let lt=await vl(he,O,H.submission,me,be,fe.active,H&&H.initialHydration===!0,{replace:H.replace,flushSync:oe});if(lt.shortCircuited)return;if(lt.pendingActionResult){let[ct,Ge]=lt.pendingActionResult;if(na(Ge)&&yr(Ge.error)&&Ge.error.status===404){Q=null,At(O,{matches:lt.matches,loaderData:{},errors:{[ct]:Ge.error}});return}}me=lt.matches||me,_e=lt.pendingActionResult,re=qu(O,H.submission),oe=!1,fe.active=!1,he=ii(n.history,he.url,he.signal)}let{shortCircuited:ve,matches:$e,loaderData:Ae,errors:tt}=await Ce(he,O,me,be,fe.active,re,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,oe,_e,H&&H.callSiteDefaultShouldRevalidate);ve||(Q=null,At(O,{matches:$e||me,...Zp(_e),loaderData:Ae,errors:tt}))}async function vl(C,O,H,te,re,me,oe,fe={}){pn();let he=i1(O,H);if(ht({navigation:he},{flushSync:fe.flushSync===!0}),me){let ve=await Da(te,O.pathname,C.signal);if(ve.type==="aborted")return{shortCircuited:!0};if(ve.type==="error"){if(ve.partialMatches.length===0){let{matches:Ae,route:tt}=Ks(m);return{matches:Ae,pendingActionResult:[tt.id,{type:"error",error:ve.error}]}}let $e=Kn(ve.partialMatches).route.id;return{matches:ve.partialMatches,pendingActionResult:[$e,{type:"error",error:ve.error}]}}else if(ve.matches)te=ve.matches;else{let{notFoundMatches:$e,error:Ae,route:tt}=Ea(O.pathname);return{matches:$e,pendingActionResult:[tt.id,{type:"error",error:Ae}]}}}let be,_e=Js(te,O);if(!_e.route.action&&!_e.route.lazy)be={type:"error",error:ya(405,{method:C.method,pathname:O.pathname,routeId:_e.route.id})};else{let ve=oi(d,h,C,te,_e,oe?[]:s,re),$e=await yt(C,ve,re,null);if(be=$e[_e.route.id],!be){for(let Ae of te)if($e[Ae.route.id]){be=$e[Ae.route.id];break}}if(C.signal.aborted)return{shortCircuited:!0}}if(pl(be)){let ve;return fe&&fe.replace!=null?ve=fe.replace:ve=Kp(be.response.headers.get("Location"),new URL(C.url),p,n.history)===E.location.pathname+E.location.search,await ja(C,be,!0,{submission:H,replace:ve}),{shortCircuited:!0}}if(na(be)){let ve=Kn(te,_e.route.id);return(fe&&fe.replace)!==!0&&($="PUSH"),{matches:te,pendingActionResult:[ve.route.id,be,_e.route.id]}}return{matches:te,pendingActionResult:[_e.route.id,be]}}async function Ce(C,O,H,te,re,me,oe,fe,he,be,_e,ve,$e){let Ae=me||qu(O,oe),tt=oe||fe||Jp(Ae),lt=!M&&!be;if(re){if(lt){let mt=Ve(ve);ht({navigation:Ae,...mt!==void 0?{actionData:mt}:{}},{flushSync:_e})}let Le=await Da(H,O.pathname,C.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){if(Le.partialMatches.length===0){let{matches:kt,route:xt}=Ks(m);return{matches:kt,loaderData:{},errors:{[xt.id]:Le.error}}}let mt=Kn(Le.partialMatches).route.id;return{matches:Le.partialMatches,loaderData:{},errors:{[mt]:Le.error}}}else if(Le.matches)H=Le.matches;else{let{error:mt,notFoundMatches:kt,route:xt}=Ea(O.pathname);return{matches:kt,loaderData:{},errors:{[xt.id]:mt}}}}let ct=y||m,{dsMatches:Ge,revalidatingFetchers:jt}=Bp(C,te,d,h,n.history,E,H,tt,O,be?[]:s,be===!0,P,ue,je,le,G,ct,p,n.patchRoutesOnNavigation!=null,ve,$e);if(j=++ee,!n.dataStrategy&&!Ge.some(Le=>Le.shouldLoad)&&!Ge.some(Le=>Le.route.middleware&&Le.route.middleware.length>0)&&jt.length===0){let Le=Cr();return At(O,{matches:H,loaderData:{},errors:ve&&na(ve[1])?{[ve[0]]:ve[1].error}:null,...Zp(ve),...Le?{fetchers:new Map(E.fetchers)}:{}},{flushSync:_e}),{shortCircuited:!0}}if(lt){let Le={};if(!re){Le.navigation=Ae;let mt=Ve(ve);mt!==void 0&&(Le.actionData=mt)}jt.length>0&&(Le.fetchers=He(jt)),ht(Le,{flushSync:_e})}jt.forEach(Le=>{Et(Le.key),Le.controller&&ce.set(Le.key,Le.controller)});let nt=()=>jt.forEach(Le=>Et(Le.key));Q&&Q.signal.addEventListener("abort",nt);let{loaderResults:xn,fetcherResults:wa}=await hi(Ge,jt,C,te);if(C.signal.aborted)return{shortCircuited:!0};Q&&Q.signal.removeEventListener("abort",nt),jt.forEach(Le=>ce.delete(Le.key));let wt=$s(xn);if(wt)return await ja(C,wt.result,!0,{replace:he}),{shortCircuited:!0};if(wt=$s(wa),wt)return G.add(wt.key),await ja(C,wt.result,!0,{replace:he}),{shortCircuited:!0};let{loaderData:Ma,errors:Jn}=Xp(E,H,xn,ve,jt,wa);be&&E.errors&&(Jn={...E.errors,...Jn});let Aa=Cr(),Wn=Rr(j),Sl=Aa||Wn||jt.length>0;return{matches:H,loaderData:Ma,errors:Jn,...Sl?{fetchers:new Map(E.fetchers)}:{}}}function Ve(C){if(C&&!na(C[1]))return{[C[0]]:C[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function He(C){return C.forEach(O=>{let H=E.fetchers.get(O.key),te=rr(void 0,H?H.data:void 0);E.fetchers.set(O.key,te)}),new Map(E.fetchers)}async function _a(C,O,H,te){Et(C);let re=(te&&te.flushSync)===!0,me=y||m,oe=Ju(E.location,E.matches,p,H,O,te?.relative),fe=Gn(me,oe,p),he=yn(fe,me,oe);if(he.active&&he.matches&&(fe=he.matches),!fe){sa(C,O,ya(404,{pathname:oe}),{flushSync:re});return}let{path:be,submission:_e,error:ve}=Hp(!0,oe,te);if(ve){sa(C,O,ve,{flushSync:re});return}let $e=n.getContext?await n.getContext():new Dp,Ae=(te&&te.preventScrollReset)===!0;if(_e&&Ht(_e.formMethod)){await fi(C,O,be,fe,$e,he.active,re,Ae,_e,te&&te.unstable_defaultShouldRevalidate);return}le.set(C,{routeId:O,path:be}),await Rt(C,O,be,fe,$e,he.active,re,Ae,_e)}async function fi(C,O,H,te,re,me,oe,fe,he,be){pn(),le.delete(C);let _e=E.fetchers.get(C);Na(C,r1(he,_e),{flushSync:oe});let ve=new AbortController,$e=ii(n.history,H,ve.signal,he);if(me){let it=await Da(te,new URL($e.url).pathname,$e.signal,C);if(it.type==="aborted")return;if(it.type==="error"){sa(C,O,it.error,{flushSync:oe});return}else if(it.matches)te=it.matches;else{sa(C,O,ya(404,{pathname:H}),{flushSync:oe});return}}let Ae=Js(te,H);if(!Ae.route.action&&!Ae.route.lazy){let it=ya(405,{method:he.formMethod,pathname:H,routeId:O});sa(C,O,it,{flushSync:oe});return}ce.set(C,ve);let tt=ee,lt=oi(d,h,$e,te,Ae,s,re),ct=await yt($e,lt,re,C),Ge=ct[Ae.route.id];if(!Ge){for(let it of lt)if(ct[it.route.id]){Ge=ct[it.route.id];break}}if($e.signal.aborted){ce.get(C)===ve&&ce.delete(C);return}if(je.has(C)){if(pl(Ge)||na(Ge)){Na(C,un(void 0));return}}else{if(pl(Ge))if(ce.delete(C),j>tt){Na(C,un(void 0));return}else return G.add(C),Na(C,rr(he)),ja($e,Ge,!1,{fetcherSubmission:he,preventScrollReset:fe});if(na(Ge)){sa(C,O,Ge.error);return}}let jt=E.navigation.location||E.location,nt=ii(n.history,jt,ve.signal),xn=y||m,wa=E.navigation.state!=="idle"?Gn(xn,E.navigation.location,p):E.matches;De(wa,"Didn't find any matches after fetcher action");let wt=++ee;q.set(C,wt);let Ma=rr(he,Ge.data);E.fetchers.set(C,Ma);let{dsMatches:Jn,revalidatingFetchers:Aa}=Bp(nt,re,d,h,n.history,E,wa,he,jt,s,!1,P,ue,je,le,G,xn,p,n.patchRoutesOnNavigation!=null,[Ae.route.id,Ge],be);Aa.filter(it=>it.key!==C).forEach(it=>{let _l=it.key,jl=E.fetchers.get(_l),Dr=rr(void 0,jl?jl.data:void 0);E.fetchers.set(_l,Dr),Et(_l),it.controller&&ce.set(_l,it.controller)}),ht({fetchers:new Map(E.fetchers)});let Wn=()=>Aa.forEach(it=>Et(it.key));ve.signal.addEventListener("abort",Wn);let{loaderResults:Sl,fetcherResults:Le}=await hi(Jn,Aa,nt,re);if(ve.signal.aborted)return;if(ve.signal.removeEventListener("abort",Wn),q.delete(C),ce.delete(C),Aa.forEach(it=>ce.delete(it.key)),E.fetchers.has(C)){let it=un(Ge.data);E.fetchers.set(C,it)}let mt=$s(Sl);if(mt)return ja(nt,mt.result,!1,{preventScrollReset:fe});if(mt=$s(Le),mt)return G.add(mt.key),ja(nt,mt.result,!1,{preventScrollReset:fe});let{loaderData:kt,errors:xt}=Xp(E,wa,Sl,void 0,Aa,Le);Rr(wt),E.navigation.state==="loading"&&wt>j?(De($,"Expected pending action"),Q&&Q.abort(),At(E.navigation.location,{matches:wa,loaderData:kt,errors:xt,fetchers:new Map(E.fetchers)})):(ht({errors:xt,loaderData:Qp(E.loaderData,kt,wa,xt),fetchers:new Map(E.fetchers)}),P=!1)}async function Rt(C,O,H,te,re,me,oe,fe,he){let be=E.fetchers.get(C);Na(C,rr(he,be?be.data:void 0),{flushSync:oe});let _e=new AbortController,ve=ii(n.history,H,_e.signal);if(me){let Ge=await Da(te,new URL(ve.url).pathname,ve.signal,C);if(Ge.type==="aborted")return;if(Ge.type==="error"){sa(C,O,Ge.error,{flushSync:oe});return}else if(Ge.matches)te=Ge.matches;else{sa(C,O,ya(404,{pathname:H}),{flushSync:oe});return}}let $e=Js(te,H);ce.set(C,_e);let Ae=ee,tt=oi(d,h,ve,te,$e,s,re),ct=(await yt(ve,tt,re,C))[$e.route.id];if(ce.get(C)===_e&&ce.delete(C),!ve.signal.aborted){if(je.has(C)){Na(C,un(void 0));return}if(pl(ct))if(j>Ae){Na(C,un(void 0));return}else{G.add(C),await ja(ve,ct,!1,{preventScrollReset:fe});return}if(na(ct)){sa(C,O,ct.error);return}Na(C,un(ct.data))}}async function ja(C,O,H,{submission:te,fetcherSubmission:re,preventScrollReset:me,replace:oe}={}){H||(ne?.resolve(),ne=null),O.response.headers.has("X-Remix-Revalidate")&&(P=!0);let fe=O.response.headers.get("Location");De(fe,"Expected a Location header on the redirect Response"),fe=Kp(fe,new URL(C.url),p,n.history);let he=pr(E.location,fe,{_isRedirect:!0});if(r){let tt=!1;if(O.response.headers.has("X-Remix-Reload-Document"))tt=!0;else if(td(fe)){const lt=Lg(fe,!0);tt=lt.origin!==i.location.origin||xa(lt.pathname,p)==null}if(tt){oe?i.location.replace(fe):i.location.assign(fe);return}}Q=null;let be=oe===!0||O.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:_e,formAction:ve,formEncType:$e}=E.navigation;!te&&!re&&_e&&ve&&$e&&(te=Jp(E.navigation));let Ae=te||re;if(L0.has(O.response.status)&&Ae&&Ht(Ae.formMethod))await Sa(be,he,{submission:{...Ae,formAction:fe},preventScrollReset:me||ae,enableViewTransition:H?xe:void 0});else{let tt=qu(he,te);await Sa(be,he,{overrideNavigation:tt,fetcherSubmission:re,preventScrollReset:me||ae,enableViewTransition:H?xe:void 0})}}async function yt(C,O,H,te){let re,me={};try{re=await $0(S,C,O,te,H,!1)}catch(oe){return O.filter(fe=>fe.shouldLoad).forEach(fe=>{me[fe.route.id]={type:"error",error:oe}}),me}if(C.signal.aborted)return me;if(!Ht(C.method))for(let oe of O){if(re[oe.route.id]?.type==="error")break;!re.hasOwnProperty(oe.route.id)&&!E.loaderData.hasOwnProperty(oe.route.id)&&(!E.errors||!E.errors.hasOwnProperty(oe.route.id))&&oe.shouldCallHandler()&&(re[oe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${oe.route.id}`)})}for(let[oe,fe]of Object.entries(re))if(t1(fe)){let he=fe.result;me[oe]={type:"redirect",response:F0(he,C,oe,O,p)}}else me[oe]=await Z0(fe);return me}async function hi(C,O,H,te){let re=yt(H,C,te,null),me=Promise.all(O.map(async he=>{if(he.matches&&he.match&&he.request&&he.controller){let _e=(await yt(he.request,he.matches,te,he.key))[he.match.route.id];return{[he.key]:_e}}else return Promise.resolve({[he.key]:{type:"error",error:ya(404,{pathname:he.path})}})})),oe=await re,fe=(await me).reduce((he,be)=>Object.assign(he,be),{});return{loaderResults:oe,fetcherResults:fe}}function pn(){P=!0,le.forEach((C,O)=>{ce.has(O)&&ue.add(O),Et(O)})}function Na(C,O,H={}){E.fetchers.set(C,O),ht({fetchers:new Map(E.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function sa(C,O,H,te={}){let re=Kn(E.matches,O);Ka(C),ht({errors:{[re.route.id]:H},fetchers:new Map(E.fetchers)},{flushSync:(te&&te.flushSync)===!0})}function wr(C){return ge.set(C,(ge.get(C)||0)+1),je.has(C)&&je.delete(C),E.fetchers.get(C)||k0}function yo(C,O){Et(C,O?.reason),Na(C,un(null))}function Ka(C){let O=E.fetchers.get(C);ce.has(C)&&!(O&&O.state==="loading"&&q.has(C))&&Et(C),le.delete(C),q.delete(C),G.delete(C),je.delete(C),ue.delete(C),E.fetchers.delete(C)}function qt(C){let O=(ge.get(C)||0)-1;O<=0?(ge.delete(C),je.add(C)):ge.set(C,O),ht({fetchers:new Map(E.fetchers)})}function Et(C,O){let H=ce.get(C);H&&(H.abort(O),ce.delete(C))}function Lt(C){for(let O of C){let H=wr(O),te=un(H.data);E.fetchers.set(O,te)}}function Cr(){let C=[],O=!1;for(let H of G){let te=E.fetchers.get(H);De(te,`Expected fetcher: ${H}`),te.state==="loading"&&(G.delete(H),C.push(H),O=!0)}return Lt(C),O}function Rr(C){let O=[];for(let[H,te]of q)if(te<C){let re=E.fetchers.get(H);De(re,`Expected fetcher: ${H}`),re.state==="loading"&&(Et(H),q.delete(H),O.push(H))}return Lt(O),O.length>0}function xo(C,O){let H=E.blockers.get(C)||ir;return Ne.get(C)!==O&&Ne.set(C,O),H}function Zn(C){E.blockers.delete(C),Ne.delete(C)}function $a(C,O){let H=E.blockers.get(C)||ir;De(H.state==="unblocked"&&O.state==="blocked"||H.state==="blocked"&&O.state==="blocked"||H.state==="blocked"&&O.state==="proceeding"||H.state==="blocked"&&O.state==="unblocked"||H.state==="proceeding"&&O.state==="unblocked",`Invalid blocker state transition: ${H.state} -> ${O.state}`);let te=new Map(E.blockers);te.set(C,O),ht({blockers:te})}function Fn({currentLocation:C,nextLocation:O,historyAction:H}){if(Ne.size===0)return;Ne.size>1&&ft(!1,"A router only supports one blocker at a time");let te=Array.from(Ne.entries()),[re,me]=te[te.length-1],oe=E.blockers.get(re);if(!(oe&&oe.state==="proceeding")&&me({currentLocation:C,nextLocation:O,historyAction:H}))return re}function Ea(C){let O=ya(404,{pathname:C}),H=y||m,{matches:te,route:re}=Ks(H);return{notFoundMatches:te,route:re,error:O}}function bl(C,O,H){if(z=C,k=O,D=H||null,!W&&E.navigation===Bu){W=!0;let te=mi(E.location,E.matches);te!=null&&ht({restoreScrollPosition:te})}return()=>{z=null,k=null,D=null}}function gn(C,O){return D&&D(C,O.map(te=>o0(te,E.loaderData)))||C.key}function vo(C,O){if(z&&k){let H=gn(C,O);z[H]=k()}}function mi(C,O){if(z){let H=gn(C,O),te=z[H];if(typeof te=="number")return te}return null}function yn(C,O,H){if(n.patchRoutesOnNavigation)if(C){if(Object.keys(C[0].params).length>0)return{active:!0,matches:ur(O,H,p,!0)}}else return{active:!0,matches:ur(O,H,p,!0)||[]};return{active:!1,matches:null}}async function Da(C,O,H,te){if(!n.patchRoutesOnNavigation)return{type:"success",matches:C};let re=C;for(;;){let me=y==null,oe=y||m,fe=h;try{await n.patchRoutesOnNavigation({signal:H,path:O,matches:re,fetcherKey:te,patch:(_e,ve)=>{H.aborted||qp(_e,ve,oe,fe,d,!1)}})}catch(_e){return{type:"error",error:_e,partialMatches:re}}finally{me&&!H.aborted&&(m=[...m])}if(H.aborted)return{type:"aborted"};let he=Gn(oe,O,p),be=null;if(he){if(Object.keys(he[0].params).length===0)return{type:"success",matches:he};if(be=ur(oe,O,p,!0),!(be&&re.length<be.length&&zr(re,be.slice(0,re.length))))return{type:"success",matches:he}}if(be||(be=ur(oe,O,p,!0)),!be||zr(re,be))return{type:"success",matches:null};re=be}}function zr(C,O){return C.length===O.length&&C.every((H,te)=>H.route.id===O[te].route.id)}function Or(C){h={},y=gr(C,d,void 0,h)}function Tr(C,O,H=!1){let te=y==null;qp(C,O,y||m,h,d,H),te&&(m=[...m],ht({}))}return B={get basename(){return p},get future(){return x},get state(){return E},get routes(){return m},get window(){return i},initialize:Va,subscribe:hn,enableScrollRestoration:bl,navigate:mn,fetch:_a,revalidate:Qn,createHref:C=>n.history.createHref(C),encodeLocation:C=>n.history.encodeLocation(C),getFetcher:wr,resetFetcher:yo,deleteFetcher:qt,dispose:Ga,getBlocker:xo,deleteBlocker:Zn,patchRoutes:Tr,_internalFetchControllers:ce,_internalSetRoutes:Or,_internalSetStateDoNotUseOrYouWillBreakYourApp(C){ht(C)}},n.unstable_instrumentations&&(B=C0(B,n.unstable_instrumentations.map(C=>C.router).filter(Boolean))),B}function B0(n){return n!=null&&("formData"in n&&n.formData!=null||"body"in n&&n.body!==void 0)}function Ju(n,i,r,s,c,d){let h,m;if(c){h=[];for(let p of i)if(h.push(p),p.route.id===c){m=p;break}}else h=i,m=i[i.length-1];let y=vr(s||".",so(h),xa(n.pathname,r)||n.pathname,d==="path");if(s==null&&(y.search=n.search,y.hash=n.hash),(s==null||s===""||s===".")&&m){let p=ld(y.search);if(m.route.index&&!p)y.search=y.search?y.search.replace(/^\?/,"?index&"):"?index";else if(!m.route.index&&p){let S=new URLSearchParams(y.search),x=S.getAll("index");S.delete("index"),x.filter(N=>N).forEach(N=>S.append("index",N));let _=S.toString();y.search=_?`?${_}`:""}}return r!=="/"&&(y.pathname=S0({basename:r,pathname:y.pathname})),qa(y)}function Hp(n,i,r){if(!r||!B0(r))return{path:i};if(r.formMethod&&!l1(r.formMethod))return{path:i,error:ya(405,{method:r.formMethod})};let s=()=>({path:i,error:ya(400,{type:"invalid-body"})}),d=(r.formMethod||"get").toUpperCase(),h=Ig(i);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Ht(d))return s();let x=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((_,[N,z])=>`${_}${N}=${z}
|
|
10
|
+
`,""):String(r.body);return{path:i,submission:{formMethod:d,formAction:h,formEncType:r.formEncType,formData:void 0,json:void 0,text:x}}}else if(r.formEncType==="application/json"){if(!Ht(d))return s();try{let x=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:i,submission:{formMethod:d,formAction:h,formEncType:r.formEncType,formData:void 0,json:x,text:void 0}}}catch{return s()}}}De(typeof FormData=="function","FormData is not available in this environment");let m,y;if(r.formData)m=Pu(r.formData),y=r.formData;else if(r.body instanceof FormData)m=Pu(r.body),y=r.body;else if(r.body instanceof URLSearchParams)m=r.body,y=$p(m);else if(r.body==null)m=new URLSearchParams,y=new FormData;else try{m=new URLSearchParams(r.body),y=$p(m)}catch{return s()}let p={formMethod:d,formAction:h,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:y,json:void 0,text:void 0};if(Ht(p.formMethod))return{path:i,submission:p};let S=fn(i);return n&&S.search&&ld(S.search)&&m.append("index",""),S.search=`?${m}`,{path:qa(S),submission:p}}function Bp(n,i,r,s,c,d,h,m,y,p,S,x,_,N,z,D,k,W,X,I,se){let de=I?na(I[1])?I[1].error:I[1].data:void 0,V=c.createURL(d.location),B=c.createURL(y),E;if(S&&d.errors){let ie=Object.keys(d.errors)[0];E=h.findIndex(M=>M.route.id===ie)}else if(I&&na(I[1])){let ie=I[0];E=h.findIndex(M=>M.route.id===ie)-1}let $=I?I[1].statusCode:void 0,ne=$&&$>=400,ae={currentUrl:V,currentParams:d.matches[0]?.params||{},nextUrl:B,nextParams:h[0].params,...m,actionResult:de,actionStatus:$},Q=Sr(h),xe=h.map((ie,M)=>{let{route:P}=ie,ue=null;if(E!=null&&M>E)ue=!1;else if(P.lazy)ue=!0;else if(!ad(P))ue=!1;else if(S){let{shouldLoad:q}=Qg(P,d.loaderData,d.errors);ue=q}else q0(d.loaderData,d.matches[M],ie)&&(ue=!0);if(ue!==null)return Wu(r,s,n,Q,ie,p,i,ue);let ce=!1;typeof se=="boolean"?ce=se:ne?ce=!1:(x||V.pathname+V.search===B.pathname+B.search||V.search!==B.search||Y0(d.matches[M],ie))&&(ce=!0);let ee={...ae,defaultShouldRevalidate:ce},j=hr(ie,ee);return Wu(r,s,n,Q,ie,p,i,j,ee,se)}),F=[];return z.forEach((ie,M)=>{if(S||!h.some(le=>le.route.id===ie.routeId)||N.has(M))return;let P=d.fetchers.get(M),ue=P&&P.state!=="idle"&&P.data===void 0,ce=Gn(k,ie.path,W);if(!ce){if(X&&ue)return;F.push({key:M,routeId:ie.routeId,path:ie.path,matches:null,match:null,request:null,controller:null});return}if(D.has(M))return;let ee=Js(ce,ie.path),j=new AbortController,q=ii(c,ie.path,j.signal),G=null;if(_.has(M))_.delete(M),G=oi(r,s,q,ce,ee,p,i);else if(ue)x&&(G=oi(r,s,q,ce,ee,p,i));else{let le;typeof se=="boolean"?le=se:ne?le=!1:le=x;let ge={...ae,defaultShouldRevalidate:le};hr(ee,ge)&&(G=oi(r,s,q,ce,ee,p,i,ge))}G&&F.push({key:M,routeId:ie.routeId,path:ie.path,matches:G,match:ee,request:q,controller:j})}),{dsMatches:xe,revalidatingFetchers:F}}function ad(n){return n.loader!=null||n.middleware!=null&&n.middleware.length>0}function Qg(n,i,r){if(n.lazy)return{shouldLoad:!0,renderFallback:!0};if(!ad(n))return{shouldLoad:!1,renderFallback:!1};let s=i!=null&&n.id in i,c=r!=null&&r[n.id]!==void 0;if(!s&&c)return{shouldLoad:!1,renderFallback:!1};if(typeof n.loader=="function"&&n.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!s};let d=!s&&!c;return{shouldLoad:d,renderFallback:d}}function q0(n,i,r){let s=!i||r.route.id!==i.route.id,c=!n.hasOwnProperty(r.route.id);return s||c}function Y0(n,i){let r=n.route.path;return n.pathname!==i.pathname||r!=null&&r.endsWith("*")&&n.params["*"]!==i.params["*"]}function hr(n,i){if(n.route.shouldRevalidate){let r=n.route.shouldRevalidate(i);if(typeof r=="boolean")return r}return i.defaultShouldRevalidate}function qp(n,i,r,s,c,d){let h;if(n){let p=s[n];De(p,`No route found to patch children into: routeId = ${n}`),p.children||(p.children=[]),h=p.children}else h=r;let m=[],y=[];if(i.forEach(p=>{let S=h.find(x=>Zg(p,x));S?y.push({existingRoute:S,newRoute:p}):m.push(p)}),m.length>0){let p=gr(m,c,[n||"_","patch",String(h?.length||"0")],s);h.push(...p)}if(d&&y.length>0)for(let p=0;p<y.length;p++){let{existingRoute:S,newRoute:x}=y[p],_=S,[N]=gr([x],c,[],{},!0);Object.assign(_,{element:N.element?N.element:_.element,errorElement:N.errorElement?N.errorElement:_.errorElement,hydrateFallbackElement:N.hydrateFallbackElement?N.hydrateFallbackElement:_.hydrateFallbackElement})}}function Zg(n,i){return"id"in n&&"id"in i&&n.id===i.id?!0:n.index===i.index&&n.path===i.path&&n.caseSensitive===i.caseSensitive?(!n.children||n.children.length===0)&&(!i.children||i.children.length===0)?!0:n.children?.every((r,s)=>i.children?.some(c=>Zg(r,c)))??!1:!1}var Yp=new WeakMap,Fg=({key:n,route:i,manifest:r,mapRouteProperties:s})=>{let c=r[i.id];if(De(c,"No route found in manifest"),!c.lazy||typeof c.lazy!="object")return;let d=c.lazy[n];if(!d)return;let h=Yp.get(c);h||(h={},Yp.set(c,h));let m=h[n];if(m)return m;let y=(async()=>{let p=l0(n),x=c[n]!==void 0&&n!=="hasErrorBoundary";if(p)ft(!p,"Route property "+n+" is not a supported lazy route property. This property will be ignored."),h[n]=Promise.resolve();else if(x)ft(!1,`Route "${c.id}" has a static property "${n}" defined. The lazy property will be ignored.`);else{let _=await d();_!=null&&(Object.assign(c,{[n]:_}),Object.assign(c,s(c)))}typeof c.lazy=="object"&&(c.lazy[n]=void 0,Object.values(c.lazy).every(_=>_===void 0)&&(c.lazy=void 0))})();return h[n]=y,y},Vp=new WeakMap;function V0(n,i,r,s,c){let d=r[n.id];if(De(d,"No route found in manifest"),!n.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof n.lazy=="function"){let S=Vp.get(d);if(S)return{lazyRoutePromise:S,lazyHandlerPromise:S};let x=(async()=>{De(typeof n.lazy=="function","No lazy route function found");let _=await n.lazy(),N={};for(let z in _){let D=_[z];if(D===void 0)continue;let k=r0(z),X=d[z]!==void 0&&z!=="hasErrorBoundary";k?ft(!k,"Route property "+z+" is not a supported property to be returned from a lazy route function. This property will be ignored."):X?ft(!X,`Route "${d.id}" has a static property "${z}" defined but its lazy function is also returning a value for this property. The lazy route property "${z}" will be ignored.`):N[z]=D}Object.assign(d,N),Object.assign(d,{...s(d),lazy:void 0})})();return Vp.set(d,x),x.catch(()=>{}),{lazyRoutePromise:x,lazyHandlerPromise:x}}let h=Object.keys(n.lazy),m=[],y;for(let S of h){if(c&&c.includes(S))continue;let x=Fg({key:S,route:n,manifest:r,mapRouteProperties:s});x&&(m.push(x),S===i&&(y=x))}let p=m.length>0?Promise.all(m).then(()=>{}):void 0;return p?.catch(()=>{}),y?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:y}}async function Gp(n){let i=n.matches.filter(c=>c.shouldLoad),r={};return(await Promise.all(i.map(c=>c.resolve()))).forEach((c,d)=>{r[i[d].route.id]=c}),r}async function G0(n){return n.matches.some(i=>i.route.middleware)?Jg(n,()=>Gp(n)):Gp(n)}function Jg(n,i){return K0(n,i,s=>{if(n1(s))throw s;return s},I0,r);function r(s,c,d){if(d)return Promise.resolve(Object.assign(d.value,{[c]:{type:"error",result:s}}));{let{matches:h}=n,m=Math.min(Math.max(h.findIndex(p=>p.route.id===c),0),Math.max(h.findIndex(p=>p.shouldCallHandler()),0)),y=Kn(h,h[m].route.id).route.id;return Promise.resolve({[y]:{type:"error",result:s}})}}}async function K0(n,i,r,s,c){let{matches:d,request:h,params:m,context:y,unstable_pattern:p}=n,S=d.flatMap(_=>_.route.middleware?_.route.middleware.map(N=>[_.route.id,N]):[]);return await Wg({request:h,params:m,context:y,unstable_pattern:p},S,i,r,s,c)}async function Wg(n,i,r,s,c,d,h=0){let{request:m}=n;if(m.signal.aborted)throw m.signal.reason??new Error(`Request aborted: ${m.method} ${m.url}`);let y=i[h];if(!y)return await r();let[p,S]=y,x,_=async()=>{if(x)throw new Error("You may only call `next()` once per middleware");try{return x={value:await Wg(n,i,r,s,c,d,h+1)},x.value}catch(N){return x={value:await d(N,p,x)},x.value}};try{let N=await S(n,_),z=N!=null?s(N):void 0;return c(z)?z:x?z??x.value:(x={value:await _()},x.value)}catch(N){return await d(N,p,x)}}function Pg(n,i,r,s,c){let d=Fg({key:"middleware",route:s.route,manifest:i,mapRouteProperties:n}),h=V0(s.route,Ht(r.method)?"action":"loader",i,n,c);return{middleware:d,route:h.lazyRoutePromise,handler:h.lazyHandlerPromise}}function Wu(n,i,r,s,c,d,h,m,y=null,p){let S=!1,x=Pg(n,i,r,c,d);return{...c,_lazyPromises:x,shouldLoad:m,shouldRevalidateArgs:y,shouldCallHandler(_){return S=!0,y?typeof p=="boolean"?hr(c,{...y,defaultShouldRevalidate:p}):typeof _=="boolean"?hr(c,{...y,defaultShouldRevalidate:_}):hr(c,y):m},resolve(_){let{lazy:N,loader:z,middleware:D}=c.route,k=S||m||_&&!Ht(r.method)&&(N||z),W=D&&D.length>0&&!z&&!N;return k&&(Ht(r.method)||!W)?X0({request:r,unstable_pattern:s,match:c,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:_,scopedContext:h}):Promise.resolve({type:"data",result:void 0})}}}function oi(n,i,r,s,c,d,h,m=null){return s.map(y=>y.route.id!==c.route.id?{...y,shouldLoad:!1,shouldRevalidateArgs:m,shouldCallHandler:()=>!1,_lazyPromises:Pg(n,i,r,y,d),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Wu(n,i,r,Sr(s),y,d,h,!0,m))}async function $0(n,i,r,s,c,d){r.some(p=>p._lazyPromises?.middleware)&&await Promise.all(r.map(p=>p._lazyPromises?.middleware));let h={request:i,unstable_pattern:Sr(r),params:r[0].params,context:c,matches:r},y=await n({...h,fetcherKey:s,runClientMiddleware:p=>{let S=h;return Jg(S,()=>p({...S,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return y}async function X0({request:n,unstable_pattern:i,match:r,lazyHandlerPromise:s,lazyRoutePromise:c,handlerOverride:d,scopedContext:h}){let m,y,p=Ht(n.method),S=p?"action":"loader",x=_=>{let N,z=new Promise((W,X)=>N=X);y=()=>N(),n.signal.addEventListener("abort",y);let D=W=>typeof _!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${S}" [routeId: ${r.route.id}]`)):_({request:n,unstable_pattern:i,params:r.params,context:h},...W!==void 0?[W]:[]),k=(async()=>{try{return{type:"data",result:await(d?d(X=>D(X)):D())}}catch(W){return{type:"error",result:W}}})();return Promise.race([k,z])};try{let _=p?r.route.action:r.route.loader;if(s||c)if(_){let N,[z]=await Promise.all([x(_).catch(D=>{N=D}),s,c]);if(N!==void 0)throw N;m=z}else{await s;let N=p?r.route.action:r.route.loader;if(N)[m]=await Promise.all([x(N),c]);else if(S==="action"){let z=new URL(n.url),D=z.pathname+z.search;throw ya(405,{method:n.method,pathname:D,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(_)m=await x(_);else{let N=new URL(n.url),z=N.pathname+N.search;throw ya(404,{pathname:z})}}catch(_){return{type:"error",result:_}}finally{y&&n.signal.removeEventListener("abort",y)}return m}async function Q0(n){let i=n.headers.get("Content-Type");return i&&/\bapplication\/json\b/.test(i)?n.body==null?null:n.json():n.text()}async function Z0(n){let{result:i,type:r}=n;if(nd(i)){let s;try{s=await Q0(i)}catch(c){return{type:"error",error:c}}return r==="error"?{type:"error",error:new br(i.status,i.statusText,s),statusCode:i.status,headers:i.headers}:{type:"data",data:s,statusCode:i.status,headers:i.headers}}return r==="error"?Fp(i)?i.data instanceof Error?{type:"error",error:i.data,statusCode:i.init?.status,headers:i.init?.headers?new Headers(i.init.headers):void 0}:{type:"error",error:P0(i),statusCode:yr(i)?i.status:void 0,headers:i.init?.headers?new Headers(i.init.headers):void 0}:{type:"error",error:i,statusCode:yr(i)?i.status:void 0}:Fp(i)?{type:"data",data:i.data,statusCode:i.init?.status,headers:i.init?.headers?new Headers(i.init.headers):void 0}:{type:"data",data:i}}function F0(n,i,r,s,c){let d=n.headers.get("Location");if(De(d,"Redirects returned/thrown from loaders/actions must have a Location header"),!td(d)){let h=s.slice(0,s.findIndex(m=>m.route.id===r)+1);d=Ju(new URL(i.url),h,c,d),n.headers.set("Location",d)}return n}function Kp(n,i,r,s){let c=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(td(n)){let d=n,h=d.startsWith("//")?new URL(i.protocol+d):new URL(d);if(c.includes(h.protocol))throw new Error("Invalid redirect location");let m=xa(h.pathname,r)!=null;if(h.origin===i.origin&&m)return h.pathname+h.search+h.hash}try{let d=s.createURL(n);if(c.includes(d.protocol))throw new Error("Invalid redirect location")}catch{}return n}function ii(n,i,r,s){let c=n.createURL(Ig(i)).toString(),d={signal:r};if(s&&Ht(s.formMethod)){let{formMethod:h,formEncType:m}=s;d.method=h.toUpperCase(),m==="application/json"?(d.headers=new Headers({"Content-Type":m}),d.body=JSON.stringify(s.json)):m==="text/plain"?d.body=s.text:m==="application/x-www-form-urlencoded"&&s.formData?d.body=Pu(s.formData):d.body=s.formData}return new Request(c,d)}function Pu(n){let i=new URLSearchParams;for(let[r,s]of n.entries())i.append(r,typeof s=="string"?s:s.name);return i}function $p(n){let i=new FormData;for(let[r,s]of n.entries())i.append(r,s);return i}function J0(n,i,r,s=!1,c=!1){let d={},h=null,m,y=!1,p={},S=r&&na(r[1])?r[1].error:void 0;return n.forEach(x=>{if(!(x.route.id in i))return;let _=x.route.id,N=i[_];if(De(!pl(N),"Cannot handle redirect results in processLoaderData"),na(N)){let z=N.error;if(S!==void 0&&(z=S,S=void 0),h=h||{},c)h[_]=z;else{let D=Kn(n,_);h[D.route.id]==null&&(h[D.route.id]=z)}s||(d[_]=Xg),y||(y=!0,m=yr(N.error)?N.error.status:500),N.headers&&(p[_]=N.headers)}else d[_]=N.data,N.statusCode&&N.statusCode!==200&&!y&&(m=N.statusCode),N.headers&&(p[_]=N.headers)}),S!==void 0&&r&&(h={[r[0]]:S},r[2]&&(d[r[2]]=void 0)),{loaderData:d,errors:h,statusCode:m||200,loaderHeaders:p}}function Xp(n,i,r,s,c,d){let{loaderData:h,errors:m}=J0(i,r,s);return c.filter(y=>!y.matches||y.matches.some(p=>p.shouldLoad)).forEach(y=>{let{key:p,match:S,controller:x}=y;if(x&&x.signal.aborted)return;let _=d[p];if(De(_,"Did not find corresponding fetcher result"),na(_)){let N=Kn(n.matches,S?.route.id);m&&m[N.route.id]||(m={...m,[N.route.id]:_.error}),n.fetchers.delete(p)}else if(pl(_))De(!1,"Unhandled fetcher revalidation redirect");else{let N=un(_.data);n.fetchers.set(p,N)}}),{loaderData:h,errors:m}}function Qp(n,i,r,s){let c=Object.entries(i).filter(([,d])=>d!==Xg).reduce((d,[h,m])=>(d[h]=m,d),{});for(let d of r){let h=d.route.id;if(!i.hasOwnProperty(h)&&n.hasOwnProperty(h)&&d.route.loader&&(c[h]=n[h]),s&&s.hasOwnProperty(h))break}return c}function Zp(n){return n?na(n[1])?{actionData:{}}:{actionData:{[n[0]]:n[1].data}}:{}}function Kn(n,i){return(i?n.slice(0,n.findIndex(s=>s.route.id===i)+1):[...n]).reverse().find(s=>s.route.hasErrorBoundary===!0)||n[0]}function Ks(n){let i=n.length===1?n[0]:n.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:i}],route:i}}function ya(n,{pathname:i,routeId:r,method:s,type:c,message:d}={}){let h="Unknown Server Error",m="Unknown @remix-run/router error";return n===400?(h="Bad Request",s&&i&&r?m=`You made a ${s} request to "${i}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:c==="invalid-body"&&(m="Unable to encode submission body")):n===403?(h="Forbidden",m=`Route "${r}" does not match URL "${i}"`):n===404?(h="Not Found",m=`No route matches URL "${i}"`):n===405&&(h="Method Not Allowed",s&&i&&r?m=`You made a ${s.toUpperCase()} request to "${i}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:s&&(m=`Invalid request method "${s.toUpperCase()}"`)),new br(n||500,h,new Error(m),!0)}function $s(n){let i=Object.entries(n);for(let r=i.length-1;r>=0;r--){let[s,c]=i[r];if(pl(c))return{key:s,result:c}}}function Ig(n){let i=typeof n=="string"?fn(n):n;return qa({...i,hash:""})}function W0(n,i){return n.pathname!==i.pathname||n.search!==i.search?!1:n.hash===""?i.hash!=="":n.hash===i.hash?!0:i.hash!==""}function P0(n){return new br(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)}function I0(n){return n!=null&&typeof n=="object"&&Object.entries(n).every(([i,r])=>typeof i=="string"&&e1(r))}function e1(n){return n!=null&&typeof n=="object"&&"type"in n&&"result"in n&&(n.type==="data"||n.type==="error")}function t1(n){return nd(n.result)&&Kg.has(n.result.status)}function na(n){return n.type==="error"}function pl(n){return(n&&n.type)==="redirect"}function Fp(n){return typeof n=="object"&&n!=null&&"type"in n&&"data"in n&&"init"in n&&n.type==="DataWithResponseInit"}function nd(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function a1(n){return Kg.has(n)}function n1(n){return nd(n)&&a1(n.status)&&n.headers.has("Location")}function l1(n){return A0.has(n.toUpperCase())}function Ht(n){return D0.has(n.toUpperCase())}function ld(n){return new URLSearchParams(n).getAll("index").some(i=>i==="")}function Js(n,i){let r=typeof i=="string"?fn(i).search:i.search;if(n[n.length-1].route.index&&ld(r||""))return n[n.length-1];let s=Bg(n);return s[s.length-1]}function Jp(n){let{formMethod:i,formAction:r,formEncType:s,text:c,formData:d,json:h}=n;if(!(!i||!r||!s)){if(c!=null)return{formMethod:i,formAction:r,formEncType:s,formData:void 0,json:void 0,text:c};if(d!=null)return{formMethod:i,formAction:r,formEncType:s,formData:d,json:void 0,text:void 0};if(h!==void 0)return{formMethod:i,formAction:r,formEncType:s,formData:void 0,json:h,text:void 0}}}function qu(n,i){return i?{state:"loading",location:n,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}:{state:"loading",location:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function i1(n,i){return{state:"submitting",location:n,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}}function rr(n,i){return n?{state:"loading",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:i}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:i}}function r1(n,i){return{state:"submitting",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text,data:i?i.data:void 0}}function un(n){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function s1(n,i){try{let r=n.sessionStorage.getItem($g);if(r){let s=JSON.parse(r);for(let[c,d]of Object.entries(s||{}))d&&Array.isArray(d)&&i.set(c,new Set(d||[]))}}catch{}}function o1(n,i){if(i.size>0){let r={};for(let[s,c]of i)r[s]=[...c];try{n.sessionStorage.setItem($g,JSON.stringify(r))}catch(s){ft(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function Wp(){let n,i,r=new Promise((s,c)=>{n=async d=>{s(d);try{await r}catch{}},i=async d=>{c(d);try{await r}catch{}}});return{promise:r,resolve:n,reject:i}}var xl=v.createContext(null);xl.displayName="DataRouter";var _r=v.createContext(null);_r.displayName="DataRouterState";var ey=v.createContext(!1);function c1(){return v.useContext(ey)}var id=v.createContext({isTransitioning:!1});id.displayName="ViewTransition";var ty=v.createContext(new Map);ty.displayName="Fetchers";var u1=v.createContext(null);u1.displayName="Await";var ra=v.createContext(null);ra.displayName="Navigation";var oo=v.createContext(null);oo.displayName="Location";var va=v.createContext({outlet:null,matches:[],isDataRoute:!1});va.displayName="Route";var rd=v.createContext(null);rd.displayName="RouteError";var ay="REACT_ROUTER_ERROR",d1="REDIRECT",f1="ROUTE_ERROR_RESPONSE";function h1(n){if(n.startsWith(`${ay}:${d1}:{`))try{let i=JSON.parse(n.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function m1(n){if(n.startsWith(`${ay}:${f1}:{`))try{let i=JSON.parse(n.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new br(i.status,i.statusText,i.data)}catch{}}function p1(n,{relative:i}={}){De(ui(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:s}=v.useContext(ra),{hash:c,pathname:d,search:h}=jr(n,{relative:i}),m=d;return r!=="/"&&(m=d==="/"?r:Oa([r,d])),s.createHref({pathname:m,search:h,hash:c})}function ui(){return v.useContext(oo)!=null}function Ta(){return De(ui(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(oo).location}var ny="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ly(n){v.useContext(ra).static||v.useLayoutEffect(n)}function Xn(){let{isDataRoute:n}=v.useContext(va);return n?O1():g1()}function g1(){De(ui(),"useNavigate() may be used only in the context of a <Router> component.");let n=v.useContext(xl),{basename:i,navigator:r}=v.useContext(ra),{matches:s}=v.useContext(va),{pathname:c}=Ta(),d=JSON.stringify(so(s)),h=v.useRef(!1);return ly(()=>{h.current=!0}),v.useCallback((y,p={})=>{if(ft(h.current,ny),!h.current)return;if(typeof y=="number"){r.go(y);return}let S=vr(y,JSON.parse(d),c,p.relative==="path");n==null&&i!=="/"&&(S.pathname=S.pathname==="/"?i:Oa([i,S.pathname])),(p.replace?r.replace:r.push)(S,p.state,p)},[i,r,d,c,n])}var y1=v.createContext(null);function x1(n){let i=v.useContext(va).outlet;return v.useMemo(()=>i&&v.createElement(y1.Provider,{value:n},i),[i,n])}function co(){let{matches:n}=v.useContext(va),i=n[n.length-1];return i?i.params:{}}function jr(n,{relative:i}={}){let{matches:r}=v.useContext(va),{pathname:s}=Ta(),c=JSON.stringify(so(r));return v.useMemo(()=>vr(n,JSON.parse(c),s,i==="path"),[n,c,s,i])}function v1(n,i,r){De(ui(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(ra),{matches:c}=v.useContext(va),d=c[c.length-1],h=d?d.params:{},m=d?d.pathname:"/",y=d?d.pathnameBase:"/",p=d&&d.route;{let k=p&&p.path||"";ry(m,!p||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
|
+
|
|
12
|
+
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let S=Ta(),x;x=S;let _=x.pathname||"/",N=_;if(y!=="/"){let k=y.replace(/^\//,"").split("/");N="/"+_.replace(/^\//,"").split("/").slice(k.length).join("/")}let z=Gn(n,{pathname:N});return ft(p||z!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),ft(z==null||z[z.length-1].route.element!==void 0||z[z.length-1].route.Component!==void 0||z[z.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),N1(z&&z.map(k=>Object.assign({},k,{params:Object.assign({},h,k.params),pathname:Oa([y,s.encodeLocation?s.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?y:Oa([y,s.encodeLocation?s.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),c,r)}function b1(){let n=z1(),i=yr(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),r=n instanceof Error?n.stack:null,s="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:s},d={padding:"2px 4px",backgroundColor:s},h=null;return console.error("Error handled by React Router default ErrorBoundary:",n),h=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:d},"ErrorBoundary")," or"," ",v.createElement("code",{style:d},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},i),r?v.createElement("pre",{style:c},r):null,h)}var S1=v.createElement(b1,null),iy=class extends v.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,i){return i.location!==n.location||i.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:i.error,location:i.location,revalidation:n.revalidation||i.revalidation}}componentDidCatch(n,i){this.props.onError?this.props.onError(n,i):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const r=m1(n.digest);r&&(n=r)}let i=n!==void 0?v.createElement(va.Provider,{value:this.props.routeContext},v.createElement(rd.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?v.createElement(_1,{error:n},i):i}};iy.contextType=ey;var Yu=new WeakMap;function _1({children:n,error:i}){let{basename:r}=v.useContext(ra);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let s=h1(i.digest);if(s){let c=Yu.get(i);if(c)throw c;let d=Yg(s.location,r);if(qg&&!Yu.get(i))if(d.isExternal||s.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:s.replace}));throw Yu.set(i,h),h}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return n}function j1({routeContext:n,match:i,children:r}){let s=v.useContext(xl);return s&&s.static&&s.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=i.route.id),v.createElement(va.Provider,{value:n},r)}function N1(n,i=[],r){let s=r?.state;if(n==null){if(!s)return null;if(s.errors)n=s.matches;else if(i.length===0&&!s.initialized&&s.matches.length>0)n=s.matches;else return null}let c=n,d=s?.errors;if(d!=null){let S=c.findIndex(x=>x.route.id&&d?.[x.route.id]!==void 0);De(S>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,S+1))}let h=!1,m=-1;if(r&&s){h=s.renderFallback;for(let S=0;S<c.length;S++){let x=c[S];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(m=S),x.route.id){let{loaderData:_,errors:N}=s,z=x.route.loader&&!_.hasOwnProperty(x.route.id)&&(!N||N[x.route.id]===void 0);if(x.route.lazy||z){r.isStatic&&(h=!0),m>=0?c=c.slice(0,m+1):c=[c[0]];break}}}}let y=r?.onError,p=s&&y?(S,x)=>{y(S,{location:s.location,params:s.matches?.[0]?.params??{},unstable_pattern:Sr(s.matches),errorInfo:x})}:void 0;return c.reduceRight((S,x,_)=>{let N,z=!1,D=null,k=null;s&&(N=d&&x.route.id?d[x.route.id]:void 0,D=x.route.errorElement||S1,h&&(m<0&&_===0?(ry("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),z=!0,k=null):m===_&&(z=!0,k=x.route.hydrateFallbackElement||null)));let W=i.concat(c.slice(0,_+1)),X=()=>{let I;return N?I=D:z?I=k:x.route.Component?I=v.createElement(x.route.Component,null):x.route.element?I=x.route.element:I=S,v.createElement(j1,{match:x,routeContext:{outlet:S,matches:W,isDataRoute:s!=null},children:I})};return s&&(x.route.ErrorBoundary||x.route.errorElement||_===0)?v.createElement(iy,{location:s.location,revalidation:s.revalidation,component:D,error:N,children:X(),routeContext:{outlet:null,matches:W,isDataRoute:!0},onError:p}):X()},null)}function sd(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function E1(n){let i=v.useContext(xl);return De(i,sd(n)),i}function w1(n){let i=v.useContext(_r);return De(i,sd(n)),i}function C1(n){let i=v.useContext(va);return De(i,sd(n)),i}function od(n){let i=C1(n),r=i.matches[i.matches.length-1];return De(r.route.id,`${n} can only be used on routes that contain a unique "id"`),r.route.id}function R1(){return od("useRouteId")}function z1(){let n=v.useContext(rd),i=w1("useRouteError"),r=od("useRouteError");return n!==void 0?n:i.errors?.[r]}function O1(){let{router:n}=E1("useNavigate"),i=od("useNavigate"),r=v.useRef(!1);return ly(()=>{r.current=!0}),v.useCallback(async(c,d={})=>{ft(r.current,ny),r.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:i,...d}))},[n,i])}var Pp={};function ry(n,i,r){!i&&!Pp[n]&&(Pp[n]=!0,ft(!1,r))}var Ip={};function eg(n,i){!n&&!Ip[i]&&(Ip[i]=!0,console.warn(i))}var T1="useOptimistic",tg=sb[T1],D1=()=>{};function M1(n){return tg?tg(n):[n,D1]}function A1(n){let i={hasErrorBoundary:n.hasErrorBoundary||n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&(n.element&&ft(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(i,{element:v.createElement(n.Component),Component:void 0})),n.HydrateFallback&&(n.hydrateFallbackElement&&ft(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(i,{hydrateFallbackElement:v.createElement(n.HydrateFallback),HydrateFallback:void 0})),n.ErrorBoundary&&(n.errorElement&&ft(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(i,{errorElement:v.createElement(n.ErrorBoundary),ErrorBoundary:void 0})),i}var L1=["HydrateFallback","hydrateFallbackElement"],k1=class{constructor(){this.status="pending",this.promise=new Promise((n,i)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",n(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",i(r))}})}};function U1({router:n,flushSync:i,onError:r,unstable_useTransitions:s}){s=c1()||s;let[d,h]=v.useState(n.state),[m,y]=M1(d),[p,S]=v.useState(),[x,_]=v.useState({isTransitioning:!1}),[N,z]=v.useState(),[D,k]=v.useState(),[W,X]=v.useState(),I=v.useRef(new Map),se=v.useCallback((E,{deletedFetchers:$,newErrors:ne,flushSync:ae,viewTransitionOpts:Q})=>{ne&&r&&Object.values(ne).forEach(F=>r(F,{location:E.location,params:E.matches[0]?.params??{},unstable_pattern:Sr(E.matches)})),E.fetchers.forEach((F,ie)=>{F.data!==void 0&&I.current.set(ie,F.data)}),$.forEach(F=>I.current.delete(F)),eg(ae===!1||i!=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 xe=n.window!=null&&n.window.document!=null&&typeof n.window.document.startViewTransition=="function";if(eg(Q==null||xe,"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."),!Q||!xe){i&&ae?i(()=>h(E)):s===!1?h(E):v.startTransition(()=>{s===!0&&y(F=>ag(F,E)),h(E)});return}if(i&&ae){i(()=>{D&&(N?.resolve(),D.skipTransition()),_({isTransitioning:!0,flushSync:!0,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation})});let F=n.window.document.startViewTransition(()=>{i(()=>h(E))});F.finished.finally(()=>{i(()=>{z(void 0),k(void 0),S(void 0),_({isTransitioning:!1})})}),i(()=>k(F));return}D?(N?.resolve(),D.skipTransition(),X({state:E,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation})):(S(E),_({isTransitioning:!0,flushSync:!1,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation}))},[n.window,i,D,N,s,y,r]);v.useLayoutEffect(()=>n.subscribe(se),[n,se]),v.useEffect(()=>{x.isTransitioning&&!x.flushSync&&z(new k1)},[x]),v.useEffect(()=>{if(N&&p&&n.window){let E=p,$=N.promise,ne=n.window.document.startViewTransition(async()=>{s===!1?h(E):v.startTransition(()=>{s===!0&&y(ae=>ag(ae,E)),h(E)}),await $});ne.finished.finally(()=>{z(void 0),k(void 0),S(void 0),_({isTransitioning:!1})}),k(ne)}},[p,N,n.window,s,y]),v.useEffect(()=>{N&&p&&m.location.key===p.location.key&&N.resolve()},[N,D,m.location,p]),v.useEffect(()=>{!x.isTransitioning&&W&&(S(W.state),_({isTransitioning:!0,flushSync:!1,currentLocation:W.currentLocation,nextLocation:W.nextLocation}),X(void 0))},[x.isTransitioning,W]);let de=v.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,$,ne)=>n.navigate(E,{state:$,preventScrollReset:ne?.preventScrollReset}),replace:(E,$,ne)=>n.navigate(E,{replace:!0,state:$,preventScrollReset:ne?.preventScrollReset})}),[n]),V=n.basename||"/",B=v.useMemo(()=>({router:n,navigator:de,static:!1,basename:V,onError:r}),[n,de,V,r]);return v.createElement(v.Fragment,null,v.createElement(xl.Provider,{value:B},v.createElement(_r.Provider,{value:m},v.createElement(ty.Provider,{value:I.current},v.createElement(id.Provider,{value:x},v.createElement(q1,{basename:V,location:m.location,navigationType:m.historyAction,navigator:de,unstable_useTransitions:s},v.createElement(H1,{routes:n.routes,future:n.future,state:m,isStatic:!1,onError:r})))))),null)}function ag(n,i){return{...n,navigation:i.navigation.state!=="idle"?i.navigation:n.navigation,revalidation:i.revalidation!=="idle"?i.revalidation:n.revalidation,actionData:i.navigation.state!=="submitting"?i.actionData:n.actionData,fetchers:i.fetchers}}var H1=v.memo(B1);function B1({routes:n,future:i,state:r,isStatic:s,onError:c}){return v1(n,void 0,{state:r,isStatic:s,onError:c})}function ng({to:n,replace:i,state:r,relative:s}){De(ui(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=v.useContext(ra);ft(!c,"<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:d}=v.useContext(va),{pathname:h}=Ta(),m=Xn(),y=vr(n,so(d),h,s==="path"),p=JSON.stringify(y);return v.useEffect(()=>{m(JSON.parse(p),{replace:i,state:r,relative:s})},[m,p,s,i,r]),null}function sy(n){return x1(n.context)}function q1({basename:n="/",children:i=null,location:r,navigationType:s="POP",navigator:c,static:d=!1,unstable_useTransitions:h}){De(!ui(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=n.replace(/^\/*/,"/"),y=v.useMemo(()=>({basename:m,navigator:c,static:d,unstable_useTransitions:h,future:{}}),[m,c,d,h]);typeof r=="string"&&(r=fn(r));let{pathname:p="/",search:S="",hash:x="",state:_=null,key:N="default",unstable_mask:z}=r,D=v.useMemo(()=>{let k=xa(p,m);return k==null?null:{location:{pathname:k,search:S,hash:x,state:_,key:N,unstable_mask:z},navigationType:s}},[m,p,S,x,_,N,s,z]);return ft(D!=null,`<Router basename="${m}"> is not able to match the URL "${p}${S}${x}" because it does not start with the basename, so the <Router> won't render anything.`),D==null?null:v.createElement(ra.Provider,{value:y},v.createElement(oo.Provider,{children:i,value:D}))}var Ws="get",Ps="application/x-www-form-urlencoded";function uo(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function Y1(n){return uo(n)&&n.tagName.toLowerCase()==="button"}function V1(n){return uo(n)&&n.tagName.toLowerCase()==="form"}function G1(n){return uo(n)&&n.tagName.toLowerCase()==="input"}function K1(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function $1(n,i){return n.button===0&&(!i||i==="_self")&&!K1(n)}function Iu(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((i,r)=>{let s=n[r];return i.concat(Array.isArray(s)?s.map(c=>[r,c]):[[r,s]])},[]))}function X1(n,i){let r=Iu(n);return i&&i.forEach((s,c)=>{r.has(c)||i.getAll(c).forEach(d=>{r.append(c,d)})}),r}var Xs=null;function Q1(){if(Xs===null)try{new FormData(document.createElement("form"),0),Xs=!1}catch{Xs=!0}return Xs}var Z1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Vu(n){return n!=null&&!Z1.has(n)?(ft(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ps}"`),null):n}function F1(n,i){let r,s,c,d,h;if(V1(n)){let m=n.getAttribute("action");s=m?xa(m,i):null,r=n.getAttribute("method")||Ws,c=Vu(n.getAttribute("enctype"))||Ps,d=new FormData(n)}else if(Y1(n)||G1(n)&&(n.type==="submit"||n.type==="image")){let m=n.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=n.getAttribute("formaction")||m.getAttribute("action");if(s=y?xa(y,i):null,r=n.getAttribute("formmethod")||m.getAttribute("method")||Ws,c=Vu(n.getAttribute("formenctype"))||Vu(m.getAttribute("enctype"))||Ps,d=new FormData(m,n),!Q1()){let{name:p,type:S,value:x}=n;if(S==="image"){let _=p?`${p}.`:"";d.append(`${_}x`,"0"),d.append(`${_}y`,"0")}else p&&d.append(p,x)}}else{if(uo(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ws,s=null,c=Ps,h=n}return d&&c==="text/plain"&&(h=d,d=void 0),{action:s,method:r.toLowerCase(),encType:c,formData:d,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function cd(n,i){if(n===!1||n===null||typeof n>"u")throw new Error(i)}function J1(n,i,r,s){let c=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return r?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${s}`:c.pathname=`${c.pathname}.${s}`:c.pathname==="/"?c.pathname=`_root.${s}`:i&&xa(c.pathname,i)==="/"?c.pathname=`${i.replace(/\/$/,"")}/_root.${s}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${s}`,c}async function W1(n,i){if(n.id in i)return i[n.id];try{let r=await import(n.module);return i[n.id]=r,r}catch(r){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function P1(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function I1(n,i,r){let s=await Promise.all(n.map(async c=>{let d=i.routes[c.route.id];if(d){let h=await W1(d,r);return h.links?h.links():[]}return[]}));return nS(s.flat(1).filter(P1).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function lg(n,i,r,s,c,d){let h=(y,p)=>r[p]?y.route.id!==r[p].route.id:!0,m=(y,p)=>r[p].pathname!==y.pathname||r[p].route.path?.endsWith("*")&&r[p].params["*"]!==y.params["*"];return d==="assets"?i.filter((y,p)=>h(y,p)||m(y,p)):d==="data"?i.filter((y,p)=>{let S=s.routes[y.route.id];if(!S||!S.hasLoader)return!1;if(h(y,p)||m(y,p))return!0;if(y.route.shouldRevalidate){let x=y.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(n,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function eS(n,i,{includeHydrateFallback:r}={}){return tS(n.map(s=>{let c=i.routes[s.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),r&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}function tS(n){return[...new Set(n)]}function aS(n){let i={},r=Object.keys(n).sort();for(let s of r)i[s]=n[s];return i}function nS(n,i){let r=new Set;return new Set(i),n.reduce((s,c)=>{let d=JSON.stringify(aS(c));return r.has(d)||(r.add(d),s.push({key:d,link:c})),s},[])}function oy(){let n=v.useContext(xl);return cd(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function lS(){let n=v.useContext(_r);return cd(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var ud=v.createContext(void 0);ud.displayName="FrameworkContext";function cy(){let n=v.useContext(ud);return cd(n,"You must render this element inside a <HydratedRouter> element"),n}function iS(n,i){let r=v.useContext(ud),[s,c]=v.useState(!1),[d,h]=v.useState(!1),{onFocus:m,onBlur:y,onMouseEnter:p,onMouseLeave:S,onTouchStart:x}=i,_=v.useRef(null);v.useEffect(()=>{if(n==="render"&&h(!0),n==="viewport"){let D=W=>{W.forEach(X=>{h(X.isIntersecting)})},k=new IntersectionObserver(D,{threshold:.5});return _.current&&k.observe(_.current),()=>{k.disconnect()}}},[n]),v.useEffect(()=>{if(s){let D=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(D)}}},[s]);let N=()=>{c(!0)},z=()=>{c(!1),h(!1)};return r?n!=="intent"?[d,_,{}]:[d,_,{onFocus:sr(m,N),onBlur:sr(y,z),onMouseEnter:sr(p,N),onMouseLeave:sr(S,z),onTouchStart:sr(x,N)}]:[!1,_,{}]}function sr(n,i){return r=>{n&&n(r),r.defaultPrevented||i(r)}}function rS({page:n,...i}){let{router:r}=oy(),s=v.useMemo(()=>Gn(r.routes,n,r.basename),[r.routes,n,r.basename]);return s?v.createElement(oS,{page:n,matches:s,...i}):null}function sS(n){let{manifest:i,routeModules:r}=cy(),[s,c]=v.useState([]);return v.useEffect(()=>{let d=!1;return I1(n,i,r).then(h=>{d||c(h)}),()=>{d=!0}},[n,i,r]),s}function oS({page:n,matches:i,...r}){let s=Ta(),{future:c,manifest:d,routeModules:h}=cy(),{basename:m}=oy(),{loaderData:y,matches:p}=lS(),S=v.useMemo(()=>lg(n,i,p,d,s,"data"),[n,i,p,d,s]),x=v.useMemo(()=>lg(n,i,p,d,s,"assets"),[n,i,p,d,s]),_=v.useMemo(()=>{if(n===s.pathname+s.search+s.hash)return[];let D=new Set,k=!1;if(i.forEach(X=>{let I=d.routes[X.route.id];!I||!I.hasLoader||(!S.some(se=>se.route.id===X.route.id)&&X.route.id in y&&h[X.route.id]?.shouldRevalidate||I.hasClientLoader?k=!0:D.add(X.route.id))}),D.size===0)return[];let W=J1(n,m,c.unstable_trailingSlashAwareDataRequests,"data");return k&&D.size>0&&W.searchParams.set("_routes",i.filter(X=>D.has(X.route.id)).map(X=>X.route.id).join(",")),[W.pathname+W.search]},[m,c.unstable_trailingSlashAwareDataRequests,y,s,d,S,i,n,h]),N=v.useMemo(()=>eS(x,d),[x,d]),z=sS(x);return v.createElement(v.Fragment,null,_.map(D=>v.createElement("link",{key:D,rel:"prefetch",as:"fetch",href:D,...r})),N.map(D=>v.createElement("link",{key:D,rel:"modulepreload",href:D,...r})),z.map(({key:D,link:k})=>v.createElement("link",{key:D,nonce:r.nonce,...k,crossOrigin:k.crossOrigin??r.crossOrigin})))}function cS(...n){return i=>{n.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var uS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{uS&&(window.__reactRouterVersion="7.13.1")}catch{}function dS(n,i){return H0({basename:i?.basename,getContext:i?.getContext,future:i?.future,history:e0({window:i?.window}),hydrationData:fS(),routes:n,mapRouteProperties:A1,hydrationRouteProperties:L1,dataStrategy:i?.dataStrategy,patchRoutesOnNavigation:i?.patchRoutesOnNavigation,window:i?.window,unstable_instrumentations:i?.unstable_instrumentations}).initialize()}function fS(){let n=window?.__staticRouterHydrationData;return n&&n.errors&&(n={...n,errors:hS(n.errors)}),n}function hS(n){if(!n)return null;let i=Object.entries(n),r={};for(let[s,c]of i)if(c&&c.__type==="RouteErrorResponse")r[s]=new br(c.status,c.statusText,c.data,c.internal===!0);else if(c&&c.__type==="Error"){if(c.__subType){let d=window[c.__subType];if(typeof d=="function")try{let h=new d(c.message);h.stack="",r[s]=h}catch{}}if(r[s]==null){let d=new Error(c.message);d.stack="",r[s]=d}}else r[s]=c;return r}var uy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ft=v.forwardRef(function({onClick:i,discover:r="render",prefetch:s="none",relative:c,reloadDocument:d,replace:h,unstable_mask:m,state:y,target:p,to:S,preventScrollReset:x,viewTransition:_,unstable_defaultShouldRevalidate:N,...z},D){let{basename:k,navigator:W,unstable_useTransitions:X}=v.useContext(ra),I=typeof S=="string"&&uy.test(S),se=Yg(S,k);S=se.to;let de=p1(S,{relative:c}),V=Ta(),B=null;if(m){let ie=vr(m,[],V.unstable_mask?V.unstable_mask.pathname:"/",!0);k!=="/"&&(ie.pathname=ie.pathname==="/"?k:Oa([k,ie.pathname])),B=W.createHref(ie)}let[E,$,ne]=iS(s,z),ae=gS(S,{replace:h,unstable_mask:m,state:y,target:p,preventScrollReset:x,relative:c,viewTransition:_,unstable_defaultShouldRevalidate:N,unstable_useTransitions:X});function Q(ie){i&&i(ie),ie.defaultPrevented||ae(ie)}let xe=!(se.isExternal||d),F=v.createElement("a",{...z,...ne,href:(xe?B:void 0)||se.absoluteURL||de,onClick:xe?Q:i,ref:cS(D,$),target:p,"data-discover":!I&&r==="render"?"true":void 0});return E&&!I?v.createElement(v.Fragment,null,F,v.createElement(rS,{page:de})):F});Ft.displayName="Link";var xr=v.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:s="",end:c=!1,style:d,to:h,viewTransition:m,children:y,...p},S){let x=jr(h,{relative:p.relative}),_=Ta(),N=v.useContext(_r),{navigator:z,basename:D}=v.useContext(ra),k=N!=null&&_S(x)&&m===!0,W=z.encodeLocation?z.encodeLocation(x).pathname:x.pathname,X=_.pathname,I=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;r||(X=X.toLowerCase(),I=I?I.toLowerCase():null,W=W.toLowerCase()),I&&D&&(I=xa(I,D)||I);const se=W!=="/"&&W.endsWith("/")?W.length-1:W.length;let de=X===W||!c&&X.startsWith(W)&&X.charAt(se)==="/",V=I!=null&&(I===W||!c&&I.startsWith(W)&&I.charAt(W.length)==="/"),B={isActive:de,isPending:V,isTransitioning:k},E=de?i:void 0,$;typeof s=="function"?$=s(B):$=[s,de?"active":null,V?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let ne=typeof d=="function"?d(B):d;return v.createElement(Ft,{...p,"aria-current":E,className:$,ref:S,style:ne,to:h,viewTransition:m},typeof y=="function"?y(B):y)});xr.displayName="NavLink";var mS=v.forwardRef(({discover:n="render",fetcherKey:i,navigate:r,reloadDocument:s,replace:c,state:d,method:h=Ws,action:m,onSubmit:y,relative:p,preventScrollReset:S,viewTransition:x,unstable_defaultShouldRevalidate:_,...N},z)=>{let{unstable_useTransitions:D}=v.useContext(ra),k=bS(),W=SS(m,{relative:p}),X=h.toLowerCase()==="get"?"get":"post",I=typeof m=="string"&&uy.test(m),se=de=>{if(y&&y(de),de.defaultPrevented)return;de.preventDefault();let V=de.nativeEvent.submitter,B=V?.getAttribute("formmethod")||h,E=()=>k(V||de.currentTarget,{fetcherKey:i,method:B,navigate:r,replace:c,state:d,relative:p,preventScrollReset:S,viewTransition:x,unstable_defaultShouldRevalidate:_});D&&r!==!1?v.startTransition(()=>E()):E()};return v.createElement("form",{ref:z,method:X,action:W,onSubmit:s?y:se,...N,"data-discover":!I&&n==="render"?"true":void 0})});mS.displayName="Form";function pS(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function dy(n){let i=v.useContext(xl);return De(i,pS(n)),i}function gS(n,{target:i,replace:r,unstable_mask:s,state:c,preventScrollReset:d,relative:h,viewTransition:m,unstable_defaultShouldRevalidate:y,unstable_useTransitions:p}={}){let S=Xn(),x=Ta(),_=jr(n,{relative:h});return v.useCallback(N=>{if($1(N,i)){N.preventDefault();let z=r!==void 0?r:qa(x)===qa(_),D=()=>S(n,{replace:z,unstable_mask:s,state:c,preventScrollReset:d,relative:h,viewTransition:m,unstable_defaultShouldRevalidate:y});p?v.startTransition(()=>D()):D()}},[x,S,_,r,s,c,i,n,d,h,m,y,p])}function yS(n){ft(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 i=v.useRef(Iu(n)),r=v.useRef(!1),s=Ta(),c=v.useMemo(()=>X1(s.search,r.current?null:i.current),[s.search]),d=Xn(),h=v.useCallback((m,y)=>{const p=Iu(typeof m=="function"?m(new URLSearchParams(c)):m);r.current=!0,d("?"+p,y)},[d,c]);return[c,h]}var xS=0,vS=()=>`__${String(++xS)}__`;function bS(){let{router:n}=dy("useSubmit"),{basename:i}=v.useContext(ra),r=R1(),s=n.fetch,c=n.navigate;return v.useCallback(async(d,h={})=>{let{action:m,method:y,encType:p,formData:S,body:x}=F1(d,i);if(h.navigate===!1){let _=h.fetcherKey||vS();await s(_,r,h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:S,body:x,formMethod:h.method||y,formEncType:h.encType||p,flushSync:h.flushSync})}else await c(h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:S,body:x,formMethod:h.method||y,formEncType:h.encType||p,replace:h.replace,state:h.state,fromRouteId:r,flushSync:h.flushSync,viewTransition:h.viewTransition})},[s,c,i,r])}function SS(n,{relative:i}={}){let{basename:r}=v.useContext(ra),s=v.useContext(va);De(s,"useFormAction must be used inside a RouteContext");let[c]=s.matches.slice(-1),d={...jr(n||".",{relative:i})},h=Ta();if(n==null){d.search=h.search;let m=new URLSearchParams(d.search),y=m.getAll("index");if(y.some(S=>S==="")){m.delete("index"),y.filter(x=>x).forEach(x=>m.append("index",x));let S=m.toString();d.search=S?`?${S}`:""}}return(!n||n===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(d.pathname=d.pathname==="/"?r:Oa([r,d.pathname])),qa(d)}function _S(n,{relative:i}={}){let r=v.useContext(id);De(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=dy("useViewTransitionState"),c=jr(n,{relative:i});if(!r.isTransitioning)return!1;let d=xa(r.currentLocation.pathname,s)||r.currentLocation.pathname,h=xa(r.nextLocation.pathname,s)||r.nextLocation.pathname;return no(c.pathname,h)!=null||no(c.pathname,d)!=null}const fy=(...n)=>n.filter((i,r,s)=>!!i&&i.trim()!==""&&s.indexOf(i)===r).join(" ").trim();const jS=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const NS=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,s)=>s?s.toUpperCase():r.toLowerCase());const ig=n=>{const i=NS(n);return i.charAt(0).toUpperCase()+i.slice(1)};var ES={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 wS=n=>{for(const i in n)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1};const CS=v.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:c="",children:d,iconNode:h,...m},y)=>v.createElement("svg",{ref:y,...ES,width:i,height:i,stroke:n,strokeWidth:s?Number(r)*24/Number(i):r,className:fy("lucide",c),...!d&&!wS(m)&&{"aria-hidden":"true"},...m},[...h.map(([p,S])=>v.createElement(p,S)),...Array.isArray(d)?d:[d]]));const Me=(n,i)=>{const r=v.forwardRef(({className:s,...c},d)=>v.createElement(CS,{ref:d,iconNode:i,className:fy(`lucide-${jS(ig(n))}`,`lucide-${n}`,s),...c}));return r.displayName=ig(n),r};const RS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],hy=Me("arrow-right",RS);const zS=[["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"}]],OS=Me("boxes",zS);const TS=[["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"}]],DS=Me("brain",TS);const MS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],lo=Me("check",MS);const AS=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],dd=Me("chevron-down",AS);const LS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],dn=Me("chevron-right",LS);const kS=[["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"}]],fd=Me("circle-alert",kS);const US=[["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"}]],rg=Me("copy",US);const HS=[["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"}]],BS=Me("database",HS);const qS=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],sg=Me("download",qS);const YS=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],VS=Me("ellipsis",YS);const GS=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],KS=Me("external-link",GS);const $S=[["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"}]],XS=Me("file-spreadsheet",$S);const QS=[["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"}]],ci=Me("file-text",QS);const ZS=[["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"}]],my=Me("file",ZS);const FS=[["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"}]],fo=Me("folder-git-2",FS);const JS=[["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"}]],WS=Me("folder-input",JS);const PS=[["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"}]],IS=Me("folder-open",PS);const e4=[["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"}]],py=Me("folder-plus",e4);const t4=[["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"}]],la=Me("folder",t4);const a4=[["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"}]],og=Me("git-branch",a4);const n4=[["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"}]],l4=Me("globe",n4);const i4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],gy=Me("info",i4);const r4=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ia=Me("loader-circle",r4);const s4=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],o4=Me("menu",s4);const c4=[["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"}]],u4=Me("monitor",c4);const d4=[["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"}]],f4=Me("moon",d4);const h4=[["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"}]],ho=Me("package",h4);const m4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],p4=Me("panel-left",m4);const g4=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],yy=Me("plus",g4);const y4=[["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"}]],x4=Me("refresh-cw",y4);const v4=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],b4=Me("search",v4);const S4=[["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"}]],_4=Me("settings",S4);const j4=[["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"}]],N4=Me("share-2",j4);const E4=[["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"}]],w4=Me("sparkles",E4);const C4=[["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"}]],R4=Me("sun",C4);const z4=[["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"}]],O4=Me("upload",z4);const T4=[["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"}]],D4=Me("users",T4);const M4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],hd=Me("x",M4),cg=n=>{let i;const r=new Set,s=(p,S)=>{const x=typeof p=="function"?p(i):p;if(!Object.is(x,i)){const _=i;i=S??(typeof x!="object"||x===null)?x:Object.assign({},i,x),r.forEach(N=>N(i,_))}},c=()=>i,m={setState:s,getState:c,getInitialState:()=>y,subscribe:p=>(r.add(p),()=>r.delete(p))},y=i=n(s,c,m);return m},A4=(n=>n?cg(n):cg),L4=n=>n;function k4(n,i=L4){const r=ri.useSyncExternalStore(n.subscribe,ri.useCallback(()=>i(n.getState()),[n,i]),ri.useCallback(()=>i(n.getInitialState()),[n,i]));return ri.useDebugValue(r),r}const ug=n=>{const i=A4(n),r=s=>k4(i,s);return Object.assign(r,i),r},mo=(n=>n?ug(n):ug),U4="/api/v1";class Is extends Error{constructor(i,r,s){super(s),this.status=i,this.code=r,this.name="ApiError"}}async function Qs(n,i,r,s){let c=`${U4}${i}`;if(s){const m=new URLSearchParams(s).toString();m&&(c+=`?${m}`)}const d={method:n,headers:{"Content-Type":"application/json"}};r!==void 0&&(d.body=JSON.stringify(r));const h=await fetch(c,d);if(!h.ok){let m="UNKNOWN",y=h.statusText;try{const p=await h.json();p.code&&(m=p.code),p.message&&(y=p.message)}catch{}throw new Is(h.status,m,y)}return h.json()}const Mt={get(n,i){return Qs("GET",n,void 0,i)},post(n,i){return Qs("POST",n,i)},put(n,i){return Qs("PUT",n,i)},delete(n){return Qs("DELETE",n)}},H4=3e4,B4=1e3,q4=3e4;class Y4{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(i){this._status=i;for(const r of this.statusHandlers)r(i)}onStatusChange(i){return this.statusHandlers.add(i),()=>{this.statusHandlers.delete(i)}}connect(i){this.url=i,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(i,r){let s=this.handlers.get(i);return s||(s=new Set,this.handlers.set(i,s)),s.add(r),()=>{s.delete(r),s.size===0&&this.handlers.delete(i)}}send(i,r){if(this.ws?.readyState!==WebSocket.OPEN)return;const s={event:i,payload:r,timestamp:Date.now()};this.ws.send(JSON.stringify(s))}open(){this.setStatus("connecting");const i=new WebSocket(this.url);i.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},i.onmessage=r=>{try{const s=JSON.parse(String(r.data));if(s.event==="pong")return;const c=this.handlers.get(s.event);if(c)for(const d of c)d(s.payload)}catch{}},i.onclose=()=>{this.stopHeartbeat(),this.intentionalClose||(this.setStatus("reconnecting"),this.scheduleReconnect())},i.onerror=()=>{},this.ws=i}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({event:"ping",payload:null,timestamp:Date.now()}))},H4)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const i=Math.min(B4*2**this.reconnectAttempt,q4);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},i)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const Ya=new Y4,yl=mo(n=>({status:"disconnected",onlineCount:0,connections:[],setStatus:i=>n({status:i}),fetchDaemonStatus:async()=>{try{const i=await Mt.get("/daemons/status");n({onlineCount:i.online_count,connections:i.connections})}catch{}}})),V4=n=>n==="connecting"?"disconnected":n;Ya.onStatusChange(n=>{yl.getState().setStatus(V4(n))});Ya.on("ws:daemon:connected",n=>{const i=n;yl.setState(r=>{if(r.connections.some(h=>h.machine_id===i.machine_id))return r;const c={machine_id:i.machine_id};i.lib_id&&(c.lib_id=i.lib_id);const d=[...r.connections,c];return{connections:d,onlineCount:d.length}})});Ya.on("ws:daemon:status",n=>{const i=n;yl.setState(r=>{if(i.is_online){if(r.connections.some(m=>m.machine_id===i.machine_id))return r;const d={machine_id:i.machine_id};i.lib_id&&(d.lib_id=i.lib_id);const h=[...r.connections,d];return{connections:h,onlineCount:h.length}}const s=r.connections.filter(c=>c.machine_id!==i.machine_id);return{connections:s,onlineCount:s.length}})});const po="lib_cloud_default",Bt=mo((n,i)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{n({loading:!0,error:null});try{const r=await Mt.get("/libraries");n({libraries:r,loading:!1})}catch(r){n({error:r instanceof Error?r.message:"Failed to load libraries",loading:!1})}},createLibrary:async r=>{const s=await Mt.post("/libraries",r);return n(c=>({libraries:[...c.libraries,s]})),s},deleteLibrary:async r=>{await Mt.delete(`/libraries/${r}`),n(s=>({libraries:s.libraries.filter(c=>c.id!==r)}))},updateLibraryName:async(r,s)=>{const c=await Mt.put(`/libraries/${r}`,{name:s});n(d=>({libraries:d.libraries.map(h=>h.id===r?c:h)}))},_updateLibraryOnline:(r,s)=>{n(c=>({libraries:c.libraries.map(d=>d.id===r?{...d,is_online:s}:d)}))},_refreshLibrary:async r=>{try{const s=await Mt.get(`/libraries/${r}`);n(c=>({libraries:c.libraries.map(d=>d.id===r?s:d)}))}catch{i().fetchLibraries()}}})),Nr=n=>{const i=n.libraries.filter(s=>s.type==="cloud").sort((s,c)=>s.created_at.localeCompare(c.created_at)),r=n.libraries.filter(s=>s.type==="daemon").sort((s,c)=>s.name.localeCompare(c.name));return[...i,...r]},G4=n=>n.libraries.filter(i=>i.type==="daemon");Ya.on("ws:daemon:status",n=>{const i=n;i.lib_id&&Bt.getState()._updateLibraryOnline(i.lib_id,i.is_online),Bt.getState().fetchLibraries()});Ya.on("ws:daemon:connected",n=>{const i=n;i.lib_id&&Bt.getState()._updateLibraryOnline(i.lib_id,!0),Bt.getState().fetchLibraries()});Ya.on("ws:library:updated",n=>{const i=n;Bt.getState()._refreshLibrary(i.library_id)});const dg=n=>Symbol.iterator in n,fg=n=>"entries"in n,hg=(n,i)=>{const r=n instanceof Map?n:new Map(n.entries()),s=i instanceof Map?i:new Map(i.entries());if(r.size!==s.size)return!1;for(const[c,d]of r)if(!s.has(c)||!Object.is(d,s.get(c)))return!1;return!0},K4=(n,i)=>{const r=n[Symbol.iterator](),s=i[Symbol.iterator]();let c=r.next(),d=s.next();for(;!c.done&&!d.done;){if(!Object.is(c.value,d.value))return!1;c=r.next(),d=s.next()}return!!c.done&&!!d.done};function $4(n,i){return Object.is(n,i)?!0:typeof n!="object"||n===null||typeof i!="object"||i===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(i)?!1:dg(n)&&dg(i)?fg(n)&&fg(i)?hg(n,i):K4(n,i):hg({entries:()=>Object.entries(n)},{entries:()=>Object.entries(i)})}function di(n){const i=ri.useRef(void 0);return r=>{const s=n(r);return $4(i.current,s)?i.current:i.current=s}}function ed(){const{t:n}=we(),i=yl(h=>h.onlineCount),r=yl(h=>h.connections.length);if(Bt(di(G4)).length===0)return null;const c=i>0,d=c?n("sources.header.daemon_status",{online:i,total:r}):n("sources.header.all_offline");return f.jsxs("div",{className:"group relative flex items-center",title:d,children:[f.jsx("span",{className:`inline-block h-[7px] w-[7px] rounded-full ${c?"bg-c4a-success":"bg-c4a-error"}`}),f.jsx("span",{className:"pointer-events-none absolute right-full mr-2 hidden whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-xs text-c4a-text-secondary shadow-c4a-md group-hover:block",children:d})]})}const mg=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function X4(){const{t:n}=we(),[i,r]=v.useState(!1);return f.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[f.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[f.jsxs(Ft,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),f.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),f.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[f.jsx("nav",{className:"flex items-center gap-4",children:mg.map(({to:s,labelKey:c})=>f.jsx(xr,{to:s,end:s==="/",className:({isActive:d})=>`font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${d?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(c)},s))}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(ed,{}),f.jsx(Ft,{to:"/login",className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:n("nav.login")})]})]}),f.jsx("button",{onClick:()=>r(!i),className:"text-c4a-text-secondary md:hidden",children:i?f.jsx(hd,{size:20}):f.jsx(o4,{size:20})})]}),i&&f.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[f.jsx("nav",{className:"flex flex-col gap-2",children:mg.map(({to:s,labelKey:c})=>f.jsx(xr,{to:s,end:s==="/",onClick:()=>r(!1),className:({isActive:d})=>`block py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${d?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:n(c)},s))}),f.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(ed,{}),f.jsx(Ft,{to:"/login",onClick:()=>r(!1),className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:n("nav.login")})]})})]})]})}function Q4(n){return n==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n==="system"?"dark":n}function xy(n){if(typeof window>"u")return;const i=Q4(n);document.documentElement.setAttribute("data-theme",i),localStorage.setItem("theme",n)}function Z4(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const vy=mo(n=>({theme:Z4(),setTheme:i=>{xy(i),n({theme:i})}}));let pg=!1;function F4(){if(pg||typeof window>"u")return;pg=!0;const n=window.matchMedia("(prefers-color-scheme: dark)"),i=()=>{const{theme:r}=vy.getState();r==="system"&&xy("system")};n.addEventListener("change",i)}F4();const J4=[{mode:"light",icon:R4,labelKey:"footer.theme.light"},{mode:"dark",icon:f4,labelKey:"footer.theme.dark"},{mode:"system",icon:u4,labelKey:"footer.theme.system"}];function W4(){const{t:n}=we(),{theme:i,setTheme:r}=vy();return f.jsx("div",{className:"flex items-center gap-1",children:J4.map(({mode:s,icon:c,labelKey:d})=>f.jsx("button",{onClick:()=>r(s),title:n(d),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${i===s?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:f.jsx(c,{size:14})},s))})}function P4(){const{i18n:n}=we(),i=()=>{const r=n.language==="en"?"zh":"en";n.changeLanguage(r)};return f.jsx("button",{onClick:i,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:n.language==="en"?"CN":"EN"})}const I4="_brandIcon_1c7st_1",e2="_iconPulse_1c7st_35",gg={brandIcon:I4,iconPulse:e2};function by(){const{t:n}=we(),i=new Date().getFullYear();return f.jsx("footer",{className:"border-t border-c4a-border-subtle bg-c4a-bg-base px-4 py-4",children:f.jsxs("div",{className:"flex items-end justify-between gap-4",children:[f.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[f.jsx("div",{className:gg.brandIcon,children:f.jsx("span",{className:gg.iconPulse,children:"C4A"})}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),f.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:n("footer.tagline")})]})]}),f.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(W4,{}),f.jsx(P4,{})]}),f.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:n("footer.copyright",{year:i})})]})]})})}function t2(){return f.jsxs("div",{className:"flex min-h-screen flex-col",children:[f.jsx(X4,{}),f.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:f.jsx(sy,{})}),f.jsx(by,{})]})}function a2({onToggleSidebar:n}){const{t:i}=we();return f.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:f.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[n&&f.jsx("button",{onClick:n,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:f.jsx(p4,{size:20})}),f.jsxs(Ft,{to:"/",className:"hidden items-center gap-2 text-c4a-text-primary md:flex",children:[f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),f.jsx("span",{className:"font-mono text-sm font-semibold uppercase tracking-tight",children:"Context4AI"})]})]}),f.jsx(Ft,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:f.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(ed,{}),f.jsx(Ft,{to:"/login",className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:i("nav.login")})]})]})})}function Sy({currentName:n,onConfirm:i,onCancel:r,error:s}){const[c,d]=v.useState(n),h=v.useRef(null);v.useEffect(()=>{h.current?.select()},[]);const m=v.useCallback(()=>{const p=c.trim();p&&p!==n?i(p):r()},[c,n,i,r]),y=v.useCallback(p=>{p.key==="Enter"?(p.preventDefault(),m()):p.key==="Escape"&&r()},[m,r]);return f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("input",{ref:h,value:c,onChange:p=>d(p.target.value),onKeyDown:y,onBlur:m,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}),f.jsx("button",{onClick:p=>{p.stopPropagation(),m()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:f.jsx(lo,{size:14})}),f.jsx("button",{onClick:p=>{p.stopPropagation(),r()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:f.jsx(hd,{size:14})}),s&&f.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:s})]})}function _y({target:n,onConfirm:i,onCancel:r}){const{t:s}=we(),c=v.useRef(null);v.useEffect(()=>{const h=m=>{m.key==="Escape"&&r()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[r]);const d=v.useCallback(h=>{c.current&&!c.current.contains(h.target)&&r()},[r]);return f.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:d,children:f.jsxs("div",{ref:c,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:s("sources.delete.confirm_title")}),f.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[n.type==="resource"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:s("sources.delete.resource",{name:n.name})}),f.jsx("p",{children:s("sources.delete.resource_impact")}),f.jsx("p",{className:"text-c4a-warning",children:s("sources.delete.session_warning")}),f.jsx("p",{children:s("sources.delete.entity_safe")})]}),n.type==="folder"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:s("sources.delete.folder",{name:n.name})}),f.jsx("p",{children:n.folderCount!==void 0&&n.sourceCount!==void 0?s("sources.delete.folder_impact",{folders:n.folderCount,sources:n.sourceCount}):s("sources.delete.folder_impact_generic")}),f.jsx("p",{className:"text-c4a-warning",children:s("sources.delete.irreversible")})]}),n.type==="repo"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:s("sources.delete.repo",{name:n.name,library:n.libraryName})}),f.jsx("p",{children:n.packageCount!==void 0&&n.docCount!==void 0?s("sources.delete.repo_impact",{packages:n.packageCount,docs:n.docCount}):s("sources.delete.repo_impact_generic")}),f.jsx("p",{children:s("sources.delete.local_safe")}),f.jsx("p",{children:s("sources.delete.entity_safe")})]}),n.type==="client"&&f.jsxs(f.Fragment,{children:[f.jsx("p",{children:s("sources.delete.client",{name:n.name})}),f.jsx("p",{children:s("sources.delete.client_impact")}),f.jsx("p",{children:s("sources.delete.local_safe")}),f.jsx("p",{children:s("sources.delete.entity_safe")}),f.jsx("p",{className:"text-c4a-warning",children:s("sources.delete.irreversible")}),f.jsx("p",{className:"text-c4a-text-muted",children:s("sources.delete.client_reregister")})]})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:r,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:s("common.cancel")}),f.jsx("button",{onClick:i,className:"rounded bg-c4a-error px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-error/80",children:s("common.confirm")})]})]})})}const jy="lib_cloud_default",n2=n=>`flex items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${n?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,l2=[{to:"/studio/modeling",icon:OS,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:DS,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:b4,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:N4,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:D4,i18nKey:"studio.sidebar.collaboration"},{to:"/studio/settings",icon:_4,i18nKey:"studio.sidebar.settings"}];function i2({state:n,onClose:i,onRename:r,onDelete:s}){const{t:c}=we(),d=v.useRef(null);v.useEffect(()=>{const m=y=>{d.current&&!d.current.contains(y.target)&&i()};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[i]);const h=n.library.id===jy;return f.jsxs("div",{ref:d,className:"fixed z-50 min-w-[140px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-lg",style:{top:n.y,left:n.x},children:[f.jsx("button",{className:"flex w-full items-center px-3 py-1.5 text-left font-mono text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary",onClick:()=>{r(n.library),i()},children:c("sources.library.rename")}),!h&&f.jsx("button",{className:"flex w-full items-center px-3 py-1.5 text-left font-mono text-xs text-c4a-error hover:bg-c4a-bg-hover",onClick:()=>{s(n.library),i()},children:c("sources.actions.delete")})]})}function yg({onNavigate:n}){const{t:i}=we(),r=Ta(),s=Xn(),c=Bt(di(Nr)),d=Bt(ae=>ae.updateLibraryName),h=Bt(ae=>ae.deleteLibrary),m=r.pathname.startsWith("/studio/sources")||r.pathname.startsWith("/studio/source/"),[y,p]=v.useState(m),[S,x]=v.useState(null),[_,N]=v.useState(null),[z,D]=v.useState(null),[k,W]=v.useState(null);v.useEffect(()=>{m&&p(!0)},[m]);const X=v.useCallback((ae,Q)=>{ae.preventDefault(),x({x:ae.clientX,y:ae.clientY,library:Q})},[]),I=v.useCallback(()=>x(null),[]),se=v.useCallback(ae=>{N(ae.id),D(null)},[]),de=v.useCallback(async ae=>{if(_)try{await d(_,ae),N(null),D(null)}catch(Q){const xe=Q instanceof Error?Q.message:String(Q);D(xe)}},[_,d]),V=v.useCallback(()=>{N(null),D(null)},[]),B=v.useCallback(ae=>{W(ae)},[]),E=v.useCallback(async()=>{if(k){try{await h(k.id),r.pathname.includes(k.id)&&s("/studio/sources")}catch{}W(null)}},[k,h,r.pathname,s]),$=v.useCallback(()=>{W(null)},[]),ne=ae=>ae.id===jy?i("sources.library.default_cloud_name"):ae.name;return f.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:[f.jsxs("nav",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"group/sources",children:[f.jsxs("button",{onClick:()=>p(ae=>!ae),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 ${m?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[f.jsx(BS,{size:14}),i("studio.sidebar.sources"),f.jsx("span",{role:"button",tabIndex:0,onClick:ae=>{ae.stopPropagation(),s("/studio/sources/add-client"),n?.()},onKeyDown:ae=>{(ae.key==="Enter"||ae.key===" ")&&(ae.stopPropagation(),s("/studio/sources/add-client"),n?.())},className:"rounded p-0.5 text-c4a-text-muted opacity-0 transition-opacity hover:bg-c4a-bg-hover hover:text-c4a-text-primary max-md:opacity-100 group-hover/sources:opacity-100",title:i("sources.menu.add_client"),children:f.jsx(yy,{size:12})}),f.jsx("span",{className:"ml-auto shrink-0",children:y?f.jsx(dd,{size:12}):f.jsx(dn,{size:12})})]}),y&&f.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:c.map(ae=>{const Q=_===ae.id,xe=ne(ae);return Q?f.jsx("div",{className:"py-1.5 pl-8 pr-3",onClick:F=>F.stopPropagation(),children:f.jsx(Sy,{currentName:xe,onConfirm:de,onCancel:V,error:z})},ae.id):f.jsxs(xr,{to:`/studio/sources/${ae.id}`,onClick:n,onContextMenu:F=>X(F,ae),className:({isActive:F})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${F?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary"}`,children:[f.jsx("span",{className:"truncate",children:xe}),ae.type==="daemon"&&f.jsx("span",{className:`ml-auto h-[7px] w-[7px] shrink-0 rounded-full ${ae.is_online?"bg-c4a-success":"bg-c4a-error"}`})]},ae.id)})})]}),l2.map(({to:ae,icon:Q,i18nKey:xe})=>f.jsxs(xr,{to:ae,onClick:n,className:({isActive:F})=>n2(F),children:[f.jsx(Q,{size:14}),i(xe)]},ae))]}),S&&f.jsx(i2,{state:S,onClose:I,onRename:se,onDelete:B}),k&&f.jsx(_y,{target:{type:"client",name:ne(k)},onConfirm:E,onCancel:$})]})}function r2(){const[n,i]=v.useState(!1);return v.useEffect(()=>{Bt.getState().fetchLibraries(),yl.getState().fetchDaemonStatus()},[]),v.useEffect(()=>Ya.onStatusChange(r=>{r==="connected"&&(Bt.getState().fetchLibraries(),yl.getState().fetchDaemonStatus())}),[]),f.jsxs("div",{className:"flex min-h-screen flex-col",children:[f.jsx(a2,{onToggleSidebar:()=>i(!n)}),f.jsxs("div",{className:"flex flex-1",children:[f.jsx("div",{className:"hidden md:block",children:f.jsx(yg,{})}),n&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>i(!1)}),f.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:f.jsx(yg,{onNavigate:()=>i(!1)})})]}),f.jsx("main",{className:"flex flex-1 flex-col overflow-x-hidden",children:f.jsx(sy,{})})]}),f.jsx(by,{})]})}function s2(){const{t:n}=we();return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[f.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:n("home.hero.title")}),f.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:n("home.hero.description")}),f.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[f.jsxs(Ft,{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:[n("home.hero.cta.studio"),f.jsx(hy,{size:14})]}),f.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:n("home.hero.cta.github")})]})]})}function ba({title:n,version:i,description:r}){const{t:s}=we();return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-md text-center",children:[f.jsx("h2",{className:"font-mono text-2xl font-bold uppercase text-c4a-text-primary",children:n}),i&&f.jsx("span",{className:"mt-3 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:s("placeholder.coming",{version:i})}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:r})]})})}function o2(){const{t:n}=we();return f.jsx(ba,{title:n("page.login.title"),version:"0.5.0",description:n("page.login.description")})}function c2(){const{t:n}=we();return f.jsx(ba,{title:n("page.docs.title"),version:"0.4.13",description:n("page.docs.description")})}function u2(){const{t:n}=we();return f.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[f.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:n("notfound.title")}),f.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:n("notfound.description")}),f.jsx(Ft,{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:n("notfound.back")})]})}function d2(){const{t:n}=we();return f.jsx(ba,{title:n("page.modeling.title"),version:"0.4.16",description:n("page.modeling.description")})}function f2(){const{t:n}=we();return f.jsx(ba,{title:n("page.brain.title"),version:"0.4.18",description:n("page.brain.description")})}function h2(){const{t:n}=we();return f.jsx(ba,{title:n("page.discovery.title"),version:"0.6.x",description:n("page.discovery.description")})}function m2(){const{t:n}=we();return f.jsx(ba,{title:n("page.sharing.title"),version:"0.4.39",description:n("page.sharing.description")})}function p2(){const{t:n}=we();return f.jsx(ba,{title:n("page.collaboration.title"),version:"0.5.x",description:n("page.collaboration.description")})}function g2(){const{t:n}=we();return f.jsx(ba,{title:n("page.settings.title"),version:"0.5.x",description:n("page.settings.description")})}function y2(){const{t:n}=we();return f.jsx(ba,{title:n("page.code_setup.title"),version:"0.4.13",description:n("page.code_setup.description")})}function x2(){const{t:n}=we();return f.jsx(ba,{title:n("page.code_compile.title"),version:"0.4.13",description:n("page.code_compile.description")})}function v2(){const{t:n}=we();return f.jsx(ba,{title:n("page.code_review.title"),version:"0.4.14",description:n("page.code_review.description")})}function b2(){const{t:n}=we();return f.jsx(ba,{title:n("page.code_result.title"),version:"0.4.14",description:n("page.code_result.description")})}const go=mo(n=>({sources:[],currentSource:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",fetchSources:async({library_id:i,parent_id:r,limit:s,offset:c})=>{n({loading:!0,error:null});try{const d={library_id:i};r!=null&&(d.parent_id=r),s!==void 0&&(d.limit=String(s)),c!==void 0&&(d.offset=String(c));const h=await Mt.get("/sources",d);n({sources:h.items,total:h.total,limit:h.limit,offset:h.offset,loading:!1})}catch(d){n({error:d instanceof Error?d.message:"Failed to load sources",loading:!1})}},fetchChildren:async i=>await Mt.get(`/sources/${i}/children`),fetchSource:async i=>{n({loading:!0,error:null});try{const r=await Mt.get(`/sources/${i}`);n({currentSource:r,loading:!1})}catch(r){n({error:r instanceof Error?r.message:"Failed to load source",loading:!1})}},createSource:async i=>await Mt.post("/sources",i),updateSource:async(i,r)=>{const s=await Mt.put(`/sources/${i}`,r);n(c=>({sources:c.sources.map(d=>d.id===i?s:d),currentSource:c.currentSource?.id===i?s:c.currentSource}))},deleteSource:async i=>{await Mt.delete(`/sources/${i}`),n(r=>({sources:r.sources.filter(s=>s.id!==i),currentSource:r.currentSource?.id===i?null:r.currentSource}))},setFilter:i=>n({filter:i}),clearSources:()=>n({sources:[],currentSource:null,total:0,offset:0})}));function Er({segments:n}){const{t:i}=we(),r=[{label:i("sources.breadcrumb.sources")},...n],s=r.length>4?[r[0],{label:"..."},r[r.length-2],r[r.length-1]]:r;return f.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs text-c4a-text-muted",children:s.map((c,d)=>{const h=d===s.length-1;return f.jsxs("span",{className:"flex items-center gap-1",children:[d>0&&f.jsx(dn,{size:12,className:"text-c4a-text-muted"}),c.to&&!h?f.jsx(Ft,{to:c.to,className:"cursor-pointer transition-colors hover:text-c4a-text-primary",children:c.label}):f.jsx("span",{className:h?"text-c4a-text-primary":"",children:c.label})]},d)})})}const S2=["all","indexed","not_indexed"];function _2({value:n,onChange:i}){const{t:r}=we(),s={all:r("sources.filter.all"),indexed:r("sources.filter.indexed"),not_indexed:r("sources.filter.not_indexed")};return f.jsx("select",{value:n,onChange:c=>i(c.target.value),className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1 font-mono text-xs text-c4a-text-secondary outline-none transition-colors hover:border-c4a-border-strong focus:border-c4a-accent",children:S2.map(c=>f.jsx("option",{value:c,children:s[c]},c))})}function j2({source:n,isDaemonLibrary:i}){return n.kind==="folder"?i?f.jsx(IS,{size:16,className:"shrink-0 text-c4a-text-muted"}):f.jsx(la,{size:16,className:"shrink-0 text-c4a-text-muted"}):n.source_type==="code"?f.jsx(ho,{size:16,className:"shrink-0 text-c4a-accent"}):f.jsx(ci,{size:16,className:"shrink-0 text-c4a-text-secondary"})}function xg({status:n}){const{t:i}=we(),r={none:"bg-c4a-bg-active text-c4a-text-muted",indexed:"bg-c4a-success/20 text-c4a-success",stale:"bg-c4a-warning/20 text-c4a-warning"},s={none:"sources.status.none",indexed:"sources.status.indexed",stale:"sources.status.stale"};return f.jsx("span",{className:`rounded px-1.5 py-0.5 font-mono text-[10px] uppercase ${r[n]}`,children:i(s[n])})}function N2({type:n}){const{t:i}=we(),r=n==="code"?"sources.type.code":"sources.type.doc";return f.jsx("span",{className:"font-mono text-[10px] uppercase text-c4a-text-muted",children:i(r)})}function E2({source:n,childCount:i,isDaemonLibrary:r,isRepoRoot:s,onClick:c,onRename:d,onMoveTo:h,onDelete:m}){const{t:y}=we(),[p,S]=v.useState(!1),[x,_]=v.useState(!1),[N,z]=v.useState(null),D=v.useRef(null);v.useEffect(()=>{if(!p)return;const B=E=>{D.current&&!D.current.contains(E.target)&&S(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[p]);const k=v.useCallback(B=>{B.preventDefault(),S(!0)},[]),W=v.useCallback(async B=>{if(!d)return;const E=await d(B);E?z(E):(_(!1),z(null))},[d]),X=v.useCallback(()=>{_(!1),z(null)},[]),I=!s&&d,se=n.kind==="source"&&!s&&h,de=m,V=I||se||de;return f.jsxs("div",{className:"group flex items-center gap-3 rounded px-3 py-2 transition-colors hover:bg-c4a-bg-hover cursor-pointer",onClick:x?void 0:c,onContextMenu:x?void 0:k,children:[f.jsx(j2,{source:n,isDaemonLibrary:r??!1}),x?f.jsx("div",{className:"min-w-0 flex-1",onClick:B=>B.stopPropagation(),children:f.jsx(Sy,{currentName:n.name,onConfirm:W,onCancel:X,error:N})}):f.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-c4a-text-primary",children:n.name}),f.jsxs("div",{className:"hidden items-center gap-2 md:flex",children:[n.kind==="folder"&&i!==void 0&&f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:y("common.items",{count:i})}),n.kind==="source"&&f.jsxs(f.Fragment,{children:[f.jsx(xg,{status:n.index_status}),n.source_type&&f.jsx(N2,{type:n.source_type})]})]}),f.jsx("div",{className:"flex items-center gap-2 md:hidden",children:n.kind==="source"&&f.jsx(xg,{status:n.index_status})}),V&&f.jsxs("div",{className:"relative",ref:D,children:[f.jsx("button",{onClick:B=>{B.stopPropagation(),S(E=>!E)},className:"rounded p-1 text-c4a-text-muted opacity-0 transition-opacity hover:bg-c4a-bg-active hover:text-c4a-text-primary group-hover:opacity-100",children:f.jsx(VS,{size:14})}),p&&f.jsxs("div",{className:"absolute right-0 top-full z-50 mt-1 min-w-[140px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-lg",children:[I&&f.jsx("button",{className:"flex w-full items-center px-3 py-1.5 text-left font-mono text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary",onClick:B=>{B.stopPropagation(),S(!1),_(!0)},children:y("sources.actions.rename")}),se&&f.jsx("button",{className:"flex w-full items-center px-3 py-1.5 text-left font-mono text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary",onClick:B=>{B.stopPropagation(),S(!1),h()},children:y("sources.actions.move_to")}),de&&f.jsx("button",{className:"flex w-full items-center px-3 py-1.5 text-left font-mono text-xs text-c4a-error hover:bg-c4a-bg-hover",onClick:B=>{B.stopPropagation(),S(!1),m()},children:y("sources.actions.delete")})]})]})]})}function w2({libraryId:n,currentParentId:i,sourceName:r,sourceId:s,onConfirm:c,onCancel:d,error:h}){const{t:m}=we(),y=v.useRef(null),[p,S]=v.useState(null),[x,_]=v.useState([]),[N,z]=v.useState(!0),D=v.useCallback((V,B)=>{if(B===null)return"/";for(const E of V){if(E.id===B)return E.name;if(E.children.length>0){const $=D(E.children,B);if($!==B)return $}}return B},[]),k=v.useMemo(()=>i===null?"/":D(x,i),[i,x,D]),W=v.useMemo(()=>p===null?"/":D(x,p),[p,x,D]);v.useEffect(()=>{const V=B=>{B.key==="Escape"&&d()};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[d]),v.useEffect(()=>{X()},[n]);const X=async()=>{try{const B=(await Mt.get("/sources",{library_id:n,kind:"folder",limit:"500"})).items.filter($=>$.id!==s),E=B.filter($=>$.parent_id===null).map($=>I($,B));_(E)}catch{}finally{z(!1)}},I=(V,B)=>{const E=B.filter($=>$.parent_id===V.id).map($=>I($,B));return{id:V.id,name:V.name,children:E,expanded:!1,loaded:!0}},se=v.useCallback(V=>{_(B=>Ey(B,V))},[]),de=v.useCallback(V=>{y.current&&!y.current.contains(V.target)&&d()},[d]);return f.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:de,children:f.jsxs("div",{ref:y,className:"mx-4 w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:m("sources.actions.move_to")}),f.jsx("div",{className:"mt-4 max-h-60 overflow-y-auto",children:N?f.jsx("p",{className:"text-xs text-c4a-text-muted",children:m("common.loading")}):f.jsxs(f.Fragment,{children:[f.jsxs("button",{onClick:()=>S(null),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm ${p===null?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"} ${i===null?"opacity-40 pointer-events-none":""}`,children:[f.jsx(la,{size:14}),"/ (",m("sources.breadcrumb.sources"),")"]}),x.map(V=>f.jsx(Ny,{node:V,depth:1,selected:p,currentParentId:i,onSelect:S,onToggle:se},V.id))]})}),!N&&f.jsxs("div",{className:"mt-3 space-y-1 border-t border-c4a-border-subtle pt-3 text-xs",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-16 text-c4a-text-muted",children:m("sources.move.current")}),f.jsxs("span",{className:"font-mono text-c4a-text-secondary",children:[k,"/",r]})]}),p!==void 0&&f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-16 text-c4a-text-muted",children:m("sources.move.target")}),f.jsxs("span",{className:"font-mono text-c4a-accent",children:[W,"/",r]})]})]}),h&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:h}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsx("button",{onClick:d,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:m("common.cancel")}),f.jsx("button",{onClick:()=>c(p),className:"rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:m("common.confirm")})]})]})})}function Ny({node:n,depth:i,selected:r,currentParentId:s,onSelect:c,onToggle:d}){const h=n.id===s,m=r===n.id,y=n.children.length>0;return f.jsxs("div",{children:[f.jsxs("button",{onClick:()=>{h||c(n.id)},className:`flex w-full items-center gap-1 rounded px-2 py-1.5 text-left text-sm ${m?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"} ${h?"opacity-40 pointer-events-none":""}`,style:{paddingLeft:`${i*16+8}px`},children:[y?f.jsx("span",{onClick:p=>{p.stopPropagation(),d(n.id)},className:"shrink-0 cursor-pointer",children:n.expanded?f.jsx(dd,{size:12}):f.jsx(dn,{size:12})}):f.jsx("span",{className:"w-3 shrink-0"}),f.jsx(la,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:n.name})]}),n.expanded&&n.children.map(p=>f.jsx(Ny,{node:p,depth:i+1,selected:r,currentParentId:s,onSelect:c,onToggle:d},p.id))]})}function Ey(n,i){return n.map(r=>r.id===i?{...r,expanded:!r.expanded}:r.children.length>0?{...r,children:Ey(r.children,i)}:r)}function C2({onConfirm:n,onCancel:i,error:r}){const{t:s}=we(),[c,d]=v.useState(""),h=v.useRef(null),m=v.useRef(null);v.useEffect(()=>{h.current?.focus()},[]),v.useEffect(()=>{const x=_=>{_.key==="Escape"&&i()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[i]);const y=v.useCallback(x=>{m.current&&!m.current.contains(x.target)&&i()},[i]),p=v.useCallback(()=>{const x=c.trim();x&&n(x)},[c,n]),S=v.useCallback(x=>{x.key==="Enter"&&(x.preventDefault(),p())},[p]);return f.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:y,children:f.jsxs("div",{ref:m,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(py,{size:16,className:"shrink-0 text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:s("sources.actions.new_folder")})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("input",{ref:h,value:c,onChange:x=>d(x.target.value),onKeyDown:S,placeholder:s("sources.folder.name_placeholder"),className:"w-full rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 text-sm text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent",autoFocus:!0}),r&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:r})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:i,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:s("common.cancel")}),f.jsx("button",{onClick:p,disabled:!c.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:s("common.confirm")})]})]})})}function vg({label:n,icon:i,items:r}){const[s,c]=v.useState(!1),d=v.useRef(null),h=v.useCallback(m=>{d.current&&!d.current.contains(m.target)&&c(!1)},[]);return v.useEffect(()=>{if(s)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s,h]),f.jsxs("div",{ref:d,className:"relative",children:[f.jsxs("button",{onClick:()=>c(m=>!m),className:"flex 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:[i,n,f.jsx(dd,{size:12,className:`transition-transform ${s?"rotate-180":""}`})]}),s&&f.jsx("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[160px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg",children:r.map(m=>f.jsxs("button",{onClick:()=>{m.onClick(),c(!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:[m.icon,m.label]},m.label))})]})}function R2({onClose:n}){const{t:i}=we(),r=v.useRef(null),s=v.useCallback(c=>{r.current&&!r.current.contains(c.target)&&n()},[n]);return f.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:s,children:f.jsxs("div",{ref:r,className:"w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(w4,{size:18,className:"text-c4a-accent"}),f.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.upgrade.title")})]}),f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:i("sources.upgrade.description")}),f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsx("button",{onClick:n,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:i("common.confirm")})})]})})}function z2({library:n,onNewFolder:i,onImportRepo:r,onImportDir:s,onUpgrade:c}){const{t:d}=we(),h=n.type==="daemon";return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-2xl text-center",children:[f.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:d(h?"sources.empty.daemon.title":"sources.empty.cloud.title")}),f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:d(h?"sources.empty.daemon.description":"sources.empty.cloud.description")}),f.jsx("div",{className:"mt-6 flex justify-center gap-3",children:h?f.jsxs(f.Fragment,{children:[s&&f.jsx("button",{onClick:s,disabled:!n.is_online,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:d("sources.actions.import_dir")}),r&&f.jsx("button",{onClick:r,disabled:!n.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:d("sources.actions.import_repo")})]}):f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:i,className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:d("sources.actions.new_folder")}),c&&f.jsx("button",{onClick:c,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:d("sources.actions.import_repo_url")})]})})]})})}function O2(){const{t:n}=we();return f.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[f.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:n("sources.empty.indexed.title")}),f.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:n("sources.empty.indexed.description")})]})}function T2(){const{t:n}=we(),i=Xn(),{libId:r}=co(),[s,c]=yS(),d=s.get("path")||null,m=Bt(di(Nr)).find(Ce=>Ce.id===r),{sources:y,loading:p,filter:S,fetchSources:x,fetchChildren:_,createSource:N,updateSource:z,deleteSource:D,setFilter:k}=go(),[W,X]=v.useState(!1),[I,se]=v.useState(null),[de,V]=v.useState(null),[B,E]=v.useState(null),[$,ne]=v.useState(null),[ae,Q]=v.useState(null),[xe,F]=v.useState(!1),[ie,M]=v.useState({}),[P,ue]=v.useState([]);v.useEffect(()=>{r&&x({library_id:r,parent_id:d})},[r,d,x]),v.useEffect(()=>{if(!d){ue([]);return}(async()=>{const Ce=[];let Ve=d;for(;Ve;)try{const He=await fetch(`/api/v1/sources/${Ve}`);if(!He.ok)break;const _a=await He.json();Ce.unshift(_a),Ve=_a.parent_id}catch{break}ue(Ce)})()},[d]),v.useEffect(()=>{y.filter(Ve=>Ve.kind==="folder").forEach(async Ve=>{try{const He=await _(Ve.id),_a=He.filter(yt=>yt.kind==="folder").length,fi=He.filter(yt=>yt.kind==="source").length,Rt=He.filter(yt=>yt.kind==="source"&&yt.source_type==="code").length,ja=He.filter(yt=>yt.kind==="source"&&yt.source_type==="doc").length;M(yt=>({...yt,[Ve.id]:{folders:_a,sources:fi,codeSources:Rt,docSources:ja}}))}catch{}})},[y,_]);const ce=v.useMemo(()=>{const Ve=[...y.filter(He=>d?He.parent_id===d:He.parent_id===null)].sort((He,_a)=>He.kind!==_a.kind?He.kind==="folder"?-1:1:He.name.localeCompare(_a.name));return S==="all"?Ve:Ve.filter(He=>He.kind==="folder"?!0:S==="indexed"?He.index_status==="indexed":He.index_status==="none")},[y,S,d]),ee=m?.type==="daemon",j=m?.type==="cloud",q=ee&&d===null,G=ee&&d!==null,le=v.useMemo(()=>{if(!m)return[];const Ce=[{label:m.id===po?n("sources.library.default_cloud_name"):m.name,to:`/studio/sources/${m.id}`}];return P.forEach(Ve=>{Ce.push({label:Ve.name,to:`/studio/sources/${m.id}?path=${Ve.id}`})}),Ce},[m,P,n]),ge=v.useCallback(async Ce=>{if(r)try{await N({library_id:r,parent_id:d,kind:"folder",name:Ce}),X(!1),se(null),x({library_id:r,parent_id:d})}catch(Ve){Ve instanceof Is&&Ve.status===409&&se(n("sources.error.name_conflict",{name:Ce}))}},[r,d,N,x,n]),je=v.useCallback(Ce=>{Ce.kind==="folder"?c({path:Ce.id}):i(`/studio/source/${Ce.id}`)},[i,c]),Ne=v.useCallback(async(Ce,Ve)=>{try{return await z(Ce.id,{name:Ve}),x({library_id:r,parent_id:d}),null}catch(He){return He instanceof Is&&He.status===409?n("sources.error.name_conflict",{name:Ve}):null}},[r,d,z,x,n]),et=v.useCallback(Ce=>{if(E(Ce.id),Ce.kind==="folder"){const Ve=Ce.parent_id===null,He=ie[Ce.id];V(ee&&Ve?{type:"repo",name:Ce.name,libraryName:m.name,...He!==void 0?{packageCount:He.codeSources,docCount:He.docSources}:{}}:{type:"folder",name:Ce.name,...He!==void 0?{folderCount:He.folders,sourceCount:He.sources}:{}})}else V({type:"resource",name:Ce.name})},[ee,m,ie]),Ke=v.useCallback(async()=>{if(!(!B||!r))try{await D(B),V(null),E(null),x({library_id:r,parent_id:d})}catch{}},[B,r,d,D,x]),Va=v.useCallback(async Ce=>{if(!(!$||!r))try{await z($.id,{parent_id:Ce}),ne(null),Q(null),x({library_id:r,parent_id:d})}catch(Ve){Ve instanceof Is&&Ve.status===409&&Q(n("sources.error.name_conflict",{name:$.name}))}},[$,r,d,z,x,n]),Ga=v.useCallback(()=>{r&&i(`/studio/sources/import/${r}`)},[r,i]),hn=v.useCallback(()=>{r&&i(`/studio/sources/import-dir/${r}`)},[r,i]);if(!m)return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})});const ht=y.length===0&&S==="all"&&!p&&!d,At=ce.filter(Ce=>Ce.kind==="source").length===0&&S==="indexed"&&!p,mn=!q,Qn=j,Sa=q,vl=G;return f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Er,{segments:le}),f.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[Qn&&f.jsxs(f.Fragment,{children:[f.jsx(vg,{label:n("sources.actions.upload"),icon:f.jsx(O4,{size:14}),items:[{label:n("sources.actions.upload_md"),icon:f.jsx(ci,{size:14}),onClick:()=>F(!0)}]}),f.jsx(vg,{label:n("sources.actions.add"),icon:f.jsx(yy,{size:14}),items:[{label:n("sources.actions.add_folder"),icon:f.jsx(py,{size:14}),onClick:()=>X(!0)},{label:n("sources.actions.add_web"),icon:f.jsx(l4,{size:14}),onClick:()=>F(!0)},{label:n("sources.actions.add_feishu"),icon:f.jsx(XS,{size:14}),onClick:()=>F(!0)}]}),f.jsxs("button",{onClick:()=>F(!0),className:"flex 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:[f.jsx(sg,{size:14}),n("sources.actions.import_repo_url")]})]}),Sa&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{onClick:hn,disabled:!m.is_online,title:m.is_online?void 0:n("sources.import.daemon_offline",{name:m.name}),className:"flex 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 disabled:cursor-not-allowed disabled:opacity-40",children:[f.jsx(WS,{size:14}),n("sources.actions.import_dir")]}),f.jsxs("button",{onClick:Ga,disabled:!m.is_online,title:m.is_online?void 0:n("sources.import.daemon_offline",{name:m.name}),className:"flex 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 disabled:cursor-not-allowed disabled:opacity-40",children:[f.jsx(sg,{size:14}),n("sources.actions.import_repo")]})]}),vl&&null,mn&&f.jsx(_2,{value:S,onChange:k})]})]}),ht?f.jsx(z2,{library:m,onNewFolder:()=>X(!0),...ee?{onImportRepo:Ga,onImportDir:hn}:{},...j?{onUpgrade:()=>F(!0)}:{}}):f.jsx("div",{className:"mt-4 flex flex-1 flex-col gap-0.5",children:p?f.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:n("common.loading")}):ce.length===0?At?f.jsx(O2,{}):j&&d?f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-2xl text-center",children:[f.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:n("sources.empty.folder.title")}),f.jsxs("div",{className:"mt-6 flex justify-center gap-3",children:[f.jsx("button",{onClick:()=>X(!0),className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:n("sources.actions.new_folder")}),f.jsx("button",{onClick:()=>F(!0),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:n("sources.actions.import_repo_url")})]})]})}):d?f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsxs("div",{className:"max-w-2xl text-center",children:[f.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:n("sources.empty.folder.title")}),ee&&f.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:n("sources.empty.folder.daemon_description")})]})}):f.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:n("common.items",{count:0})}):ce.map(Ce=>{const Ve=ee&&Ce.parent_id===null&&Ce.kind==="folder";return f.jsx(E2,{source:Ce,...ie[Ce.id]!==void 0?{childCount:ie[Ce.id].folders+ie[Ce.id].sources}:{},isDaemonLibrary:ee??!1,isRepoRoot:Ve,onClick:()=>je(Ce),...G?{}:{onRename:He=>Ne(Ce,He)},...Ce.kind==="source"&&!G?{onMoveTo:()=>ne(Ce)}:{},...G?{}:{onDelete:()=>et(Ce)}},Ce.id)})}),W&&f.jsx(C2,{onConfirm:ge,onCancel:()=>{X(!1),se(null)},error:I}),xe&&f.jsx(R2,{onClose:()=>F(!1)}),de&&f.jsx(_y,{target:de,onConfirm:Ke,onCancel:()=>{V(null),E(null)}}),$&&r&&f.jsx(w2,{libraryId:r,currentParentId:$.parent_id,sourceName:$.name,sourceId:$.id,onConfirm:Va,onCancel:()=>{ne(null),Q(null)},error:ae})]})}function wy(){const{t:n}=we(),[i,r]=v.useState(!1),[s,c]=v.useState(null),d=v.useRef(),h=v.useRef(),m=window.location.host,y=`c4a-daemon --server ${m} --allow <dir1> <dir2>`,p=`c4a-daemon --server ${m}`,S=v.useCallback((N,z)=>{navigator.clipboard.writeText(N),c(z),clearTimeout(d.current),d.current=setTimeout(()=>c(null),1500)},[]),x=v.useCallback(()=>{clearTimeout(h.current),r(!0)},[]),_=v.useCallback(()=>{h.current=setTimeout(()=>r(!1),150)},[]);return f.jsxs("span",{className:"relative",onMouseEnter:x,onMouseLeave:_,children:[f.jsx(fd,{size:12,className:"text-c4a-warning"}),i&&f.jsxs("span",{className:"absolute left-full top-1/2 z-10 ml-2 -translate-y-1/2 rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-2 shadow-lg",onMouseEnter:x,onMouseLeave:_,children:[f.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_restrict")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:y}),f.jsx("button",{onClick:()=>S(y,0),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:s===0?f.jsx(lo,{size:10}):f.jsx(rg,{size:10})})]}),f.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:n("sources.import.allowed_dirs_tooltip_all")}),f.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[f.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:p}),f.jsx("button",{onClick:()=>S(p,1),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:s===1?f.jsx(lo,{size:10}):f.jsx(rg,{size:10})})]})]})]})}function Cy({open:n,onClose:i,rpc:r,onNavigate:s,defaultPath:c}){const{t:d}=we(),[h,m]=v.useState(c??""),[y,p]=v.useState(null),[S,x]=v.useState(!1),_=v.useRef(null);v.useEffect(()=>{c&&!h&&m(c)},[c]);const N=v.useCallback(async()=>{const D=h.trim();if(D){x(!0),p(null);try{(await r("fs/exists",{path:D})).exists?(s(D),m(c??""),p(null),i()):p(d("sources.import.wildcard_path_not_found"))}catch(k){p(k instanceof Error?k.message:String(k))}finally{x(!1)}}},[h,r,d,s,i]),z=v.useCallback(()=>{m(c??""),p(null),i()},[i,c]);return n?f.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:f.jsxs("div",{className:"w-full max-w-md rounded-lg border border-c4a-border-default bg-c4a-bg-surface p-5 shadow-xl",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:d("sources.import.wildcard_go_title")}),f.jsx("button",{onClick:z,className:"rounded p-1 text-c4a-text-muted transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-secondary",children:f.jsx(hd,{size:14})})]}),f.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[f.jsx("input",{ref:_,type:"text",value:h,onChange:D=>{m(D.target.value),p(null)},onKeyDown:D=>{D.key==="Enter"&&N()},placeholder:d("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"}),f.jsxs("button",{onClick:N,disabled:S||!h.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:[S?f.jsx(ia,{size:12,className:"animate-spin"}):f.jsx(hy,{size:12}),d("sources.import.wildcard_go")]})]}),y&&f.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:y})]})}):null}function D2(n){const i=n.match(/^[\w.-]+@([\w.-]+):([\w./-]+?)(?:\.git)?$/);if(i){const r=i[1],s=i[2];return{slug:s,repoUrl:`https://${r}/${s}`,host:r}}try{const r=new URL(n),s=r.hostname,c=r.pathname.replace(/^\//,"").replace(/\.git$/,"");return c?{slug:c,repoUrl:`https://${s}/${c}`,host:s}:null}catch{return null}}function M2(n,i){return`${n}/tree/${encodeURIComponent(i)}`}function A2(n,i){return`${n}/commit/${i}`}function L2({rpc:n,selectedPath:i,onSelect:r,allowedPaths:s,importedPaths:c}){const{t:d}=we(),h=!!s&&s.length>0,m=h&&s.length===1&&s[0]==="*",[y,p]=v.useState(h),S=!h||m?"/":s?.[0]??"/",[x,_]=v.useState(h?"":S),[N,z]=v.useState([]),[D,k]=v.useState(!1),[W,X]=v.useState(null),[I,se]=v.useState(null);v.useEffect(()=>{if(!m)return;let ee=!1;return(async()=>{try{const j=await n("fs/homeDir",{});ee||se(j.home_dir)}catch{}})(),()=>{ee=!0}},[m,n]);const[de,V]=v.useState(!1),B=v.useCallback(async ee=>{k(!0),X(null);try{const j=await n("fs/listTree",{path:ee,depth:2});z(j.entries||[]),_(ee),p(!1)}catch(j){const q=j instanceof Error?j.message:String(j);X(q)}finally{k(!1)}},[n]);v.useEffect(()=>{h||B(S)},[B,S,h]);const[E,$]=v.useState(null),[ne,ae]=v.useState(null),[Q,xe]=v.useState(!1);v.useEffect(()=>{if(!i){ae(null),xe(!1);return}ae(null),xe(!0);let ee=!1;return(async()=>{try{const j=await n("fs/repoStatus",{path:i});ee||(ae({branch:j.branch,hash:j.head_hash,remoteUrl:j.remote_url}),xe(!1))}catch{ee||(ae(null),xe(!1))}})(),()=>{ee=!0}},[i,n]);const F=v.useMemo(()=>ne?.remoteUrl?D2(ne.remoteUrl):null,[ne?.remoteUrl]),ie=v.useMemo(()=>new Set(c??[]),[c]),M=v.useCallback(ee=>{if(ee.type==="directory")if(ee.is_git_repo){if(ie.has(ee.path))return;$(null),r(ee.path,ee.name)}else $(ee.path),B(ee.path)},[r,B,ie]),P=v.useCallback(()=>{if(h&&!m&&s.some(q=>q===x)){p(!0),_(""),z([]),X(null),$(null);return}if(m&&x.split("/").filter(Boolean).length<=1){p(!0),_(""),z([]),X(null),$(null);return}const ee=x.split("/").slice(0,-1).join("/")||"/";$(null),B(ee)},[x,B,h,m,s]),ue=v.useMemo(()=>N.filter(ee=>ee.type==="directory").sort((ee,j)=>ee.is_git_repo&&!j.is_git_repo?-1:!ee.is_git_repo&&j.is_git_repo?1:ee.name.localeCompare(j.name)),[N]),ce=v.useMemo(()=>N.filter(ee=>ee.type==="file").sort((ee,j)=>ee.name.localeCompare(j.name)),[N]);return f.jsxs("div",{className:"rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[y?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:d("sources.import.allowed_dirs")}),f.jsx(wy,{})]}):f.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:x}),i&&Q?f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[f.jsx(ia,{size:12,className:"animate-spin"}),f.jsx("span",{children:d("common.loading")})]}):i&&ne?f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[F?f.jsxs("a",{href:F.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",title:F.repoUrl,children:[f.jsx("span",{children:F.slug}),f.jsx(KS,{size:10})]}):f.jsx("span",{children:i.split("/").pop()||i}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),F?f.jsxs("a",{href:M2(F.repoUrl,ne.branch),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[f.jsx(og,{size:10}),f.jsx("span",{children:ne.branch})]}):f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx(og,{size:10}),f.jsx("span",{children:ne.branch})]}),f.jsx("span",{className:"text-c4a-text-muted",children:"/"}),F?f.jsx("a",{href:A2(F.repoUrl,ne.hash),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:ne.hash.slice(0,7)}):f.jsx("span",{children:ne.hash.slice(0,7)})]}):!i&&m&&y?f.jsx("button",{onClick:()=>V(!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:d("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),y?m?f.jsx("div",{className:"max-h-80 overflow-y-auto",children:I&&f.jsxs("button",{onClick:()=>B(I),className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(la,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[I,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",d("sources.import.wildcard_home"),")"]})]}),f.jsx(dn,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"max-h-80 overflow-y-auto",children:s.map(ee=>f.jsxs("button",{onClick:()=>B(ee),className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(la,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:ee}),f.jsx(dn,{size:12,className:"shrink-0 text-c4a-text-muted"})]},ee))}):D?f.jsxs("div",{className:"flex items-center gap-2 py-8",children:[f.jsx(ia,{size:14,className:"animate-spin text-c4a-text-muted"}),f.jsx("span",{className:"text-xs text-c4a-text-muted",children:d("common.loading")})]}):W?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:W}):f.jsxs("div",{className:"mt-3 max-h-80 overflow-y-auto",children:[x!=="/"&&f.jsxs("button",{onClick:P,className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover",children:[f.jsx(la,{size:14}),f.jsx("span",{children:".."})]}),ue.map(ee=>{const j=ee.is_git_repo&&ie.has(ee.path),q=ee.is_git_repo?fo:la;return f.jsxs("div",{className:`flex w-full items-center rounded text-left text-sm transition-colors ${j?"cursor-not-allowed opacity-50":i===ee.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[f.jsxs("button",{onClick:()=>M(ee),disabled:j,className:"flex flex-1 items-center gap-2 px-2 py-1.5",children:[f.jsx(q,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate text-left",children:ee.name}),j&&f.jsx("span",{className:"rounded bg-c4a-bg-active px-1.5 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:d("sources.import.already_imported")})]}),!j&&f.jsx("button",{onClick:G=>{G.stopPropagation(),B(ee.path)},className:"shrink-0 rounded p-1.5 text-c4a-text-muted transition-colors hover:bg-c4a-bg-active hover:text-c4a-text-secondary",title:ee.path,children:f.jsx(dn,{size:12})})]},ee.path)}),ce.map(ee=>f.jsxs("div",{className:"flex w-full items-center gap-2 px-2 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(my,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:ee.name})]},ee.path)),N.length===0&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:d("sources.import.no_entries")})]}),E&&!i&&f.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:d("sources.import.not_git")}),f.jsx(Cy,{open:de,onClose:()=>V(!1),rpc:n,onNavigate:B,defaultPath:I??void 0})]})}const k2=["package.json","pyproject.toml","go.mod","Cargo.toml","pom.xml","build.gradle"],U2=/\.md$/i;function H2({rpc:n,repoPath:i,onReady:r}){const{t:s}=we(),[c,d]=v.useState(""),[h,m]=v.useState([]),[y,p]=v.useState(""),[S,x]=v.useState([]),[_,N]=v.useState(!1),[z,D]=v.useState(!0),[k,W]=v.useState(!1),[X,I]=v.useState([]),[se,de]=v.useState([]),[,V]=v.useState([]),[B,E]=v.useState([]),$=v.useCallback(async(Q,xe)=>{W(!0);try{const ie=(await n("fs/repoTree",{path:i,hash:Q})).files||[];V(ie);const M=ie.filter(G=>k2.some(le=>{const ge=G.path.split("/");return ge[ge.length-1]===le})),P=ie.filter(G=>U2.test(G.path)).filter(G=>G.path.split("/").length<=2).map(G=>G.path);de(P);const ue=[],ce=[];await Promise.all(M.map(async G=>{try{const le=await n("fs/readFile",{path:`${i}/${G.path}`});ue.push({path:G.path,content:le.content});const ge=B2(G.path,le.content);ce.push({name:ge||G.path,path:G.path.split("/").slice(0,-1).join("/")||".",isRoot:G.path.split("/").length===1||G.path==="package.json"})}catch{ce.push({name:G.path,path:G.path.split("/").slice(0,-1).join("/")||"."})}}));const ee=ue.find(G=>G.path==="package.json");if(ee)try{const G=JSON.parse(ee.content),le=Array.isArray(G.workspaces)?G.workspaces:Array.isArray(G.workspaces?.packages)?G.workspaces.packages:void 0;if(le&&le.length>0){const ge=ce.find(Ne=>Ne.isRoot&&Ne.path===".");ge&&(ge.isRoot=!0);const je=Ne=>le.some(et=>{const Ke=et.replace(/\/\*$/,"");return Ne.startsWith(Ke+"/")||Ne===Ke});for(let Ne=ce.length-1;Ne>=0;Ne--){const et=ce[Ne];!et.isRoot&&!je(et.path)&&ce.splice(Ne,1)}}}catch{}I(ce),E(ue);const j=xe?.branch??c,q=xe?.isDirty??_;r({branch:j,commit:Q,isDirty:q,repoFiles:ie,packages:ce,mdFiles:P,repoFileContents:ue})}catch{}finally{W(!1)}},[n,i,c,_,r]);v.useEffect(()=>{(async()=>{D(!0);try{const Q=await n("fs/repoStatus",{path:i});d(Q.branch),m(Q.branches||[Q.branch]),p(Q.head_hash),N(Q.is_dirty),x(Q.commits||[{hash:Q.head_hash,message:"HEAD"}]),await $(Q.head_hash,{branch:Q.branch,isDirty:Q.is_dirty})}catch{}finally{D(!1)}})()},[i]),v.useEffect(()=>{r({branch:c,commit:y,isDirty:_,packages:X,mdFiles:se,repoFileContents:B})},[c,y,_]);const ne=v.useCallback(async Q=>{d(Q);try{const xe=await n("fs/repoStatus",{path:i});p(xe.head_hash),await $(xe.head_hash)}catch{}},[i,n,$]),ae=c&&c!=="main"&&c!=="master";return z?f.jsx("div",{className:"flex items-center justify-center py-12",children:f.jsx(ia,{size:20,className:"animate-spin text-c4a-text-muted"})}):f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:s("sources.detail.repo")}),f.jsx("p",{className:"mt-0.5 font-mono text-xs text-c4a-text-primary",children:i.split("/").pop()})]}),f.jsxs("div",{children:[f.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:s("sources.import.current_path")}),f.jsx("p",{className:"mt-0.5 font-mono text-xs text-c4a-text-primary",children:i})]})]}),f.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"font-mono text-xs text-c4a-text-muted",children:s("sources.import.branch")}),f.jsx("select",{value:c,onChange:Q=>ne(Q.target.value),className:"mt-1 w-full 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",children:h.map(Q=>f.jsx("option",{value:Q,children:Q},Q))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"font-mono text-xs text-c4a-text-muted",children:s("sources.import.commit")}),f.jsx("select",{value:y,onChange:Q=>{p(Q.target.value),$(Q.target.value)},className:"mt-1 w-full 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",children:S.map(Q=>f.jsxs("option",{value:Q.hash,children:[Q.hash.slice(0,7)," - ",Q.message.slice(0,60)]},Q.hash))})]})]}),f.jsxs("div",{className:"mt-3 space-y-1",children:[ae&&f.jsxs("p",{className:"flex items-center gap-1 text-xs text-c4a-info",children:[f.jsx(gy,{size:12}),s("sources.import.branch_warning",{branch:c})]}),_&&f.jsxs("p",{className:"flex items-center gap-1 text-xs text-c4a-warning",children:[f.jsx(fd,{size:12}),s("sources.import.uncommitted_warning")]})]})]}),f.jsx("div",{className:"rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:k?f.jsxs("div",{className:"flex items-center gap-2 py-4",children:[f.jsx(ia,{size:14,className:"animate-spin text-c4a-text-muted"}),f.jsx("span",{className:"text-xs text-c4a-text-muted",children:"Analyzing repository..."})]}):f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"font-mono text-xs text-c4a-text-primary",children:X.length>0?s("sources.import.recognized",{packages:X.length,docs:se.length}):s("sources.import.no_packages")}),X.length>0&&f.jsx("div",{className:"mt-3 space-y-1",children:X.map(Q=>f.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1 text-xs",children:[f.jsx(ho,{size:14,className:"shrink-0 text-c4a-accent"}),f.jsx("span",{className:"text-c4a-text-primary",children:Q.name}),f.jsx("span",{className:"text-c4a-text-muted",children:Q.path}),Q.isRoot&&f.jsx("span",{className:"rounded bg-c4a-bg-active px-1 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:"root"})]},Q.path))}),se.length>0&&f.jsx("div",{className:"mt-3 space-y-1",children:se.map(Q=>f.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1 text-xs",children:[f.jsx(ci,{size:14,className:"shrink-0 text-c4a-text-secondary"}),f.jsx("span",{className:"text-c4a-text-primary",children:Q})]},Q))})]})})]})}function B2(n,i){const r=n.split("/").pop()||"";try{if(r==="package.json")return JSON.parse(i).name||null;if(r==="go.mod")return i.match(/^module\s+(.+)$/m)?.[1]||null;if(r==="Cargo.toml")return i.match(/name\s*=\s*"([^"]+)"/)?.[1]||null;if(r==="pyproject.toml")return i.match(/name\s*=\s*"([^"]+)"/)?.[1]||null}catch{}return null}function q2({importState:n,libraryName:i,importing:r}){const{t:s}=we();return f.jsxs("div",{className:"rounded border border-c4a-border-default bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"text-sm text-c4a-text-secondary",children:s("sources.import.confirm_heading",{name:i})}),f.jsxs("div",{className:"mt-4 space-y-2 text-sm",children:[f.jsx(or,{label:s("sources.detail.repo"),value:n.repoName}),f.jsx(or,{label:s("sources.import.branch"),value:n.branch}),f.jsx(or,{label:s("sources.import.commit"),value:n.commit.slice(0,7)}),f.jsx(or,{label:s("sources.import.packages"),value:String(n.packages.length)}),f.jsx(or,{label:s("sources.import.documents"),value:String(n.mdFiles.length)})]}),r&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(ia,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:s("sources.import.importing")})]})]})}function or({label:n,value:i}){return f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsx("span",{className:"w-24 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:i})]})}function Y2(){const{t:n}=we(),i=Xn(),{libId:r}=co(),c=Bt(di(Nr)).find(V=>V.id===r),d=go(V=>V.createSource),[h,m]=v.useState(1),[y,p]=v.useState(!1),[S,x]=v.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),_=c?.is_online??!1,[N,z]=v.useState([]);v.useEffect(()=>{if(!r)return;let V=!1;return(async()=>{try{const B=await Mt.get("/sources",{library_id:r,limit:"500"});if(V)return;const E=B.items.filter($=>!$.parent_id).map($=>{const ne=$.metadata;return typeof ne?.local_path=="string"?ne.local_path:null}).filter($=>$!==null);z(E)}catch{}})(),()=>{V=!0}},[r]);const D=v.useMemo(()=>{const V=c?.config;return!V||!Array.isArray(V.allowed_paths)?[]:V.allowed_paths},[c]),k=v.useCallback(async(V,B)=>{if(!r)throw new Error("No library");const E=await Mt.post(`/libraries/${r}/rpc`,{method:V,params:B});if(E.error){const $=E.error;throw new Error($.message??JSON.stringify(E.error))}return E.result??E},[r]),W=v.useCallback((V,B)=>{x(E=>({...E,repoPath:V,repoName:B}))},[]),X=v.useCallback(V=>{x(B=>({...B,...V}))},[]),I=v.useCallback(async()=>{if(r){p(!0);try{const V=await d({library_id:r,repo_name:S.repoName,repo_root_path:S.repoPath,repo_branch:S.branch,repo_commit:S.commit,repo_files:S.repoFiles.map(E=>E.path),repo_file_contents:S.repoFileContents}),B=Array.isArray(V)?V[0]:V;B?.kind==="folder"?i(`/studio/sources/${r}?path=${B.id}`):i(`/studio/sources/${r}`)}catch{p(!1)}}},[r,S,d,i]),se=v.useMemo(()=>h===1?!!S.repoPath:h===2?S.repoFiles.length>0:!0,[h,S]),de=v.useMemo(()=>c?[{label:c.id===po?n("sources.library.default_cloud_name"):c.name,to:`/studio/sources/${c.id}`},{label:n("sources.import.title")}]:[],[c,n]);return c?f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Er,{segments:de}),f.jsxs("div",{className:"mt-6 flex w-full items-center gap-2 font-mono text-sm md:gap-3",children:[f.jsx(Gu,{active:h>=1,current:h===1}),f.jsx("span",{className:h===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.select")}),f.jsx(bg,{}),f.jsx(Gu,{active:h>=2,current:h===2}),f.jsx("span",{className:h===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.version")}),f.jsx(bg,{}),f.jsx(Gu,{active:h>=3,current:h===3}),f.jsx("span",{className:h===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.step.confirm")})]}),f.jsx("div",{className:"mt-6 flex-1",children:_?f.jsxs(f.Fragment,{children:[h===1&&f.jsx(L2,{rpc:k,selectedPath:S.repoPath,onSelect:W,allowedPaths:D,importedPaths:N}),h===2&&f.jsx(H2,{rpc:k,repoPath:S.repoPath,onReady:X}),h===3&&f.jsx(q2,{importState:S,libraryName:c.name,importing:y})]}):f.jsx(V2,{libraryName:c.name})}),f.jsx("p",{className:"mt-4 text-right text-xs text-c4a-text-muted",children:n("sources.safety.notice.repo")}),_&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-c4a-border-subtle pt-4",children:[h>1&&f.jsx("button",{onClick:()=>m(V=>V-1),disabled:y,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:n("common.previous")}),h<3?f.jsx("button",{onClick:()=>m(V=>V+1),disabled:!se,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:n("common.next")}):f.jsxs("button",{onClick:I,disabled:y,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:[y&&f.jsx(ia,{size:12,className:"animate-spin"}),n(y?"sources.import.importing":"sources.import.step.confirm")]})]})]}):f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})})}function Gu({active:n,current:i}){return f.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full border-2 ${i?"border-c4a-accent bg-c4a-accent":n?"border-c4a-accent bg-transparent":"border-c4a-border-default bg-transparent"}`})}function bg(){return f.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function V2({libraryName:n}){const{t:i}=we();return f.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[f.jsx("p",{className:"text-sm text-c4a-warning",children:i("sources.import.daemon_offline",{name:n})}),f.jsx(Ft,{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:i("sources.import.view_guide")})]})}const Sg=(n,i)=>{let r=0,s=0,c=0;const d=[],h=m=>{for(const y of m)if(y.type==="directory")s++,y.is_git_repo&&c++,y.children&&h(y.children);else if(r++,/\.md$/i.test(y.name)){const p=y.path.startsWith(i)?y.path.slice(i.length).replace(/^\//,""):y.name;d.push(p)}};return h(n),{files:r,dirs:s,gitRepos:c,mdFiles:d}};function G2({rpc:n,selectedPath:i,onSelect:r,allowedPaths:s,importedPaths:c}){const{t:d}=we(),h=!!s&&s.length>0,m=h&&s.length===1&&s[0]==="*",[y,p]=v.useState(h),S=!h||m?"/":s?.[0]??"/",[x,_]=v.useState(h?"":S),[N,z]=v.useState([]),[D,k]=v.useState(!1),[W,X]=v.useState(null),I=v.useMemo(()=>new Set(c??[]),[c]),[se,de]=v.useState(null);v.useEffect(()=>{if(!m)return;let F=!1;return(async()=>{try{const ie=await n("fs/homeDir",{});F||de(ie.home_dir)}catch{}})(),()=>{F=!0}},[m,n]);const[V,B]=v.useState(!1),E=v.useCallback(async F=>{k(!0),X(null);try{const ie=await n("fs/listTree",{path:F,depth:2});z(ie.entries||[]),_(F),p(!1)}catch(ie){const M=ie instanceof Error?ie.message:String(ie);X(M)}finally{k(!1)}},[n]);v.useEffect(()=>{h||E(S)},[E,S,h]);const $=v.useCallback(F=>{if(F.type!=="directory"||I.has(F.path))return;const ie=Sg(F.children||[],F.path);r(F.path,F.name,ie),E(F.path)},[r,E,I]),ne=v.useCallback(()=>{if(h&&!m&&s.some(M=>M===x)){p(!0),_(""),z([]),X(null);return}if(m&&x.split("/").filter(Boolean).length<=1){p(!0),_(""),z([]),X(null);return}const F=x.split("/").slice(0,-1).join("/")||"/";E(F)},[x,E,h,m,s]);v.useEffect(()=>{if(x&&!y&&N.length>=0&&!D){const F=x.split("/").pop()||x,ie=Sg(N,x);r(x,F,ie)}},[x,y,N,D]);const ae=v.useMemo(()=>i?i.split("/").pop()||i:"",[i]),Q=v.useMemo(()=>N.filter(F=>F.type==="directory").sort((F,ie)=>F.is_git_repo&&!ie.is_git_repo?-1:!F.is_git_repo&&ie.is_git_repo?1:F.name.localeCompare(ie.name)),[N]),xe=v.useMemo(()=>N.filter(F=>F.type==="file").sort((F,ie)=>F.name.localeCompare(ie.name)),[N]);return f.jsxs("div",{className:"rounded border border-c4a-border-default bg-c4a-bg-surface p-4",children:[f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[y?f.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[f.jsx("span",{children:d("sources.import.allowed_dirs")}),f.jsx(wy,{})]}):f.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:x}),i?f.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[f.jsx(la,{size:12}),f.jsx("span",{children:ae})]}):m&&y?f.jsx("button",{onClick:()=>B(!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:d("sources.import.wildcard_goto")}):null]}),f.jsx("hr",{className:"my-3 border-c4a-border-subtle"}),y?m?f.jsx("div",{className:"max-h-80 overflow-y-auto",children:se&&f.jsxs("button",{onClick:()=>E(se),className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(la,{size:14,className:"shrink-0"}),f.jsxs("span",{className:"truncate",children:[se,f.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",d("sources.import.wildcard_home"),")"]})]}),f.jsx(dn,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):f.jsx("div",{className:"max-h-80 overflow-y-auto",children:s.map(F=>f.jsxs("button",{onClick:()=>E(F),className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[f.jsx(la,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:F}),f.jsx(dn,{size:12,className:"shrink-0 text-c4a-text-muted"})]},F))}):D?f.jsxs("div",{className:"flex items-center gap-2 py-8",children:[f.jsx(ia,{size:14,className:"animate-spin text-c4a-text-muted"}),f.jsx("span",{className:"text-xs text-c4a-text-muted",children:d("common.loading")})]}):W?f.jsx("p",{className:"py-4 text-xs text-c4a-error",children:W}):f.jsxs("div",{className:"mt-3 max-h-80 overflow-y-auto",children:[x!=="/"&&f.jsxs("button",{onClick:ne,className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-c4a-text-secondary hover:bg-c4a-bg-hover",children:[f.jsx(la,{size:14}),f.jsx("span",{children:".."})]}),Q.map(F=>{const ie=I.has(F.path),M=F.is_git_repo?fo:la;return f.jsxs("button",{onClick:()=>$(F),disabled:ie,className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm transition-colors ${ie?"cursor-not-allowed opacity-50":i===F.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[f.jsx(M,{size:14,className:"shrink-0"}),f.jsx("span",{className:"flex-1 truncate",children:F.name}),ie&&f.jsx("span",{className:"rounded bg-c4a-bg-active px-1.5 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:d("sources.import.already_imported")}),f.jsx(dn,{size:12,className:"shrink-0 text-c4a-text-muted"})]},F.path)}),xe.map(F=>f.jsxs("div",{className:"flex w-full items-center gap-2 px-2 py-1.5 text-sm text-c4a-text-muted",children:[f.jsx(my,{size:14,className:"shrink-0"}),f.jsx("span",{className:"truncate",children:F.name})]},F.path)),N.length===0&&f.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:d("sources.import.no_entries")})]}),f.jsx(Cy,{open:V,onClose:()=>B(!1),rpc:n,onNavigate:E,defaultPath:se??void 0})]})}const K2=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),$2=n=>{let i=0,r=0,s=0,c=0,d=0;const h=new Set;for(const m of n)if(m.type==="directory")r++,m.is_git_repo&&d++;else{i++,m.path.toLowerCase().endsWith(".md")&&c++;const p=m.path.split("/").pop();if(p&&K2.has(p.toLowerCase())){const S=m.path.split("/").slice(0,-1).join("/");n.some(_=>_.type==="directory"&&_.is_git_repo&&(S===_.path||S.startsWith(`${_.path}/`)))||h.add(S)}}return s=h.size,{totalFiles:i,totalDirs:r,codePackages:s,docFiles:c,gitRepos:d}};function X2({dirPath:n,dirName:i,rpc:r,onScanComplete:s}){const{t:c}=we(),[d,h]=v.useState(!1),[m,y]=v.useState(null),[p,S]=v.useState(null),x=v.useCallback(async()=>{h(!0),y(null),S(null);try{const N=(await r("fs/dirScan",{path:n})).entries||[],z=$2(N);S(z),s(N,z)}catch(_){const N=_ instanceof Error?_.message:String(_);y(N)}finally{h(!1)}},[n,r,s]);return v.useEffect(()=>{x()},[x]),f.jsxs("div",{className:"rounded border border-c4a-border-default bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("p",{className:"mt-1 font-mono text-sm font-bold text-c4a-text-primary",children:i}),d&&f.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[f.jsx(ia,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:c("sources.import.dir_scanning")})]}),m&&f.jsxs("div",{className:"mt-6",children:[f.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[f.jsx(fd,{size:14,className:"mt-0.5 shrink-0"}),c("sources.import.dir_scan_error")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:m}),f.jsxs("button",{onClick:x,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:[f.jsx(x4,{size:12}),c("sources.import.dir_scan_retry")]})]}),p&&!d&&!m&&f.jsxs("div",{className:"mt-6 space-y-3",children:[f.jsx("p",{className:"font-mono text-xs uppercase text-c4a-accent",children:c("sources.import.dir_scan_complete")}),f.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[f.jsx(Zs,{icon:f.jsx(ho,{size:14}),label:c("sources.import.dir_code_packages"),value:p.codePackages}),f.jsx(Zs,{icon:f.jsx(ci,{size:14}),label:c("sources.import.dir_doc_files"),value:p.docFiles}),f.jsx(Zs,{icon:f.jsx(la,{size:14}),label:c("sources.import.dir_total_dirs"),value:p.totalDirs}),f.jsx(Zs,{icon:f.jsx(ci,{size:14}),label:c("sources.import.dir_total_files"),value:p.totalFiles})]}),p.gitRepos>0&&f.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-info",children:[f.jsx(fo,{size:14,className:"mt-0.5 shrink-0"}),c("sources.import.dir_git_skip_hint",{count:p.gitRepos})]})]})]})}function Zs({icon:n,label:i,value:r}){return f.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted",children:[n,f.jsx("span",{className:"font-mono text-[10px] uppercase",children:i})]}),f.jsx("p",{className:"mt-1 font-mono text-lg font-bold text-c4a-text-primary",children:r})]})}function Q2({importState:n,libraryName:i,importing:r,onCancel:s,onConfirm:c}){const{t:d}=we(),h=n.scanStats;return f.jsxs("div",{className:"rounded border border-c4a-border-default bg-c4a-bg-surface p-6",children:[f.jsx("p",{className:"text-sm text-c4a-text-secondary",children:d("sources.import.dir_confirm_heading",{name:i})}),f.jsxs("div",{className:"mt-4 space-y-2 text-sm",children:[f.jsx(Vn,{label:d("sources.import.dir_name"),value:n.dirName}),f.jsx(Vn,{label:d("sources.import.dir_path"),value:n.dirPath}),h?f.jsxs(f.Fragment,{children:[f.jsx(Vn,{label:d("sources.import.dir_code_packages"),value:String(h.codePackages)}),f.jsx(Vn,{label:d("sources.import.dir_doc_files"),value:String(h.docFiles)}),f.jsx(Vn,{label:d("sources.import.dir_total_files"),value:String(h.totalFiles)}),f.jsx(Vn,{label:d("sources.import.dir_total_dirs"),value:String(h.totalDirs)})]}):f.jsxs(f.Fragment,{children:[f.jsx(Vn,{label:d("sources.import.dir_files"),value:String(n.fileCount)}),f.jsx(Vn,{label:d("sources.import.dir_subdirs"),value:String(n.subDirCount)})]})]}),(h?.gitRepos??n.gitRepoCount)>0&&f.jsxs("p",{className:"mt-4 flex items-start gap-2 text-xs text-c4a-info",children:[f.jsx(fo,{size:14,className:"mt-0.5 shrink-0"}),d("sources.import.dir_git_skip_hint",{count:h?.gitRepos??n.gitRepoCount})]}),f.jsxs("p",{className:"mt-6 flex items-start gap-2 text-xs text-c4a-text-muted",children:[f.jsx(gy,{size:14,className:"mt-0.5 shrink-0 text-c4a-info"}),d("sources.safety.notice.dir")]}),r&&f.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[f.jsx(ia,{size:14,className:"animate-spin text-c4a-accent"}),f.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:d("sources.import.importing")})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[f.jsx("button",{onClick:s,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 disabled:opacity-40",children:d("common.back")}),f.jsxs("button",{onClick:c,disabled: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&&f.jsx(ia,{size:12,className:"animate-spin"}),d(r?"sources.import.importing":"sources.import.dir_step.confirm")]})]})]})}function Vn({label:n,value:i}){return f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsx("span",{className:"w-24 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:i})]})}function Z2(){const{t:n}=we(),i=Xn(),{libId:r}=co(),c=Bt(di(Nr)).find(V=>V.id===r),d=go(V=>V.createSource),[h,m]=v.useState(1),[y,p]=v.useState(!1),[S,x]=v.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null}),_=c?.is_online??!1,[N,z]=v.useState([]);v.useEffect(()=>{if(!r)return;let V=!1;return(async()=>{try{const B=await Mt.get("/sources",{library_id:r,limit:"500"});if(V)return;const E=B.items.filter($=>!$.parent_id).map($=>{const ne=$.metadata;return typeof ne?.local_path=="string"?ne.local_path:null}).filter($=>$!==null);z(E)}catch{}})(),()=>{V=!0}},[r]);const D=v.useMemo(()=>{const V=c?.config;return!V||!Array.isArray(V.allowed_paths)?[]:V.allowed_paths},[c]),k=v.useCallback(async(V,B)=>{if(!r)throw new Error("No library");const E=await Mt.post(`/libraries/${r}/rpc`,{method:V,params:B});if(E.error){const $=E.error;throw new Error($.message??JSON.stringify(E.error))}return E.result??E},[r]),W=v.useCallback((V,B,E)=>{x($=>({...$,dirPath:V,dirName:B,fileCount:E.files,subDirCount:E.dirs,gitRepoCount:E.gitRepos,mdFiles:E.mdFiles}))},[]),X=v.useCallback((V,B)=>{x(E=>({...E,scanEntries:V,scanStats:B}))},[]),I=v.useCallback(async()=>{if(r){p(!0);try{const V=await d({library_id:r,dir_files:S.scanEntries,dir_name:S.dirName,dir_path:S.dirPath}),B=Array.isArray(V)?V[0]:V;B?.kind==="folder"?i(`/studio/sources/${r}?path=${B.id}`):i(`/studio/sources/${r}`)}catch{p(!1)}}},[r,S,d,i]),se=v.useMemo(()=>h===1?!!S.dirPath:h===2?S.scanEntries.length>0:!0,[h,S]),de=v.useMemo(()=>c?[{label:c.id===po?n("sources.library.default_cloud_name"):c.name,to:`/studio/sources/${c.id}`},{label:n("sources.import.dir_title")}]:[],[c,n]);return c?f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Er,{segments:de}),f.jsxs("div",{className:"mt-6 flex w-full items-center gap-2 font-mono text-sm md:gap-3",children:[f.jsx(Ku,{active:h>=1,current:h===1}),f.jsx("span",{className:h===1?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.select")}),f.jsx(_g,{}),f.jsx(Ku,{active:h>=2,current:h===2}),f.jsx("span",{className:h===2?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.scan")}),f.jsx(_g,{}),f.jsx(Ku,{active:h>=3,current:h===3}),f.jsx("span",{className:h===3?"text-c4a-accent":"text-c4a-text-muted",children:n("sources.import.dir_step.confirm")})]}),f.jsx("div",{className:"mt-6 flex-1",children:_?f.jsxs(f.Fragment,{children:[h===1&&f.jsx(G2,{rpc:k,selectedPath:S.dirPath,onSelect:W,allowedPaths:D,importedPaths:N}),h===2&&f.jsx(X2,{dirPath:S.dirPath,dirName:S.dirName,rpc:k,onScanComplete:X}),h===3&&f.jsx(Q2,{importState:S,libraryName:c.name,importing:y,onCancel:()=>m(2),onConfirm:I})]}):f.jsx(F2,{libraryName:c.name})}),f.jsx("p",{className:"mt-4 text-right text-xs text-c4a-text-muted",children:n("sources.safety.notice.dir")}),_&&h===1&&f.jsx("div",{className:"mt-6 flex justify-end gap-2 border-t border-c4a-border-subtle pt-4",children:f.jsx("button",{onClick:()=>m(2),disabled:!se,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:n("common.next")})}),_&&h===2&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-c4a-border-subtle pt-4",children:[f.jsx("button",{onClick:()=>m(1),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:n("common.back")}),f.jsx("button",{onClick:()=>m(3),disabled:!se,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:n("common.next")})]})]}):f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})})}function Ku({active:n,current:i}){return f.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full border-2 ${i?"border-c4a-accent bg-c4a-accent":n?"border-c4a-accent bg-transparent":"border-c4a-border-default bg-transparent"}`})}function _g(){return f.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function F2({libraryName:n}){const{t:i}=we();return f.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[f.jsx("p",{className:"text-sm text-c4a-warning",children:i("sources.import.daemon_offline",{name:n})}),f.jsx(Ft,{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:i("sources.import.view_guide")})]})}function J2(){const{t:n}=we(),i=Xn(),r=Bt(_=>_.createLibrary),[s,c]=v.useState("waiting"),[d,h]=v.useState(null),[m,y]=v.useState(""),[p,S]=v.useState(!1);v.useEffect(()=>Ya.on("ws:daemon:connected",N=>{const z=N;h(z),y(z.machine_id),c(z.needs_registration?"new_client":"reconnected")}),[]);const x=v.useCallback(async()=>{if(d){S(!0);try{const _=await r({type:"daemon",name:m||d.machine_id,config:{machine_id:d.machine_id,os:d.os||"",daemon_version:d.daemon_version||""}});i(`/studio/sources/${_.id}`)}catch{S(!1)}}},[d,m,r,i]);return f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Er,{segments:[{label:n("sources.add_client.title")}]}),f.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:n("sources.add_client.description")}),f.jsx("div",{className:"mt-6 rounded border border-c4a-border-default bg-c4a-bg-surface p-5",children:f.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",n("sources.add_client.step1")]}),f.jsx("pre",{className:"mt-1 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:"npm install -g @c4a/daemon"})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",n("sources.add_client.step2")]}),f.jsx("pre",{className:"mt-1 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:`c4a-daemon --server ${window.location.host} --allow ./`})]}),f.jsxs("li",{children:[f.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",n("sources.add_client.step3")]}),f.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:n("sources.add_client.step3_desc")})]})]})}),f.jsxs("div",{className:"mt-6 rounded border border-c4a-border-default bg-c4a-bg-surface p-5",children:[s==="waiting"&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(ia,{size:16,className:"animate-spin text-c4a-warning"}),f.jsx("span",{className:"text-sm text-c4a-warning",children:n("sources.add_client.waiting")})]}),s==="new_client"&&d&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:n("sources.add_client.detected")}),f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsx($u,{label:n("sources.add_client.machine_name"),value:d.machine_id}),d.os&&f.jsx($u,{label:n("sources.add_client.os"),value:d.os}),d.daemon_version&&f.jsx($u,{label:n("sources.add_client.daemon_version"),value:d.daemon_version})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n("sources.add_client.client_name")}),f.jsx("input",{value:m,onChange:_=>y(_.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"})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx("button",{onClick:()=>i("/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:n("common.cancel")}),f.jsxs("button",{onClick:x,disabled:p||!m.trim(),className:"flex items-center gap-1.5 rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-50",children:[p&&f.jsx(ia,{size:12,className:"animate-spin"}),n("sources.add_client.confirm")]})]})]}),s==="reconnected"&&d&&f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(lo,{size:16,className:"text-c4a-success"}),f.jsx("span",{className:"text-sm text-c4a-text-primary",children:n("sources.add_client.reconnected",{name:d.machine_id})})]}),d.lib_id&&f.jsx(Ft,{to:`/studio/sources/${d.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:n("sources.add_client.go_to",{name:d.machine_id})})]})]})]})}function $u({label:n,value:i}){return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:n}),f.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:i})]})}function W2(){const{t:n}=we(),{sourceUuid:i}=co(),{currentSource:r,loading:s,fetchSource:c}=go(),d=Bt(di(Nr)),[h,m]=v.useState("original"),[y,p]=v.useState([]);v.useEffect(()=>{i&&c(i)},[i,c]),v.useEffect(()=>{r&&(async()=>{const D=[];let k=r.parent_id;for(;k;)try{const W=await fetch(`/api/v1/sources/${k}`);if(!W.ok)break;const X=await W.json();D.unshift(X),k=X.parent_id}catch{break}p(D)})()},[r]);const S=d.find(D=>D.id===r?.library_id),x=r?.metadata?Object.fromEntries(Object.entries(r.metadata).map(([D,k])=>[D,String(k??"")])):null,_=r?.source_type==="code",N=v.useMemo(()=>{if(!r||!S)return[];const D=[{label:S.id===po?n("sources.library.default_cloud_name"):S.name,to:`/studio/sources/${S.id}`}];return y.forEach(k=>{D.push({label:k.name,to:`/studio/sources/${S.id}?path=${k.id}`})}),D.push({label:r.name}),D},[r,S,y,n]),z=[{key:"original",label:n(_?"sources.detail.tab.overview":"sources.detail.tab.original")},{key:"digest",label:n("sources.detail.tab.digest")},{key:"modeling",label:n("sources.detail.tab.modeling")}];return s||!r?f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})}):f.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[f.jsx(Er,{segments:N}),f.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[_?f.jsx(ho,{size:20,className:"text-c4a-accent"}):f.jsx(ci,{size:20,className:"text-c4a-text-secondary"}),f.jsx("h1",{className:"font-mono text-xl font-bold text-c4a-text-primary",children:r.name})]}),f.jsxs("div",{className:"mt-2 flex flex-wrap gap-4 text-xs text-c4a-text-muted",children:[f.jsxs("span",{children:[n("sources.detail.type"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:r.source_type==="code"?n("sources.type.code"):n("sources.type.doc")})]}),_&&x?.relative_path&&f.jsxs("span",{children:[n("sources.detail.path"),":"," ",f.jsx("span",{className:"font-mono text-c4a-text-secondary",children:x.relative_path})]}),!_&&f.jsxs("span",{children:[n("sources.detail.origin"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:S?.type==="daemon"?n("sources.detail.origin.local"):n("sources.detail.origin.upload")})]}),f.jsxs("span",{children:[n("sources.detail.status"),":"," ",f.jsx("span",{className:"text-c4a-text-secondary",children:n(`sources.status.${r.index_status}`)})]})]}),_&&x&&f.jsx("div",{className:"mt-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:f.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-xs md:grid-cols-4",children:[x.repo_name&&f.jsx(Fs,{label:n("sources.detail.repo"),value:x.repo_name}),x.pinned_branch&&f.jsx(Fs,{label:n("sources.detail.branch"),value:x.pinned_branch}),x.pinned_hash&&f.jsx(Fs,{label:n("sources.detail.commit"),value:x.pinned_hash.slice(0,7)}),x.tech_stack&&f.jsx(Fs,{label:n("sources.detail.tech_stack"),value:x.tech_stack})]})}),f.jsx("div",{className:"mt-6 flex border-b border-c4a-border-subtle",children:z.map(D=>f.jsx("button",{onClick:()=>m(D.key),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${h===D.key?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:D.label},D.key))}),f.jsxs("div",{className:"mt-4 flex-1",children:[h==="original"&&f.jsx(P2,{source:r,isCode:_}),h==="digest"&&f.jsx(jg,{message:n("sources.detail.digest_placeholder")}),h==="modeling"&&f.jsx(jg,{message:n("sources.detail.modeling_placeholder")})]})]})}function Fs({label:n,value:i}){return f.jsxs("div",{children:[f.jsx("span",{className:"text-c4a-text-muted",children:n}),f.jsx("p",{className:"mt-0.5 font-mono text-c4a-text-primary",children:i})]})}function P2({source:n,isCode:i}){const{t:r}=we(),s=n.metadata;return i?f.jsxs("div",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[!!s?.description&&f.jsx("p",{children:String(s.description)}),!!s?.dependencies&&f.jsxs("div",{children:[f.jsx("h4",{className:"font-mono text-xs font-bold uppercase text-c4a-text-primary",children:r("sources.detail.dependencies")}),f.jsx("div",{className:"mt-2 rounded bg-c4a-bg-surface p-3 font-mono text-xs",children:Object.entries(s.dependencies).map(([c,d])=>f.jsxs("div",{className:"flex justify-between py-0.5",children:[f.jsx("span",{className:"text-c4a-text-primary",children:c}),f.jsx("span",{className:"text-c4a-text-muted",children:d})]},c))})]}),!s?.description&&!s?.dependencies&&f.jsx("p",{className:"text-c4a-text-muted",children:r("sources.detail.original_code_placeholder")})]}):f.jsx("div",{className:"prose prose-invert max-w-none text-sm text-c4a-text-secondary",children:f.jsx("p",{className:"text-c4a-text-muted",children:r("sources.detail.original_doc_placeholder")})})}function jg({message:n}){return f.jsx("div",{className:"flex items-center justify-center rounded border border-dashed border-c4a-border-subtle p-12",children:f.jsx("p",{className:"text-center text-sm text-c4a-text-muted",children:n})})}const I2="lib_cloud_default",e_=dS([{element:f.jsx(t2,{}),children:[{path:"/",element:f.jsx(s2,{})},{path:"/login",element:f.jsx(o2,{})},{path:"/docs",element:f.jsx(c2,{})}]},{path:"/studio",element:f.jsx(r2,{}),children:[{index:!0,element:f.jsx(ng,{to:"/studio/sources",replace:!0})},{path:"sources",element:f.jsx(ng,{to:`/studio/sources/${I2}`,replace:!0})},{path:"sources/add-client",element:f.jsx(J2,{})},{path:"sources/import/:libId",element:f.jsx(Y2,{})},{path:"sources/import-dir/:libId",element:f.jsx(Z2,{})},{path:"sources/:libId",element:f.jsx(T2,{})},{path:"source/:sourceUuid",element:f.jsx(W2,{})},{path:"modeling",element:f.jsx(d2,{})},{path:"modeling/code/setup",element:f.jsx(y2,{})},{path:"modeling/code/compile",element:f.jsx(x2,{})},{path:"modeling/code/review",element:f.jsx(v2,{})},{path:"modeling/code/result",element:f.jsx(b2,{})},{path:"brain",element:f.jsx(f2,{})},{path:"discovery",element:f.jsx(h2,{})},{path:"sharing",element:f.jsx(m2,{})},{path:"collaboration",element:f.jsx(p2,{})},{path:"settings",element:f.jsx(g2,{})}]},{path:"*",element:f.jsx(u2,{})}]);function t_(){return v.useEffect(()=>{const i=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return Ya.connect(i),()=>{Ya.disconnect()}},[]),f.jsx(U1,{router:e_})}Wb.createRoot(document.getElementById("root")).render(f.jsx(v.StrictMode,{children:f.jsx(t_,{})}));
|