@c4a/server-cli 0.4.15-alpha.7 โ†’ 0.4.15-alpha.9

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.
@@ -0,0 +1,139 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA-rfuFy.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/angular-ts-BrjP3tb8.js","assets/scss-D5BDwBP9.js","assets/astro-HNnZUWAn.js","assets/json-Cp-IABpG.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-BjGOyj-B.js","assets/html-derivative-DlHx6ybY.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/sql-BLtJtn59.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/haml-D5jkg6IW.js","assets/handlebars-BpdQsYii.js","assets/yaml-Buea-lGh.js","assets/http-jrhK8wxY.js","assets/shellscript-Yzrsuije.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/jinja-f2NsQr07.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/python-B6aJPvgy.js","assets/r-Dspwwk_N.js","assets/marko-DjSrsDqO.js","assets/less-B1dDrJ26.js","assets/mdc-DTYItulj.js","assets/markdown-Cvjx9yec.js","assets/php-R6g_5hLQ.js","assets/pug-DKIMFp6K.js","assets/svelte-Cy7k_4gC.js","assets/ts-tags-DQrlYJgV.js","assets/vue-D2xRrEX4.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-BEDo0Tqx.js"])))=>i.map(i=>d[i]);
2
+ function ZN(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function kg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vh={exports:{}},al={};var iv;function WN(){if(iv)return al;iv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var l=null;if(o!==void 0&&(l=""+o),i.key!==void 0&&(l=""+i.key),"key"in i){o={};for(var d in i)d!=="key"&&(o[d]=i[d])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:o}}return al.Fragment=t,al.jsx=n,al.jsxs=n,al}var sv;function JN(){return sv||(sv=1,vh.exports=WN()),vh.exports}var u=JN();const et=e=>typeof e=="string",il=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},ov=e=>e==null?"":""+e,eC=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},tC=/###/g,lv=e=>e&&e.indexOf("###")>-1?e.replace(tC,"."):e,cv=e=>!e||et(e),Tl=(e,t,n)=>{const r=et(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(cv(e))return{};const o=lv(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return cv(e)?{}:{obj:e,k:lv(r[i])}},uv=(e,t,n)=>{const{obj:r,k:i}=Tl(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],l=t.slice(0,t.length-1),d=Tl(e,l,Object);for(;d.obj===void 0&&l.length;)o=`${l[l.length-1]}.${o}`,l=l.slice(0,l.length-1),d=Tl(e,l,Object),d?.obj&&typeof d.obj[`${d.k}.${o}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${o}`]=n},nC=(e,t,n,r)=>{const{obj:i,k:o}=Tl(e,t,Object);i[o]=i[o]||[],i[o].push(n)},md=(e,t)=>{const{obj:n,k:r}=Tl(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},rC=(e,t,n)=>{const r=md(e,n);return r!==void 0?r:md(t,n)},Hw=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?et(e[r])||e[r]instanceof String||et(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Hw(e[r],t[r],n):e[r]=t[r]);return e},Vi=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var aC={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const iC=e=>et(e)?e.replace(/[&<>"'\/]/g,t=>aC[t]):e;class sC{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const oC=[" ",",","?","!",";"],lC=new sC(20),cC=(e,t,n)=>{t=t||"",n=n||"";const r=oC.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const i=lC.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let o=!i.test(e);if(!o){const l=e.indexOf(n);l>0&&!i.test(e.substring(0,l))&&(o=!0)}return o},km=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let l,d="";for(let p=o;p<r.length;++p)if(p!==o&&(d+=n),d+=r[p],l=i[d],l!==void 0){if(["string","number","boolean"].indexOf(typeof l)>-1&&p<r.length-1)continue;o+=p-o+1;break}i=l}return i},$l=e=>e?.replace("_","-"),uC={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class gd{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||uC,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(et(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new gd(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new gd(this.logger,t)}}var ia=new gd;class Ud{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([i,o])=>{for(let l=0;l<o;l++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,o])=>{for(let l=0;l<o;l++)i.apply(i,[t,...n])})}}class dv extends Ud{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,i={}){const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,l=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;t.indexOf(".")>-1?d=t.split("."):(d=[t,n],r&&(Array.isArray(r)?d.push(...r):et(r)&&o?d.push(...r.split(o)):d.push(r)));const p=md(this.data,d);return!p&&!n&&!r&&t.indexOf(".")>-1&&(t=d[0],n=d[1],r=d.slice(2).join(".")),p||!l||!et(r)?p:km(this.data?.[t]?.[n],r,o)}addResource(t,n,r,i,o={silent:!1}){const l=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let d=[t,n];r&&(d=d.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(d=t.split("."),i=n,n=d[1]),this.addNamespaces(n),uv(this.data,d,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r,i={silent:!1}){for(const o in r)(et(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o,l={silent:!1,skipCopy:!1}){let d=[t,n];t.indexOf(".")>-1&&(d=t.split("."),i=r,r=n,n=d[1]),this.addNamespaces(n);let p=md(this.data,d)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Hw(p,r,o):p={...p,...r},uv(this.data,d,p),l.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var qw={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{t=this.processors[o]?.process(t,n,r,i)??t}),t}};const Vw=Symbol("i18next/PATH_KEY");function dC(){const e=[],t=Object.create(null);let n;return t.get=(r,i)=>(n?.revoke?.(),i===Vw?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Sm(e,t){const{[Vw]:n}=e(dC());return n.join(t?.keySeparator??".")}const fv={},_h=e=>!et(e)&&typeof e!="boolean"&&typeof e!="number";class xd extends Ud{constructor(t,n={}){super(),eC(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ia.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const i=this.resolve(t,r);if(i?.res===void 0)return!1;const o=_h(i.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,d=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!cC(t,r,i);if(l&&!d){const p=t.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:t,namespaces:et(o)?[o]:o};const f=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(f[0])>-1)&&(o=f.shift()),t=f.join(i)}return{key:t,namespaces:et(o)?[o]:o}}translate(t,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";typeof t=="function"&&(t=Sm(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]);const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,l=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:d,namespaces:p}=this.extractFromKey(t[t.length-1],i),f=p[p.length-1];let m=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;m===void 0&&(m=":");const g=i.lng||this.language,y=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g?.toLowerCase()==="cimode")return y?o?{res:`${f}${m}${d}`,usedKey:d,exactUsedKey:d,usedLng:g,usedNS:f,usedParams:this.getUsedParamsDetails(i)}:`${f}${m}${d}`:o?{res:d,usedKey:d,exactUsedKey:d,usedLng:g,usedNS:f,usedParams:this.getUsedParamsDetails(i)}:d;const b=this.resolve(t,i);let w=b?.res;const k=b?.usedKey||d,j=b?.exactUsedKey||d,S=["[object Number]","[object Function]","[object RegExp]"],E=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,z=i.count!==void 0&&!et(i.count),D=xd.hasDefaultValue(i),A=z?this.pluralResolver.getSuffix(g,i.count,i):"",P=i.ordinal&&z?this.pluralResolver.getSuffix(g,i.count,{ordinal:!1}):"",T=z&&!i.ordinal&&i.count===0,F=T&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${A}`]||i[`defaultValue${P}`]||i.defaultValue;let M=w;C&&!w&&D&&(M=F);const G=_h(M),Q=Object.prototype.toString.apply(M);if(C&&M&&G&&S.indexOf(Q)<0&&!(et(E)&&Array.isArray(M))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const re=this.options.returnedObjectHandler?this.options.returnedObjectHandler(k,M,{...i,ns:p}):`key '${d} (${this.language})' returned an object instead of string.`;return o?(b.res=re,b.usedParams=this.getUsedParamsDetails(i),b):re}if(l){const re=Array.isArray(M),$=re?[]:{},U=re?j:k;for(const I in M)if(Object.prototype.hasOwnProperty.call(M,I)){const V=`${U}${l}${I}`;D&&!w?$[I]=this.translate(V,{...i,defaultValue:_h(F)?F[I]:void 0,joinArrays:!1,ns:p}):$[I]=this.translate(V,{...i,joinArrays:!1,ns:p}),$[I]===V&&($[I]=M[I])}w=$}}else if(C&&et(E)&&Array.isArray(w))w=w.join(E),w&&(w=this.extendTranslation(w,t,i,r));else{let re=!1,$=!1;!this.isValidLookup(w)&&D&&(re=!0,w=F),this.isValidLookup(w)||($=!0,w=d);const I=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&$?void 0:w,V=D&&F!==w&&this.options.updateMissing;if($||re||V){if(this.logger.log(V?"updateKey":"missingKey",g,f,d,V?F:w),l){const B=this.resolve(d,{...i,keySeparator:!1});B&&B.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 te=[];const oe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&oe&&oe[0])for(let B=0;B<oe.length;B++)te.push(oe[B]);else this.options.saveMissingTo==="all"?te=this.languageUtils.toResolveHierarchy(i.lng||this.language):te.push(i.lng||this.language);const R=(B,K,O)=>{const se=D&&O!==w?O:I;this.options.missingKeyHandler?this.options.missingKeyHandler(B,f,K,se,V,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(B,f,K,se,V,i),this.emit("missingKey",B,f,K,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&z?te.forEach(B=>{const K=this.pluralResolver.getSuffixes(B,i);T&&i[`defaultValue${this.options.pluralSeparator}zero`]&&K.indexOf(`${this.options.pluralSeparator}zero`)<0&&K.push(`${this.options.pluralSeparator}zero`),K.forEach(O=>{R([B],d+O,i[`defaultValue${O}`]||F)})}):R(te,d,F))}w=this.extendTranslation(w,t,i,b,r),$&&w===d&&this.options.appendNamespaceToMissingKey&&(w=`${f}${m}${d}`),($||re)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}${m}${d}`:d,re?w:void 0,i))}return o?(b.res=w,b.usedParams=this.getUsedParamsDetails(i),b):w}extendTranslation(t,n,r,i,o){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const p=et(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(p){const g=t.match(this.interpolator.nestingRegexp);f=g&&g.length}let m=r.replace&&!et(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),t=this.interpolator.interpolate(t,m,r.lng||this.language||i.usedLng,r),p){const g=t.match(this.interpolator.nestingRegexp),y=g&&g.length;f<y&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...g)=>o?.[0]===g[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):this.translate(...g,n),r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,d=et(l)?[l]:l;return t!=null&&d?.length&&r.applyPostProcessor!==!1&&(t=qw.handle(d,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,i,o,l,d;return et(t)&&(t=[t]),t.forEach(p=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(p,n),m=f.key;i=m;let g=f.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const y=n.count!==void 0&&!et(n.count),b=y&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(et(n.context)||typeof n.context=="number")&&n.context!=="",k=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);g.forEach(j=>{this.isValidLookup(r)||(d=j,!fv[`${k[0]}-${j}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(d)&&(fv[`${k[0]}-${j}`]=!0,this.logger.warn(`key "${i}" for languages "${k.join(", ")}" won't get resolved as namespace "${d}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),k.forEach(S=>{if(this.isValidLookup(r))return;l=S;const E=[m];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(E,m,S,j,n);else{let z;y&&(z=this.pluralResolver.getSuffix(S,n.count,n));const D=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(n.ordinal&&z.indexOf(A)===0&&E.push(m+z.replace(A,this.options.pluralSeparator)),E.push(m+z),b&&E.push(m+D)),w){const P=`${m}${this.options.contextSeparator||"_"}${n.context}`;E.push(P),y&&(n.ordinal&&z.indexOf(A)===0&&E.push(P+z.replace(A,this.options.pluralSeparator)),E.push(P+z),b&&E.push(P+D))}}let C;for(;C=E.pop();)this.isValidLookup(r)||(o=C,r=this.getResource(S,j,C,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:l,usedNS:d}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!et(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class pv{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ia.create("languageUtils")}getScriptPartFromCode(t){if(t=$l(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=$l(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(et(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(l=>{if(l===o)return l;if(!(l.indexOf("-")<0&&o.indexOf("-")<0)&&(l.indexOf("-")>0&&o.indexOf("-")<0&&l.substring(0,l.indexOf("-"))===o||l.indexOf(o)===0&&o.length>1))return l})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),et(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),i=[],o=l=>{l&&(this.isSupportedCode(l)?i.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return et(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):et(t)&&o(this.formatLanguageCode(t)),r.forEach(l=>{i.indexOf(l)<0&&o(this.formatLanguageCode(l))}),i}}const hv={zero:0,one:1,two:2,few:3,many:4,other:5},mv={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class fC{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=ia.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=$l(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let l;try{l=new Intl.PluralRules(r,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),mv;if(!t.match(/-|_/))return mv;const p=this.languageUtils.getLanguagePartFromCode(t);l=this.getRule(p,n)}return this.pluralRulesCache[o]=l,l}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>hv[i]-hv[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n,r={}){const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const gv=(e,t,n,r=".",i=!0)=>{let o=rC(e,t,n);return!o&&i&&et(n)&&(o=km(e,n,r),o===void 0&&(o=km(t,n,r))),o},wh=e=>e.replace(/\$/g,"$$$$");class xv{constructor(t={}){this.logger=ia.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:l,suffix:d,suffixEscaped:p,formatSeparator:f,unescapeSuffix:m,unescapePrefix:g,nestingPrefix:y,nestingPrefixEscaped:b,nestingSuffix:w,nestingSuffixEscaped:k,nestingOptionsSeparator:j,maxReplaces:S,alwaysFormat:E}=t.interpolation;this.escape=n!==void 0?n:iC,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Vi(o):l||"{{",this.suffix=d?Vi(d):p||"}}",this.formatSeparator=f||",",this.unescapePrefix=m?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=y?Vi(y):b||Vi("$t("),this.nestingSuffix=w?Vi(w):k||Vi(")"),this.nestingOptionsSeparator=j||",",this.maxReplaces=S||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let o,l,d;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=b=>{if(b.indexOf(this.formatSeparator)<0){const S=gv(n,p,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(S,void 0,r,{...i,...n,interpolationkey:b}):S}const w=b.split(this.formatSeparator),k=w.shift().trim(),j=w.join(this.formatSeparator).trim();return this.format(gv(n,p,k,this.options.keySeparator,this.options.ignoreJSONStructure),j,r,{...i,...n,interpolationkey:k})};this.resetRegExp();const m=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,g=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>wh(b)},{regex:this.regexp,safeValue:b=>this.escapeValue?wh(this.escape(b)):wh(b)}].forEach(b=>{for(d=0;o=b.regex.exec(t);){const w=o[1].trim();if(l=f(w),l===void 0)if(typeof m=="function"){const j=m(t,o,i);l=et(j)?j:""}else if(i&&Object.prototype.hasOwnProperty.call(i,w))l="";else if(g){l=o[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${t}`),l="";else!et(l)&&!this.useRawValueToEscape&&(l=ov(l));const k=b.safeValue(l);if(t=t.replace(o[0],k),g?(b.regex.lastIndex+=l.length,b.regex.lastIndex-=o[0].length):b.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),t}nest(t,n,r={}){let i,o,l;const d=(p,f)=>{const m=this.nestingOptionsSeparator;if(p.indexOf(m)<0)return p;const g=p.split(new RegExp(`${Vi(m)}[ ]*{`));let y=`{${g[1]}`;p=g[0],y=this.interpolate(y,l);const b=y.match(/'/g),w=y.match(/"/g);((b?.length??0)%2===0&&!w||(w?.length??0)%2!==0)&&(y=y.replace(/'/g,'"'));try{l=JSON.parse(y),f&&(l={...f,...l})}catch(k){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,k),`${p}${m}${y}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,p};for(;i=this.nestingRegexp.exec(t);){let p=[];l={...r},l=l.replace&&!et(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const f=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(f!==-1&&(p=i[1].slice(f).split(this.formatSeparator).map(m=>m.trim()).filter(Boolean),i[1]=i[1].slice(0,f)),o=n(d.call(this,i[1].trim(),l),l),o&&i[0]===t&&!et(o))return o;et(o)||(o=ov(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),p.length&&(o=p.reduce((m,g)=>this.format(m,g,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const pC=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(l=>{if(l){const[d,...p]=l.split(":"),f=p.join(":").trim().replace(/^'+|'+$/g,""),m=d.trim();n[m]||(n[m]=f),f==="false"&&(n[m]=!1),f==="true"&&(n[m]=!0),isNaN(f)||(n[m]=parseInt(f,10))}})}return{formatName:t,formatOptions:n}},yv=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const l=r+JSON.stringify(o);let d=t[l];return d||(d=e($l(r),i),t[l]=d),d(n)}},hC=e=>(t,n,r)=>e($l(n),r)(t);class mC{constructor(t={}){this.logger=ia.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?yv:hC;this.formats={number:r((i,o)=>{const l=new Intl.NumberFormat(i,{...o});return d=>l.format(d)}),currency:r((i,o)=>{const l=new Intl.NumberFormat(i,{...o,style:"currency"});return d=>l.format(d)}),datetime:r((i,o)=>{const l=new Intl.DateTimeFormat(i,{...o});return d=>l.format(d)}),relativetime:r((i,o)=>{const l=new Intl.RelativeTimeFormat(i,{...o});return d=>l.format(d,o.range||"day")}),list:r((i,o)=>{const l=new Intl.ListFormat(i,{...o});return d=>l.format(d)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=yv(n)}format(t,n,r,i={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(d=>d.indexOf(")")>-1)){const d=o.findIndex(p=>p.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,d)].join(this.formatSeparator)}return o.reduce((d,p)=>{const{formatName:f,formatOptions:m}=pC(p);if(this.formats[f]){let g=d;try{const y=i?.formatParams?.[i.interpolationkey]||{},b=y.locale||y.lng||i.locale||i.lng||r;g=this.formats[f](d,b,{...m,...i,...y})}catch(y){this.logger.warn(y)}return g}else this.logger.warn(`there was no format function for ${f}`);return d},t)}}const gC=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class xC extends Ud{constructor(t,n,r,i={}){super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=ia.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(t,n,r,i){const o={},l={},d={},p={};return t.forEach(f=>{let m=!0;n.forEach(g=>{const y=`${f}|${g}`;!r.reload&&this.store.hasResourceBundle(f,g)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?l[y]===void 0&&(l[y]=!0):(this.state[y]=1,m=!1,l[y]===void 0&&(l[y]=!0),o[y]===void 0&&(o[y]=!0),p[g]===void 0&&(p[g]=!0)))}),m||(d[f]=!0)}),(Object.keys(o).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(l),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(p)}}loaded(t,n,r){const i=t.split("|"),o=i[0],l=i[1];n&&this.emit("failedLoading",o,l,n),!n&&r&&this.store.addResourceBundle(o,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const d={};this.queue.forEach(p=>{nC(p.loaded,[o],l),gC(p,t),n&&p.errors.push(n),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(f=>{d[f]||(d[f]={});const m=p.loaded[f];m.length&&m.forEach(g=>{d[f][g]===void 0&&(d[f][g]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(p=>!p.done)}read(t,n,r,i=0,o=this.retryTimeout,l){if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:l});return}this.readingCalls++;const d=(f,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(f&&m&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,l)},o);return}l(f,m)},p=this.backend[r].bind(this.backend);if(p.length===2){try{const f=p(t,n);f&&typeof f.then=="function"?f.then(m=>d(null,m)).catch(d):d(null,f)}catch(f){d(f)}return}return p(t,n,d)}prepareLoading(t,n,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();et(t)&&(t=this.languageUtils.toResolveHierarchy(t)),et(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(l=>{this.loadOne(l)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(l,d)=>{l&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,l),!l&&d&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,d),this.loaded(t,l,d)})}saveMissing(t,n,r,i,o,l={},d=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const p={...l,isUpdate:o},f=this.backend.create.bind(this.backend);if(f.length<6)try{let m;f.length===5?m=f(t,n,r,i,p):m=f(t,n,r,i),m&&typeof m.then=="function"?m.then(g=>d(null,g)).catch(d):d(null,m)}catch(m){d(m)}else f(t,n,r,i,d,p)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const kh=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),et(e[1])&&(t.defaultValue=e[1]),et(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),bv=e=>(et(e.ns)&&(e.ns=[e.ns]),et(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),et(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Ru=()=>{},yC=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},Gw="__i18next_supportNoticeShown",bC=()=>typeof globalThis<"u"&&!!globalThis[Gw],vC=()=>{typeof globalThis<"u"&&(globalThis[Gw]=!0)},_C=e=>!!(e?.modules?.backend?.name?.indexOf("Locize")>0||e?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||e?.options?.backend?.backends&&e.options.backend.backends.some(t=>t?.name?.indexOf("Locize")>0||t?.constructor?.name?.indexOf("Locize")>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(t=>t?.projectId));class Rl extends Ud{constructor(t={},n){if(super(),this.options=bv(t),this.services={},this.logger=ia,this.modules={external:[]},yC(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(et(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=kh();this.options={...r,...this.options,...bv(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!_C(this)&&!bC()&&(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 ๐Ÿ’™"),vC());const i=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?ia.init(i(this.modules.logger),this.options):ia.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=mC;const m=new pv(this.options);this.store=new dv(this.options.resources,this.options);const g=this.services;g.logger=ia,g.resourceStore=this.store,g.languageUtils=m,g.pluralResolver=new fC(m,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),f&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(g.formatter=i(f),g.formatter.init&&g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new xv(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new xC(i(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",(b,...w)=>{this.emit(b,...w)}),this.modules.languageDetector&&(g.languageDetector=i(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=i(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new xd(this.services,this.options),this.translator.on("*",(b,...w)=>{this.emit(b,...w)}),this.modules.external.forEach(b=>{b.init&&b.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Ru),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[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(f=>{this[f]=(...m)=>this.store[f](...m)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...m)=>(this.store[f](...m),this)});const d=il(),p=()=>{const f=(m,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),d.resolve(g),n(m,g)};if(this.languages&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),d}loadResources(t,n=Ru){let r=n;const i=et(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],l=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(f=>{f!=="cimode"&&o.indexOf(f)<0&&o.push(f)})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>l(p)),this.options.preload?.forEach?.(d=>l(d)),this.services.backendConnector.load(o,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(d)})}else r(null)}reloadResources(t,n,r){const i=il();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Ru),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&qw.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=il();this.emit("languageChanging",t);const i=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},o=(d,p)=>{p?this.isLanguageChangingTo===t&&(i(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,r.resolve((...f)=>this.t(...f)),n&&n(d,(...f)=>this.t(...f))},l=d=>{!t&&!d&&this.services.languageDetector&&(d=[]);const p=et(d)?d:d&&d[0],f=this.store.hasLanguageSomeTranslations(p)?p:this.services.languageUtils.getBestMatchFromCodes(et(d)?[d]:d);f&&(this.language||i(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector?.cacheUserLanguage?.(f)),this.loadResources(f,m=>{o(m,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),r}getFixedT(t,n,r){const i=(o,l,...d)=>{let p;typeof l!="object"?p=this.options.overloadTranslationOptionHandler([o,l].concat(d)):p={...l},p.lng=p.lng||i.lng,p.lngs=p.lngs||i.lngs,p.ns=p.ns||i.ns,p.keyPrefix!==""&&(p.keyPrefix=p.keyPrefix||r||i.keyPrefix);const f=this.options.keySeparator||".";let m;return p.keyPrefix&&Array.isArray(o)?m=o.map(g=>(typeof g=="function"&&(g=Sm(g,{...this.options,...l})),`${p.keyPrefix}${f}${g}`)):(typeof o=="function"&&(o=Sm(o,{...this.options,...l})),m=p.keyPrefix?`${p.keyPrefix}${f}${o}`:o),this.t(m,p)};return et(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(d,p)=>{const f=this.services.backendConnector.state[`${d}|${p}`];return f===-1||f===0||f===2};if(n.precheck){const d=n.precheck(this,l);if(d!==void 0)return d}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!i||l(o,t)))}loadNamespaces(t,n){const r=il();return this.options.ns?(et(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=il();et(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(l=>i.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return o.length?(this.options.preload=i.concat(o),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const o=i.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new pv(kh());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new Rl(t,n);return r.createInstance=Rl.createInstance,r}cloneInstance(t={},n=Ru){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Rl(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(d=>{o[d]=this[d]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const d=Object.keys(this.store.data).reduce((p,f)=>(p[f]={...this.store.data[f]},p[f]=Object.keys(p[f]).reduce((m,g)=>(m[g]={...p[f][g]},m),p[f]),p),{});o.store=new dv(d,i),o.services.resourceStore=o.store}if(t.interpolation){const p={...kh().interpolation,...this.options.interpolation,...t.interpolation},f={...i,interpolation:p};o.services.interpolator=new xv(f)}return o.translator=new xd(o.services,i),o.translator.on("*",(d,...p)=>{o.emit(d,...p)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const $n=Rl.createInstance();$n.createInstance;$n.dir;$n.init;$n.loadResources;$n.reloadResources;$n.use;$n.changeLanguage;$n.getFixedT;$n.t;$n.exists;$n.setDefaultNamespace;$n.hasLoadedNamespace;$n.loadNamespaces;$n.loadLanguages;var Sh={exports:{}},tt={};var vv;function wC(){if(vv)return tt;vv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function b(B){return B===null||typeof B!="object"?null:(B=y&&B[y]||B["@@iterator"],typeof B=="function"?B:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,j={};function S(B,K,O){this.props=B,this.context=K,this.refs=j,this.updater=O||w}S.prototype.isReactComponent={},S.prototype.setState=function(B,K){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,K,"setState")},S.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function E(){}E.prototype=S.prototype;function C(B,K,O){this.props=B,this.context=K,this.refs=j,this.updater=O||w}var z=C.prototype=new E;z.constructor=C,k(z,S.prototype),z.isPureReactComponent=!0;var D=Array.isArray;function A(){}var P={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function F(B,K,O){var se=O.ref;return{$$typeof:e,type:B,key:K,ref:se!==void 0?se:null,props:O}}function M(B,K){return F(B.type,K,B.props)}function G(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function Q(B){var K={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(O){return K[O]})}var re=/\/+/g;function $(B,K){return typeof B=="object"&&B!==null&&B.key!=null?Q(""+B.key):K.toString(36)}function U(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(A,A):(B.status="pending",B.then(function(K){B.status==="pending"&&(B.status="fulfilled",B.value=K)},function(K){B.status==="pending"&&(B.status="rejected",B.reason=K)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function I(B,K,O,se,ie){var pe=typeof B;(pe==="undefined"||pe==="boolean")&&(B=null);var Ee=!1;if(B===null)Ee=!0;else switch(pe){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(B.$$typeof){case e:case t:Ee=!0;break;case m:return Ee=B._init,I(Ee(B._payload),K,O,se,ie)}}if(Ee)return ie=ie(B),Ee=se===""?"."+$(B,0):se,D(ie)?(O="",Ee!=null&&(O=Ee.replace(re,"$&/")+"/"),I(ie,K,O,"",function(be){return be})):ie!=null&&(G(ie)&&(ie=M(ie,O+(ie.key==null||B&&B.key===ie.key?"":(""+ie.key).replace(re,"$&/")+"/")+Ee)),K.push(ie)),1;Ee=0;var Ie=se===""?".":se+":";if(D(B))for(var Ue=0;Ue<B.length;Ue++)se=B[Ue],pe=Ie+$(se,Ue),Ee+=I(se,K,O,pe,ie);else if(Ue=b(B),typeof Ue=="function")for(B=Ue.call(B),Ue=0;!(se=B.next()).done;)se=se.value,pe=Ie+$(se,Ue++),Ee+=I(se,K,O,pe,ie);else if(pe==="object"){if(typeof B.then=="function")return I(U(B),K,O,se,ie);throw K=String(B),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function V(B,K,O){if(B==null)return B;var se=[],ie=0;return I(B,se,"","",function(pe){return K.call(O,pe,ie++)}),se}function te(B){if(B._status===-1){var K=B._result;K=K(),K.then(function(O){(B._status===0||B._status===-1)&&(B._status=1,B._result=O)},function(O){(B._status===0||B._status===-1)&&(B._status=2,B._result=O)}),B._status===-1&&(B._status=0,B._result=K)}if(B._status===1)return B._result.default;throw B._result}var oe=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},R={map:V,forEach:function(B,K,O){V(B,function(){K.apply(this,arguments)},O)},count:function(B){var K=0;return V(B,function(){K++}),K},toArray:function(B){return V(B,function(K){return K})||[]},only:function(B){if(!G(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return tt.Activity=g,tt.Children=R,tt.Component=S,tt.Fragment=n,tt.Profiler=i,tt.PureComponent=C,tt.StrictMode=r,tt.Suspense=p,tt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,tt.__COMPILER_RUNTIME={__proto__:null,c:function(B){return P.H.useMemoCache(B)}},tt.cache=function(B){return function(){return B.apply(null,arguments)}},tt.cacheSignal=function(){return null},tt.cloneElement=function(B,K,O){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var se=k({},B.props),ie=B.key;if(K!=null)for(pe in K.key!==void 0&&(ie=""+K.key),K)!T.call(K,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&K.ref===void 0||(se[pe]=K[pe]);var pe=arguments.length-2;if(pe===1)se.children=O;else if(1<pe){for(var Ee=Array(pe),Ie=0;Ie<pe;Ie++)Ee[Ie]=arguments[Ie+2];se.children=Ee}return F(B.type,ie,se)},tt.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:o,_context:B},B},tt.createElement=function(B,K,O){var se,ie={},pe=null;if(K!=null)for(se in K.key!==void 0&&(pe=""+K.key),K)T.call(K,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ie[se]=K[se]);var Ee=arguments.length-2;if(Ee===1)ie.children=O;else if(1<Ee){for(var Ie=Array(Ee),Ue=0;Ue<Ee;Ue++)Ie[Ue]=arguments[Ue+2];ie.children=Ie}if(B&&B.defaultProps)for(se in Ee=B.defaultProps,Ee)ie[se]===void 0&&(ie[se]=Ee[se]);return F(B,pe,ie)},tt.createRef=function(){return{current:null}},tt.forwardRef=function(B){return{$$typeof:d,render:B}},tt.isValidElement=G,tt.lazy=function(B){return{$$typeof:m,_payload:{_status:-1,_result:B},_init:te}},tt.memo=function(B,K){return{$$typeof:f,type:B,compare:K===void 0?null:K}},tt.startTransition=function(B){var K=P.T,O={};P.T=O;try{var se=B(),ie=P.S;ie!==null&&ie(O,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(A,oe)}catch(pe){oe(pe)}finally{K!==null&&O.types!==null&&(K.types=O.types),P.T=K}},tt.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},tt.use=function(B){return P.H.use(B)},tt.useActionState=function(B,K,O){return P.H.useActionState(B,K,O)},tt.useCallback=function(B,K){return P.H.useCallback(B,K)},tt.useContext=function(B){return P.H.useContext(B)},tt.useDebugValue=function(){},tt.useDeferredValue=function(B,K){return P.H.useDeferredValue(B,K)},tt.useEffect=function(B,K){return P.H.useEffect(B,K)},tt.useEffectEvent=function(B){return P.H.useEffectEvent(B)},tt.useId=function(){return P.H.useId()},tt.useImperativeHandle=function(B,K,O){return P.H.useImperativeHandle(B,K,O)},tt.useInsertionEffect=function(B,K){return P.H.useInsertionEffect(B,K)},tt.useLayoutEffect=function(B,K){return P.H.useLayoutEffect(B,K)},tt.useMemo=function(B,K){return P.H.useMemo(B,K)},tt.useOptimistic=function(B,K){return P.H.useOptimistic(B,K)},tt.useReducer=function(B,K,O){return P.H.useReducer(B,K,O)},tt.useRef=function(B){return P.H.useRef(B)},tt.useState=function(B){return P.H.useState(B)},tt.useSyncExternalStore=function(B,K,O){return P.H.useSyncExternalStore(B,K,O)},tt.useTransition=function(){return P.H.useTransition()},tt.version="19.2.4",tt}var _v;function Hd(){return _v||(_v=1,Sh.exports=wC()),Sh.exports}var _=Hd();const Zs=kg(_),kC=ZN({__proto__:null,default:Zs},[_]),SC=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);ns(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},wv={},Yw=(e,t,n,r)=>{ns(n)&&wv[n]||(ns(n)&&(wv[n]=new Date),SC(e,t,n,r))},Kw=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},jm=(e,t,n)=>{e.loadNamespaces(t,Kw(e,n))},kv=(e,t,n,r)=>{if(ns(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return jm(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,Kw(e,r))},jC=(e,t,n={})=>!t.languages||!t.languages.length?(Yw(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),ns=e=>typeof e=="string",NC=e=>typeof e=="object"&&e!==null,CC=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,EC={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"ยฉ","&#169;":"ยฉ","&reg;":"ยฎ","&#174;":"ยฎ","&hellip;":"โ€ฆ","&#8230;":"โ€ฆ","&#x2F;":"/","&#47;":"/"},AC=e=>EC[e],TC=e=>e.replace(CC,AC);let Nm={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:TC,transDefaultProps:void 0};const RC=(e={})=>{Nm={...Nm,...e}},LC=()=>Nm;let Xw;const DC=e=>{Xw=e},OC=()=>Xw,MC={type:"3rdParty",init(e){RC(e.options.react),DC(e)}},zC=_.createContext();class IC{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var jh={exports:{}},Nh={};var Sv;function $C(){if(Sv)return Nh;Sv=1;var e=Hd();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function d(g,y){var b=y(),w=r({inst:{value:b,getSnapshot:y}}),k=w[0].inst,j=w[1];return o(function(){k.value=b,k.getSnapshot=y,p(k)&&j({inst:k})},[g,b,y]),i(function(){return p(k)&&j({inst:k}),g(function(){p(k)&&j({inst:k})})},[g]),l(b),b}function p(g){var y=g.getSnapshot;g=g.value;try{var b=y();return!n(g,b)}catch{return!0}}function f(g,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:d;return Nh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Nh}var jv;function BC(){return jv||(jv=1,jh.exports=$C()),jh.exports}var PC=BC();const FC=(e,t)=>ns(t)?t:NC(t)&&ns(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,UC={t:FC,ready:!1},HC=()=>()=>{},_e=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=_.useContext(zC)||{},o=n||r||OC();o&&!o.reportNamespaces&&(o.reportNamespaces=new IC),o||Yw(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const l=_.useMemo(()=>({...LC(),...o?.options?.react,...t}),[o,t]),{useSuspense:d,keyPrefix:p}=l,f=i||o?.options?.defaultNS,m=ns(f)?[f]:f||["translation"],g=_.useMemo(()=>m,m);o?.reportNamespaces?.addUsedNamespaces?.(g);const y=_.useRef(0),b=_.useCallback(F=>{if(!o)return HC;const{bindI18n:M,bindI18nStore:G}=l,Q=()=>{y.current+=1,F()};return M&&o.on(M,Q),G&&o.store.on(G,Q),()=>{M&&M.split(" ").forEach(re=>o.off(re,Q)),G&&G.split(" ").forEach(re=>o.store.off(re,Q))}},[o,l]),w=_.useRef(),k=_.useCallback(()=>{if(!o)return UC;const F=!!(o.isInitialized||o.initializedStoreOnce)&&g.every(U=>jC(U,o,l)),M=t.lng||o.language,G=y.current,Q=w.current;if(Q&&Q.ready===F&&Q.lng===M&&Q.keyPrefix===p&&Q.revision===G)return Q;const $={t:o.getFixedT(M,l.nsMode==="fallback"?g:g[0],p),ready:F,lng:M,keyPrefix:p,revision:G};return w.current=$,$},[o,g,p,l,t.lng]),[j,S]=_.useState(0),{t:E,ready:C}=PC.useSyncExternalStore(b,k,k);_.useEffect(()=>{if(o&&!C&&!d){const F=()=>S(M=>M+1);t.lng?kv(o,t.lng,g,F):jm(o,g,F)}},[o,t.lng,g,C,d,j]);const z=o||{},D=_.useRef(null),A=_.useRef(),P=F=>{const M=Object.getOwnPropertyDescriptors(F);M.__original&&delete M.__original;const G=Object.create(Object.getPrototypeOf(F),M);if(!Object.prototype.hasOwnProperty.call(G,"__original"))try{Object.defineProperty(G,"__original",{value:F,writable:!1,enumerable:!1,configurable:!1})}catch{}return G},T=_.useMemo(()=>{const F=z,M=F?.language;let G=F;F&&(D.current&&D.current.__original===F?A.current!==M?(G=P(F),D.current=G,A.current=M):G=D.current:(G=P(F),D.current=G,A.current=M));const Q=[E,G,C];return Q.t=E,Q.i18n=G,Q.ready=C,Q},[E,z,C,z.resolvedLanguage,z.language,z.languages]);if(o&&d&&!C)throw new Promise(F=>{const M=()=>F();t.lng?kv(o,t.lng,g,M):jm(o,g,M)});return T},{slice:qC,forEach:VC}=[];function GC(e){return VC.call(qC.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function YC(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const Nv=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,KC=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let o=`${e}=${i}`;if(r.maxAge>0){const l=r.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(l)}`}if(r.domain){if(!Nv.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!Nv.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},Cv={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=KC(e,t,i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var XC={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return Cv.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:o}=t;n&&typeof document<"u"&&Cv.create(n,e,r,i,o)}},QC={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let l=0;l<o.length;l++){const d=o[l].indexOf("=");d>0&&o[l].substring(0,d)===t&&(n=o[l].substring(d+1))}}return n}},ZC={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const o=i.substring(1);if(t){const l=o.split("&");for(let d=0;d<l.length;d++){const p=l[d].indexOf("=");p>0&&l[d].substring(0,p)===t&&(r=l[d].substring(p+1))}}if(r)return r;if(!r&&n>-1){const l=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?l[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let qs=null;const Ev=()=>{if(qs!==null)return qs;try{if(qs=typeof window<"u"&&window.localStorage!==null,!qs)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{qs=!1}return qs};var WC={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&Ev())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Ev()&&window.localStorage.setItem(n,e)}};let Vs=null;const Av=()=>{if(Vs!==null)return Vs;try{if(Vs=typeof window<"u"&&window.sessionStorage!==null,!Vs)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Vs=!1}return Vs};var JC={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Av())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Av()&&window.sessionStorage.setItem(n,e)}},eE={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let o=0;o<n.length;o++)t.push(n[o]);r&&t.push(r),i&&t.push(i)}return t.length>0?t:void 0}},tE={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},nE={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof t=="number"?t:0]?.replace("/",""):void 0}},rE={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let Qw=!1;try{document.cookie,Qw=!0}catch{}const Zw=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Qw||Zw.splice(1,1);const aE=()=>({order:Zw,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Ww{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=GC(n,this.options||{},aE()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(XC),this.addDetector(QC),this.addDetector(WC),this.addDetector(JC),this.addDetector(eE),this.addDetector(tE),this.addDetector(nE),this.addDetector(rE),this.addDetector(ZC)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!YC(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}Ww.type="languageDetector";const iE={"nav.home":"Home","nav.studio":"Studio","nav.docs":"Docs","nav.login":"Login","nav.logout":"Logout","header.status.connected":"Connected","header.status.disconnected":"Disconnected","header.status.reconnecting":"Reconnecting","footer.copyright":"GitHub ยท @Context4AI {{year}}. All rights reserved.","footer.copyright_compact":"@Context4AI {{year}}. Allย rightsย reserved.","footer.tagline":"Knowledge Factory","footer.theme.dark":"Dark","footer.theme.light":"Light","footer.theme.system":"System","studio.sidebar.sources":"Sources","studio.sidebar.modeling":"Modeling","studio.sidebar.brain":"Brain","studio.sidebar.discovery":"Discovery","studio.sidebar.sharing":"Sharing","studio.sidebar.collaboration":"Collaboration","studio.sidebar.settings":"Settings","placeholder.coming":"Coming in {{version}}","page.login.title":"Login","page.login.description":"Authentication and user management","login.title":"SIGN IN","login.provider_cta":"Sign in with {{name}}","login.loading":"LOADING...","login.authenticating":"AUTHENTICATING...","login.or":"OR","login.test_account":"Test Account","login.error":"Failed to load login options","login.retry":"Retry","user.menu.connect_source":"Connect Source","user.menu.sign_out":"Sign out","api_keys.title":"API Keys","api_keys.description":"API Keys for programmatic access to C4A API (AI Agent, CLI, CI/CD)","api_keys.create":"Create API Key","api_keys.created":"API Key Created","api_keys.copy_warning":"Copy now, this key won't be shown again.","api_keys.copy":"Copy","api_keys.copied":"Copied!","api_keys.done":"Done","api_keys.empty.title":"No API Keys","api_keys.empty.description":"API Keys for programmatic access to C4A API","api_keys.created_at":"Created {{date}}","api_keys.never_used":"Never used","api_keys.expires.never":"Never expires","api_keys.expires.30d":"30 days","api_keys.expires.90d":"90 days","api_keys.expires.1y":"1 year","api_keys.form.name":"Name","api_keys.form.name_placeholder":"My CLI key","api_keys.form.expiry":"Expiration (optional)","api_keys.delete.confirm":"Delete this API key? This action cannot be undone.","workspace.default_name":"My Brain","settings.tab.general":"General","settings.tab.api_keys":"API Keys","page.docs.title":"Docs","page.docs.description":"Public documentation portal","page.sources.title":"Sources","page.sources.description":"Add code repositories, documents, and other input materials for your brain to index","page.modeling.title":"Modeling","page.modeling.description":"Model indexed content with AI โ€” only what stands up to scrutiny gets written to the knowledge graph","page.brain.title":"Brain","page.brain.description":"All modeled knowledge lives here โ€” browse, search, analyze, and use it anytime","page.discovery.title":"Discovery","page.discovery.description":"Explore knowledge curated by others and add what's useful to your own brain","page.sharing.title":"Sharing","page.sharing.description":"Package and export knowledge from your brain for others and AI to use directly","page.collaboration.title":"Collaboration","page.collaboration.description":"Stay in sync with other brains โ€” get notified on updates, no manual transfer needed","page.settings.title":"Settings","page.settings.description":"Manage workspace members and configuration","page.code_setup.title":"Code Setup","page.code_setup.description":"Repository selection and configuration for code modeling","page.code_compile.title":"Code Compile","page.code_compile.description":"Compilation progress tracking for code modeling","page.code_review.title":"Code Review","page.code_review.description":"Review and approve modeling results","page.code_result.title":"Code Result","page.code_result.description":"View final modeling results and generated knowledge graph","home.hero.title":"Context For AI","home.hero.description":"Transform code repositories and business documents into structured knowledge graphs.","home.hero.cta.studio":"Enter Studio","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"The page you're looking for doesn't exist.","notfound.back":"Back to Home","error.description":"Something went wrong. Please try again.","error.reload":"Reload","sources.menu.add_client":"Add Client","sources.menu.online":"online","sources.menu.offline":"offline","sources.menu.status_online":"{{machine}} connected","sources.menu.status_offline":"{{machine}} not connected, click for setup guide","sources.library.default_cloud_name":"My Drive","sources.library.rename":"Rename","sources.library.rename_placeholder":"Enter library name","sources.header.daemon_status":"{{online}}/{{total}} online","sources.header.all_offline":"All offline","sources.actions.new_folder":"New Folder","sources.folder.name_placeholder":"Enter folder name","sources.actions.import_repo":"Import Repository","sources.actions.rename":"Rename","sources.actions.move_to":"Move to...","sources.actions.delete":"Delete","sources.filter.all":"All","sources.filter.indexed":"Indexed","sources.filter.not_indexed":"Not Indexed","sources.status.none":"None","sources.status.indexed":"Indexed","sources.status.stale":"Index outdated","sources.type.code":"Code","sources.type.doc":"Document","sources.empty.cloud.title":"Your personal knowledge input zone","sources.empty.cloud.description":"Create folders to organize your documents and materials. These are visible only to you and will serve as the foundation for building your digital brain","sources.empty.daemon.title":"Connect your local code assets","sources.empty.daemon.description":"Import local code repositories. The system will automatically extract code structures and technical documents, transforming them into structured knowledge","sources.empty.indexed.title":"Knowledge not yet indexed","sources.empty.indexed.description":"Select sources and complete indexing. They will be transformed into structured summaries, providing material for your future speculations.","sources.empty.folder.title":"This folder is empty","sources.empty.folder.daemon_description":"You can add or edit documents locally, and they will appear here after the next sync.","sources.safety.notice.repo":"In local mode, your code has absolute privacy. Source code never leaves your computer. The system only extracts structured summaries for knowledge modeling (function signatures, dependencies, etc.).","sources.safety.notice.dir":"The system extracts document content and summaries for knowledge modeling. Although unsafe text is filtered, please ensure sensitive data is not included in indexing or modeling.","sources.import.title":"Import Repository","sources.import.step.select":"Select Repository","sources.import.step.version":"Select Version","sources.import.step.confirm":"Import Complete","sources.import.daemon_offline":"Client {{name}} is not connected. Please start the local Daemon and connect to the server before importing.","sources.import.view_guide":"View Connection Guide","sources.import.select_root":"Select repository root directory","sources.import.current_path":"Current path","sources.import.not_git":"This directory is not a Git repository. Please select a directory containing .git.","sources.import.branch":"Branch","sources.import.commit":"Commit","sources.import.branch_warning":"Currently based on {{branch}} branch HEAD","sources.import.uncommitted_warning":"Uncommitted changes will not be collected","sources.import.recognized":"Recognized {{packages}} packages and {{docs}} documents","sources.import.no_packages":"No package structure detected. Will be imported as a single-package repository.","sources.import.confirm_heading":"About to import the following repository to {{name}}:","sources.import.packages":"Packages","sources.import.documents":"Documents","sources.import.loading_repo":"Loading repository info...","sources.import.loading_repo_slow":"Large repositories (>10 GB) may take 5โ€“10 seconds...","sources.import.importing":"Importing...","sources.import.error_title":"Import Failed","sources.import.success":"Import complete","sources.import.stage.prepare":"Preparing environment","sources.import.stage.clone":"Cloning repository","sources.import.stage.clone_polling":"","sources.import.stage.scan":"Scanning project","sources.import.stage.save":"Saving sources","sources.import.stage.done_suffix":"done","sources.import.stage.complete":"Import complete","sources.import.stage.fetch_tree":"Fetching file tree","sources.import.stage.read_packages":"Reading package descriptors","sources.import.step.loading":"Data Import","sources.import.done":"Done","sources.import.back":"Back","sources.import.retry":"Retry","sources.add_client.title":"Connect Local Knowledge Source","sources.add_client.description":"Start a client (Daemon) on your local computer to mount local code repositories as input material into your digital brain.","sources.add_client.step1":"Install Daemon","sources.add_client.step2":"Start Daemon","sources.add_client.step2_allow":"Restrict access to specific directories (does not affect existing imports)","sources.add_client.step3":"Wait for connection","sources.add_client.step3_desc":"This page will update automatically once connected.","sources.add_client.waiting":"Waiting for new client connection...","sources.add_client.detected":"New client detected","sources.add_client.machine_name":"Machine ID","sources.add_client.os":"Operating system","sources.add_client.daemon_version":"Daemon version","sources.add_client.client_name":"Client name","sources.add_client.confirm":"Confirm Add","sources.add_client.reconnected":"Client {{name}} has reconnected","sources.add_client.go_to":"Go to {{name}}","sources.detail.tab.original":"Original","sources.detail.tab.overview":"Overview","sources.detail.tab.digest":"Digest","sources.detail.tab.modeling":"Modeling Result","sources.detail.not_found_title":"Source Not Found","sources.detail.not_found_desc":"This source could not be found. It may have been deleted or the ID is invalid.","sources.detail.digest_placeholder":"Structured summary will be available here after indexing is complete.","sources.detail.modeling_placeholder":"Knowledge entities derived from this source will appear here after modeling in the speculation zone.","sources.detail.type":"Type","sources.detail.origin":"Origin","sources.detail.origin.upload":"Upload","sources.detail.origin.local":"Local file","sources.detail.path":"Path","sources.detail.status":"Status","sources.detail.repo":"Repository","sources.detail.branch":"Branch","sources.detail.commit":"Commit","sources.detail.tech_stack":"Tech stack","sources.detail.original_code_placeholder":"Package overview will be available after indexing.","sources.detail.original_doc_placeholder":"Document content will be available after upload.","sources.detail.dependencies":"Dependencies","sources.delete.confirm_title":"Confirm Delete","sources.delete.resource":"Are you sure you want to delete {{name}}?","sources.delete.resource_impact":"The following data will be permanently deleted: original content, structured digest (if any).","sources.delete.session_warning":"If your personal speculation zone is using this source, related candidate speculations will be affected.","sources.delete.entity_safe":"Formal knowledge already merged into the brain will not be affected.","sources.delete.folder":"Are you sure you want to delete folder {{name}}?","sources.delete.folder_impact":"All resources inside will be recursively deleted: {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_contents":"Contains {{folders}} sub-folders, {{sources}} sources.","sources.delete.folder_impact_generic":"All sub-folders and resources inside will be recursively deleted.","sources.delete.irreversible":"This action cannot be undone.","sources.delete.repo":"Are you sure you want to remove repository {{name}} from {{library}}?","sources.delete.repo_impact":"Will delete: {{packages}} package index records, {{docs}} document index records.","sources.delete.repo_contents":"Contains {{packages}} packages, {{docs}} documents.","sources.delete.indexed_hint":"{{indexed}}/{{total}} have been indexed; their index data will be deleted.","sources.delete.repo_impact_generic":"All package and document index records will be deleted.","sources.delete.local_safe":"Local files will not be affected.","sources.delete.client":"Are you sure you want to delete client {{name}}?","sources.delete.client_impact":"All imported repository records and related index data under this client will be deleted.","sources.delete.client_reregister":"This client will need to re-register on next connection.","sources.error.name_conflict":'An item named "{{name}}" already exists in this directory.',"sources.move.current":"Current","sources.move.target":"Move to","sources.breadcrumb.sources":"Sources","common.cancel":"Cancel","common.confirm":"Confirm","common.back":"Back","common.next":"Next","common.previous":"Previous","common.items":"{{count}} items","common.loading":"Loading...","common.more":"More","common.collapse":"Collapse","sources.import.no_entries":"No entries found","sources.import.allowed_dirs":"Client authorized directories","sources.import.allowed_dirs_tooltip_restrict":"Restrict to specific directories:","sources.import.allowed_dirs_tooltip_all":"Or allow all directories (default):","sources.import.wildcard_home":"Home","sources.import.wildcard_path_placeholder":"Enter a directory pathโ€ฆ","sources.import.wildcard_go":"Go","sources.import.wildcard_goto":"Go to","sources.import.wildcard_go_title":"Go to Directory","sources.import.wildcard_path_not_found":"Path does not exist on the remote machine","sources.import.already_imported":"Imported","sources.import.dir_title":"Import Directory","sources.import.dir_step.select":"Select Directory","sources.import.dir_step.scan":"Scan","sources.import.dir_step.confirm":"Confirm Import","sources.import.dir_confirm_heading":"About to import the following directory to {{name}}:","sources.import.dir_name":"Directory Name","sources.import.dir_name_hint":"Display name in the source tree after import. Leave empty to use the default repository name.","sources.import.dir_name_duplicate":"This name already exists. Please use a different name.","sources.import.dir_path":"Directory Path","sources.import.dir_files":"Files","sources.import.dir_subdirs":"Subdirectories","sources.import.dir_git_repos":"Repositories (skipped)","sources.import.dir_git_hint":"Git repositories inside the directory will not be expanded for indexing. Import them separately if needed.","sources.import.dir_scanning":"Scanning directory contents...","sources.import.dir_scan_complete":"Scan complete","sources.import.dir_scan_error":"Failed to scan directory","sources.import.dir_scan_retry":"Retry","sources.import.dir_code_packages":"Code Packages","sources.import.dir_code_packages_tip":"Supported: package.json, pyproject.toml, setup.py, go.mod, Cargo.toml, pom.xml, build.gradle","sources.import.dir_doc_files":"Documents","sources.import.dir_doc_files_tip":"Supported: Markdown (.md)","sources.import.dir_total_files":"Total Files","sources.import.dir_total_dirs":"Directories","sources.import.dir_git_skip_hint":"Git repos are skipped. Use 'Import Repository' instead.","sources.actions.upload":"Upload","sources.actions.upload_md":"Markdown Document","sources.actions.upload_doc":"Document","sources.actions.upload_document":"Upload Document","sources.actions.add":"Add","sources.actions.add_folder":"Folder","sources.actions.add_web":"Web Page","sources.actions.add_feishu":"Feishu Document","sources.actions.import_dir":"Import Directory","sources.actions.import_repo_url":"Import Repository","sources.upgrade.title":"Feature Upgrading","sources.upgrade.description":"This feature will be available in version 0.5.x. Stay tuned.","sources.upload.title":"Upload Documents","sources.upload.drop_hint":"Click to select or drag files here","sources.upload.supported_formats":"Supported: .md, .doc, .docx, .pdf, .ppt, .pptx, .txt (max 5MB each, up to 10 files)","sources.upload.file_too_large":'"{{name}}" exceeds 5MB limit',"sources.upload.too_many_files":"Maximum 10 files allowed, please re-select","sources.upload.unsupported_type":'"{{name}}" is not a supported file type',"sources.upload.uploading":"Uploading...","sources.upload.success":"Uploaded {{count}} documents","sources.upload.selected":"{{count}} files selected","sources.upload.remove":"Remove","sources.import_remote.title":"Import Remote Repository","sources.import_remote.step.loading":"Data Import","sources.import_remote.url_label":"Repository URL","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"Only HTTPS URLs are accepted. SSH support is planned for a future release","sources.import_remote.url_hint_public":"Supports public Git repositories without authentication, and Git services with OAuth configured: ","sources.import_remote.url_hint_no_auth":"Supports public Git repositories and Git services with OAuth configured","sources.import_remote.url_invalid":"Only HTTPS Git URLs are supported","sources.import_remote.ref_label":"Branch / Tag","sources.import_remote.ref_branches":"Branches","sources.import_remote.ref_tags":"Tags","sources.import_remote.ref_search":"Search branches or tagsโ€ฆ","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"Auto-filled with the latest commit of selected branch. You can also type or search","sources.import_remote.commit_search":"Search commitโ€ฆ","sources.import_remote.loading_refs":"Querying repository branches...","sources.import_remote.loading_refs_slow":"Large projects may take 10โ€“30s, please wait...","sources.import_remote.summary_repo":"Repository","sources.import_remote.summary_branch":"Branch","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"Preparing environment","sources.import_remote.stage.clone":"Cloning repository","sources.import_remote.stage.scan":"Scanning project","sources.import_remote.stage.save":"Saving sources","sources.import_remote.complete":"Import complete","sources.import_remote.back_to_library":"Done","sources.import_remote.retry":"Retry","sources.import_remote.back":"Back","sources.import_remote.error.auth_required":"This repository requires authentication. Please configure an access token for {{host}} in Server Settings โ†’ Git Tokens.","sources.import_remote.error.auth_failed":"Authentication failed. Please check your Git token configuration.","sources.import_remote.error.not_found":"Repository not found or no access. Please check the URL.","sources.import_remote.error.network":"Cannot connect to the remote repository. Please check your network or try again later.","sources.import_remote.error.capacity":"Import queue is full. Please try again later.","sources.import_remote.error.clone_failed":"Clone failed","sources.import_remote.error.scan_failed":"Scan failed","sources.import_remote.error.save_failed":"Save failed","sources.import_remote.api.detected":"Detected {{platform}} repo, fetch via API with partial indexing support","sources.import_remote.api.fast_available":"Fast import available","sources.import_remote.api.will_use_clone":"Fetch repo data via Clone, full indexing","sources.import_remote.api.use_clone":"Fetch repo data via Clone, full indexing","sources.import_remote.api.sub_path":"Sub path (optional)","sources.import_remote.api.sub_path_hint":"For monorepos: import only a subdirectory","sources.import_remote.api.sub_path_placeholder":"Multiple paths separated by ;","sources.import_remote.api.select_sub_paths":"Select subdirectories","sources.import_remote.api.panel_selected":"Selected","sources.import_remote.api.selected_count":"{{count}} directories selected","sources.import_remote.api.confirm_full":"Confirm (full import)","sources.import_remote.api.back_to_ref":"Back to branch select","sources.import_remote.api.method":"Import method","sources.import_remote.api.method_api":"API (fast)","sources.import_remote.api.method_clone":"Clone","sources.import_remote.api.truncated_warning":"File tree exceeds 100,000 entries, API results may be incomplete","sources.import_remote.api.truncated_suggest":"Recommend using traditional clone for complete results","sources.import_remote.api.truncated_continue":"Continue import","sources.import_remote.api.truncated_use_clone":"Use clone","sources.import_remote.api.suggest_clone":"Recommend traditional clone","sources.import_remote.api.fallback_msg":"API import failed, switching to traditional clone","sources.import_remote.api.git_host_not_configured":"Git host {{host}} is not configured. Please add it to server.yaml git_hosts section with an access token.","sources.safety.notice.remote":"The remote repository will be cloned to the server for analysis. Code will not be uploaded to any third-party services.","content.detail.tab.raw":"Raw Content","content.detail.tab.digest":"Digest","content.detail.tab.extraction":"LLM Extraction","content.detail.tab.entities":"Entities","content.card.lines":"Lines {{start}}-{{end}}","content.detail.size":"Size","content.detail.created_at":"Created","content.detail.sources":"Sources","content.detail.language":"Language","content.detail.model":"Model","entity.detail.tab.overview":"Overview","entity.detail.tab.relations":"Relations","entity.detail.tab.contents":"Contents","entity.detail.tab.referrers":"Referrers","entity.detail.tab.neighbors":"Neighbors","entity.detail.type":"Type","entity.detail.kind":"Kind","entity.detail.perspective":"Perspective","entity.detail.scope":"Scope","relation.detail.tab.overview":"Overview","relation.detail.weight":"Weight","relation.detail.confidence":"Confidence","relation.detail.from":"From","relation.detail.to":"To","relation.detail.description":"Description","relation.detail.data":"Additional Data","relation.detail.source_refs":"Content Sources","relation.detail.meta":"Metadata","relation.detail.source_label":"Source","relation.detail.source_field_sync":"System-derived","relation.detail.source_explicit":"Explicitly declared","relation.filter.direction.all":"All Directions","relation.filter.direction.outgoing":"Outgoing โ†’","relation.filter.direction.incoming":"โ† Incoming","relation.filter.type.all":"All Types","ref.stale":"Stale ref","ref.unknown":"Unknown entity","ref.retry":"Resolve failed, click to retry","confidence.high":"High confidence","confidence.high.tip":"Confidence โ‰ฅ 0.9, cross-validated by multiple signals","confidence.ai":"AI suggestion","confidence.ai.tip":"Confidence 0.7โ€“0.9, AI-inferred but not fully verified","confidence.low":"Low confidence","confidence.low.tip":"Confidence < 0.7, insufficient info or conflicting signals","source.field_sync":"System-derived","source.explicit":"Explicitly declared","common.empty.content_raw.title":"Not yet indexed","common.empty.content_raw.description":"Content will be available after indexing.","common.empty.content_raw.cta":"Start indexing","common.empty.content_digest.title":"Not yet indexed","common.empty.content_digest.description":"This content has not been through structured indexing yet.","common.empty.content_extraction.title":"Not yet extracted","common.empty.content_extraction.description":"AI has not yet performed entity extraction and analysis on this content.","common.empty.content_entities.title":"No associated entities","common.empty.content_entities.description":"No entities have been extracted from this content yet.","common.empty.entity_relations.title":"No relations","common.empty.entity_relations.description":"This entity is currently an island with no connections to other entities.","common.empty.entity_contents.title":"No content sources","common.empty.entity_contents.description":"This entity is not linked to any source code or document content.","common.empty.entity_referrers.title":"No referrers","common.empty.entity_referrers.description":"No other entities currently reference this entity in their data fields.","common.empty.entity_neighbors.title":"No neighbors","common.empty.entity_neighbors.description":"This entity has no directly connected neighbor nodes in the graph.","common.error.not_found":"Resource not found","common.error.not_found_description":"The requested resource does not exist or has been removed.","common.error.load_failed":"Failed to load","common.error.load_failed_description":"An error occurred while loading data. Please try again.","explorer.mode.append":"Append","explorer.mode.replace":"Replace","explorer.mode.append_tooltip":"Open links in new tabs","explorer.mode.replace_tooltip":"Replace current tab","explorer.close_all":"Close All Tabs","explorer.type.content":"Content","explorer.type.entity":"Entity","explorer.type.relation":"Relation","explorer.type.call_graph":"Call Graph","explorer.type.import_deps":"Import Deps","explorer.type.inheritance":"Inheritance","version.selector_label":"Version","version.current":"Current","upload.no_change":"File content unchanged, upload ignored","upload.partial_no_change":"{{count}} file(s) unchanged, ignored","upload.new_version_title":"New Version","upload.new_version_desc":"File content has changed. Enter a new version number:","upload.version_label":"Version","upload.current_version":"Current version: {{version}}","upload.version_must_increase":"Version must be greater than {{version}}","upload.confirm":"Upload","package.last_commit":"Last Commit","package.dependencies":"Dependencies","package.files":"Files","package.no_dependencies":"No dependencies","package.unknown":"Unknown","index.code.go_index":"Index","index.code.reindex":"Re-index","index.code.indexing":"Indexing...","index.stage.daemon_starting":"Daemon","index.stage.cloning":"Cloning","index.stage.preparing":"Preparing","index.stage.scanning":"Scanning","index.stage.parsing":"Parsing","index.stage.analyzing":"Analyzing","index.stage.uploading":"Uploading","index.stage.skipping":"Skipping","index.code.complete":"Index complete","index.code.unchanged_count":"{{count}} module(s) unchanged, skipped","index.code.error":"Index failed","index.code.timeout":"Index timed out","index.code.dismiss":"Dismiss","index.code.skipped":"Already up to date","index.code.delete":"Delete index","index.code.delete_confirm":"Delete index for this resource? Original content, digest and extraction data will be removed.","index.code.delete_success":"Index deleted","index.code.delete_failed":"Delete index failed","index.code.auto_continue":"Auto-continue on complete","index.code.auto_continue_pending":"Auto-continuing shortly..","index.code.done_continue":"Done","index.log.daemon_starting":"Starting cloud Daemon...","index.log.daemon_ready":"Daemon ready","index.log.cloning":"Cloning repository...","index.log.clone_done":"Clone complete","index.log.preparing":"Preparing index version...","index.log.prepare_done":"Version ready","index.log.done_suffix":"done","index.log.scan_done":"Scan complete","index.log.parse_done":"Parse complete, {{count}} files","index.log.analyze_done":"Analysis complete","index.log.upload_done":"Data saved {{name}}","index.log.restored":"(Progress restored from server, previous logs unavailable)","index.error.commit_not_available":"Target commit unavailable, check remote","index.error.daemon_start_failed":"Cloud Daemon failed to start","index.error.git_archive_failed":"Version export failed","index.doc.error.llm_unavailable":"LLM service unavailable, check configuration","index.doc.error.embedding_unavailable":"Embedding service unavailable, check configuration","index.doc.error.content_missing":"Document content missing","index.doc.error.parse_failed":"Document parsing failed","index.doc.error.llm_exhausted":"LLM call failed: {{message}}","index.stage.chunking":"Chunking","index.stage.annotating":"Annotating","index.stage.post_processing":"Post-processing","index.stage.embedding":"Embedding","index.stage.storing":"Storing","index.doc.log.chunking":"Analyzing document structure...","index.doc.log.chunking_done":"Chunking complete ({{n}} chunks)","index.doc.log.annotating_start":"LLM annotation starting...","index.doc.log.annotating":"LLM annotating ({{n}}/{{m}})","index.doc.log.post_processing":"Entity resolution & quality checks...","index.doc.log.embedding":"Generating embeddings...","index.doc.log.storing":"Saving to storage...","index.doc.msg.chunking_result":"{{chunks}} chunks, {{sections}} sections","index.doc.msg.annotating_start":"{{n}} chunks","index.doc.msg.annotating_start_model":"{{n}} chunks, LLM {{model}}","index.doc.msg.annotating_chunk":"Chunk {{current}}/{{total}} {{step}} ({{calls}} calls, {{tokens}} tokens)","index.doc.msg.annotating_chunk_done":"Chunk {{current}}/{{total}} done, total {{calls}} calls {{tokens}} tokens","index.doc.msg.post_process_start":"Entity auto-complete & normalization","index.doc.msg.extraction_stats":"{{entities}} entities, {{relations}} relations, {{withAtoms}}/{{totalParas}} paragraphs with atoms","index.doc.msg.no_resolution":"No resolution candidates","index.doc.msg.resolving":"Resolving {{duplicates}} duplicates + {{noise}} noise candidates via LLM","index.doc.msg.resolution_parse_failed":"Entity resolution parse failed","index.doc.msg.resolution_result":"Resolution: {{merges}} merges ({{mergeRefs}} refs), {{removed}} removed ({{removeRefs}} instances), {{ambiguous}} ambiguous","index.doc.msg.resolution_failed":"Entity resolution failed (non-blocking)","index.doc.msg.embedding_model":"Embedding {{model}}","index.doc.msg.file_start":"[{{idx}}/{{total}}] {{file}} indexing started","index.doc.msg.file_done":"[{{idx}}/{{total}}] {{file}} indexing complete","index.doc.msg.file_error":"[{{idx}}/{{total}}] {{file}} indexing failed: {{error}}","index.doc.confirm_title":"Document indexing","index.doc.confirm_desc":"The following documents will be indexed using LLM, which will consume tokens:","index.doc.confirm_btn":"Confirm indexing","index.doc.estimating":"Estimating consumption...","index.doc.estimate_tokens":"Tokens","index.doc.estimate_calls":"LLM calls","index.doc.estimate_chunks":"Chunks","index.doc.estimate_summary":"Estimated ~{{tokens}} tokens, ~{{calls}} LLM calls","index.doc.cancel":"Cancel","digest.empty.title":"No code digest","digest.empty.description":"This content has not been code-indexed. Index to view structured code digest.","digest.empty.cta":"Start indexing","digest.doc.empty.title":"Document not yet indexed","digest.doc.empty.description":"Index to view the original text alongside structured annotations","digest.doc.empty.cta":"Index document","digest.doc.no_atoms":"No annotations or extracted in other paragraphs","digest.doc.atom.entities":"Entities","digest.doc.atom.relations":"Relations","digest.doc.atom.behaviors":"Behaviors","digest.doc.atom.attributes":"Attributes","digest.doc.atom.states":"States","digest.doc.atom.rules":"Rules","digest.doc.atom.transitions":"Transitions","digest.doc.atom.events":"Events","digest.doc.atom.decisions":"Decisions","digest.doc.atom.metrics":"Metrics","digest.doc.atom.roles":"Roles","digest.doc.atom.constraints":"Constraints","digest.doc.atom.comparisons":"Comparisons","digest.doc.atom.boundaries":"Boundaries","digest.stats.files":"Files","digest.stats.classes":"Classes","digest.stats.functions":"Functions","digest.stats.relations":"Relations","digest.tech_stack":"Tech stack","digest.modules":"Modules","daemon.offline_tooltip":"Please start the client","sources.detail.repo_url":"Repo URL","raw.basic_info":"Basic info","raw.field.name":"Name","raw.field.version":"Version","raw.field.license":"License","raw.field.description":"Description","raw.dependencies":"Dependencies","raw.dev_dependencies":"Dev dependencies","raw.no_dependencies":"No dependencies","raw.readme":"Readme","raw.code_files":"Code files","raw.doc_files":"Doc files","raw.total_files":"Total files","index.batch.title":"Select items to index","index.batch.panel_a_title":"Indexable content","index.batch.panel_b_title":"Selected","index.batch.selected_count":"Selected {{n}} / {{total}} available","index.batch.already_indexed":"Indexed","index.batch.reindex_tag":"Re-index","index.batch.skipped_unsupported":"Skipped (not yet supported)","index.batch.empty_selection":"Select items from the tree on the left","index.batch.warning_over_50":"Large number of items (>50), may take a while","index.batch.confirm":"Start indexing","index.batch.back":"Back","index.batch.tooltip":"Batch index","index.batch.tooltip_indexing":"Indexing...","index.batch.toast_skipped":"All selected items are up to date. No re-indexing needed.","index.batch.toast_partial_fail":"Some index tasks failed. Check console for details.","index.batch.error":"Batch index failed","error.dialog.console_hint":"Full error details have been printed to the browser console.","error.dialog.copy":"Copy","error.dialog.copied":"Copied","error.dialog.confirm":"OK","query.tab.label":"Query","query.indexing.title":"Indexing in progress","query.indexing.desc":"Query will be available once indexing completes.","query.symbol.search_placeholder":"Search symbols...","query.symbol.exported_only":"Exported only","query.symbol.load_more":"Load more ({{count}} remaining)","query.symbol.loading":"Loading symbols...","query.symbol.empty":"No symbols found","query.symbol.empty_desc":"This source has no code symbols to display.","query.symbol.methods":"Methods","query.symbol.properties":"Properties","query.symbol.extends":"Extends","query.symbol.implements":"Implements","query.symbol.signature":"Signature","query.symbol.parameters":"Parameters","query.symbol.returns":"Returns","query.symbol.async":"Async","query.call_graph.title":"Call Graph","query.call_graph.callers":"Callers","query.call_graph.callees":"Callees","query.call_graph.empty":"No call relations found","query.call_graph.empty_desc":"No {{direction}} found for this function.","query.call_graph.depth":"Depth","query.call_graph.open":"View call graph","query.import_deps.title":"Import Dependencies","query.import_deps.forward":"Imports","query.import_deps.reverse":"Imported by","query.import_deps.external":"External dependencies","query.import_deps.internal":"Internal dependencies","query.import_deps.empty":"No import relations found","query.import_deps.open":"View dependencies","query.inheritance.title":"Inheritance","query.inheritance.descendants":"Descendants","query.inheritance.ancestors":"Ancestors","query.inheritance.empty":"No inheritance relations found","query.inheritance.cross_source":"Searching {{count}} indexed code sources","query.inheritance.open":"View inheritance","query.doc.search_placeholder":"Search documents with natural language...","query.doc.search_button":"Search","query.doc.searching":"Searching...","query.doc.relevance.high":"High relevance","query.doc.relevance.medium":"Medium relevance","query.doc.relevance.low":"Low relevance","query.doc.empty.title":"No matching paragraphs","query.doc.empty.desc":"Try different keywords, or check if the document has been imported and indexed.","query.doc.error.title":"Document search failed","query.warning.more":"+{{count}} more"},sE={"nav.home":"้ฆ–้กต","nav.studio":"ๅทฅไฝœๅฐ","nav.docs":"ๆ–‡ๆกฃ","nav.login":"็™ปๅฝ•","nav.logout":"้€€ๅ‡บ็™ปๅฝ•","header.status.connected":"ๅทฒ่ฟžๆŽฅ","header.status.disconnected":"ๅทฒๆ–ญๅผ€","header.status.reconnecting":"้‡่ฟžไธญ","footer.copyright":"GitHub ยท @Context4AI {{year}}. ็‰ˆๆƒๆ‰€ๆœ‰","footer.copyright_compact":"@Context4AI {{year}}. ็‰ˆๆƒๆ‰€ๆœ‰","footer.tagline":"็Ÿฅ่ฏ†ๅทฅๅŽ‚","footer.theme.dark":"ๆš—่‰ฒ","footer.theme.light":"ไบฎ่‰ฒ","footer.theme.system":"่ทŸ้š็ณป็ปŸ","studio.sidebar.sources":"็Ÿฅ่ฏ†็ดขๅผ•","studio.sidebar.modeling":"็Ÿฅ่ฏ†ๅปบๆจก","studio.sidebar.brain":"็Ÿฅ่ฏ†ๅคง่„‘","studio.sidebar.discovery":"ๅ‘็Žฐ็Ÿฅ่ฏ†","studio.sidebar.sharing":"ๅˆ†ไบซ็Ÿฅ่ฏ†","studio.sidebar.collaboration":"็Ÿฅ่ฏ†ๅๅŒ","studio.sidebar.settings":"่ฎพ็ฝฎ","placeholder.coming":"่ฎกๅˆ’ๅœจ {{version}} ็‰ˆๆœฌๅฎž็Žฐ","page.login.title":"็™ปๅฝ•","page.login.description":"่บซไปฝ้ชŒ่ฏไธŽ็”จๆˆท็ฎก็†","login.title":"็™ปๅฝ•","login.provider_cta":"ไฝฟ็”จ {{name}} ็™ปๅฝ•","login.loading":"ๅŠ ่ฝฝไธญ...","login.authenticating":"่ฎค่ฏไธญ...","login.or":"ๆˆ–","login.test_account":"ๆต‹่ฏ•่ดฆๆˆท","login.error":"ๅŠ ่ฝฝ็™ปๅฝ•้€‰้กนๅคฑ่ดฅ","login.retry":"้‡่ฏ•","user.menu.connect_source":"ๆŽฅๅ…ฅ็Ÿฅ่ฏ†ๆบ","user.menu.sign_out":"้€€ๅ‡บ็™ปๅฝ•","api_keys.title":"API ๅฏ†้’ฅ","api_keys.description":"API Key ็”จไบŽ็จ‹ๅบๅŒ–่ฎฟ้—ฎ C4A API๏ผˆAI Agentใ€CLIใ€CI/CD๏ผ‰","api_keys.create":"ๅˆ›ๅปบ API Key","api_keys.created":"API Key ๅทฒๅˆ›ๅปบ","api_keys.copy_warning":"่ฏท็ซ‹ๅณๅคๅˆถ๏ผŒๆญค Key ไธไผšๅ†ๆฌกๆ˜พ็คบใ€‚","api_keys.copy":"ๅคๅˆถ","api_keys.copied":"ๅทฒๅคๅˆถ๏ผ","api_keys.done":"ๅฎŒๆˆ","api_keys.empty.title":"ๅฐšๆ—  API Key","api_keys.empty.description":"API Key ็”จไบŽ็จ‹ๅบๅŒ–่ฎฟ้—ฎ C4A API","api_keys.created_at":"ๅˆ›ๅปบไบŽ {{date}}","api_keys.never_used":"ไปŽๆœชไฝฟ็”จ","api_keys.expires.never":"ๆฐธไธ่ฟ‡ๆœŸ","api_keys.expires.30d":"30 ๅคฉ","api_keys.expires.90d":"90 ๅคฉ","api_keys.expires.1y":"1 ๅนด","api_keys.form.name":"ๅ็งฐ","api_keys.form.name_placeholder":"My CLI key","api_keys.form.expiry":"่ฟ‡ๆœŸๆ—ถ้—ด๏ผˆๅฏ้€‰๏ผ‰","api_keys.delete.confirm":"ๅˆ ้™คๆญค API Key๏ผŸๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚","workspace.default_name":"ๆˆ‘็š„ๅคง่„‘","settings.tab.general":"ๅธธ่ง„","settings.tab.api_keys":"API ๅฏ†้’ฅ","page.docs.title":"ๆ–‡ๆกฃ","page.docs.description":"ๅ…ฌๅผ€ๆ–‡ๆกฃ้—จๆˆท","page.sources.title":"็Ÿฅ่ฏ†็ดขๅผ•","page.sources.description":"ๆทปๅŠ ไปฃ็ ไป“ๅบ“ใ€ๆ–‡ๆกฃ็ญ‰่พ“ๅ…ฅๆๆ–™๏ผŒ่ฎฉๅคง่„‘ๅฎŒๆˆๅˆๆญฅ็ดขๅผ•","page.modeling.title":"็Ÿฅ่ฏ†ๅปบๆจก","page.modeling.description":"ๅ’Œ AI ไธ€่ตทๅฏน็ดขๅผ•ๅ†…ๅฎนๅปบๆจก๏ผŒๅชๆœ‰็ปๅพ—่ตทๆŽจๆ•ฒ็š„ๆ‰ๅ†™ๅ…ฅ็Ÿฅ่ฏ†ๅ›พ่ฐฑ","page.brain.title":"็Ÿฅ่ฏ†ๅคง่„‘","page.brain.description":"ๅปบๆจกๅฎŒๆˆ็š„ๅ…จ้ƒจ็Ÿฅ่ฏ†้ƒฝๅœจ่ฟ™้‡Œโ€”โ€”ๆต่งˆใ€ๆœ็ดขใ€ๅˆ†ๆž๏ผŒ้šๆ—ถ่ฐƒ็”จ","page.discovery.title":"ๅ‘็Žฐ็Ÿฅ่ฏ†","page.discovery.description":"็œ‹็œ‹ๅˆซไบบๆ•ด็†ๅฅฝ็š„็Ÿฅ่ฏ†๏ผŒๅ‘็Žฐๆœ‰็”จ็š„ไธ€้”ฎ่กฅๅ……ๅˆฐ่‡ชๅทฑ็š„ๅคง่„‘","page.sharing.title":"ๅˆ†ไบซ็Ÿฅ่ฏ†","page.sharing.description":"ๆŠŠๅคง่„‘ไธญ็š„็Ÿฅ่ฏ†ๆ‰“ๅŒ…่พ“ๅ‡บ๏ผŒ่ฎฉๅˆซไบบๅ’Œ AI ้ƒฝ่ƒฝ็›ดๆŽฅไฝฟ็”จ","page.collaboration.title":"็Ÿฅ่ฏ†ๅๅŒ","page.collaboration.description":"ๅ’Œๅ…ถไป–ๅคง่„‘ไฟๆŒๅŒๆญฅ๏ผŒ็Ÿฅ่ฏ†ๆ›ดๆ–ฐๆ—ถ่‡ชๅŠจ้€š็Ÿฅ๏ผŒไธ็”จๆ‰‹ๅŠจๆฌ่ฟ","page.settings.title":"่ฎพ็ฝฎ","page.settings.description":"็ฎก็†ๅคง่„‘็š„ๆˆๅ‘˜ๅ’Œ้…็ฝฎ","page.code_setup.title":"ไปฃ็ ่ฎพ็ฝฎ","page.code_setup.description":"ไปฃ็ ๅปบๆจก็š„ไป“ๅบ“้€‰ๆ‹ฉไธŽ้…็ฝฎ","page.code_compile.title":"ไปฃ็ ็ผ–่ฏ‘","page.code_compile.description":"ไปฃ็ ๅปบๆจก็š„็ผ–่ฏ‘่ฟ›ๅบฆ่ฟฝ่ธช","page.code_review.title":"ไปฃ็ ๅฎกๆŸฅ","page.code_review.description":"ๅฎกๆŸฅๅนถ็กฎ่ฎคๅปบๆจก็ป“ๆžœ","page.code_result.title":"ไปฃ็ ็ป“ๆžœ","page.code_result.description":"ๆŸฅ็œ‹ๆœ€็ปˆๅปบๆจก็ป“ๆžœไธŽ็”Ÿๆˆ็š„็Ÿฅ่ฏ†ๅ›พ่ฐฑ","home.hero.title":"Context For AI","home.hero.description":"ๅฐ†ไปฃ็ ไป“ๅบ“ๅ’ŒไธšๅŠกๆ–‡ๆกฃ่ฝฌๅŒ–ไธบ็ป“ๆž„ๅŒ–็Ÿฅ่ฏ†ๅ›พ่ฐฑใ€‚","home.hero.cta.studio":"่ฟ›ๅ…ฅๅทฅไฝœๅฐ","home.hero.cta.github":"GitHub","notfound.title":"404","notfound.description":"ๆ‚จ่ฎฟ้—ฎ็š„้กต้ขไธๅญ˜ๅœจใ€‚","notfound.back":"่ฟ”ๅ›ž้ฆ–้กต","error.description":"้กต้ขๅ‡บ็Žฐไบ†้—ฎ้ข˜๏ผŒ่ฏท้‡่ฏ•ใ€‚","error.reload":"้‡ๆ–ฐๅŠ ่ฝฝ","sources.menu.add_client":"ๆทปๅŠ ๅฎขๆˆท็ซฏ","sources.menu.online":"ๅœจ็บฟ","sources.menu.offline":"็ฆป็บฟ","sources.menu.status_online":"{{machine}} ๅทฒ่ฟžๆŽฅ","sources.menu.status_offline":"{{machine}} ๆœช่ฟžๆŽฅ๏ผŒ็‚นๅ‡ปๅ‰ๅพ€ๆ•™็จ‹","sources.library.default_cloud_name":"ๆˆ‘็š„ไบ‘็›˜","sources.library.rename":"้‡ๅ‘ฝๅ","sources.library.rename_placeholder":"่พ“ๅ…ฅๅ็งฐ","sources.header.daemon_status":"{{online}}/{{total}} ๅœจ็บฟ","sources.header.all_offline":"ๅ…จ้ƒจ็ฆป็บฟ","sources.actions.new_folder":"ๆ–ฐๆ–‡ไปถๅคน","sources.folder.name_placeholder":"่พ“ๅ…ฅๆ–‡ไปถๅคนๅ็งฐ","sources.actions.import_repo":"ๅฏผๅ…ฅไป“ๅบ“","sources.actions.rename":"้‡ๅ‘ฝๅ","sources.actions.move_to":"็งปๅŠจๅˆฐ...","sources.actions.delete":"ๅˆ ้™ค","sources.filter.all":"ๅ…จ้ƒจ","sources.filter.indexed":"ๅทฒ็ดขๅผ•","sources.filter.not_indexed":"ๆœช็ดขๅผ•","sources.status.none":"ๆœช็ดขๅผ•","sources.status.indexed":"ๅทฒ็ดขๅผ•","sources.status.stale":"ๆœ‰ๆ–ฐๅ˜ๆ›ดๆœชๆ›ดๆ–ฐ็ดขๅผ•","sources.type.code":"ไปฃ็ ","sources.type.doc":"ๆ–‡ๆกฃ","sources.empty.cloud.title":"่ฟ™้‡Œๆ˜ฏไฝ ไธ“ๅฑž็š„็Ÿฅ่ฏ†่พ“ๅ…ฅๅŒบ","sources.empty.cloud.description":"ๅˆ›ๅปบๆ–‡ไปถๅคนๆฅๆ•ด็†ไฝ ็š„ๆ–‡ๆกฃๅ’Œๆๆ–™ใ€‚่ฟ™ไบ›ๅ†…ๅฎนไป…ไฝ ไธชไบบๅฏ่ง๏ผŒๅฐ†ๆˆไธบๅŽ็ปญๆŽจๆผ”ใ€ๆž„ๅปบๆ•ฐๅญ—ๅคง่„‘็š„ๅŸบ็ก€","sources.empty.daemon.title":"่ฟžๆŽฅไฝ ็š„ๆœฌๅœฐไปฃ็ ่ต„ไบง","sources.empty.daemon.description":"ๅฏผๅ…ฅๆœฌๅœฐไปฃ็ ไป“ๅบ“๏ผŒ็ณป็ปŸไผš่‡ชๅŠจๆๅ–ไปฃ็ ็ป“ๆž„ไธŽๆŠ€ๆœฏๆ–‡ๆกฃ๏ผŒๅฐ†ๅ…ถ่ฝฌๅŒ–ไธบ็ป“ๆž„ๅŒ–็Ÿฅ่ฏ†","sources.empty.indexed.title":"่ฟ™ไบ›็Ÿฅ่ฏ†ๅฐšๆœช่ขซ็ดขๅผ•","sources.empty.indexed.description":"้€‰ๆ‹ฉ่ต„ๆบๅนถๅฎŒๆˆ็ดขๅผ•ๅŽ๏ผŒๅฎƒไปฌๅฐ†่ฝฌๅŒ–ไธบ็ป“ๆž„ๅŒ–ๆ‘˜่ฆ๏ผŒไธบไฝ ๅŽ็ปญ็š„ๆŽจๆผ”ๆไพ›็ด ๆใ€‚","sources.empty.folder.title":"ๅฝ“ๅ‰ๆ–‡ไปถๅคน่ฟ˜ๆฒกๆœ‰ๅ†…ๅฎน","sources.empty.folder.daemon_description":"ไฝ ๅฏไปฅๅœจๆœฌๅœฐ่ฟ›่กŒๆ–‡ๆกฃๆ–ฐๅขžใ€็ผ–่พ‘ๅŽๆŸฅ็œ‹ใ€‚","sources.safety.notice.repo":"ๅœจๆœฌๅœฐๆจกๅผไธ‹๏ผŒไฝ ็š„ไปฃ็ ไฟๆœ‰็ปๅฏน้š็ง๏ผŒๆบไปฃ็ ๆฐธ่ฟœไธไผš็ฆปๅผ€ไฝ ็š„็”ต่„‘๏ผŒ็ณป็ปŸไป…ๆๅ–็”จไบŽ็Ÿฅ่ฏ†ๅปบๆจก็š„็ป“ๆž„ๅŒ–ๆ‘˜่ฆ๏ผˆๅ‡ฝๆ•ฐ็ญพๅใ€ไพ่ต–ๅ…ณ็ณป็ญ‰๏ผ‰ใ€‚","sources.safety.notice.dir":"็ณป็ปŸไผšๆๅ–็”จไบŽ็Ÿฅ่ฏ†ๅปบๆจก็š„ๆ–‡ๆกฃๅ†…ๅฎนๅŠๆ‘˜่ฆ๏ผŒๅฐฝ็ฎกไผš่ฟ‡ๆปคไธๅฎ‰ๅ…จ็š„ๆ–‡ๆœฌๅ†…ๅฎน๏ผŒไฝ†่ฏท็กฎไฟๆ•ๆ„Ÿๆ•ฐๆฎไธ่ฆๅ‚ไธŽ็ดขๅผ•ๅŠๅปบๆจกใ€‚","sources.import.title":"ๅฏผๅ…ฅไปฃ็ ไป“ๅบ“","sources.import.step.select":"้€‰ๆ‹ฉไป“ๅบ“","sources.import.step.version":"้€‰ๆ‹ฉ็‰ˆๆœฌ","sources.import.step.confirm":"ๅฏผๅ…ฅๅฎŒๆˆ","sources.import.daemon_offline":"ๅฎขๆˆท็ซฏ {{name}} ๆœช่ฟžๆŽฅ๏ผŒ่ฏทๅ…ˆๅฏๅŠจๆœฌๅœฐ Daemon ๅนถ่ฟžๆŽฅๅˆฐๆœๅŠกๅ™จๅŽๅ†ๅฏผๅ…ฅไป“ๅบ“ใ€‚","sources.import.view_guide":"ๆŸฅ็œ‹่ฟžๆŽฅๆŒ‡ๅผ•","sources.import.select_root":"้€‰ๆ‹ฉไป“ๅบ“ๆ น็›ฎๅฝ•","sources.import.current_path":"ๅฝ“ๅ‰่ทฏๅพ„","sources.import.not_git":"่ฏฅ็›ฎๅฝ•ไธๆ˜ฏ Git ไป“ๅบ“๏ผŒ่ฏท้€‰ๆ‹ฉๅŒ…ๅซ .git ็š„็›ฎๅฝ•ใ€‚","sources.import.branch":"ๅˆ†ๆ”ฏ","sources.import.commit":"ๆไบค","sources.import.branch_warning":"ๅฝ“ๅ‰ๅŸบไบŽ {{branch}} ๅˆ†ๆ”ฏ็š„ HEAD","sources.import.uncommitted_warning":"ๆœชๆไบค็š„ไฟฎๆ”นไธไผš่ขซ้‡‡้›†","sources.import.recognized":"ๅทฒ่ฏ†ๅˆซ {{packages}} ไธชๅŒ…ๅ’Œ {{docs}} ็ฏ‡ๆ–‡ๆกฃ","sources.import.no_packages":"ๆœช่ฏ†ๅˆซๅˆฐๅŒ…็ป“ๆž„๏ผŒๅฐ†ไฝœไธบๅ•ๅŒ…ไป“ๅบ“ๅฏผๅ…ฅใ€‚","sources.import.confirm_heading":"ๅณๅฐ†ๅฏผๅ…ฅไปฅไธ‹ไป“ๅบ“ๅˆฐ {{name}}๏ผš","sources.import.packages":"ๅŒ…ๆ•ฐ","sources.import.documents":"ๆ–‡ๆกฃ","sources.import.loading_repo":"ๆญฃๅœจๅŠ ่ฝฝไป“ๅบ“ไฟกๆฏ...","sources.import.loading_repo_slow":"ๅคงๅž‹ไป“ๅบ“๏ผˆ>10 GB๏ผ‰ๅฏ่ƒฝ้œ€่ฆ 5~10 ็ง’...","sources.import.importing":"ๅฏผๅ…ฅไธญ...","sources.import.error_title":"ๅฏผๅ…ฅๅคฑ่ดฅ","sources.import.success":"ๅฏผๅ…ฅๅฎŒๆˆ","sources.import.stage.prepare":"ๅ‡†ๅค‡ๆ‰ง่กŒ็Žฏๅขƒ","sources.import.stage.clone":"ๅ…‹้š†ไป“ๅบ“","sources.import.stage.clone_polling":"","sources.import.stage.scan":"ๆ‰ซๆ้กน็›ฎ","sources.import.stage.save":"ไฟๅญ˜ๆ•ฐๆฎๆบ","sources.import.stage.done_suffix":"โœ“","sources.import.stage.complete":"ๅฏผๅ…ฅๅฎŒๆˆ","sources.import.stage.fetch_tree":"่Žทๅ–ๆ–‡ไปถๆ ‘","sources.import.stage.read_packages":"่ฏปๅ–ๅŒ…ๆ่ฟฐๆ–‡ไปถ","sources.import.step.loading":"ๆ•ฐๆฎๅฏผๅ…ฅ","sources.import.done":"ๅฎŒๆˆ","sources.import.back":"่ฟ”ๅ›ž","sources.import.retry":"้‡่ฏ•","sources.add_client.title":"ๆŽฅๅ…ฅๆœฌๅœฐ็Ÿฅ่ฏ†ๆบ","sources.add_client.description":"ๅœจๆœฌๅœฐ่ฎก็ฎ—ๆœบไธŠๅฏๅŠจๅฎขๆˆท็ซฏ (Daemon)๏ผŒๅณๅฏๅฐ†ๆœฌๅœฐไปฃ็ ไป“ๅบ“ไฝœไธบ่พ“ๅ…ฅๆๆ–™๏ผŒๆŒ‚่ฝฝๅˆฐไฝ ็š„ๆ•ฐๅญ—ๅคง่„‘ไธญใ€‚","sources.add_client.step1":"ๅฎ‰่ฃ… Daemon","sources.add_client.step2":"ๅฏๅŠจ Daemon","sources.add_client.step2_allow":"้™ๅˆถ่ฎฟ้—ฎ็›ฎๅฝ•๏ผˆไธๅฝฑๅ“ๅทฒๆœ‰ๅฏผๅ…ฅ๏ผ‰","sources.add_client.step3":"็ญ‰ๅพ…่ฟžๆŽฅ","sources.add_client.step3_desc":"่ฟžๆŽฅๆˆๅŠŸๅŽ๏ผŒๆœฌ้กต้ขๅฐ†่‡ชๅŠจๆ›ดๆ–ฐใ€‚","sources.add_client.waiting":"็ญ‰ๅพ…ๆ–ฐ็š„ๅฎขๆˆท็ซฏ่ฟžๆŽฅ...","sources.add_client.detected":"ๆฃ€ๆต‹ๅˆฐๆ–ฐ็š„ๆœฌๅœฐๅฎขๆˆท็ซฏ","sources.add_client.machine_name":"ๆœบๅ™จๆ ‡่ฏ†","sources.add_client.os":"ๆ“ไฝœ็ณป็ปŸ","sources.add_client.daemon_version":"Daemon ็‰ˆๆœฌ","sources.add_client.client_name":"ๅฎขๆˆท็ซฏๅ็งฐ","sources.add_client.confirm":"็กฎ่ฎคๆทปๅŠ ","sources.add_client.reconnected":"ๅฎขๆˆท็ซฏ {{name}} ๅทฒ้‡ๆ–ฐ่ฟžๆŽฅ","sources.add_client.go_to":"ๅ‰ๅพ€ {{name}}","sources.detail.tab.original":"ๅŽŸๆ–‡","sources.detail.tab.overview":"ๆฆ‚่งˆ","sources.detail.tab.digest":"ๆ‘˜่ฆ","sources.detail.tab.modeling":"ๅปบๆจก็ป“ๆžœ","sources.detail.not_found_title":"ๆฅๆบไธๅญ˜ๅœจ","sources.detail.not_found_desc":"ๆœชๆ‰พๅˆฐๆญคๆฅๆบ๏ผŒๅฏ่ƒฝๅทฒ่ขซๅˆ ้™คๆˆ– ID ๆ— ๆ•ˆใ€‚","sources.detail.digest_placeholder":"ๅฎŒๆˆ็ดขๅผ•ๅŽ๏ผŒๅณๅฏๅœจๆญคๆŸฅ็œ‹็ป“ๆž„ๅŒ–ๆ‘˜่ฆใ€‚","sources.detail.modeling_placeholder":"ๅœจๆŽจๆผ”ๅŒบๅฎŒๆˆๅปบๆจกๅŽ๏ผŒๆญคๅค„ๅฐ†ๅฑ•็คบ็”ฑ่ฏฅๆบไบง็”Ÿ็š„็Ÿฅ่ฏ†ๅฎžไฝ“ใ€‚","sources.detail.type":"็ฑปๅž‹","sources.detail.origin":"ๆฅๆบ","sources.detail.origin.upload":"็›ดๆŽฅไธŠไผ ","sources.detail.origin.local":"ๆœฌๅœฐๆ–‡ไปถ","sources.detail.path":"่ทฏๅพ„","sources.detail.status":"็Šถๆ€","sources.detail.repo":"ไป“ๅบ“","sources.detail.branch":"ๅˆ†ๆ”ฏ","sources.detail.commit":"ๆไบค","sources.detail.tech_stack":"ๆŠ€ๆœฏๆ ˆ","sources.detail.original_code_placeholder":"ๅฎŒๆˆ็ดขๅผ•ๅŽๅณๅฏๆŸฅ็œ‹ๅŒ…ๆฆ‚่งˆใ€‚","sources.detail.original_doc_placeholder":"ๆ–‡ๆกฃๅ†…ๅฎนๅฐ†ๅœจไธŠไผ ๅŽๅฑ•็คบใ€‚","sources.detail.dependencies":"ไพ่ต–","sources.delete.confirm_title":"็กฎ่ฎคๅˆ ้™ค","sources.delete.resource":"็กฎๅฎš่ฆๅˆ ้™ค {{name}}๏ผŸ","sources.delete.resource_impact":"ไปฅไธ‹ๆ•ฐๆฎๅฐ†่ขซๆฐธไน…ๅˆ ้™ค๏ผšๅŽŸๆ–‡ๅ†…ๅฎนใ€็ป“ๆž„ๅŒ–ๆ‘˜่ฆ๏ผˆๅฆ‚ๆœ‰๏ผ‰ใ€‚","sources.delete.session_warning":"ๅฆ‚ๆžœไฝ ็š„ไธชไบบๆŽจๆผ”ๅŒบๆญฃๅœจไฝฟ็”จๆญค็Ÿฅ่ฏ†ๆบ๏ผŒ็›ธๅ…ณ็š„ๅ€™้€‰ๆŽจๆผ”ๅฐ†ๅ—ๅˆฐๅฝฑๅ“ใ€‚","sources.delete.entity_safe":"ๅทฒๆฑ‡ๅ…ฅๅคง่„‘็š„ๆญฃๅผ็Ÿฅ่ฏ†ไธๅ—ๅฝฑๅ“ใ€‚","sources.delete.folder":"็กฎๅฎš่ฆๅˆ ้™คๆ–‡ไปถๅคน {{name}}๏ผŸ","sources.delete.folder_impact":"ๆ–‡ไปถๅคนๅ†…็š„ๆ‰€ๆœ‰่ต„ๆบๅฐ†่ขซ้€’ๅฝ’ๅˆ ้™ค๏ผš{{folders}} ไธชๅญๆ–‡ไปถๅคนใ€{{sources}} ไธช็Ÿฅ่ฏ†ๆบใ€‚","sources.delete.folder_contents":"ๅŒ…ๅซ {{folders}} ไธชๅญๆ–‡ไปถๅคนใ€{{sources}} ไธช็Ÿฅ่ฏ†ๆบใ€‚","sources.delete.folder_impact_generic":"ๆ–‡ไปถๅคนๅ†…็š„ๆ‰€ๆœ‰ๅญๆ–‡ไปถๅคนๅ’Œ็Ÿฅ่ฏ†ๆบๅฐ†่ขซ้€’ๅฝ’ๅˆ ้™คใ€‚","sources.delete.irreversible":"ๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚","sources.delete.repo":"็กฎๅฎš่ฆไปŽ {{library}} ไธญ็งป้™คไป“ๅบ“ {{name}}๏ผŸ","sources.delete.repo_impact":"ๅฐ†ๅˆ ้™ค๏ผš{{packages}} ไธชๅŒ…็š„็ดขๅผ•่ฎฐๅฝ•ใ€{{docs}} ็ฏ‡ๆ–‡ๆกฃ็š„็ดขๅผ•่ฎฐๅฝ•ใ€‚","sources.delete.repo_contents":"ๅŒ…ๅซ {{packages}} ไธชๅŒ…ใ€{{docs}} ไธชๆ–‡ๆกฃใ€‚","sources.delete.indexed_hint":"ๅ…ถไธญ {{indexed}}/{{total}} ไธชๅทฒๅปบ็ซ‹็ดขๅผ•๏ผŒ็ดขๅผ•ๆ•ฐๆฎๅฐ†่ขซๅˆ ้™คใ€‚","sources.delete.repo_impact_generic":"ๆ‰€ๆœ‰ๅŒ…ๅ’Œๆ–‡ๆกฃ็š„็ดขๅผ•่ฎฐๅฝ•ๅฐ†่ขซๅˆ ้™คใ€‚","sources.delete.local_safe":"ๆœฌๅœฐๆ–‡ไปถไธๅ—ๅฝฑๅ“ใ€‚","sources.delete.client":"็กฎๅฎš่ฆๅˆ ้™คๅฎขๆˆท็ซฏ {{name}}๏ผŸ","sources.delete.client_impact":"่ฏฅๅฎขๆˆท็ซฏไธ‹็š„ๆ‰€ๆœ‰ๅทฒๅฏผๅ…ฅไป“ๅบ“่ฎฐๅฝ•ๅ’Œ็›ธๅ…ณ็ดขๅผ•ๆ•ฐๆฎๅฐ†่ขซๅˆ ้™คใ€‚","sources.delete.client_reregister":"่ฏฅๅฎขๆˆท็ซฏไธ‹ๆฌก่ฟžๆŽฅๆ—ถๅฐ†่งฆๅ‘้‡ๆ–ฐๆณจๅ†Œใ€‚","sources.error.name_conflict":'่ฏฅ็›ฎๅฝ•ไธ‹ๅทฒๅญ˜ๅœจๅŒๅ้กน"{{name}}"ใ€‚',"sources.move.current":"ๅฝ“ๅ‰ไฝ็ฝฎ","sources.move.target":"็งปๅŠจๅˆฐ","sources.breadcrumb.sources":"็Ÿฅ่ฏ†็ดขๅผ•","common.cancel":"ๅ–ๆถˆ","common.confirm":"็กฎ่ฎค","common.back":"่ฟ”ๅ›ž","common.next":"ไธ‹ไธ€ๆญฅ","common.previous":"ไธŠไธ€ๆญฅ","common.items":"{{count}} ้กน","common.loading":"ๅŠ ่ฝฝไธญ...","common.more":"ๅฑ•ๅผ€","common.collapse":"ๆ”ถ่ตท","sources.import.no_entries":"ๆœชๆ‰พๅˆฐไปปไฝ•ๆก็›ฎ","sources.import.allowed_dirs":"ๅฎขๆˆท็ซฏๆŽˆๆƒ็›ฎๅฝ•","sources.import.allowed_dirs_tooltip_restrict":"้€š่ฟ‡ๅ‚ๆ•ฐ่ฎพๅฎšๆœ‰ๆƒ้™็š„็›ฎๅฝ•๏ผš","sources.import.allowed_dirs_tooltip_all":"ๆˆ–้ป˜่ฎคๅ…่ฎธๅ…จ้ƒจ็›ฎๅฝ•๏ผš","sources.import.wildcard_home":"ไธป็›ฎๅฝ•","sources.import.wildcard_path_placeholder":"่พ“ๅ…ฅ็›ฎๅฝ•่ทฏๅพ„โ€ฆ","sources.import.wildcard_go":"ๅ‰ๅพ€","sources.import.wildcard_goto":"ๅ‰ๅพ€","sources.import.wildcard_go_title":"ๅ‰ๅพ€็›ฎๅฝ•","sources.import.wildcard_path_not_found":"่ฏฅ่ทฏๅพ„ๅœจ่ฟœ็จ‹ๆœบๅ™จไธŠไธๅญ˜ๅœจ","sources.import.already_imported":"ๅทฒๅฏผๅ…ฅ","sources.import.dir_title":"ๅฏผๅ…ฅ็›ฎๅฝ•","sources.import.dir_step.select":"้€‰ๆ‹ฉ็›ฎๅฝ•","sources.import.dir_step.scan":"ๆ‰ซๆ","sources.import.dir_step.confirm":"็กฎ่ฎคๅฏผๅ…ฅ","sources.import.dir_confirm_heading":"ๅณๅฐ†ๅฏผๅ…ฅไปฅไธ‹็›ฎๅฝ•ๅˆฐ {{name}}๏ผš","sources.import.dir_name":"็›ฎๅฝ•ๅ","sources.import.dir_name_hint":"ๅฏผๅ…ฅๅŽๅœจ็›ฎๅฝ•ๆ ‘ไธญ็š„ๆ˜พ็คบๅ็งฐ๏ผŒ็•™็ฉบไฝฟ็”จ้ป˜่ฎคไป“ๅบ“ๅใ€‚","sources.import.dir_name_duplicate":"่ฏฅๅ็งฐๅทฒๅญ˜ๅœจ๏ผŒ่ฏทไฝฟ็”จๅ…ถไป–ๅ็งฐใ€‚","sources.import.dir_path":"็›ฎๅฝ•่ทฏๅพ„","sources.import.dir_files":"ๆ–‡ไปถๆ•ฐ","sources.import.dir_subdirs":"ๅญ็›ฎๅฝ•ๆ•ฐ","sources.import.dir_git_repos":"ไป“ๅบ“๏ผˆๅทฒ่ทณ่ฟ‡๏ผ‰","sources.import.dir_git_hint":"็›ฎๅฝ•ๅ†…็š„ Git ไป“ๅบ“ไธไผš่ขซๅฑ•ๅผ€็ดขๅผ•๏ผŒๅฆ‚้œ€็ดขๅผ•่ฏทๅ•็‹ฌๅฏผๅ…ฅไป“ๅบ“ใ€‚","sources.import.dir_scanning":"ๆญฃๅœจๆ‰ซๆ็›ฎๅฝ•ๅ†…ๅฎน...","sources.import.dir_scan_complete":"ๆ‰ซๆๅฎŒๆˆ","sources.import.dir_scan_error":"็›ฎๅฝ•ๆ‰ซๆๅคฑ่ดฅ","sources.import.dir_scan_retry":"้‡่ฏ•","sources.import.dir_code_packages":"ไปฃ็ ๅŒ…","sources.import.dir_code_packages_tip":"ๆ”ฏๆŒ๏ผšpackage.jsonใ€pyproject.tomlใ€setup.pyใ€go.modใ€Cargo.tomlใ€pom.xmlใ€build.gradle","sources.import.dir_doc_files":"ๆ–‡ๆกฃ","sources.import.dir_doc_files_tip":"ๆ”ฏๆŒ๏ผšMarkdown (.md)","sources.import.dir_total_files":"ๆ–‡ไปถๆ€ปๆ•ฐ","sources.import.dir_total_dirs":"็›ฎๅฝ•","sources.import.dir_git_skip_hint":"Git ไป“ๅบ“ๅฐ†่ขซ่ทณ่ฟ‡๏ผŒๅปบ่ฎฎๅ•็‹ฌไฝฟ็”จใ€Œๅฏผๅ…ฅไป“ๅบ“ใ€ใ€‚","sources.actions.upload":"ไธŠไผ ","sources.actions.upload_md":"Markdown ๆ–‡ๆกฃ","sources.actions.upload_doc":"ๆ–‡ๆกฃ","sources.actions.upload_document":"ไธŠไผ ๆ–‡ๆกฃ","sources.actions.add":"ๆ–ฐๅขž","sources.actions.add_folder":"ๆ–‡ไปถๅคน","sources.actions.add_web":"็ฝ‘้กต","sources.actions.add_feishu":"้ฃžไนฆๆ–‡ๆกฃ","sources.actions.import_dir":"ๅฏผๅ…ฅ็›ฎๅฝ•","sources.actions.import_repo_url":"ๅฏผๅ…ฅไป“ๅบ“","sources.upgrade.title":"ๅŠŸ่ƒฝๅ‡็บงไธญ","sources.upgrade.description":"ๆญคๅŠŸ่ƒฝๅฐ†ๅœจ 0.5.x ็‰ˆๆœฌไธญๆŽจๅ‡บ๏ผŒๆ•ฌ่ฏทๆœŸๅพ…ใ€‚","sources.upload.title":"ไธŠไผ ๆ–‡ๆกฃ","sources.upload.drop_hint":"็‚นๅ‡ป้€‰ๆ‹ฉๆ–‡ไปถๆˆ–ๆ‹–ๆ‹ฝ่‡ณๆญค","sources.upload.supported_formats":"ๆ”ฏๆŒๆ ผๅผ๏ผš.md, .doc, .docx, .pdf, .ppt, .pptx, .txt๏ผˆๆฏไธชๆœ€ๅคง 5MB๏ผŒๆœ€ๅคš 10 ไธช๏ผ‰","sources.upload.file_too_large":'"{{name}}" ่ถ…่ฟ‡ 5MB ้™ๅˆถ',"sources.upload.too_many_files":"ๆœ€ๅคšไธŠไผ  10 ไธชๆ–‡ไปถ๏ผŒ่ฏท้‡ๆ–ฐ้€‰ๆ‹ฉ","sources.upload.unsupported_type":'"{{name}}" ไธๆ˜ฏๆ”ฏๆŒ็š„ๆ–‡ไปถ็ฑปๅž‹',"sources.upload.uploading":"ไธŠไผ ไธญ...","sources.upload.success":"ๅทฒไธŠไผ  {{count}} ไธชๆ–‡ๆกฃ","sources.upload.selected":"ๅทฒ้€‰ๆ‹ฉ {{count}} ไธชๆ–‡ไปถ","sources.upload.remove":"็งป้™ค","sources.import_remote.title":"ๅฏผๅ…ฅ่ฟœ็จ‹ไป“ๅบ“","sources.import_remote.step.loading":"ๆ•ฐๆฎๅฏผๅ…ฅ","sources.import_remote.url_label":"ไป“ๅบ“ๅœฐๅ€","sources.import_remote.url_placeholder":"https://github.com/org/repo.git","sources.import_remote.url_hint_format":"ไป…ๆŽฅๅ— HTTPS ๅœฐๅ€๏ผŒSSH ๅœฐๅ€ๆœชๆฅ็‰ˆๆœฌๆ”ฏๆŒ","sources.import_remote.url_hint_public":"้™คไบ†ๆ”ฏๆŒๆ— ้œ€้‰ดๆƒ็š„ๅ…ฌๅผ€ Git ไป“ๅบ“๏ผŒไนŸๆ”ฏๆŒๅทฒ้…็ฝฎ OAuth ็š„ Git ๆœๅŠก๏ผš","sources.import_remote.url_hint_no_auth":"้™คไบ†ๆ”ฏๆŒๆ— ้œ€้‰ดๆƒ็š„ๅ…ฌๅผ€ Git ไป“ๅบ“๏ผŒไนŸๆ”ฏๆŒๅทฒ้…็ฝฎ OAuth ็š„ Git ๆœๅŠก","sources.import_remote.url_invalid":"ไป…ๆ”ฏๆŒ HTTPS ๆ ผๅผ็š„ Git URL","sources.import_remote.ref_label":"ๅˆ†ๆ”ฏ / Tag","sources.import_remote.ref_branches":"ๅˆ†ๆ”ฏ","sources.import_remote.ref_tags":"Tag","sources.import_remote.ref_search":"ๆœ็ดขๅˆ†ๆ”ฏๆˆ– Tagโ€ฆ","sources.import_remote.commit_label":"Commit","sources.import_remote.commit_hint":"ๅทฒ่‡ชๅŠจๅกซๅ…ฅๆ‰€้€‰ๅˆ†ๆ”ฏๆœ€ๆ–ฐ commit๏ผŒไนŸๅฏๆ‰‹ๅŠจ่พ“ๅ…ฅๆˆ–ๆœ็ดข","sources.import_remote.commit_search":"ๆœ็ดข commitโ€ฆ","sources.import_remote.loading_refs":"ๆญฃๅœจๆŸฅ่ฏขไป“ๅบ“ๅˆ†ๆ”ฏ...","sources.import_remote.loading_refs_slow":"ๅคงๅž‹้กน็›ฎๅฏ่ƒฝ้œ€่ฆ 10~30s๏ผŒ่ฏท่€ๅฟƒ็ญ‰ๅพ…...","sources.import_remote.summary_repo":"ไป“ๅบ“","sources.import_remote.summary_branch":"ๅˆ†ๆ”ฏ","sources.import_remote.summary_commit":"Commit","sources.import_remote.commit_latest":"(latest)","sources.import_remote.stage.prepare":"ๅ‡†ๅค‡ๆ‰ง่กŒ็Žฏๅขƒ","sources.import_remote.stage.clone":"ๅ…‹้š†ไป“ๅบ“","sources.import_remote.stage.scan":"่ฏ†ๅˆซ้กน็›ฎ็ป“ๆž„","sources.import_remote.stage.save":"ๅ†™ๅ…ฅ็Ÿฅ่ฏ†ๆบ","sources.import_remote.complete":"ๅฏผๅ…ฅๅฎŒๆˆ","sources.import_remote.back_to_library":"ๅฎŒๆˆ","sources.import_remote.retry":"้‡่ฏ•","sources.import_remote.back":"่ฟ”ๅ›ž","sources.import_remote.error.auth_required":"่ฏฅไป“ๅบ“้œ€่ฆ่ฎค่ฏใ€‚่ฏทๅœจ ๆœๅŠก่ฎพ็ฝฎ โ†’ Git ไปค็‰Œ ไธญ้…็ฝฎ {{host}} ็š„่ฎฟ้—ฎไปค็‰Œใ€‚","sources.import_remote.error.auth_failed":"่ฎค่ฏๅคฑ่ดฅ๏ผŒ่ฏทๆฃ€ๆŸฅ Git ไปค็‰Œ้…็ฝฎใ€‚","sources.import_remote.error.not_found":"ไป“ๅบ“ไธๅญ˜ๅœจๆˆ–ๆ— ๆƒ่ฎฟ้—ฎใ€‚่ฏทๆฃ€ๆŸฅ URL ๆ˜ฏๅฆๆญฃ็กฎใ€‚","sources.import_remote.error.network":"ๆ— ๆณ•่ฟžๆŽฅๅˆฐ่ฟœ็จ‹ไป“ๅบ“ใ€‚่ฏทๆฃ€ๆŸฅ็ฝ‘็ปœๆˆ–็จๅŽ้‡่ฏ•ใ€‚","sources.import_remote.error.capacity":"ๅฝ“ๅ‰ๅฏผๅ…ฅไปปๅŠกๅทฒๆปก๏ผŒ่ฏท็จๅŽๅ†่ฏ•ใ€‚","sources.import_remote.error.clone_failed":"ๅ…‹้š†ๅคฑ่ดฅ","sources.import_remote.error.scan_failed":"่ฏ†ๅˆซๅคฑ่ดฅ","sources.import_remote.error.save_failed":"ๅ†™ๅ…ฅๅคฑ่ดฅ","sources.import_remote.api.detected":"ๅทฒ่ฏ†ๅˆซ {{platform}} ไป“ๅบ“๏ผŒไฝฟ็”จ API ่Žทๅ–ไป“ๅบ“ๆ•ฐๆฎ๏ผŒๆ”ฏๆŒๅฑ€้ƒจ็ดขๅผ•","sources.import_remote.api.fast_available":"ๅฟซ้€Ÿๅฏผๅ…ฅๅฏ็”จ","sources.import_remote.api.will_use_clone":"ไฝฟ็”จ Clone ๆ–นๅผ่Žทๅ–ไป“ๅบ“ๆ•ฐๆฎ๏ผŒๅ…จ้‡็ดขๅผ•","sources.import_remote.api.use_clone":"ไฝฟ็”จ Clone ๆ–นๅผ่Žทๅ–ไป“ๅบ“ๆ•ฐๆฎ๏ผŒๅ…จ้‡็ดขๅผ•","sources.import_remote.api.sub_path":"ๅญ่ทฏๅพ„๏ผˆๅฏ้€‰๏ผ‰","sources.import_remote.api.sub_path_hint":"ๅคงไป“ๅœบๆ™ฏ๏ผšไป…ๅฏผๅ…ฅๆŒ‡ๅฎšๅญ็›ฎๅฝ•","sources.import_remote.api.sub_path_placeholder":"ๅคšไธช่ทฏๅพ„็”จ ; ๅˆ†้š”๏ผŒ็•™็ฉบ่กจ็คบๅ…จ้‡ๅฏผๅ…ฅ","sources.import_remote.api.select_sub_paths":"้€‰ๆ‹ฉๅญ็›ฎๅฝ•","sources.import_remote.api.panel_selected":"ๅทฒ้€‰ๅ†…ๅฎน","sources.import_remote.api.selected_count":"ๅทฒ้€‰ {{count}} ไธช็›ฎๅฝ•","sources.import_remote.api.confirm_full":"็กฎ่ฎค๏ผˆๅ…จ้‡ๅฏผๅ…ฅ๏ผ‰","sources.import_remote.api.back_to_ref":"่ฟ”ๅ›žๅˆ†ๆ”ฏ้€‰ๆ‹ฉ","sources.import_remote.api.method":"ๅฏผๅ…ฅๆ–นๅผ","sources.import_remote.api.method_api":"API๏ผˆๅฟซ้€Ÿ๏ผ‰","sources.import_remote.api.method_clone":"Clone","sources.import_remote.api.truncated_warning":"ๆ–‡ไปถๆ ‘่ถ…่ฟ‡ 100,000 ไธชๆก็›ฎ๏ผŒAPI ่ฟ”ๅ›ž็ป“ๆžœๅฏ่ƒฝไธๅฎŒๆ•ด","sources.import_remote.api.truncated_suggest":"ๅปบ่ฎฎไฝฟ็”จไผ ็ปŸๅ…‹้š†ๆ–นๅผไปฅ่Žทๅ–ๅฎŒๆ•ด็ป“ๆžœ","sources.import_remote.api.truncated_continue":"็ปง็ปญๅฏผๅ…ฅ","sources.import_remote.api.truncated_use_clone":"ไผ ็ปŸๅฏผๅ…ฅ","sources.import_remote.api.suggest_clone":"ๅปบ่ฎฎไฝฟ็”จไผ ็ปŸๅ…‹้š†ๆ–นๅผ","sources.import_remote.api.fallback_msg":"API ๅฏผๅ…ฅๅคฑ่ดฅ๏ผŒๅˆ‡ๆขๅˆฐไผ ็ปŸๆ–นๅผ","sources.import_remote.api.git_host_not_configured":"Git ไธปๆœบ {{host}} ๆœช้…็ฝฎใ€‚่ฏทๅœจ server.yaml ็š„ git_hosts ไธญๆทปๅŠ ่ฏฅไธปๆœบๅŠ่ฎฟ้—ฎไปค็‰Œใ€‚","sources.safety.notice.remote":"่ฟœ็จ‹ไป“ๅบ“ๅฐ†่ขซๅ…‹้š†ๅˆฐๆœๅŠกๅ™จๆœฌๅœฐ่ฟ›่กŒๅˆ†ๆž๏ผŒไปฃ็ ไธไผšไธŠไผ ๅˆฐไปปไฝ•็ฌฌไธ‰ๆ–นๆœๅŠกใ€‚","content.detail.tab.raw":"ๅŽŸๅง‹ๅ†…ๅฎน","content.detail.tab.digest":"็ดขๅผ•ๆ‘˜่ฆ","content.detail.tab.extraction":"LLM ๆๅ–","content.detail.tab.entities":"ๅ…ณ่”ๅฎžไฝ“","content.detail.size":"ๅคงๅฐ","content.detail.created_at":"ๅˆ›ๅปบๆ—ถ้—ด","content.detail.sources":"ๆฅๆบ","content.detail.language":"่ฏญ่จ€","content.detail.model":"ๆจกๅž‹","entity.detail.tab.overview":"ๆฆ‚่งˆ","entity.detail.tab.relations":"ๅ…ณ็ณป","entity.detail.tab.contents":"ๅ†…ๅฎนๆฅๆบ","entity.detail.tab.referrers":"่ขซๅผ•็”จ","entity.detail.tab.neighbors":"้‚ปๅฑ…","entity.detail.type":"็ฑปๅž‹","entity.detail.kind":"็ง็ฑป","entity.detail.perspective":"่ง†่ง’","entity.detail.scope":"ไฝœ็”จๅŸŸ","relation.detail.tab.overview":"ๆฆ‚่งˆ","relation.detail.weight":"ๆƒ้‡","relation.detail.confidence":"็ฝฎไฟกๅบฆ","relation.detail.from":"่ตท็‚น","relation.detail.to":"็ปˆ็‚น","relation.detail.description":"ๆ่ฟฐ","relation.detail.data":"้™„ๅŠ ๆ•ฐๆฎ","relation.detail.source_refs":"ๅ†…ๅฎนๆฅๆบ","relation.detail.meta":"ๅ…ƒไฟกๆฏ","relation.detail.source_label":"็”Ÿๆˆๆ–นๅผ","relation.detail.source_field_sync":"็ณป็ปŸๆŽจๅฏผ","relation.detail.source_explicit":"ๆ˜พๅผๅฃฐๆ˜Ž","relation.filter.direction.all":"ๅ…จ้ƒจๆ–นๅ‘","relation.filter.direction.outgoing":"ๅ‡บ่พน โ†’","relation.filter.direction.incoming":"โ† ๅ…ฅ่พน","relation.filter.type.all":"ๅ…จ้ƒจ็ฑปๅž‹","ref.stale":"ๅทฒๅคฑๆ•ˆๅผ•็”จ","ref.unknown":"ๆœช็Ÿฅๅฎžไฝ“","ref.retry":"่งฃๆžๅคฑ่ดฅ๏ผŒ็‚นๅ‡ป้‡่ฏ•","confidence.high":"้ซ˜็กฎไฟก","confidence.high.tip":"็ฝฎไฟกๅบฆ โ‰ฅ 0.9๏ผŒๅคšไธชไฟกๅทไบคๅ‰้ชŒ่ฏ","confidence.ai":"AI ๅปบ่ฎฎ","confidence.ai.tip":"็ฝฎไฟกๅบฆ 0.7โ€“0.9๏ผŒ็”ฑ AI ๆŽจๆ–ญไฝ†ๆœชๅ……ๅˆ†้ชŒ่ฏ","confidence.low":"ไฝŽ็กฎไฟก","confidence.low.tip":"็ฝฎไฟกๅบฆ < 0.7๏ผŒไฟกๆฏไธ่ถณๆˆ–ๅญ˜ๅœจ็Ÿ›็›พ","source.field_sync":"็ณป็ปŸๆŽจๅฏผ","source.explicit":"ๆ˜พๅผๅฃฐๆ˜Ž","common.empty.content_raw.title":"ๅฐšๆœช็ดขๅผ•","common.empty.content_raw.description":"็ดขๅผ•ๅŽๅฏๆŸฅ็œ‹็ป“ๆž„ๅŒ–ๅ†…ๅฎนใ€‚","common.empty.content_raw.cta":"ๅผ€ๅง‹็ดขๅผ•","common.empty.content_digest.title":"ๅฐšๆœช็ดขๅผ•","common.empty.content_digest.description":"ๆญคๅ†…ๅฎนๅฐšๆœช็ป่ฟ‡็ป“ๆž„ๅŒ–็ดขๅผ•ๅค„็†ใ€‚","common.empty.content_extraction.title":"ๅฐšๆœชๆๅ–","common.empty.content_extraction.description":"AI ๅฐšๆœชๅฏนๆญคๅ†…ๅฎน่ฟ›่กŒๅฎžไฝ“ๆๅ–ๅ’Œๅˆ†ๆžใ€‚","common.empty.content_entities.title":"ๆš‚ๆ— ๅ…ณ่”ๅฎžไฝ“","common.empty.content_entities.description":"ๅฐšๆœชไปŽๆญคๅ†…ๅฎนไธญๆๅ–ๅ‡บไปปไฝ•ๅฎžไฝ“ใ€‚","common.empty.entity_relations.title":"ๆš‚ๆ— ๅ…ณ็ณป","common.empty.entity_relations.description":"่ฏฅๅฎžไฝ“็›ฎๅ‰ๆ˜ฏไธ€ไธชๅญคๅฒ›๏ผŒๅฐšๆœชไธŽๅ…ถไป–ๅฎžไฝ“ๅปบ็ซ‹ๅ…ณ่”ใ€‚","common.empty.entity_contents.title":"ๆš‚ๆ— ๅ†…ๅฎนๆฅๆบ","common.empty.entity_contents.description":"่ฏฅๅฎžไฝ“ๆœชๅ…ณ่”ไปปไฝ•ๆบไปฃ็ ๆˆ–ๆ–‡ๆกฃๅ†…ๅฎนใ€‚","common.empty.entity_referrers.title":"ๆš‚ๆ— ่ขซๅผ•็”จ","common.empty.entity_referrers.description":"็›ฎๅ‰ๆฒกๆœ‰ๅ…ถไป–ๅฎžไฝ“ๅœจ data ๅญ—ๆฎตไธญๅผ•็”จๆญคๅฎžไฝ“ใ€‚","common.empty.entity_neighbors.title":"ๆš‚ๆ— ้‚ปๅฑ…","common.empty.entity_neighbors.description":"่ฏฅๅฎžไฝ“ๅœจๅ›พ่ฐฑไธญๆฒกๆœ‰็›ดๆŽฅๅ…ณ่”็š„้‚ปๅฑ…่Š‚็‚นใ€‚","common.error.not_found":"่ต„ๆบไธๅญ˜ๅœจ","common.error.not_found_description":"่ฏทๆฑ‚็š„่ต„ๆบไธๅญ˜ๅœจๆˆ–ๅทฒ่ขซ็งป้™คใ€‚","common.error.load_failed":"ๅŠ ่ฝฝๅคฑ่ดฅ","common.error.load_failed_description":"ๅŠ ่ฝฝๆ•ฐๆฎๆ—ถๅ‘็”Ÿ้”™่ฏฏ๏ผŒ่ฏท้‡่ฏ•ใ€‚","explorer.mode.append":"่ฟฝๅŠ ","explorer.mode.replace":"ๆ›ฟๆข","explorer.mode.append_tooltip":"ๅœจๆ–ฐๆ ‡็ญพไธญๆ‰“ๅผ€้“พๆŽฅ","explorer.mode.replace_tooltip":"ๆ›ฟๆขๅฝ“ๅ‰ๆ ‡็ญพ","explorer.close_all":"ๅ…ณ้—ญๆ‰€ๆœ‰ๆ ‡็ญพ","explorer.type.content":"ๅ†…ๅฎน","explorer.type.entity":"ๅฎžไฝ“","explorer.type.relation":"ๅ…ณ็ณป","explorer.type.call_graph":"่ฐƒ็”จๅ›พ","explorer.type.import_deps":"ไพ่ต–ๅฏผๅ…ฅ","explorer.type.inheritance":"็ปงๆ‰ฟๅ…ณ็ณป","version.selector_label":"็‰ˆๆœฌ","version.current":"ๅฝ“ๅ‰","upload.no_change":"ๆ–‡ไปถๅ†…ๅฎนๆ— ๅ˜ๅŒ–๏ผŒๅทฒๅฟฝ็•ฅไธŠไผ ","upload.partial_no_change":"{{count}} ไธชๆ–‡ไปถๅ†…ๅฎนๆ— ๅ˜ๅŒ–๏ผŒๅทฒๅฟฝ็•ฅ","upload.new_version_title":"ๆ–ฐ็‰ˆๆœฌ","upload.new_version_desc":"ๆ–‡ไปถๅ†…ๅฎนๅทฒๅ˜ๅŒ–๏ผŒ่ฏท่พ“ๅ…ฅๆ–ฐ็‰ˆๆœฌๅท๏ผš","upload.version_label":"็‰ˆๆœฌๅท","upload.current_version":"ๅฝ“ๅ‰็‰ˆๆœฌ๏ผš{{version}}","upload.version_must_increase":"็‰ˆๆœฌๅทๅฟ…้กปๅคงไบŽ {{version}}","upload.confirm":"ไธŠไผ ","package.last_commit":"ๆœ€ๅŽๆไบค","package.dependencies":"ไพ่ต–","package.files":"ๆ–‡ไปถ","package.no_dependencies":"ๆ— ไพ่ต–","package.unknown":"ๆœช็Ÿฅ","content.card.lines":"็ฌฌ {{start}}-{{end}} ่กŒ","index.code.go_index":"็ดขๅผ•","index.code.reindex":"้‡ๆ–ฐ็ดขๅผ•","index.code.indexing":"็ดขๅผ•ไธญ...","index.stage.daemon_starting":"ๅฏๅŠจ Daemon","index.stage.cloning":"ๅ…‹้š†ไป“ๅบ“","index.stage.preparing":"็‰ˆๆœฌๅ‡†ๅค‡","index.stage.scanning":"ๆ‰ซๆไธญ","index.stage.parsing":"่งฃๆžไธญ","index.stage.analyzing":"ๅˆ†ๆžไธญ","index.stage.uploading":"ไธŠไผ ไธญ","index.stage.skipping":"่ทณ่ฟ‡","index.code.complete":"็ดขๅผ•ๅฎŒๆˆ","index.code.unchanged_count":"{{count}} ไธชๆจกๅ—ๆ— ๅ˜ๅŒ–๏ผŒๅทฒ่ทณ่ฟ‡","index.code.error":"็ดขๅผ•ๅคฑ่ดฅ","index.code.timeout":"็ดขๅผ•่ถ…ๆ—ถ","index.code.dismiss":"ๅ…ณ้—ญ","index.code.skipped":"ๅทฒๆ˜ฏๆœ€ๆ–ฐ","index.code.delete":"ๅˆ ้™ค็ดขๅผ•","index.code.delete_confirm":"็กฎๅฎš่ฆๅˆ ้™ค่ฏฅ่ต„ๆบ็š„็ดขๅผ•๏ผŸๅŽŸๅง‹ๅ†…ๅฎนใ€ๆ‘˜่ฆๅ’Œๆๅ–ๆ•ฐๆฎๅฐ†่ขซๆธ…้™คใ€‚","index.code.delete_success":"็ดขๅผ•ๅทฒๅˆ ้™ค","index.code.delete_failed":"ๅˆ ้™ค็ดขๅผ•ๅคฑ่ดฅ","index.code.auto_continue":"ๅฎŒๆˆๅŽ่‡ชๅŠจ็ปง็ปญ","index.code.auto_continue_pending":"ๅณๅฐ†่‡ชๅŠจ็ปง็ปญ..","index.code.done_continue":"ๅฎŒๆˆ","index.log.daemon_starting":"ๆญฃๅœจๅฏๅŠจไบ‘็ซฏ Daemon...","index.log.daemon_ready":"Daemon ๅฐฑ็ปช","index.log.cloning":"ๆญฃๅœจๅ…‹้š†ไป“ๅบ“...","index.log.clone_done":"ๅ…‹้š†ๅฎŒๆˆ","index.log.preparing":"ๆญฃๅœจๅ‡†ๅค‡็ดขๅผ•็‰ˆๆœฌ...","index.log.prepare_done":"็‰ˆๆœฌๅ‡†ๅค‡ๅฎŒๆˆ","index.log.done_suffix":"ๅฎŒๆˆ","index.log.scan_done":"ๆ‰ซๆๅฎŒๆˆ","index.log.parse_done":"่งฃๆžๅฎŒๆˆ {{count}}ไธช","index.log.analyze_done":"ๅˆ†ๆžๅฎŒๆˆ","index.log.upload_done":"ๆ•ฐๆฎๅทฒไฟๅญ˜ {{name}}","index.log.restored":"(ๅทฒไปŽๆœๅŠกๅ™จๆขๅค่ฟ›ๅบฆ๏ผŒไน‹ๅ‰็š„ๆ—ฅๅฟ—ไธๅฏ็”จ)","index.error.commit_not_available":"็›ฎๆ ‡็‰ˆๆœฌไธๅฏ็”จ๏ผŒ่ฏทๆฃ€ๆŸฅ่ฟœ็จ‹ไป“ๅบ“","index.error.daemon_start_failed":"ไบ‘็ซฏ Daemon ๅฏๅŠจๅคฑ่ดฅ","index.error.git_archive_failed":"็‰ˆๆœฌๅฏผๅ‡บๅคฑ่ดฅ","index.doc.error.llm_unavailable":"LLM ๆœๅŠกไธๅฏ็”จ๏ผŒ่ฏทๆฃ€ๆŸฅ้…็ฝฎ","index.doc.error.embedding_unavailable":"Embedding ๆœๅŠกไธๅฏ็”จ๏ผŒ่ฏทๆฃ€ๆŸฅ้…็ฝฎ","index.doc.error.content_missing":"ๆ–‡ๆกฃๅ†…ๅฎน็ผบๅคฑ","index.doc.error.parse_failed":"ๆ–‡ๆกฃ่งฃๆžๅคฑ่ดฅ","index.doc.error.llm_exhausted":"LLM ่ฐƒ็”จๅคฑ่ดฅ๏ผš{{message}}","index.stage.chunking":"ๅˆ†็‰‡ไธญ","index.stage.annotating":"ๆ ‡ๆณจไธญ","index.stage.post_processing":"ๅŽๅค„็†","index.stage.embedding":"ๅ‘้‡ๅŒ–","index.stage.storing":"ๅญ˜ๅ‚จไธญ","index.doc.log.chunking":"ๅˆ†ๆžๆ–‡ๆกฃ็ป“ๆž„...","index.doc.log.chunking_done":"ๅˆ†็‰‡ๅฎŒๆˆ๏ผˆ{{n}} ไธชๅˆ†็‰‡๏ผ‰","index.doc.log.annotating_start":"LLM ๆ ‡ๆณจๅผ€ๅง‹...","index.doc.log.annotating":"LLM ๆ ‡ๆณจไธญ ({{n}}/{{m}})","index.doc.log.post_processing":"ๅฎžไฝ“ๅฝ’ไธ€ๅŒ– & ่ดจ้‡ๆฃ€ๆŸฅ...","index.doc.log.embedding":"็”Ÿๆˆๅ‘้‡...","index.doc.log.storing":"ๆญฃๅœจไฟๅญ˜...","index.doc.msg.chunking_result":"{{chunks}} ไธชๅˆ†็‰‡๏ผŒ{{sections}} ไธช็ซ ่Š‚","index.doc.msg.annotating_start":"{{n}} ไธชๅˆ†็‰‡","index.doc.msg.annotating_start_model":"{{n}} ไธชๅˆ†็‰‡๏ผŒLLM {{model}}","index.doc.msg.annotating_chunk":"ๅˆ†็‰‡ {{current}}/{{total}} {{step}}๏ผˆ{{calls}} ๆฌก่ฐƒ็”จ๏ผŒ{{tokens}} tokens๏ผ‰","index.doc.msg.annotating_chunk_done":"ๅˆ†็‰‡ {{current}}/{{total}} ๅฎŒๆˆ๏ผŒ็ดฏ่ฎก {{calls}} ๆฌก่ฐƒ็”จ {{tokens}} tokens","index.doc.msg.post_process_start":"ๅฎžไฝ“่‡ชๅŠจ่กฅๅ…จ & ๅฝ’ไธ€ๅŒ–","index.doc.msg.extraction_stats":"{{entities}} ไธชๅฎžไฝ“๏ผŒ{{relations}} ไธชๅ…ณ็ณป๏ผŒ{{withAtoms}}/{{totalParas}} ๆฎต่ฝๅซๆ ‡ๆณจ","index.doc.msg.no_resolution":"ๆ— ้œ€ๅฎžไฝ“ๅฝ’ไธ€ๅŒ–","index.doc.msg.resolving":"ๅฝ’ไธ€ๅŒ–ไธญ๏ผš{{duplicates}} ๅฏน้‡ๅค + {{noise}} ไธชๅ™ชๅฃฐๅ€™้€‰","index.doc.msg.resolution_parse_failed":"ๅฎžไฝ“ๅฝ’ไธ€ๅŒ–่งฃๆžๅคฑ่ดฅ","index.doc.msg.resolution_result":"ๅฝ’ไธ€ๅŒ–ๅฎŒๆˆ๏ผš{{merges}} ๆฌกๅˆๅนถ๏ผˆ{{mergeRefs}} ๅค„ๅผ•็”จ๏ผ‰๏ผŒ็งป้™ค {{removed}} ไธช๏ผˆ{{removeRefs}} ๅค„๏ผ‰๏ผŒ{{ambiguous}} ไธชๅพ…ๅฎš","index.doc.msg.resolution_failed":"ๅฎžไฝ“ๅฝ’ไธ€ๅŒ–ๅคฑ่ดฅ๏ผˆ้ž้˜ปๅกž๏ผ‰","index.doc.msg.embedding_model":"ๅ‘้‡ๅŒ– {{model}}","index.doc.msg.file_start":"[{{idx}}/{{total}}] {{file}} ๅผ€ๅง‹็ดขๅผ•","index.doc.msg.file_done":"[{{idx}}/{{total}}] {{file}} ็ดขๅผ•ๅฎŒๆˆ","index.doc.msg.file_error":"[{{idx}}/{{total}}] {{file}} ็ดขๅผ•ๅคฑ่ดฅ: {{error}}","index.doc.confirm_title":"ๆ–‡ๆกฃ็ดขๅผ•็กฎ่ฎค","index.doc.confirm_desc":"ไปฅไธ‹ๆ–‡ๆกฃๅฐ†ไฝฟ็”จ LLM ่ฟ›่กŒ็ป“ๆž„ๅŒ–็ดขๅผ•๏ผŒไผšไบง็”Ÿ token ๆถˆ่€—๏ผš","index.doc.confirm_btn":"็กฎ่ฎค็ดขๅผ•","index.doc.estimating":"ๆญฃๅœจไผฐ็ฎ—ๆถˆ่€—...","index.doc.estimate_tokens":"้ข„ไผฐ Token","index.doc.estimate_calls":"LLM ่ฐƒ็”จ","index.doc.estimate_chunks":"ๅˆ†็‰‡ๆ•ฐ","index.doc.estimate_summary":"้ข„่ฎกๆถˆ่€—็บฆ ~{{tokens}} tokens๏ผŒ~{{calls}} ๆฌก LLM ่ฐƒ็”จ","index.doc.cancel":"ๅ–ๆถˆ","digest.empty.title":"ๆš‚ๆ— ไปฃ็ ๆ‘˜่ฆ","digest.empty.description":"่ฏฅๅ†…ๅฎนๅฐšๆœช่ฟ›่กŒไปฃ็ ็ดขๅผ•๏ผŒ็ดขๅผ•ๅŽๅฏๆŸฅ็œ‹็ป“ๆž„ๅŒ–ไปฃ็ ๆ‘˜่ฆใ€‚","digest.empty.cta":"ๅผ€ๅง‹็ดขๅผ•","digest.doc.empty.title":"ๆ–‡ๆกฃๅฐšๆœชๅฎŒๆˆ LLM ็ดขๅผ•","digest.doc.empty.description":"็ดขๅผ•ๅŽๅฏๆŸฅ็œ‹ๅŽŸๆ–‡ไธŽ็ป“ๆž„ๅŒ–ๆ ‡ๆณจ็š„ๅฏน็…ง่ง†ๅ›พ","digest.doc.empty.cta":"็ดขๅผ•ๆ–‡ๆกฃ","digest.doc.no_atoms":"ๆ— ๆ ‡ๆณจๆˆ–ๅทฒๆๅ–ๅˆฐๅ…ถไป–ๆฎต่ฝ","digest.doc.atom.entities":"ๅฎžไฝ“","digest.doc.atom.relations":"ๅ…ณ็ณป","digest.doc.atom.behaviors":"่กŒไธบ","digest.doc.atom.attributes":"ๅฑžๆ€ง","digest.doc.atom.states":"็Šถๆ€","digest.doc.atom.rules":"่ง„ๅˆ™","digest.doc.atom.transitions":"่ฝฌๆข","digest.doc.atom.events":"ไบ‹ไปถ","digest.doc.atom.decisions":"ๅ†ณ็ญ–","digest.doc.atom.metrics":"ๆŒ‡ๆ ‡","digest.doc.atom.roles":"่ง’่‰ฒ","digest.doc.atom.constraints":"็บฆๆŸ","digest.doc.atom.comparisons":"ๅฏนๆฏ”","digest.doc.atom.boundaries":"่พน็•Œ","digest.stats.files":"ๆ–‡ไปถ","digest.stats.classes":"็ฑป","digest.stats.functions":"ๅ‡ฝๆ•ฐ","digest.stats.relations":"ๅ…ณ็ณป","digest.tech_stack":"ๆŠ€ๆœฏๆ ˆ","digest.modules":"ๆจกๅ—","daemon.offline_tooltip":"่ฏทๅฏๅŠจๅฎขๆˆท็ซฏ","sources.detail.repo_url":"ไป“ๅบ“ๅœฐๅ€","raw.basic_info":"ๅŸบๆœฌไฟกๆฏ","raw.field.name":"ๅ็งฐ","raw.field.version":"็‰ˆๆœฌ","raw.field.license":"่ฎธๅฏ่ฏ","raw.field.description":"ๆ่ฟฐ","raw.dependencies":"ไพ่ต–","raw.dev_dependencies":"ๅผ€ๅ‘ไพ่ต–","raw.no_dependencies":"ๆ— ไพ่ต–","raw.readme":"่ฏดๆ˜Žๆ–‡ๆกฃ","raw.code_files":"ไปฃ็ ๆ–‡ไปถ","raw.doc_files":"ๆ–‡ๆกฃๆ–‡ไปถ","raw.total_files":"ๆ€ปๆ–‡ไปถๆ•ฐ","index.batch.title":"้€‰ๆ‹ฉๅพ…็ดขๅผ•ๅ†…ๅฎน","index.batch.panel_a_title":"ๅฏ็ดขๅผ•ๅ†…ๅฎน","index.batch.panel_b_title":"ๅทฒ้€‰ๅ†…ๅฎน","index.batch.selected_count":"ๅทฒ้€‰ {{n}} / ๅฏ้€‰ {{total}}","index.batch.already_indexed":"ๅทฒ็ดขๅผ•","index.batch.reindex_tag":"้‡็ดขๅผ•","index.batch.skipped_unsupported":"ๅทฒ่ทณ่ฟ‡๏ผˆๆš‚ไธๆ”ฏๆŒ๏ผ‰","index.batch.empty_selection":"่ฏทๅœจๅทฆไพงๅ‹พ้€‰่ฆ็ดขๅผ•็š„ๅ†…ๅฎน","index.batch.warning_over_50":"ๅพ…็ดขๅผ•ๆ•ฐ้‡่พƒๅคš๏ผˆ>50๏ผ‰๏ผŒๅฏ่ƒฝ้œ€่ฆ่พƒ้•ฟๆ—ถ้—ด","index.batch.confirm":"ๅผ€ๅง‹็ดขๅผ•","index.batch.back":"่ฟ”ๅ›ž","index.batch.tooltip":"ๆ‰น้‡็ดขๅผ•","index.batch.tooltip_indexing":"็ดขๅผ•ไธญ...","index.batch.toast_skipped":"้€‰ไธญ็š„ๅ†…ๅฎนๅ‡ๅทฒๆ˜ฏๆœ€ๆ–ฐ็Šถๆ€๏ผŒๆ— ้œ€้‡ๆ–ฐ็ดขๅผ•ใ€‚","index.batch.toast_partial_fail":"้ƒจๅˆ†็ดขๅผ•ไปปๅŠกๅคฑ่ดฅ๏ผŒ่ฏฆๆƒ…่ฏทๆŸฅ็œ‹ๆŽงๅˆถๅฐใ€‚","index.batch.error":"ๆ‰น้‡็ดขๅผ•ๅคฑ่ดฅ","error.dialog.console_hint":"ๅฎŒๆ•ด้”™่ฏฏไฟกๆฏๅทฒๆ‰“ๅฐๅˆฐๆต่งˆๅ™จๆŽงๅˆถๅฐใ€‚","error.dialog.copy":"ๅคๅˆถ","error.dialog.copied":"ๅทฒๅคๅˆถ","error.dialog.confirm":"็กฎๅฎš","query.tab.label":"ๆŸฅ่ฏข","query.indexing.title":"็ดขๅผ•่ฟ›่กŒไธญ","query.indexing.desc":"็ดขๅผ•ๅฎŒๆˆๅŽๅณๅฏไฝฟ็”จๆŸฅ่ฏขๅŠŸ่ƒฝใ€‚","query.symbol.search_placeholder":"ๆœ็ดข็ฌฆๅท...","query.symbol.exported_only":"ไป…ๅฏผๅ‡บ","query.symbol.load_more":"ๅŠ ่ฝฝๆ›ดๅคš๏ผˆๅ‰ฉไฝ™ {{count}} ไธช๏ผ‰","query.symbol.loading":"ๅŠ ่ฝฝ็ฌฆๅทไธญ...","query.symbol.empty":"ๆœชๆ‰พๅˆฐ็ฌฆๅท","query.symbol.empty_desc":"่ฏฅๆบๆฒกๆœ‰ๅฏๅฑ•็คบ็š„ไปฃ็ ็ฌฆๅทใ€‚","query.symbol.methods":"ๆ–นๆณ•","query.symbol.properties":"ๅฑžๆ€ง","query.symbol.extends":"็ปงๆ‰ฟ","query.symbol.implements":"ๅฎž็Žฐ","query.symbol.signature":"็ญพๅ","query.symbol.parameters":"ๅ‚ๆ•ฐ","query.symbol.returns":"่ฟ”ๅ›žๅ€ผ","query.symbol.async":"ๅผ‚ๆญฅ","query.call_graph.title":"่ฐƒ็”จๅ›พ","query.call_graph.callers":"่ฐƒ็”จ่€…","query.call_graph.callees":"่ขซ่ฐƒ็”จ","query.call_graph.empty":"ๆœชๆ‰พๅˆฐ่ฐƒ็”จๅ…ณ็ณป","query.call_graph.empty_desc":"ๆœชๆ‰พๅˆฐ่ฏฅๅ‡ฝๆ•ฐ็š„{{direction}}ใ€‚","query.call_graph.depth":"ๆทฑๅบฆ","query.call_graph.open":"ๆŸฅ็œ‹่ฐƒ็”จๅ›พ","query.import_deps.title":"ๅฏผๅ…ฅไพ่ต–","query.import_deps.forward":"ๅฏผๅ…ฅ","query.import_deps.reverse":"่ขซๅฏผๅ…ฅ","query.import_deps.external":"ๅค–้ƒจไพ่ต–","query.import_deps.internal":"ๅ†…้ƒจไพ่ต–","query.import_deps.empty":"ๆœชๆ‰พๅˆฐๅฏผๅ…ฅๅ…ณ็ณป","query.import_deps.open":"ๆŸฅ็œ‹ไพ่ต–","query.inheritance.title":"็ปงๆ‰ฟๅ…ณ็ณป","query.inheritance.descendants":"ๅญ็ฑป","query.inheritance.ancestors":"็ˆถ็ฑป","query.inheritance.empty":"ๆœชๆ‰พๅˆฐ็ปงๆ‰ฟๅ…ณ็ณป","query.inheritance.cross_source":"ๆญฃๅœจๆœ็ดข {{count}} ไธชๅทฒ็ดขๅผ•ไปฃ็ ๆบ","query.inheritance.open":"ๆŸฅ็œ‹็ปงๆ‰ฟ","query.doc.search_placeholder":"็”จ่‡ช็„ถ่ฏญ่จ€ๆœ็ดขๆ–‡ๆกฃ...","query.doc.search_button":"ๆœ็ดข","query.doc.searching":"ๆœ็ดขไธญ...","query.doc.relevance.high":"้ซ˜็›ธๅ…ณๅบฆ","query.doc.relevance.medium":"ไธญ็›ธๅ…ณๅบฆ","query.doc.relevance.low":"ไฝŽ็›ธๅ…ณๅบฆ","query.doc.empty.title":"ๆœชๆ‰พๅˆฐๅŒน้…ๆฎต่ฝ","query.doc.empty.desc":"่ฏทๅฐ่ฏ•ๆ›ดๆขๅ…ณ้”ฎ่ฏ๏ผŒๆˆ–ๆฃ€ๆŸฅ็›ธๅ…ณๆ–‡ๆกฃๆ˜ฏๅฆๅทฒๅฏผๅ…ฅๅนถๅฎŒๆˆ็ดขๅผ•ใ€‚","query.doc.error.title":"ๆ–‡ๆกฃๆœ็ดขๅคฑ่ดฅ","query.warning.more":"่ฟ˜ๆœ‰ {{count}} ๆก"};$n.use(Ww).use(MC).init({resources:{en:{translation:iE},zh:{translation:sE}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage"],caches:["localStorage"],lookupLocalStorage:"lang"}});var Ch={exports:{}},sl={},Eh={exports:{}},Ah={};var Tv;function oE(){return Tv||(Tv=1,(function(e){function t(I,V){var te=I.length;I.push(V);e:for(;0<te;){var oe=te-1>>>1,R=I[oe];if(0<i(R,V))I[oe]=V,I[te]=R,te=oe;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var V=I[0],te=I.pop();if(te!==V){I[0]=te;e:for(var oe=0,R=I.length,B=R>>>1;oe<B;){var K=2*(oe+1)-1,O=I[K],se=K+1,ie=I[se];if(0>i(O,te))se<R&&0>i(ie,O)?(I[oe]=ie,I[se]=te,oe=se):(I[oe]=O,I[K]=te,oe=K);else if(se<R&&0>i(ie,te))I[oe]=ie,I[se]=te,oe=se;else break e}}return V}function i(I,V){var te=I.sortIndex-V.sortIndex;return te!==0?te:I.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var p=[],f=[],m=1,g=null,y=3,b=!1,w=!1,k=!1,j=!1,S=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function z(I){for(var V=n(f);V!==null;){if(V.callback===null)r(f);else if(V.startTime<=I)r(f),V.sortIndex=V.expirationTime,t(p,V);else break;V=n(f)}}function D(I){if(k=!1,z(I),!w)if(n(p)!==null)w=!0,A||(A=!0,Q());else{var V=n(f);V!==null&&U(D,V.startTime-I)}}var A=!1,P=-1,T=5,F=-1;function M(){return j?!0:!(e.unstable_now()-F<T)}function G(){if(j=!1,A){var I=e.unstable_now();F=I;var V=!0;try{e:{w=!1,k&&(k=!1,E(P),P=-1),b=!0;var te=y;try{t:{for(z(I),g=n(p);g!==null&&!(g.expirationTime>I&&M());){var oe=g.callback;if(typeof oe=="function"){g.callback=null,y=g.priorityLevel;var R=oe(g.expirationTime<=I);if(I=e.unstable_now(),typeof R=="function"){g.callback=R,z(I),V=!0;break t}g===n(p)&&r(p),z(I)}else r(p);g=n(p)}if(g!==null)V=!0;else{var B=n(f);B!==null&&U(D,B.startTime-I),V=!1}}break e}finally{g=null,y=te,b=!1}V=void 0}}finally{V?Q():A=!1}}}var Q;if(typeof C=="function")Q=function(){C(G)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,$=re.port2;re.port1.onmessage=G,Q=function(){$.postMessage(null)}}else Q=function(){S(G,0)};function U(I,V){P=S(function(){I(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(I){switch(y){case 1:case 2:case 3:var V=3;break;default:V=y}var te=y;y=V;try{return I()}finally{y=te}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(I,V){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var te=y;y=I;try{return V()}finally{y=te}},e.unstable_scheduleCallback=function(I,V,te){var oe=e.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?oe+te:oe):te=oe,I){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=te+R,I={id:m++,callback:V,priorityLevel:I,startTime:te,expirationTime:R,sortIndex:-1},te>oe?(I.sortIndex=te,t(f,I),n(p)===null&&I===n(f)&&(k?(E(P),P=-1):k=!0,U(D,te-oe))):(I.sortIndex=R,t(p,I),w||b||(w=!0,A||(A=!0,Q()))),I},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(I){var V=y;return function(){var te=y;y=V;try{return I.apply(this,arguments)}finally{y=te}}}})(Ah)),Ah}var Rv;function lE(){return Rv||(Rv=1,Eh.exports=oE()),Eh.exports}var Th={exports:{}},Ln={};var Lv;function cE(){if(Lv)return Ln;Lv=1;var e=Hd();function t(p){var f="https://react.dev/errors/"+p;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+p+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(p,f,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:p,containerInfo:f,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(p,f){if(p==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ln.createPortal=function(p,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return o(p,f,null,m)},Ln.flushSync=function(p){var f=l.T,m=r.p;try{if(l.T=null,r.p=2,p)return p()}finally{l.T=f,r.p=m,r.d.f()}},Ln.preconnect=function(p,f){typeof p=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(p,f))},Ln.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},Ln.preinit=function(p,f){if(typeof p=="string"&&f&&typeof f.as=="string"){var m=f.as,g=d(m,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,b=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(p,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:b}):m==="script"&&r.d.X(p,{crossOrigin:g,integrity:y,fetchPriority:b,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Ln.preinitModule=function(p,f){if(typeof p=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=d(f.as,f.crossOrigin);r.d.M(p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(p)},Ln.preload=function(p,f){if(typeof p=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,g=d(m,f.crossOrigin);r.d.L(p,m,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Ln.preloadModule=function(p,f){if(typeof p=="string")if(f){var m=d(f.as,f.crossOrigin);r.d.m(p,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(p)},Ln.requestFormReset=function(p){r.d.r(p)},Ln.unstable_batchedUpdates=function(p,f){return p(f)},Ln.useFormState=function(p,f,m){return l.H.useFormState(p,f,m)},Ln.useFormStatus=function(){return l.H.useHostTransitionStatus()},Ln.version="19.2.4",Ln}var Dv;function uE(){if(Dv)return Th.exports;Dv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Th.exports=cE(),Th.exports}var Ov;function dE(){if(Ov)return sl;Ov=1;var e=lE(),t=Hd(),n=uE();function r(a){var s="https://react.dev/errors/"+a;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+a+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function o(a){var s=a,c=a;if(a.alternate)for(;s.return;)s=s.return;else{a=s;do s=a,(s.flags&4098)!==0&&(c=s.return),a=s.return;while(a)}return s.tag===3?c:null}function l(a){if(a.tag===13){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function d(a){if(a.tag===31){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function p(a){if(o(a)!==a)throw Error(r(188))}function f(a){var s=a.alternate;if(!s){if(s=o(a),s===null)throw Error(r(188));return s!==a?null:a}for(var c=a,h=s;;){var x=c.return;if(x===null)break;var v=x.alternate;if(v===null){if(h=x.return,h!==null){c=h;continue}break}if(x.child===v.child){for(v=x.child;v;){if(v===c)return p(x),a;if(v===h)return p(x),s;v=v.sibling}throw Error(r(188))}if(c.return!==h.return)c=x,h=v;else{for(var N=!1,L=x.child;L;){if(L===c){N=!0,c=x,h=v;break}if(L===h){N=!0,h=x,c=v;break}L=L.sibling}if(!N){for(L=v.child;L;){if(L===c){N=!0,c=v,h=x;break}if(L===h){N=!0,h=v,c=x;break}L=L.sibling}if(!N)throw Error(r(189))}}if(c.alternate!==h)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?a:s}function m(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a;for(a=a.child;a!==null;){if(s=m(a),s!==null)return s;a=a.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),C=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function Q(a){return a===null||typeof a!="object"?null:(a=G&&a[G]||a["@@iterator"],typeof a=="function"?a:null)}var re=Symbol.for("react.client.reference");function $(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===re?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case k:return"Fragment";case S:return"Profiler";case j:return"StrictMode";case D:return"Suspense";case A:return"SuspenseList";case F:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case C:return a.displayName||"Context";case E:return(a._context.displayName||"Context")+".Consumer";case z:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case P:return s=a.displayName||null,s!==null?s:$(a.type)||"Memo";case T:s=a._payload,a=a._init;try{return $(a(s))}catch{}}return null}var U=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},oe=[],R=-1;function B(a){return{current:a}}function K(a){0>R||(a.current=oe[R],oe[R]=null,R--)}function O(a,s){R++,oe[R]=a.current,a.current=s}var se=B(null),ie=B(null),pe=B(null),Ee=B(null);function Ie(a,s){switch(O(pe,s),O(ie,a),O(se,null),s.nodeType){case 9:case 11:a=(a=s.documentElement)&&(a=a.namespaceURI)?E0(a):0;break;default:if(a=s.tagName,s=s.namespaceURI)s=E0(s),a=A0(s,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}K(se),O(se,a)}function Ue(){K(se),K(ie),K(pe)}function be(a){a.memoizedState!==null&&O(Ee,a);var s=se.current,c=A0(s,a.type);s!==c&&(O(ie,a),O(se,c))}function de(a){ie.current===a&&(K(se),K(ie)),Ee.current===a&&(K(Ee),el._currentValue=te)}var ke,ge;function we(a){if(ke===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);ke=s&&s[1]||"",ge=-1<c.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+ke+a+ge}var Xe=!1;function Me(a,s){if(!a||Xe)return"";Xe=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(le){var ne=le}Reflect.construct(a,[],xe)}else{try{xe.call()}catch(le){ne=le}a.call(xe.prototype)}}else{try{throw Error()}catch(le){ne=le}(xe=a())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(le){if(le&&ne&&typeof le.stack=="string")return[le.stack,ne.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=h.DetermineComponentFrameRoot(),N=v[0],L=v[1];if(N&&L){var q=N.split(`
5
+ `),ee=L.split(`
6
+ `);for(x=h=0;h<q.length&&!q[h].includes("DetermineComponentFrameRoot");)h++;for(;x<ee.length&&!ee[x].includes("DetermineComponentFrameRoot");)x++;if(h===q.length||x===ee.length)for(h=q.length-1,x=ee.length-1;1<=h&&0<=x&&q[h]!==ee[x];)x--;for(;1<=h&&0<=x;h--,x--)if(q[h]!==ee[x]){if(h!==1||x!==1)do if(h--,x--,0>x||q[h]!==ee[x]){var ce=`
7
+ `+q[h].replace(" at new "," at ");return a.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",a.displayName)),ce}while(1<=h&&0<=x);break}}}finally{Xe=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?we(c):""}function Je(a,s){switch(a.tag){case 26:case 27:case 5:return we(a.type);case 16:return we("Lazy");case 13:return a.child!==s&&s!==null?we("Suspense Fallback"):we("Suspense");case 19:return we("SuspenseList");case 0:case 15:return Me(a.type,!1);case 11:return Me(a.type.render,!1);case 1:return Me(a.type,!0);case 31:return we("Activity");default:return""}}function zt(a){try{var s="",c=null;do s+=Je(a,c),c=a,a=a.return;while(a);return s}catch(h){return`
8
+ Error generating stack: `+h.message+`
9
+ `+h.stack}}var en=Object.prototype.hasOwnProperty,Kt=e.unstable_scheduleCallback,An=e.unstable_cancelCallback,Kn=e.unstable_shouldYield,Pn=e.unstable_requestPaint,Xt=e.unstable_now,Sn=e.unstable_getCurrentPriorityLevel,Z=e.unstable_ImmediatePriority,fe=e.unstable_UserBlockingPriority,Ne=e.unstable_NormalPriority,ze=e.unstable_LowPriority,He=e.unstable_IdlePriority,Tt=e.log,Ft=e.unstable_setDisableYieldValue,Rt=null,_t=null;function yt(a){if(typeof Tt=="function"&&Ft(a),_t&&typeof _t.setStrictMode=="function")try{_t.setStrictMode(Rt,a)}catch{}}var lt=Math.clz32?Math.clz32:xa,bn=Math.log,on=Math.LN2;function xa(a){return a>>>=0,a===0?32:31-(bn(a)/on|0)|0}var ye=256,Ge=262144,Lt=4194304;function it(a){var s=a&42;if(s!==0)return s;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function It(a,s,c){var h=a.pendingLanes;if(h===0)return 0;var x=0,v=a.suspendedLanes,N=a.pingedLanes;a=a.warmLanes;var L=h&134217727;return L!==0?(h=L&~v,h!==0?x=it(h):(N&=L,N!==0?x=it(N):c||(c=L&~a,c!==0&&(x=it(c))))):(L=h&~v,L!==0?x=it(L):N!==0?x=it(N):c||(c=h&~a,c!==0&&(x=it(c)))),x===0?0:s!==0&&s!==x&&(s&v)===0&&(v=x&-x,c=s&-s,v>=c||v===32&&(c&4194048)!==0)?s:x}function Ut(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function Ya(a,s){switch(a){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ya(){var a=Lt;return Lt<<=1,(Lt&62914560)===0&&(Lt=4194304),a}function vr(a){for(var s=[],c=0;31>c;c++)s.push(a);return s}function Fn(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Yr(a,s,c,h,x,v){var N=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var L=a.entanglements,q=a.expirationTimes,ee=a.hiddenUpdates;for(c=N&~c;0<c;){var ce=31-lt(c),xe=1<<ce;L[ce]=0,q[ce]=-1;var ne=ee[ce];if(ne!==null)for(ee[ce]=null,ce=0;ce<ne.length;ce++){var le=ne[ce];le!==null&&(le.lane&=-536870913)}c&=~xe}h!==0&&ba(a,h,0),v!==0&&x===0&&a.tag!==0&&(a.suspendedLanes|=v&~(N&~s))}function ba(a,s,c){a.pendingLanes|=s,a.suspendedLanes&=~s;var h=31-lt(s);a.entangledLanes|=s,a.entanglements[h]=a.entanglements[h]|1073741824|c&261930}function Ka(a,s){var c=a.entangledLanes|=s;for(a=a.entanglements;c;){var h=31-lt(c),x=1<<h;x&s|a[h]&s&&(a[h]|=s),c&=~x}}function H(a,s){var c=s&-s;return c=(c&42)!==0?1:X(c),(c&(a.suspendedLanes|s))!==0?0:c}function X(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function ae(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function ve(){var a=V.p;return a!==0?a:(a=window.event,a===void 0?32:W0(a.type))}function Se(a,s){var c=V.p;try{return V.p=a,s()}finally{V.p=c}}var Le=Math.random().toString(36).slice(2),Ce="__reactFiber$"+Le,Ae="__reactProps$"+Le,Re="__reactContainer$"+Le,Ve="__reactEvents$"+Le,Ye="__reactListeners$"+Le,qe="__reactHandles$"+Le,gt="__reactResources$"+Le,he="__reactMarker$"+Le;function Te(a){delete a[Ce],delete a[Ae],delete a[Ve],delete a[Ye],delete a[qe]}function De(a){var s=a[Ce];if(s)return s;for(var c=a.parentNode;c;){if(s=c[Re]||c[Ce]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(a=z0(a);a!==null;){if(c=a[Ce])return c;a=z0(a)}return s}a=c,c=a.parentNode}return null}function Qe(a){if(a=a[Ce]||a[Re]){var s=a.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return a}return null}function $e(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a.stateNode;throw Error(r(33))}function kt(a){var s=a[gt];return s||(s=a[gt]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function ft(a){a[he]=!0}var hn=new Set,Tn={};function vn(a,s){Kr(a,s),Kr(a+"Capture",s)}function Kr(a,s){for(Tn[a]=s,a=0;a<s.length;a++)hn.add(s[a])}var Ci=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]*$"),Xr={},Ei={};function ls(a){return en.call(Ei,a)?!0:en.call(Xr,a)?!1:Ci.test(a)?Ei[a]=!0:(Xr[a]=!0,!1)}function ot(a,s,c){if(ls(s))if(c===null)a.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+c)}}function tn(a,s,c){if(c===null)a.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(s);return}a.setAttribute(s,""+c)}}function Rn(a,s,c,h){if(h===null)a.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttributeNS(s,c,""+h)}}function ln(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Ht(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function cs(a,s,c){var h=Object.getOwnPropertyDescriptor(a.constructor.prototype,s);if(!a.hasOwnProperty(s)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var x=h.get,v=h.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return x.call(this)},set:function(N){c=""+N,v.call(this,N)}}),Object.defineProperty(a,s,{enumerable:h.enumerable}),{getValue:function(){return c},setValue:function(N){c=""+N},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function us(a){if(!a._valueTracker){var s=Ht(a)?"checked":"value";a._valueTracker=cs(a,s,""+a[s])}}function vc(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var c=s.getValue(),h="";return a&&(h=Ht(a)?a.checked?"true":"false":a.value),a=h,a!==c?(s.setValue(a),!0):!1}function _c(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var V2=/[\n"\\]/g;function _r(a){return a.replace(V2,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function hf(a,s,c,h,x,v,N,L){a.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?a.type=N:a.removeAttribute("type"),s!=null?N==="number"?(s===0&&a.value===""||a.value!=s)&&(a.value=""+ln(s)):a.value!==""+ln(s)&&(a.value=""+ln(s)):N!=="submit"&&N!=="reset"||a.removeAttribute("value"),s!=null?mf(a,N,ln(s)):c!=null?mf(a,N,ln(c)):h!=null&&a.removeAttribute("value"),x==null&&v!=null&&(a.defaultChecked=!!v),x!=null&&(a.checked=x&&typeof x!="function"&&typeof x!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.name=""+ln(L):a.removeAttribute("name")}function wx(a,s,c,h,x,v,N,L){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(a.type=v),s!=null||c!=null){if(!(v!=="submit"&&v!=="reset"||s!=null)){us(a);return}c=c!=null?""+ln(c):"",s=s!=null?""+ln(s):c,L||s===a.value||(a.value=s),a.defaultValue=s}h=h??x,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=L?a.checked:!!h,a.defaultChecked=!!h,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.name=N),us(a)}function mf(a,s,c){s==="number"&&_c(a.ownerDocument)===a||a.defaultValue===""+c||(a.defaultValue=""+c)}function ds(a,s,c,h){if(a=a.options,s){s={};for(var x=0;x<c.length;x++)s["$"+c[x]]=!0;for(c=0;c<a.length;c++)x=s.hasOwnProperty("$"+a[c].value),a[c].selected!==x&&(a[c].selected=x),x&&h&&(a[c].defaultSelected=!0)}else{for(c=""+ln(c),s=null,x=0;x<a.length;x++){if(a[x].value===c){a[x].selected=!0,h&&(a[x].defaultSelected=!0);return}s!==null||a[x].disabled||(s=a[x])}s!==null&&(s.selected=!0)}}function kx(a,s,c){if(s!=null&&(s=""+ln(s),s!==a.value&&(a.value=s),c==null)){a.defaultValue!==s&&(a.defaultValue=s);return}a.defaultValue=c!=null?""+ln(c):""}function Sx(a,s,c,h){if(s==null){if(h!=null){if(c!=null)throw Error(r(92));if(U(h)){if(1<h.length)throw Error(r(93));h=h[0]}c=h}c==null&&(c=""),s=c}c=ln(s),a.defaultValue=c,h=a.textContent,h===c&&h!==""&&h!==null&&(a.value=h),us(a)}function fs(a,s){if(s){var c=a.firstChild;if(c&&c===a.lastChild&&c.nodeType===3){c.nodeValue=s;return}}a.textContent=s}var G2=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 jx(a,s,c){var h=s.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?a.setProperty(s,""):s==="float"?a.cssFloat="":a[s]="":h?a.setProperty(s,c):typeof c!="number"||c===0||G2.has(s)?s==="float"?a.cssFloat=c:a[s]=(""+c).trim():a[s]=c+"px"}function Nx(a,s,c){if(s!=null&&typeof s!="object")throw Error(r(62));if(a=a.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||s!=null&&s.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var x in s)h=s[x],s.hasOwnProperty(x)&&c[x]!==h&&jx(a,x,h)}else for(var v in s)s.hasOwnProperty(v)&&jx(a,v,s[v])}function gf(a){if(a.indexOf("-")===-1)return!1;switch(a){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 Y2=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"]]),K2=/^[\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 wc(a){return K2.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function va(){}var xf=null;function yf(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ps=null,hs=null;function Cx(a){var s=Qe(a);if(s&&(a=s.stateNode)){var c=a[Ae]||null;e:switch(a=s.stateNode,s.type){case"input":if(hf(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),s=c.name,c.type==="radio"&&s!=null){for(c=a;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+_r(""+s)+'"][type="radio"]'),s=0;s<c.length;s++){var h=c[s];if(h!==a&&h.form===a.form){var x=h[Ae]||null;if(!x)throw Error(r(90));hf(h,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(s=0;s<c.length;s++)h=c[s],h.form===a.form&&vc(h)}break e;case"textarea":kx(a,c.value,c.defaultValue);break e;case"select":s=c.value,s!=null&&ds(a,!!c.multiple,s,!1)}}}var bf=!1;function Ex(a,s,c){if(bf)return a(s,c);bf=!0;try{var h=a(s);return h}finally{if(bf=!1,(ps!==null||hs!==null)&&(cu(),ps&&(s=ps,a=hs,hs=ps=null,Cx(s),a)))for(s=0;s<a.length;s++)Cx(a[s])}}function xo(a,s){var c=a.stateNode;if(c===null)return null;var h=c[Ae]||null;if(h===null)return null;c=h[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;break e;default:a=!1}if(a)return null;if(c&&typeof c!="function")throw Error(r(231,s,typeof c));return c}var _a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vf=!1;if(_a)try{var yo={};Object.defineProperty(yo,"passive",{get:function(){vf=!0}}),window.addEventListener("test",yo,yo),window.removeEventListener("test",yo,yo)}catch{vf=!1}var Xa=null,_f=null,kc=null;function Ax(){if(kc)return kc;var a,s=_f,c=s.length,h,x="value"in Xa?Xa.value:Xa.textContent,v=x.length;for(a=0;a<c&&s[a]===x[a];a++);var N=c-a;for(h=1;h<=N&&s[c-h]===x[v-h];h++);return kc=x.slice(a,1<h?1-h:void 0)}function Sc(a){var s=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&s===13&&(a=13)):a=s,a===10&&(a=13),32<=a||a===13?a:0}function jc(){return!0}function Tx(){return!1}function Xn(a){function s(c,h,x,v,N){this._reactName=c,this._targetInst=x,this.type=h,this.nativeEvent=v,this.target=N,this.currentTarget=null;for(var L in a)a.hasOwnProperty(L)&&(c=a[L],this[L]=c?c(v):v[L]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?jc:Tx,this.isPropagationStopped=Tx,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=jc)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=jc)},persist:function(){},isPersistent:jc}),s}var Ai={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nc=Xn(Ai),bo=g({},Ai,{view:0,detail:0}),X2=Xn(bo),wf,kf,vo,Cc=g({},bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jf,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==vo&&(vo&&a.type==="mousemove"?(wf=a.screenX-vo.screenX,kf=a.screenY-vo.screenY):kf=wf=0,vo=a),wf)},movementY:function(a){return"movementY"in a?a.movementY:kf}}),Rx=Xn(Cc),Q2=g({},Cc,{dataTransfer:0}),Z2=Xn(Q2),W2=g({},bo,{relatedTarget:0}),Sf=Xn(W2),J2=g({},Ai,{animationName:0,elapsedTime:0,pseudoElement:0}),ej=Xn(J2),tj=g({},Ai,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),nj=Xn(tj),rj=g({},Ai,{data:0}),Lx=Xn(rj),aj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ij={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"},sj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oj(a){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(a):(a=sj[a])?!!s[a]:!1}function jf(){return oj}var lj=g({},bo,{key:function(a){if(a.key){var s=aj[a.key]||a.key;if(s!=="Unidentified")return s}return a.type==="keypress"?(a=Sc(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?ij[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jf,charCode:function(a){return a.type==="keypress"?Sc(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Sc(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),cj=Xn(lj),uj=g({},Cc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dx=Xn(uj),dj=g({},bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jf}),fj=Xn(dj),pj=g({},Ai,{propertyName:0,elapsedTime:0,pseudoElement:0}),hj=Xn(pj),mj=g({},Cc,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),gj=Xn(mj),xj=g({},Ai,{newState:0,oldState:0}),yj=Xn(xj),bj=[9,13,27,32],Nf=_a&&"CompositionEvent"in window,_o=null;_a&&"documentMode"in document&&(_o=document.documentMode);var vj=_a&&"TextEvent"in window&&!_o,Ox=_a&&(!Nf||_o&&8<_o&&11>=_o),Mx=" ",zx=!1;function Ix(a,s){switch(a){case"keyup":return bj.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $x(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var ms=!1;function _j(a,s){switch(a){case"compositionend":return $x(s);case"keypress":return s.which!==32?null:(zx=!0,Mx);case"textInput":return a=s.data,a===Mx&&zx?null:a;default:return null}}function wj(a,s){if(ms)return a==="compositionend"||!Nf&&Ix(a,s)?(a=Ax(),kc=_f=Xa=null,ms=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Ox&&s.locale!=="ko"?null:s.data;default:return null}}var kj={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 Bx(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s==="input"?!!kj[a.type]:s==="textarea"}function Px(a,s,c,h){ps?hs?hs.push(h):hs=[h]:ps=h,s=gu(s,"onChange"),0<s.length&&(c=new Nc("onChange","change",null,c,h),a.push({event:c,listeners:s}))}var wo=null,ko=null;function Sj(a){w0(a,0)}function Ec(a){var s=$e(a);if(vc(s))return a}function Fx(a,s){if(a==="change")return s}var Ux=!1;if(_a){var Cf;if(_a){var Ef="oninput"in document;if(!Ef){var Hx=document.createElement("div");Hx.setAttribute("oninput","return;"),Ef=typeof Hx.oninput=="function"}Cf=Ef}else Cf=!1;Ux=Cf&&(!document.documentMode||9<document.documentMode)}function qx(){wo&&(wo.detachEvent("onpropertychange",Vx),ko=wo=null)}function Vx(a){if(a.propertyName==="value"&&Ec(ko)){var s=[];Px(s,ko,a,yf(a)),Ex(Sj,s)}}function jj(a,s,c){a==="focusin"?(qx(),wo=s,ko=c,wo.attachEvent("onpropertychange",Vx)):a==="focusout"&&qx()}function Nj(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Ec(ko)}function Cj(a,s){if(a==="click")return Ec(s)}function Ej(a,s){if(a==="input"||a==="change")return Ec(s)}function Aj(a,s){return a===s&&(a!==0||1/a===1/s)||a!==a&&s!==s}var sr=typeof Object.is=="function"?Object.is:Aj;function So(a,s){if(sr(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;var c=Object.keys(a),h=Object.keys(s);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var x=c[h];if(!en.call(s,x)||!sr(a[x],s[x]))return!1}return!0}function Gx(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Yx(a,s){var c=Gx(a);a=0;for(var h;c;){if(c.nodeType===3){if(h=a+c.textContent.length,a<=s&&h>=s)return{node:c,offset:s-a};a=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Gx(c)}}function Kx(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?Kx(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function Xx(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=_c(a.document);s instanceof a.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)a=s.contentWindow;else break;s=_c(a.document)}return s}function Af(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}var Tj=_a&&"documentMode"in document&&11>=document.documentMode,gs=null,Tf=null,jo=null,Rf=!1;function Qx(a,s,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Rf||gs==null||gs!==_c(h)||(h=gs,"selectionStart"in h&&Af(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),jo&&So(jo,h)||(jo=h,h=gu(Tf,"onSelect"),0<h.length&&(s=new Nc("onSelect","select",null,s,c),a.push({event:s,listeners:h}),s.target=gs)))}function Ti(a,s){var c={};return c[a.toLowerCase()]=s.toLowerCase(),c["Webkit"+a]="webkit"+s,c["Moz"+a]="moz"+s,c}var xs={animationend:Ti("Animation","AnimationEnd"),animationiteration:Ti("Animation","AnimationIteration"),animationstart:Ti("Animation","AnimationStart"),transitionrun:Ti("Transition","TransitionRun"),transitionstart:Ti("Transition","TransitionStart"),transitioncancel:Ti("Transition","TransitionCancel"),transitionend:Ti("Transition","TransitionEnd")},Lf={},Zx={};_a&&(Zx=document.createElement("div").style,"AnimationEvent"in window||(delete xs.animationend.animation,delete xs.animationiteration.animation,delete xs.animationstart.animation),"TransitionEvent"in window||delete xs.transitionend.transition);function Ri(a){if(Lf[a])return Lf[a];if(!xs[a])return a;var s=xs[a],c;for(c in s)if(s.hasOwnProperty(c)&&c in Zx)return Lf[a]=s[c];return a}var Wx=Ri("animationend"),Jx=Ri("animationiteration"),ey=Ri("animationstart"),Rj=Ri("transitionrun"),Lj=Ri("transitionstart"),Dj=Ri("transitioncancel"),ty=Ri("transitionend"),ny=new Map,Df="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(" ");Df.push("scrollEnd");function $r(a,s){ny.set(a,s),vn(s,[a])}var Ac=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},wr=[],ys=0,Of=0;function Tc(){for(var a=ys,s=Of=ys=0;s<a;){var c=wr[s];wr[s++]=null;var h=wr[s];wr[s++]=null;var x=wr[s];wr[s++]=null;var v=wr[s];if(wr[s++]=null,h!==null&&x!==null){var N=h.pending;N===null?x.next=x:(x.next=N.next,N.next=x),h.pending=x}v!==0&&ry(c,x,v)}}function Rc(a,s,c,h){wr[ys++]=a,wr[ys++]=s,wr[ys++]=c,wr[ys++]=h,Of|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function Mf(a,s,c,h){return Rc(a,s,c,h),Lc(a)}function Li(a,s){return Rc(a,null,null,s),Lc(a)}function ry(a,s,c){a.lanes|=c;var h=a.alternate;h!==null&&(h.lanes|=c);for(var x=!1,v=a.return;v!==null;)v.childLanes|=c,h=v.alternate,h!==null&&(h.childLanes|=c),v.tag===22&&(a=v.stateNode,a===null||a._visibility&1||(x=!0)),a=v,v=v.return;return a.tag===3?(v=a.stateNode,x&&s!==null&&(x=31-lt(c),a=v.hiddenUpdates,h=a[x],h===null?a[x]=[s]:h.push(s),s.lane=c|536870912),v):null}function Lc(a){if(50<Yo)throw Yo=0,qp=null,Error(r(185));for(var s=a.return;s!==null;)a=s,s=a.return;return a.tag===3?a.stateNode:null}var bs={};function Oj(a,s,c,h){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function or(a,s,c,h){return new Oj(a,s,c,h)}function zf(a){return a=a.prototype,!(!a||!a.isReactComponent)}function wa(a,s){var c=a.alternate;return c===null?(c=or(a.tag,s,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=s,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=a.flags&65011712,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,s=a.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c.refCleanup=a.refCleanup,c}function ay(a,s){a.flags&=65011714;var c=a.alternate;return c===null?(a.childLanes=0,a.lanes=s,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,s=c.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),a}function Dc(a,s,c,h,x,v){var N=0;if(h=a,typeof a=="function")zf(a)&&(N=1);else if(typeof a=="string")N=BN(a,c,se.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case F:return a=or(31,c,s,x),a.elementType=F,a.lanes=v,a;case k:return Di(c.children,x,v,s);case j:N=8,x|=24;break;case S:return a=or(12,c,s,x|2),a.elementType=S,a.lanes=v,a;case D:return a=or(13,c,s,x),a.elementType=D,a.lanes=v,a;case A:return a=or(19,c,s,x),a.elementType=A,a.lanes=v,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case C:N=10;break e;case E:N=9;break e;case z:N=11;break e;case P:N=14;break e;case T:N=16,h=null;break e}N=29,c=Error(r(130,a===null?"null":typeof a,"")),h=null}return s=or(N,c,s,x),s.elementType=a,s.type=h,s.lanes=v,s}function Di(a,s,c,h){return a=or(7,a,h,s),a.lanes=c,a}function If(a,s,c){return a=or(6,a,null,s),a.lanes=c,a}function iy(a){var s=or(18,null,null,0);return s.stateNode=a,s}function $f(a,s,c){return s=or(4,a.children!==null?a.children:[],a.key,s),s.lanes=c,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}var sy=new WeakMap;function kr(a,s){if(typeof a=="object"&&a!==null){var c=sy.get(a);return c!==void 0?c:(s={value:a,source:s,stack:zt(s)},sy.set(a,s),s)}return{value:a,source:s,stack:zt(s)}}var vs=[],_s=0,Oc=null,No=0,Sr=[],jr=0,Qa=null,Qr=1,Zr="";function ka(a,s){vs[_s++]=No,vs[_s++]=Oc,Oc=a,No=s}function oy(a,s,c){Sr[jr++]=Qr,Sr[jr++]=Zr,Sr[jr++]=Qa,Qa=a;var h=Qr;a=Zr;var x=32-lt(h)-1;h&=~(1<<x),c+=1;var v=32-lt(s)+x;if(30<v){var N=x-x%5;v=(h&(1<<N)-1).toString(32),h>>=N,x-=N,Qr=1<<32-lt(s)+x|c<<x|h,Zr=v+a}else Qr=1<<v|c<<x|h,Zr=a}function Bf(a){a.return!==null&&(ka(a,1),oy(a,1,0))}function Pf(a){for(;a===Oc;)Oc=vs[--_s],vs[_s]=null,No=vs[--_s],vs[_s]=null;for(;a===Qa;)Qa=Sr[--jr],Sr[jr]=null,Zr=Sr[--jr],Sr[jr]=null,Qr=Sr[--jr],Sr[jr]=null}function ly(a,s){Sr[jr++]=Qr,Sr[jr++]=Zr,Sr[jr++]=Qa,Qr=s.id,Zr=s.overflow,Qa=a}var jn=null,qt=null,mt=!1,Za=null,Nr=!1,Ff=Error(r(519));function Wa(a){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Co(kr(s,a)),Ff}function cy(a){var s=a.stateNode,c=a.type,h=a.memoizedProps;switch(s[Ce]=a,s[Ae]=h,c){case"dialog":ut("cancel",s),ut("close",s);break;case"iframe":case"object":case"embed":ut("load",s);break;case"video":case"audio":for(c=0;c<Xo.length;c++)ut(Xo[c],s);break;case"source":ut("error",s);break;case"img":case"image":case"link":ut("error",s),ut("load",s);break;case"details":ut("toggle",s);break;case"input":ut("invalid",s),wx(s,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":ut("invalid",s);break;case"textarea":ut("invalid",s),Sx(s,h.value,h.defaultValue,h.children)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||s.textContent===""+c||h.suppressHydrationWarning===!0||N0(s.textContent,c)?(h.popover!=null&&(ut("beforetoggle",s),ut("toggle",s)),h.onScroll!=null&&ut("scroll",s),h.onScrollEnd!=null&&ut("scrollend",s),h.onClick!=null&&(s.onclick=va),s=!0):s=!1,s||Wa(a,!0)}function uy(a){for(jn=a.return;jn;)switch(jn.tag){case 5:case 31:case 13:Nr=!1;return;case 27:case 3:Nr=!0;return;default:jn=jn.return}}function ws(a){if(a!==jn)return!1;if(!mt)return uy(a),mt=!0,!1;var s=a.tag,c;if((c=s!==3&&s!==27)&&((c=s===5)&&(c=a.type,c=!(c!=="form"&&c!=="button")||ih(a.type,a.memoizedProps)),c=!c),c&&qt&&Wa(a),uy(a),s===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));qt=M0(a)}else if(s===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));qt=M0(a)}else s===27?(s=qt,fi(a.type)?(a=uh,uh=null,qt=a):qt=s):qt=jn?Er(a.stateNode.nextSibling):null;return!0}function Oi(){qt=jn=null,mt=!1}function Uf(){var a=Za;return a!==null&&(Jn===null?Jn=a:Jn.push.apply(Jn,a),Za=null),a}function Co(a){Za===null?Za=[a]:Za.push(a)}var Hf=B(null),Mi=null,Sa=null;function Ja(a,s,c){O(Hf,s._currentValue),s._currentValue=c}function ja(a){a._currentValue=Hf.current,K(Hf)}function qf(a,s,c){for(;a!==null;){var h=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),a===c)break;a=a.return}}function Vf(a,s,c,h){var x=a.child;for(x!==null&&(x.return=a);x!==null;){var v=x.dependencies;if(v!==null){var N=x.child;v=v.firstContext;e:for(;v!==null;){var L=v;v=x;for(var q=0;q<s.length;q++)if(L.context===s[q]){v.lanes|=c,L=v.alternate,L!==null&&(L.lanes|=c),qf(v.return,c,a),h||(N=null);break e}v=L.next}}else if(x.tag===18){if(N=x.return,N===null)throw Error(r(341));N.lanes|=c,v=N.alternate,v!==null&&(v.lanes|=c),qf(N,c,a),N=null}else N=x.child;if(N!==null)N.return=x;else for(N=x;N!==null;){if(N===a){N=null;break}if(x=N.sibling,x!==null){x.return=N.return,N=x;break}N=N.return}x=N}}function ks(a,s,c,h){a=null;for(var x=s,v=!1;x!==null;){if(!v){if((x.flags&524288)!==0)v=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var N=x.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var L=x.type;sr(x.pendingProps.value,N.value)||(a!==null?a.push(L):a=[L])}}else if(x===Ee.current){if(N=x.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(a!==null?a.push(el):a=[el])}x=x.return}a!==null&&Vf(s,a,c,h),s.flags|=262144}function Mc(a){for(a=a.firstContext;a!==null;){if(!sr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function zi(a){Mi=a,Sa=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Nn(a){return dy(Mi,a)}function zc(a,s){return Mi===null&&zi(a),dy(a,s)}function dy(a,s){var c=s._currentValue;if(s={context:s,memoizedValue:c,next:null},Sa===null){if(a===null)throw Error(r(308));Sa=s,a.dependencies={lanes:0,firstContext:s},a.flags|=524288}else Sa=Sa.next=s;return c}var Mj=typeof AbortController<"u"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(c,h){a.push(h)}};this.abort=function(){s.aborted=!0,a.forEach(function(c){return c()})}},zj=e.unstable_scheduleCallback,Ij=e.unstable_NormalPriority,cn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gf(){return{controller:new Mj,data:new Map,refCount:0}}function Eo(a){a.refCount--,a.refCount===0&&zj(Ij,function(){a.controller.abort()})}var Ao=null,Yf=0,Ss=0,js=null;function $j(a,s){if(Ao===null){var c=Ao=[];Yf=0,Ss=Qp(),js={status:"pending",value:void 0,then:function(h){c.push(h)}}}return Yf++,s.then(fy,fy),s}function fy(){if(--Yf===0&&Ao!==null){js!==null&&(js.status="fulfilled");var a=Ao;Ao=null,Ss=0,js=null;for(var s=0;s<a.length;s++)(0,a[s])()}}function Bj(a,s){var c=[],h={status:"pending",value:null,reason:null,then:function(x){c.push(x)}};return a.then(function(){h.status="fulfilled",h.value=s;for(var x=0;x<c.length;x++)(0,c[x])(s)},function(x){for(h.status="rejected",h.reason=x,x=0;x<c.length;x++)(0,c[x])(void 0)}),h}var py=I.S;I.S=function(a,s){Qb=Xt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&$j(a,s),py!==null&&py(a,s)};var Ii=B(null);function Kf(){var a=Ii.current;return a!==null?a:Dt.pooledCache}function Ic(a,s){s===null?O(Ii,Ii.current):O(Ii,s.pool)}function hy(){var a=Kf();return a===null?null:{parent:cn._currentValue,pool:a}}var Ns=Error(r(460)),Xf=Error(r(474)),$c=Error(r(542)),Bc={then:function(){}};function my(a){return a=a.status,a==="fulfilled"||a==="rejected"}function gy(a,s,c){switch(c=a[c],c===void 0?a.push(s):c!==s&&(s.then(va,va),s=c),s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,yy(a),a;default:if(typeof s.status=="string")s.then(va,va);else{if(a=Dt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=s,a.status="pending",a.then(function(h){if(s.status==="pending"){var x=s;x.status="fulfilled",x.value=h}},function(h){if(s.status==="pending"){var x=s;x.status="rejected",x.reason=h}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,yy(a),a}throw Bi=s,Ns}}function $i(a){try{var s=a._init;return s(a._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Bi=c,Ns):c}}var Bi=null;function xy(){if(Bi===null)throw Error(r(459));var a=Bi;return Bi=null,a}function yy(a){if(a===Ns||a===$c)throw Error(r(483))}var Cs=null,To=0;function Pc(a){var s=To;return To+=1,Cs===null&&(Cs=[]),gy(Cs,a,s)}function Ro(a,s){s=s.props.ref,a.ref=s!==void 0?s:null}function Fc(a,s){throw s.$$typeof===y?Error(r(525)):(a=Object.prototype.toString.call(s),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":a)))}function by(a){function s(W,Y){if(a){var J=W.deletions;J===null?(W.deletions=[Y],W.flags|=16):J.push(Y)}}function c(W,Y){if(!a)return null;for(;Y!==null;)s(W,Y),Y=Y.sibling;return null}function h(W){for(var Y=new Map;W!==null;)W.key!==null?Y.set(W.key,W):Y.set(W.index,W),W=W.sibling;return Y}function x(W,Y){return W=wa(W,Y),W.index=0,W.sibling=null,W}function v(W,Y,J){return W.index=J,a?(J=W.alternate,J!==null?(J=J.index,J<Y?(W.flags|=67108866,Y):J):(W.flags|=67108866,Y)):(W.flags|=1048576,Y)}function N(W){return a&&W.alternate===null&&(W.flags|=67108866),W}function L(W,Y,J,me){return Y===null||Y.tag!==6?(Y=If(J,W.mode,me),Y.return=W,Y):(Y=x(Y,J),Y.return=W,Y)}function q(W,Y,J,me){var Ke=J.type;return Ke===k?ce(W,Y,J.props.children,me,J.key):Y!==null&&(Y.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===T&&$i(Ke)===Y.type)?(Y=x(Y,J.props),Ro(Y,J),Y.return=W,Y):(Y=Dc(J.type,J.key,J.props,null,W.mode,me),Ro(Y,J),Y.return=W,Y)}function ee(W,Y,J,me){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==J.containerInfo||Y.stateNode.implementation!==J.implementation?(Y=$f(J,W.mode,me),Y.return=W,Y):(Y=x(Y,J.children||[]),Y.return=W,Y)}function ce(W,Y,J,me,Ke){return Y===null||Y.tag!==7?(Y=Di(J,W.mode,me,Ke),Y.return=W,Y):(Y=x(Y,J),Y.return=W,Y)}function xe(W,Y,J){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=If(""+Y,W.mode,J),Y.return=W,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case b:return J=Dc(Y.type,Y.key,Y.props,null,W.mode,J),Ro(J,Y),J.return=W,J;case w:return Y=$f(Y,W.mode,J),Y.return=W,Y;case T:return Y=$i(Y),xe(W,Y,J)}if(U(Y)||Q(Y))return Y=Di(Y,W.mode,J,null),Y.return=W,Y;if(typeof Y.then=="function")return xe(W,Pc(Y),J);if(Y.$$typeof===C)return xe(W,zc(W,Y),J);Fc(W,Y)}return null}function ne(W,Y,J,me){var Ke=Y!==null?Y.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Ke!==null?null:L(W,Y,""+J,me);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return J.key===Ke?q(W,Y,J,me):null;case w:return J.key===Ke?ee(W,Y,J,me):null;case T:return J=$i(J),ne(W,Y,J,me)}if(U(J)||Q(J))return Ke!==null?null:ce(W,Y,J,me,null);if(typeof J.then=="function")return ne(W,Y,Pc(J),me);if(J.$$typeof===C)return ne(W,Y,zc(W,J),me);Fc(W,J)}return null}function le(W,Y,J,me,Ke){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return W=W.get(J)||null,L(Y,W,""+me,Ke);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case b:return W=W.get(me.key===null?J:me.key)||null,q(Y,W,me,Ke);case w:return W=W.get(me.key===null?J:me.key)||null,ee(Y,W,me,Ke);case T:return me=$i(me),le(W,Y,J,me,Ke)}if(U(me)||Q(me))return W=W.get(J)||null,ce(Y,W,me,Ke,null);if(typeof me.then=="function")return le(W,Y,J,Pc(me),Ke);if(me.$$typeof===C)return le(W,Y,J,zc(Y,me),Ke);Fc(Y,me)}return null}function Oe(W,Y,J,me){for(var Ke=null,bt=null,Be=Y,rt=Y=0,ht=null;Be!==null&&rt<J.length;rt++){Be.index>rt?(ht=Be,Be=null):ht=Be.sibling;var vt=ne(W,Be,J[rt],me);if(vt===null){Be===null&&(Be=ht);break}a&&Be&&vt.alternate===null&&s(W,Be),Y=v(vt,Y,rt),bt===null?Ke=vt:bt.sibling=vt,bt=vt,Be=ht}if(rt===J.length)return c(W,Be),mt&&ka(W,rt),Ke;if(Be===null){for(;rt<J.length;rt++)Be=xe(W,J[rt],me),Be!==null&&(Y=v(Be,Y,rt),bt===null?Ke=Be:bt.sibling=Be,bt=Be);return mt&&ka(W,rt),Ke}for(Be=h(Be);rt<J.length;rt++)ht=le(Be,W,rt,J[rt],me),ht!==null&&(a&&ht.alternate!==null&&Be.delete(ht.key===null?rt:ht.key),Y=v(ht,Y,rt),bt===null?Ke=ht:bt.sibling=ht,bt=ht);return a&&Be.forEach(function(xi){return s(W,xi)}),mt&&ka(W,rt),Ke}function We(W,Y,J,me){if(J==null)throw Error(r(151));for(var Ke=null,bt=null,Be=Y,rt=Y=0,ht=null,vt=J.next();Be!==null&&!vt.done;rt++,vt=J.next()){Be.index>rt?(ht=Be,Be=null):ht=Be.sibling;var xi=ne(W,Be,vt.value,me);if(xi===null){Be===null&&(Be=ht);break}a&&Be&&xi.alternate===null&&s(W,Be),Y=v(xi,Y,rt),bt===null?Ke=xi:bt.sibling=xi,bt=xi,Be=ht}if(vt.done)return c(W,Be),mt&&ka(W,rt),Ke;if(Be===null){for(;!vt.done;rt++,vt=J.next())vt=xe(W,vt.value,me),vt!==null&&(Y=v(vt,Y,rt),bt===null?Ke=vt:bt.sibling=vt,bt=vt);return mt&&ka(W,rt),Ke}for(Be=h(Be);!vt.done;rt++,vt=J.next())vt=le(Be,W,rt,vt.value,me),vt!==null&&(a&&vt.alternate!==null&&Be.delete(vt.key===null?rt:vt.key),Y=v(vt,Y,rt),bt===null?Ke=vt:bt.sibling=vt,bt=vt);return a&&Be.forEach(function(QN){return s(W,QN)}),mt&&ka(W,rt),Ke}function Et(W,Y,J,me){if(typeof J=="object"&&J!==null&&J.type===k&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case b:e:{for(var Ke=J.key;Y!==null;){if(Y.key===Ke){if(Ke=J.type,Ke===k){if(Y.tag===7){c(W,Y.sibling),me=x(Y,J.props.children),me.return=W,W=me;break e}}else if(Y.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===T&&$i(Ke)===Y.type){c(W,Y.sibling),me=x(Y,J.props),Ro(me,J),me.return=W,W=me;break e}c(W,Y);break}else s(W,Y);Y=Y.sibling}J.type===k?(me=Di(J.props.children,W.mode,me,J.key),me.return=W,W=me):(me=Dc(J.type,J.key,J.props,null,W.mode,me),Ro(me,J),me.return=W,W=me)}return N(W);case w:e:{for(Ke=J.key;Y!==null;){if(Y.key===Ke)if(Y.tag===4&&Y.stateNode.containerInfo===J.containerInfo&&Y.stateNode.implementation===J.implementation){c(W,Y.sibling),me=x(Y,J.children||[]),me.return=W,W=me;break e}else{c(W,Y);break}else s(W,Y);Y=Y.sibling}me=$f(J,W.mode,me),me.return=W,W=me}return N(W);case T:return J=$i(J),Et(W,Y,J,me)}if(U(J))return Oe(W,Y,J,me);if(Q(J)){if(Ke=Q(J),typeof Ke!="function")throw Error(r(150));return J=Ke.call(J),We(W,Y,J,me)}if(typeof J.then=="function")return Et(W,Y,Pc(J),me);if(J.$$typeof===C)return Et(W,Y,zc(W,J),me);Fc(W,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,Y!==null&&Y.tag===6?(c(W,Y.sibling),me=x(Y,J),me.return=W,W=me):(c(W,Y),me=If(J,W.mode,me),me.return=W,W=me),N(W)):c(W,Y)}return function(W,Y,J,me){try{To=0;var Ke=Et(W,Y,J,me);return Cs=null,Ke}catch(Be){if(Be===Ns||Be===$c)throw Be;var bt=or(29,Be,null,W.mode);return bt.lanes=me,bt.return=W,bt}}}var Pi=by(!0),vy=by(!1),ei=!1;function Qf(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zf(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ti(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ni(a,s,c){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(wt&2)!==0){var x=h.pending;return x===null?s.next=s:(s.next=x.next,x.next=s),h.pending=s,s=Lc(a),ry(a,null,c),s}return Rc(a,h,s,c),Lc(a)}function Lo(a,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194048)!==0)){var h=s.lanes;h&=a.pendingLanes,c|=h,s.lanes=c,Ka(a,c)}}function Wf(a,s){var c=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var x=null,v=null;if(c=c.firstBaseUpdate,c!==null){do{var N={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};v===null?x=v=N:v=v.next=N,c=c.next}while(c!==null);v===null?x=v=s:v=v.next=s}else x=v=s;c={baseState:h.baseState,firstBaseUpdate:x,lastBaseUpdate:v,shared:h.shared,callbacks:h.callbacks},a.updateQueue=c;return}a=c.lastBaseUpdate,a===null?c.firstBaseUpdate=s:a.next=s,c.lastBaseUpdate=s}var Jf=!1;function Do(){if(Jf){var a=js;if(a!==null)throw a}}function Oo(a,s,c,h){Jf=!1;var x=a.updateQueue;ei=!1;var v=x.firstBaseUpdate,N=x.lastBaseUpdate,L=x.shared.pending;if(L!==null){x.shared.pending=null;var q=L,ee=q.next;q.next=null,N===null?v=ee:N.next=ee,N=q;var ce=a.alternate;ce!==null&&(ce=ce.updateQueue,L=ce.lastBaseUpdate,L!==N&&(L===null?ce.firstBaseUpdate=ee:L.next=ee,ce.lastBaseUpdate=q))}if(v!==null){var xe=x.baseState;N=0,ce=ee=q=null,L=v;do{var ne=L.lane&-536870913,le=ne!==L.lane;if(le?(pt&ne)===ne:(h&ne)===ne){ne!==0&&ne===Ss&&(Jf=!0),ce!==null&&(ce=ce.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Oe=a,We=L;ne=s;var Et=c;switch(We.tag){case 1:if(Oe=We.payload,typeof Oe=="function"){xe=Oe.call(Et,xe,ne);break e}xe=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=We.payload,ne=typeof Oe=="function"?Oe.call(Et,xe,ne):Oe,ne==null)break e;xe=g({},xe,ne);break e;case 2:ei=!0}}ne=L.callback,ne!==null&&(a.flags|=64,le&&(a.flags|=8192),le=x.callbacks,le===null?x.callbacks=[ne]:le.push(ne))}else le={lane:ne,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ce===null?(ee=ce=le,q=xe):ce=ce.next=le,N|=ne;if(L=L.next,L===null){if(L=x.shared.pending,L===null)break;le=L,L=le.next,le.next=null,x.lastBaseUpdate=le,x.shared.pending=null}}while(!0);ce===null&&(q=xe),x.baseState=q,x.firstBaseUpdate=ee,x.lastBaseUpdate=ce,v===null&&(x.shared.lanes=0),oi|=N,a.lanes=N,a.memoizedState=xe}}function _y(a,s){if(typeof a!="function")throw Error(r(191,a));a.call(s)}function wy(a,s){var c=a.callbacks;if(c!==null)for(a.callbacks=null,a=0;a<c.length;a++)_y(c[a],s)}var Es=B(null),Uc=B(0);function ky(a,s){a=Oa,O(Uc,a),O(Es,s),Oa=a|s.baseLanes}function ep(){O(Uc,Oa),O(Es,Es.current)}function tp(){Oa=Uc.current,K(Es),K(Uc)}var lr=B(null),Cr=null;function ri(a){var s=a.alternate;O(nn,nn.current&1),O(lr,a),Cr===null&&(s===null||Es.current!==null||s.memoizedState!==null)&&(Cr=a)}function np(a){O(nn,nn.current),O(lr,a),Cr===null&&(Cr=a)}function Sy(a){a.tag===22?(O(nn,nn.current),O(lr,a),Cr===null&&(Cr=a)):ai()}function ai(){O(nn,nn.current),O(lr,lr.current)}function cr(a){K(lr),Cr===a&&(Cr=null),K(nn)}var nn=B(0);function Hc(a){for(var s=a;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||lh(c)||ch(c)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Na=0,nt=null,Nt=null,un=null,qc=!1,As=!1,Fi=!1,Vc=0,Mo=0,Ts=null,Pj=0;function Zt(){throw Error(r(321))}function rp(a,s){if(s===null)return!1;for(var c=0;c<s.length&&c<a.length;c++)if(!sr(a[c],s[c]))return!1;return!0}function ap(a,s,c,h,x,v){return Na=v,nt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,I.H=a===null||a.memoizedState===null?ob:bp,Fi=!1,v=c(h,x),Fi=!1,As&&(v=Ny(s,c,h,x)),jy(a),v}function jy(a){I.H=$o;var s=Nt!==null&&Nt.next!==null;if(Na=0,un=Nt=nt=null,qc=!1,Mo=0,Ts=null,s)throw Error(r(300));a===null||dn||(a=a.dependencies,a!==null&&Mc(a)&&(dn=!0))}function Ny(a,s,c,h){nt=a;var x=0;do{if(As&&(Ts=null),Mo=0,As=!1,25<=x)throw Error(r(301));if(x+=1,un=Nt=null,a.updateQueue!=null){var v=a.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}I.H=lb,v=s(c,h)}while(As);return v}function Fj(){var a=I.H,s=a.useState()[0];return s=typeof s.then=="function"?zo(s):s,a=a.useState()[0],(Nt!==null?Nt.memoizedState:null)!==a&&(nt.flags|=1024),s}function ip(){var a=Vc!==0;return Vc=0,a}function sp(a,s,c){s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~c}function op(a){if(qc){for(a=a.memoizedState;a!==null;){var s=a.queue;s!==null&&(s.pending=null),a=a.next}qc=!1}Na=0,un=Nt=nt=null,As=!1,Mo=Vc=0,Ts=null}function Un(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?nt.memoizedState=un=a:un=un.next=a,un}function rn(){if(Nt===null){var a=nt.alternate;a=a!==null?a.memoizedState:null}else a=Nt.next;var s=un===null?nt.memoizedState:un.next;if(s!==null)un=s,Nt=a;else{if(a===null)throw nt.alternate===null?Error(r(467)):Error(r(310));Nt=a,a={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},un===null?nt.memoizedState=un=a:un=un.next=a}return un}function Gc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zo(a){var s=Mo;return Mo+=1,Ts===null&&(Ts=[]),a=gy(Ts,a,s),s=nt,(un===null?s.memoizedState:un.next)===null&&(s=s.alternate,I.H=s===null||s.memoizedState===null?ob:bp),a}function Yc(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return zo(a);if(a.$$typeof===C)return Nn(a)}throw Error(r(438,String(a)))}function lp(a){var s=null,c=nt.updateQueue;if(c!==null&&(s=c.memoCache),s==null){var h=nt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(s={data:h.data.map(function(x){return x.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),c===null&&(c=Gc(),nt.updateQueue=c),c.memoCache=s,c=s.data[s.index],c===void 0)for(c=s.data[s.index]=Array(a),h=0;h<a;h++)c[h]=M;return s.index++,c}function Ca(a,s){return typeof s=="function"?s(a):s}function Kc(a){var s=rn();return cp(s,Nt,a)}function cp(a,s,c){var h=a.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=c;var x=a.baseQueue,v=h.pending;if(v!==null){if(x!==null){var N=x.next;x.next=v.next,v.next=N}s.baseQueue=x=v,h.pending=null}if(v=a.baseState,x===null)a.memoizedState=v;else{s=x.next;var L=N=null,q=null,ee=s,ce=!1;do{var xe=ee.lane&-536870913;if(xe!==ee.lane?(pt&xe)===xe:(Na&xe)===xe){var ne=ee.revertLane;if(ne===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),xe===Ss&&(ce=!0);else if((Na&ne)===ne){ee=ee.next,ne===Ss&&(ce=!0);continue}else xe={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},q===null?(L=q=xe,N=v):q=q.next=xe,nt.lanes|=ne,oi|=ne;xe=ee.action,Fi&&c(v,xe),v=ee.hasEagerState?ee.eagerState:c(v,xe)}else ne={lane:xe,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},q===null?(L=q=ne,N=v):q=q.next=ne,nt.lanes|=xe,oi|=xe;ee=ee.next}while(ee!==null&&ee!==s);if(q===null?N=v:q.next=L,!sr(v,a.memoizedState)&&(dn=!0,ce&&(c=js,c!==null)))throw c;a.memoizedState=v,a.baseState=N,a.baseQueue=q,h.lastRenderedState=v}return x===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function up(a){var s=rn(),c=s.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=a;var h=c.dispatch,x=c.pending,v=s.memoizedState;if(x!==null){c.pending=null;var N=x=x.next;do v=a(v,N.action),N=N.next;while(N!==x);sr(v,s.memoizedState)||(dn=!0),s.memoizedState=v,s.baseQueue===null&&(s.baseState=v),c.lastRenderedState=v}return[v,h]}function Cy(a,s,c){var h=nt,x=rn(),v=mt;if(v){if(c===void 0)throw Error(r(407));c=c()}else c=s();var N=!sr((Nt||x).memoizedState,c);if(N&&(x.memoizedState=c,dn=!0),x=x.queue,pp(Ty.bind(null,h,x,a),[a]),x.getSnapshot!==s||N||un!==null&&un.memoizedState.tag&1){if(h.flags|=2048,Rs(9,{destroy:void 0},Ay.bind(null,h,x,c,s),null),Dt===null)throw Error(r(349));v||(Na&127)!==0||Ey(h,s,c)}return c}function Ey(a,s,c){a.flags|=16384,a={getSnapshot:s,value:c},s=nt.updateQueue,s===null?(s=Gc(),nt.updateQueue=s,s.stores=[a]):(c=s.stores,c===null?s.stores=[a]:c.push(a))}function Ay(a,s,c,h){s.value=c,s.getSnapshot=h,Ry(s)&&Ly(a)}function Ty(a,s,c){return c(function(){Ry(s)&&Ly(a)})}function Ry(a){var s=a.getSnapshot;a=a.value;try{var c=s();return!sr(a,c)}catch{return!0}}function Ly(a){var s=Li(a,2);s!==null&&er(s,a,2)}function dp(a){var s=Un();if(typeof a=="function"){var c=a;if(a=c(),Fi){yt(!0);try{c()}finally{yt(!1)}}}return s.memoizedState=s.baseState=a,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:a},s}function Dy(a,s,c,h){return a.baseState=c,cp(a,Nt,typeof h=="function"?h:Ca)}function Uj(a,s,c,h,x){if(Zc(a))throw Error(r(485));if(a=s.action,a!==null){var v={payload:x,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){v.listeners.push(N)}};I.T!==null?c(!0):v.isTransition=!1,h(v),c=s.pending,c===null?(v.next=s.pending=v,Oy(s,v)):(v.next=c.next,s.pending=c.next=v)}}function Oy(a,s){var c=s.action,h=s.payload,x=a.state;if(s.isTransition){var v=I.T,N={};I.T=N;try{var L=c(x,h),q=I.S;q!==null&&q(N,L),My(a,s,L)}catch(ee){fp(a,s,ee)}finally{v!==null&&N.types!==null&&(v.types=N.types),I.T=v}}else try{v=c(x,h),My(a,s,v)}catch(ee){fp(a,s,ee)}}function My(a,s,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){zy(a,s,h)},function(h){return fp(a,s,h)}):zy(a,s,c)}function zy(a,s,c){s.status="fulfilled",s.value=c,Iy(s),a.state=c,s=a.pending,s!==null&&(c=s.next,c===s?a.pending=null:(c=c.next,s.next=c,Oy(a,c)))}function fp(a,s,c){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do s.status="rejected",s.reason=c,Iy(s),s=s.next;while(s!==h)}a.action=null}function Iy(a){a=a.listeners;for(var s=0;s<a.length;s++)(0,a[s])()}function $y(a,s){return s}function By(a,s){if(mt){var c=Dt.formState;if(c!==null){e:{var h=nt;if(mt){if(qt){t:{for(var x=qt,v=Nr;x.nodeType!==8;){if(!v){x=null;break t}if(x=Er(x.nextSibling),x===null){x=null;break t}}v=x.data,x=v==="F!"||v==="F"?x:null}if(x){qt=Er(x.nextSibling),h=x.data==="F!";break e}}Wa(h)}h=!1}h&&(s=c[0])}}return c=Un(),c.memoizedState=c.baseState=s,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$y,lastRenderedState:s},c.queue=h,c=ab.bind(null,nt,h),h.dispatch=c,h=dp(!1),v=yp.bind(null,nt,!1,h.queue),h=Un(),x={state:s,dispatch:null,action:a,pending:null},h.queue=x,c=Uj.bind(null,nt,x,v,c),x.dispatch=c,h.memoizedState=a,[s,c,!1]}function Py(a){var s=rn();return Fy(s,Nt,a)}function Fy(a,s,c){if(s=cp(a,s,$y)[0],a=Kc(Ca)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var h=zo(s)}catch(N){throw N===Ns?$c:N}else h=s;s=rn();var x=s.queue,v=x.dispatch;return c!==s.memoizedState&&(nt.flags|=2048,Rs(9,{destroy:void 0},Hj.bind(null,x,c),null)),[h,v,a]}function Hj(a,s){a.action=s}function Uy(a){var s=rn(),c=Nt;if(c!==null)return Fy(s,c,a);rn(),s=s.memoizedState,c=rn();var h=c.queue.dispatch;return c.memoizedState=a,[s,h,!1]}function Rs(a,s,c,h){return a={tag:a,create:c,deps:h,inst:s,next:null},s=nt.updateQueue,s===null&&(s=Gc(),nt.updateQueue=s),c=s.lastEffect,c===null?s.lastEffect=a.next=a:(h=c.next,c.next=a,a.next=h,s.lastEffect=a),a}function Hy(){return rn().memoizedState}function Xc(a,s,c,h){var x=Un();nt.flags|=a,x.memoizedState=Rs(1|s,{destroy:void 0},c,h===void 0?null:h)}function Qc(a,s,c,h){var x=rn();h=h===void 0?null:h;var v=x.memoizedState.inst;Nt!==null&&h!==null&&rp(h,Nt.memoizedState.deps)?x.memoizedState=Rs(s,v,c,h):(nt.flags|=a,x.memoizedState=Rs(1|s,v,c,h))}function qy(a,s){Xc(8390656,8,a,s)}function pp(a,s){Qc(2048,8,a,s)}function qj(a){nt.flags|=4;var s=nt.updateQueue;if(s===null)s=Gc(),nt.updateQueue=s,s.events=[a];else{var c=s.events;c===null?s.events=[a]:c.push(a)}}function Vy(a){var s=rn().memoizedState;return qj({ref:s,nextImpl:a}),function(){if((wt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function Gy(a,s){return Qc(4,2,a,s)}function Yy(a,s){return Qc(4,4,a,s)}function Ky(a,s){if(typeof s=="function"){a=a();var c=s(a);return function(){typeof c=="function"?c():s(null)}}if(s!=null)return a=a(),s.current=a,function(){s.current=null}}function Xy(a,s,c){c=c!=null?c.concat([a]):null,Qc(4,4,Ky.bind(null,s,a),c)}function hp(){}function Qy(a,s){var c=rn();s=s===void 0?null:s;var h=c.memoizedState;return s!==null&&rp(s,h[1])?h[0]:(c.memoizedState=[a,s],a)}function Zy(a,s){var c=rn();s=s===void 0?null:s;var h=c.memoizedState;if(s!==null&&rp(s,h[1]))return h[0];if(h=a(),Fi){yt(!0);try{a()}finally{yt(!1)}}return c.memoizedState=[h,s],h}function mp(a,s,c){return c===void 0||(Na&1073741824)!==0&&(pt&261930)===0?a.memoizedState=s:(a.memoizedState=c,a=Wb(),nt.lanes|=a,oi|=a,c)}function Wy(a,s,c,h){return sr(c,s)?c:Es.current!==null?(a=mp(a,c,h),sr(a,s)||(dn=!0),a):(Na&42)===0||(Na&1073741824)!==0&&(pt&261930)===0?(dn=!0,a.memoizedState=c):(a=Wb(),nt.lanes|=a,oi|=a,s)}function Jy(a,s,c,h,x){var v=V.p;V.p=v!==0&&8>v?v:8;var N=I.T,L={};I.T=L,yp(a,!1,s,c);try{var q=x(),ee=I.S;if(ee!==null&&ee(L,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var ce=Bj(q,h);Io(a,s,ce,fr(a))}else Io(a,s,h,fr(a))}catch(xe){Io(a,s,{then:function(){},status:"rejected",reason:xe},fr())}finally{V.p=v,N!==null&&L.types!==null&&(N.types=L.types),I.T=N}}function Vj(){}function gp(a,s,c,h){if(a.tag!==5)throw Error(r(476));var x=eb(a).queue;Jy(a,x,s,te,c===null?Vj:function(){return tb(a),c(h)})}function eb(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:te},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:c},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function tb(a){var s=eb(a);s.next===null&&(s=a.alternate.memoizedState),Io(a,s.next.queue,{},fr())}function xp(){return Nn(el)}function nb(){return rn().memoizedState}function rb(){return rn().memoizedState}function Gj(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var c=fr();a=ti(c);var h=ni(s,a,c);h!==null&&(er(h,s,c),Lo(h,s,c)),s={cache:Gf()},a.payload=s;return}s=s.return}}function Yj(a,s,c){var h=fr();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Zc(a)?ib(s,c):(c=Mf(a,s,c,h),c!==null&&(er(c,a,h),sb(c,s,h)))}function ab(a,s,c){var h=fr();Io(a,s,c,h)}function Io(a,s,c,h){var x={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Zc(a))ib(s,x);else{var v=a.alternate;if(a.lanes===0&&(v===null||v.lanes===0)&&(v=s.lastRenderedReducer,v!==null))try{var N=s.lastRenderedState,L=v(N,c);if(x.hasEagerState=!0,x.eagerState=L,sr(L,N))return Rc(a,s,x,0),Dt===null&&Tc(),!1}catch{}if(c=Mf(a,s,x,h),c!==null)return er(c,a,h),sb(c,s,h),!0}return!1}function yp(a,s,c,h){if(h={lane:2,revertLane:Qp(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Zc(a)){if(s)throw Error(r(479))}else s=Mf(a,c,h,2),s!==null&&er(s,a,2)}function Zc(a){var s=a.alternate;return a===nt||s!==null&&s===nt}function ib(a,s){As=qc=!0;var c=a.pending;c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s}function sb(a,s,c){if((c&4194048)!==0){var h=s.lanes;h&=a.pendingLanes,c|=h,s.lanes=c,Ka(a,c)}}var $o={readContext:Nn,use:Yc,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useLayoutEffect:Zt,useInsertionEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useSyncExternalStore:Zt,useId:Zt,useHostTransitionStatus:Zt,useFormState:Zt,useActionState:Zt,useOptimistic:Zt,useMemoCache:Zt,useCacheRefresh:Zt};$o.useEffectEvent=Zt;var ob={readContext:Nn,use:Yc,useCallback:function(a,s){return Un().memoizedState=[a,s===void 0?null:s],a},useContext:Nn,useEffect:qy,useImperativeHandle:function(a,s,c){c=c!=null?c.concat([a]):null,Xc(4194308,4,Ky.bind(null,s,a),c)},useLayoutEffect:function(a,s){return Xc(4194308,4,a,s)},useInsertionEffect:function(a,s){Xc(4,2,a,s)},useMemo:function(a,s){var c=Un();s=s===void 0?null:s;var h=a();if(Fi){yt(!0);try{a()}finally{yt(!1)}}return c.memoizedState=[h,s],h},useReducer:function(a,s,c){var h=Un();if(c!==void 0){var x=c(s);if(Fi){yt(!0);try{c(s)}finally{yt(!1)}}}else x=s;return h.memoizedState=h.baseState=x,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:x},h.queue=a,a=a.dispatch=Yj.bind(null,nt,a),[h.memoizedState,a]},useRef:function(a){var s=Un();return a={current:a},s.memoizedState=a},useState:function(a){a=dp(a);var s=a.queue,c=ab.bind(null,nt,s);return s.dispatch=c,[a.memoizedState,c]},useDebugValue:hp,useDeferredValue:function(a,s){var c=Un();return mp(c,a,s)},useTransition:function(){var a=dp(!1);return a=Jy.bind(null,nt,a.queue,!0,!1),Un().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,c){var h=nt,x=Un();if(mt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=s(),Dt===null)throw Error(r(349));(pt&127)!==0||Ey(h,s,c)}x.memoizedState=c;var v={value:c,getSnapshot:s};return x.queue=v,qy(Ty.bind(null,h,v,a),[a]),h.flags|=2048,Rs(9,{destroy:void 0},Ay.bind(null,h,v,c,s),null),c},useId:function(){var a=Un(),s=Dt.identifierPrefix;if(mt){var c=Zr,h=Qr;c=(h&~(1<<32-lt(h)-1)).toString(32)+c,s="_"+s+"R_"+c,c=Vc++,0<c&&(s+="H"+c.toString(32)),s+="_"}else c=Pj++,s="_"+s+"r_"+c.toString(32)+"_";return a.memoizedState=s},useHostTransitionStatus:xp,useFormState:By,useActionState:By,useOptimistic:function(a){var s=Un();s.memoizedState=s.baseState=a;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=c,s=yp.bind(null,nt,!0,c),c.dispatch=s,[a,s]},useMemoCache:lp,useCacheRefresh:function(){return Un().memoizedState=Gj.bind(null,nt)},useEffectEvent:function(a){var s=Un(),c={impl:a};return s.memoizedState=c,function(){if((wt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},bp={readContext:Nn,use:Yc,useCallback:Qy,useContext:Nn,useEffect:pp,useImperativeHandle:Xy,useInsertionEffect:Gy,useLayoutEffect:Yy,useMemo:Zy,useReducer:Kc,useRef:Hy,useState:function(){return Kc(Ca)},useDebugValue:hp,useDeferredValue:function(a,s){var c=rn();return Wy(c,Nt.memoizedState,a,s)},useTransition:function(){var a=Kc(Ca)[0],s=rn().memoizedState;return[typeof a=="boolean"?a:zo(a),s]},useSyncExternalStore:Cy,useId:nb,useHostTransitionStatus:xp,useFormState:Py,useActionState:Py,useOptimistic:function(a,s){var c=rn();return Dy(c,Nt,a,s)},useMemoCache:lp,useCacheRefresh:rb};bp.useEffectEvent=Vy;var lb={readContext:Nn,use:Yc,useCallback:Qy,useContext:Nn,useEffect:pp,useImperativeHandle:Xy,useInsertionEffect:Gy,useLayoutEffect:Yy,useMemo:Zy,useReducer:up,useRef:Hy,useState:function(){return up(Ca)},useDebugValue:hp,useDeferredValue:function(a,s){var c=rn();return Nt===null?mp(c,a,s):Wy(c,Nt.memoizedState,a,s)},useTransition:function(){var a=up(Ca)[0],s=rn().memoizedState;return[typeof a=="boolean"?a:zo(a),s]},useSyncExternalStore:Cy,useId:nb,useHostTransitionStatus:xp,useFormState:Uy,useActionState:Uy,useOptimistic:function(a,s){var c=rn();return Nt!==null?Dy(c,Nt,a,s):(c.baseState=a,[a,c.queue.dispatch])},useMemoCache:lp,useCacheRefresh:rb};lb.useEffectEvent=Vy;function vp(a,s,c,h){s=a.memoizedState,c=c(h,s),c=c==null?s:g({},s,c),a.memoizedState=c,a.lanes===0&&(a.updateQueue.baseState=c)}var _p={enqueueSetState:function(a,s,c){a=a._reactInternals;var h=fr(),x=ti(h);x.payload=s,c!=null&&(x.callback=c),s=ni(a,x,h),s!==null&&(er(s,a,h),Lo(s,a,h))},enqueueReplaceState:function(a,s,c){a=a._reactInternals;var h=fr(),x=ti(h);x.tag=1,x.payload=s,c!=null&&(x.callback=c),s=ni(a,x,h),s!==null&&(er(s,a,h),Lo(s,a,h))},enqueueForceUpdate:function(a,s){a=a._reactInternals;var c=fr(),h=ti(c);h.tag=2,s!=null&&(h.callback=s),s=ni(a,h,c),s!==null&&(er(s,a,c),Lo(s,a,c))}};function cb(a,s,c,h,x,v,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,v,N):s.prototype&&s.prototype.isPureReactComponent?!So(c,h)||!So(x,v):!0}function ub(a,s,c,h){a=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,h),s.state!==a&&_p.enqueueReplaceState(s,s.state,null)}function Ui(a,s){var c=s;if("ref"in s){c={};for(var h in s)h!=="ref"&&(c[h]=s[h])}if(a=a.defaultProps){c===s&&(c=g({},c));for(var x in a)c[x]===void 0&&(c[x]=a[x])}return c}function db(a){Ac(a)}function fb(a){console.error(a)}function pb(a){Ac(a)}function Wc(a,s){try{var c=a.onUncaughtError;c(s.value,{componentStack:s.stack})}catch(h){setTimeout(function(){throw h})}}function hb(a,s,c){try{var h=a.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function wp(a,s,c){return c=ti(c),c.tag=3,c.payload={element:null},c.callback=function(){Wc(a,s)},c}function mb(a){return a=ti(a),a.tag=3,a}function gb(a,s,c,h){var x=c.type.getDerivedStateFromError;if(typeof x=="function"){var v=h.value;a.payload=function(){return x(v)},a.callback=function(){hb(s,c,h)}}var N=c.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(a.callback=function(){hb(s,c,h),typeof x!="function"&&(li===null?li=new Set([this]):li.add(this));var L=h.stack;this.componentDidCatch(h.value,{componentStack:L!==null?L:""})})}function Kj(a,s,c,h,x){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(s=c.alternate,s!==null&&ks(s,c,x,!0),c=lr.current,c!==null){switch(c.tag){case 31:case 13:return Cr===null?uu():c.alternate===null&&Wt===0&&(Wt=3),c.flags&=-257,c.flags|=65536,c.lanes=x,h===Bc?c.flags|=16384:(s=c.updateQueue,s===null?c.updateQueue=new Set([h]):s.add(h),Yp(a,h,x)),!1;case 22:return c.flags|=65536,h===Bc?c.flags|=16384:(s=c.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=s):(c=s.retryQueue,c===null?s.retryQueue=new Set([h]):c.add(h)),Yp(a,h,x)),!1}throw Error(r(435,c.tag))}return Yp(a,h,x),uu(),!1}if(mt)return s=lr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=x,h!==Ff&&(a=Error(r(422),{cause:h}),Co(kr(a,c)))):(h!==Ff&&(s=Error(r(423),{cause:h}),Co(kr(s,c))),a=a.current.alternate,a.flags|=65536,x&=-x,a.lanes|=x,h=kr(h,c),x=wp(a.stateNode,h,x),Wf(a,x),Wt!==4&&(Wt=2)),!1;var v=Error(r(520),{cause:h});if(v=kr(v,c),Go===null?Go=[v]:Go.push(v),Wt!==4&&(Wt=2),s===null)return!0;h=kr(h,c),c=s;do{switch(c.tag){case 3:return c.flags|=65536,a=x&-x,c.lanes|=a,a=wp(c.stateNode,h,a),Wf(c,a),!1;case 1:if(s=c.type,v=c.stateNode,(c.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(li===null||!li.has(v))))return c.flags|=65536,x&=-x,c.lanes|=x,x=mb(x),gb(x,a,c,h),Wf(c,x),!1}c=c.return}while(c!==null);return!1}var kp=Error(r(461)),dn=!1;function Cn(a,s,c,h){s.child=a===null?vy(s,null,c,h):Pi(s,a.child,c,h)}function xb(a,s,c,h,x){c=c.render;var v=s.ref;if("ref"in h){var N={};for(var L in h)L!=="ref"&&(N[L]=h[L])}else N=h;return zi(s),h=ap(a,s,c,N,v,x),L=ip(),a!==null&&!dn?(sp(a,s,x),Ea(a,s,x)):(mt&&L&&Bf(s),s.flags|=1,Cn(a,s,h,x),s.child)}function yb(a,s,c,h,x){if(a===null){var v=c.type;return typeof v=="function"&&!zf(v)&&v.defaultProps===void 0&&c.compare===null?(s.tag=15,s.type=v,bb(a,s,v,h,x)):(a=Dc(c.type,null,h,s,s.mode,x),a.ref=s.ref,a.return=s,s.child=a)}if(v=a.child,!Rp(a,x)){var N=v.memoizedProps;if(c=c.compare,c=c!==null?c:So,c(N,h)&&a.ref===s.ref)return Ea(a,s,x)}return s.flags|=1,a=wa(v,h),a.ref=s.ref,a.return=s,s.child=a}function bb(a,s,c,h,x){if(a!==null){var v=a.memoizedProps;if(So(v,h)&&a.ref===s.ref)if(dn=!1,s.pendingProps=h=v,Rp(a,x))(a.flags&131072)!==0&&(dn=!0);else return s.lanes=a.lanes,Ea(a,s,x)}return Sp(a,s,c,h,x)}function vb(a,s,c,h){var x=h.children,v=a!==null?a.memoizedState:null;if(a===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((s.flags&128)!==0){if(v=v!==null?v.baseLanes|c:c,a!==null){for(h=s.child=a.child,x=0;h!==null;)x=x|h.lanes|h.childLanes,h=h.sibling;h=x&~v}else h=0,s.child=null;return _b(a,s,v,c,h)}if((c&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},a!==null&&Ic(s,v!==null?v.cachePool:null),v!==null?ky(s,v):ep(),Sy(s);else return h=s.lanes=536870912,_b(a,s,v!==null?v.baseLanes|c:c,c,h)}else v!==null?(Ic(s,v.cachePool),ky(s,v),ai(),s.memoizedState=null):(a!==null&&Ic(s,null),ep(),ai());return Cn(a,s,x,c),s.child}function Bo(a,s){return a!==null&&a.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function _b(a,s,c,h,x){var v=Kf();return v=v===null?null:{parent:cn._currentValue,pool:v},s.memoizedState={baseLanes:c,cachePool:v},a!==null&&Ic(s,null),ep(),Sy(s),a!==null&&ks(a,s,h,!0),s.childLanes=x,null}function Jc(a,s){return s=tu({mode:s.mode,children:s.children},a.mode),s.ref=a.ref,a.child=s,s.return=a,s}function wb(a,s,c){return Pi(s,a.child,null,c),a=Jc(s,s.pendingProps),a.flags|=2,cr(s),s.memoizedState=null,a}function Xj(a,s,c){var h=s.pendingProps,x=(s.flags&128)!==0;if(s.flags&=-129,a===null){if(mt){if(h.mode==="hidden")return a=Jc(s,h),s.lanes=536870912,Bo(null,a);if(np(s),(a=qt)?(a=O0(a,Nr),a=a!==null&&a.data==="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:Qa!==null?{id:Qr,overflow:Zr}:null,retryLane:536870912,hydrationErrors:null},c=iy(a),c.return=s,s.child=c,jn=s,qt=null)):a=null,a===null)throw Wa(s);return s.lanes=536870912,null}return Jc(s,h)}var v=a.memoizedState;if(v!==null){var N=v.dehydrated;if(np(s),x)if(s.flags&256)s.flags&=-257,s=wb(a,s,c);else if(s.memoizedState!==null)s.child=a.child,s.flags|=128,s=null;else throw Error(r(558));else if(dn||ks(a,s,c,!1),x=(c&a.childLanes)!==0,dn||x){if(h=Dt,h!==null&&(N=H(h,c),N!==0&&N!==v.retryLane))throw v.retryLane=N,Li(a,N),er(h,a,N),kp;uu(),s=wb(a,s,c)}else a=v.treeContext,qt=Er(N.nextSibling),jn=s,mt=!0,Za=null,Nr=!1,a!==null&&ly(s,a),s=Jc(s,h),s.flags|=4096;return s}return a=wa(a.child,{mode:h.mode,children:h.children}),a.ref=s.ref,s.child=a,a.return=s,a}function eu(a,s){var c=s.ref;if(c===null)a!==null&&a.ref!==null&&(s.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(a===null||a.ref!==c)&&(s.flags|=4194816)}}function Sp(a,s,c,h,x){return zi(s),c=ap(a,s,c,h,void 0,x),h=ip(),a!==null&&!dn?(sp(a,s,x),Ea(a,s,x)):(mt&&h&&Bf(s),s.flags|=1,Cn(a,s,c,x),s.child)}function kb(a,s,c,h,x,v){return zi(s),s.updateQueue=null,c=Ny(s,h,c,x),jy(a),h=ip(),a!==null&&!dn?(sp(a,s,v),Ea(a,s,v)):(mt&&h&&Bf(s),s.flags|=1,Cn(a,s,c,v),s.child)}function Sb(a,s,c,h,x){if(zi(s),s.stateNode===null){var v=bs,N=c.contextType;typeof N=="object"&&N!==null&&(v=Nn(N)),v=new c(h,v),s.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=_p,s.stateNode=v,v._reactInternals=s,v=s.stateNode,v.props=h,v.state=s.memoizedState,v.refs={},Qf(s),N=c.contextType,v.context=typeof N=="object"&&N!==null?Nn(N):bs,v.state=s.memoizedState,N=c.getDerivedStateFromProps,typeof N=="function"&&(vp(s,c,N,h),v.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(N=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),N!==v.state&&_p.enqueueReplaceState(v,v.state,null),Oo(s,h,v,x),Do(),v.state=s.memoizedState),typeof v.componentDidMount=="function"&&(s.flags|=4194308),h=!0}else if(a===null){v=s.stateNode;var L=s.memoizedProps,q=Ui(c,L);v.props=q;var ee=v.context,ce=c.contextType;N=bs,typeof ce=="object"&&ce!==null&&(N=Nn(ce));var xe=c.getDerivedStateFromProps;ce=typeof xe=="function"||typeof v.getSnapshotBeforeUpdate=="function",L=s.pendingProps!==L,ce||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(L||ee!==N)&&ub(s,v,h,N),ei=!1;var ne=s.memoizedState;v.state=ne,Oo(s,h,v,x),Do(),ee=s.memoizedState,L||ne!==ee||ei?(typeof xe=="function"&&(vp(s,c,xe,h),ee=s.memoizedState),(q=ei||cb(s,c,q,h,ne,ee,N))?(ce||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(s.flags|=4194308)):(typeof v.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=ee),v.props=h,v.state=ee,v.context=N,h=q):(typeof v.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{v=s.stateNode,Zf(a,s),N=s.memoizedProps,ce=Ui(c,N),v.props=ce,xe=s.pendingProps,ne=v.context,ee=c.contextType,q=bs,typeof ee=="object"&&ee!==null&&(q=Nn(ee)),L=c.getDerivedStateFromProps,(ee=typeof L=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N!==xe||ne!==q)&&ub(s,v,h,q),ei=!1,ne=s.memoizedState,v.state=ne,Oo(s,h,v,x),Do();var le=s.memoizedState;N!==xe||ne!==le||ei||a!==null&&a.dependencies!==null&&Mc(a.dependencies)?(typeof L=="function"&&(vp(s,c,L,h),le=s.memoizedState),(ce=ei||cb(s,c,ce,h,ne,le,q)||a!==null&&a.dependencies!==null&&Mc(a.dependencies))?(ee||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(h,le,q),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(h,le,q)),typeof v.componentDidUpdate=="function"&&(s.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof v.componentDidUpdate!="function"||N===a.memoizedProps&&ne===a.memoizedState||(s.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&ne===a.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=le),v.props=h,v.state=le,v.context=q,h=ce):(typeof v.componentDidUpdate!="function"||N===a.memoizedProps&&ne===a.memoizedState||(s.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&ne===a.memoizedState||(s.flags|=1024),h=!1)}return v=h,eu(a,s),h=(s.flags&128)!==0,v||h?(v=s.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:v.render(),s.flags|=1,a!==null&&h?(s.child=Pi(s,a.child,null,x),s.child=Pi(s,null,c,x)):Cn(a,s,c,x),s.memoizedState=v.state,a=s.child):a=Ea(a,s,x),a}function jb(a,s,c,h){return Oi(),s.flags|=256,Cn(a,s,c,h),s.child}var jp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Np(a){return{baseLanes:a,cachePool:hy()}}function Cp(a,s,c){return a=a!==null?a.childLanes&~c:0,s&&(a|=dr),a}function Nb(a,s,c){var h=s.pendingProps,x=!1,v=(s.flags&128)!==0,N;if((N=v)||(N=a!==null&&a.memoizedState===null?!1:(nn.current&2)!==0),N&&(x=!0,s.flags&=-129),N=(s.flags&32)!==0,s.flags&=-33,a===null){if(mt){if(x?ri(s):ai(),(a=qt)?(a=O0(a,Nr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:Qa!==null?{id:Qr,overflow:Zr}:null,retryLane:536870912,hydrationErrors:null},c=iy(a),c.return=s,s.child=c,jn=s,qt=null)):a=null,a===null)throw Wa(s);return ch(a)?s.lanes=32:s.lanes=536870912,null}var L=h.children;return h=h.fallback,x?(ai(),x=s.mode,L=tu({mode:"hidden",children:L},x),h=Di(h,x,c,null),L.return=s,h.return=s,L.sibling=h,s.child=L,h=s.child,h.memoizedState=Np(c),h.childLanes=Cp(a,N,c),s.memoizedState=jp,Bo(null,h)):(ri(s),Ep(s,L))}var q=a.memoizedState;if(q!==null&&(L=q.dehydrated,L!==null)){if(v)s.flags&256?(ri(s),s.flags&=-257,s=Ap(a,s,c)):s.memoizedState!==null?(ai(),s.child=a.child,s.flags|=128,s=null):(ai(),L=h.fallback,x=s.mode,h=tu({mode:"visible",children:h.children},x),L=Di(L,x,c,null),L.flags|=2,h.return=s,L.return=s,h.sibling=L,s.child=h,Pi(s,a.child,null,c),h=s.child,h.memoizedState=Np(c),h.childLanes=Cp(a,N,c),s.memoizedState=jp,s=Bo(null,h));else if(ri(s),ch(L)){if(N=L.nextSibling&&L.nextSibling.dataset,N)var ee=N.dgst;N=ee,h=Error(r(419)),h.stack="",h.digest=N,Co({value:h,source:null,stack:null}),s=Ap(a,s,c)}else if(dn||ks(a,s,c,!1),N=(c&a.childLanes)!==0,dn||N){if(N=Dt,N!==null&&(h=H(N,c),h!==0&&h!==q.retryLane))throw q.retryLane=h,Li(a,h),er(N,a,h),kp;lh(L)||uu(),s=Ap(a,s,c)}else lh(L)?(s.flags|=192,s.child=a.child,s=null):(a=q.treeContext,qt=Er(L.nextSibling),jn=s,mt=!0,Za=null,Nr=!1,a!==null&&ly(s,a),s=Ep(s,h.children),s.flags|=4096);return s}return x?(ai(),L=h.fallback,x=s.mode,q=a.child,ee=q.sibling,h=wa(q,{mode:"hidden",children:h.children}),h.subtreeFlags=q.subtreeFlags&65011712,ee!==null?L=wa(ee,L):(L=Di(L,x,c,null),L.flags|=2),L.return=s,h.return=s,h.sibling=L,s.child=h,Bo(null,h),h=s.child,L=a.child.memoizedState,L===null?L=Np(c):(x=L.cachePool,x!==null?(q=cn._currentValue,x=x.parent!==q?{parent:q,pool:q}:x):x=hy(),L={baseLanes:L.baseLanes|c,cachePool:x}),h.memoizedState=L,h.childLanes=Cp(a,N,c),s.memoizedState=jp,Bo(a.child,h)):(ri(s),c=a.child,a=c.sibling,c=wa(c,{mode:"visible",children:h.children}),c.return=s,c.sibling=null,a!==null&&(N=s.deletions,N===null?(s.deletions=[a],s.flags|=16):N.push(a)),s.child=c,s.memoizedState=null,c)}function Ep(a,s){return s=tu({mode:"visible",children:s},a.mode),s.return=a,a.child=s}function tu(a,s){return a=or(22,a,null,s),a.lanes=0,a}function Ap(a,s,c){return Pi(s,a.child,null,c),a=Ep(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function Cb(a,s,c){a.lanes|=s;var h=a.alternate;h!==null&&(h.lanes|=s),qf(a.return,s,c)}function Tp(a,s,c,h,x,v){var N=a.memoizedState;N===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:x,treeForkCount:v}:(N.isBackwards=s,N.rendering=null,N.renderingStartTime=0,N.last=h,N.tail=c,N.tailMode=x,N.treeForkCount=v)}function Eb(a,s,c){var h=s.pendingProps,x=h.revealOrder,v=h.tail;h=h.children;var N=nn.current,L=(N&2)!==0;if(L?(N=N&1|2,s.flags|=128):N&=1,O(nn,N),Cn(a,s,h,c),h=mt?No:0,!L&&a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Cb(a,c,s);else if(a.tag===19)Cb(a,c,s);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(x){case"forwards":for(c=s.child,x=null;c!==null;)a=c.alternate,a!==null&&Hc(a)===null&&(x=c),c=c.sibling;c=x,c===null?(x=s.child,s.child=null):(x=c.sibling,c.sibling=null),Tp(s,!1,x,c,v,h);break;case"backwards":case"unstable_legacy-backwards":for(c=null,x=s.child,s.child=null;x!==null;){if(a=x.alternate,a!==null&&Hc(a)===null){s.child=x;break}a=x.sibling,x.sibling=c,c=x,x=a}Tp(s,!0,c,null,v,h);break;case"together":Tp(s,!1,null,null,void 0,h);break;default:s.memoizedState=null}return s.child}function Ea(a,s,c){if(a!==null&&(s.dependencies=a.dependencies),oi|=s.lanes,(c&s.childLanes)===0)if(a!==null){if(ks(a,s,c,!1),(c&s.childLanes)===0)return null}else return null;if(a!==null&&s.child!==a.child)throw Error(r(153));if(s.child!==null){for(a=s.child,c=wa(a,a.pendingProps),s.child=c,c.return=s;a.sibling!==null;)a=a.sibling,c=c.sibling=wa(a,a.pendingProps),c.return=s;c.sibling=null}return s.child}function Rp(a,s){return(a.lanes&s)!==0?!0:(a=a.dependencies,!!(a!==null&&Mc(a)))}function Qj(a,s,c){switch(s.tag){case 3:Ie(s,s.stateNode.containerInfo),Ja(s,cn,a.memoizedState.cache),Oi();break;case 27:case 5:be(s);break;case 4:Ie(s,s.stateNode.containerInfo);break;case 10:Ja(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,np(s),null;break;case 13:var h=s.memoizedState;if(h!==null)return h.dehydrated!==null?(ri(s),s.flags|=128,null):(c&s.child.childLanes)!==0?Nb(a,s,c):(ri(s),a=Ea(a,s,c),a!==null?a.sibling:null);ri(s);break;case 19:var x=(a.flags&128)!==0;if(h=(c&s.childLanes)!==0,h||(ks(a,s,c,!1),h=(c&s.childLanes)!==0),x){if(h)return Eb(a,s,c);s.flags|=128}if(x=s.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),O(nn,nn.current),h)break;return null;case 22:return s.lanes=0,vb(a,s,c,s.pendingProps);case 24:Ja(s,cn,a.memoizedState.cache)}return Ea(a,s,c)}function Ab(a,s,c){if(a!==null)if(a.memoizedProps!==s.pendingProps)dn=!0;else{if(!Rp(a,c)&&(s.flags&128)===0)return dn=!1,Qj(a,s,c);dn=(a.flags&131072)!==0}else dn=!1,mt&&(s.flags&1048576)!==0&&oy(s,No,s.index);switch(s.lanes=0,s.tag){case 16:e:{var h=s.pendingProps;if(a=$i(s.elementType),s.type=a,typeof a=="function")zf(a)?(h=Ui(a,h),s.tag=1,s=Sb(null,s,a,h,c)):(s.tag=0,s=Sp(null,s,a,h,c));else{if(a!=null){var x=a.$$typeof;if(x===z){s.tag=11,s=xb(null,s,a,h,c);break e}else if(x===P){s.tag=14,s=yb(null,s,a,h,c);break e}}throw s=$(a)||a,Error(r(306,s,""))}}return s;case 0:return Sp(a,s,s.type,s.pendingProps,c);case 1:return h=s.type,x=Ui(h,s.pendingProps),Sb(a,s,h,x,c);case 3:e:{if(Ie(s,s.stateNode.containerInfo),a===null)throw Error(r(387));h=s.pendingProps;var v=s.memoizedState;x=v.element,Zf(a,s),Oo(s,h,null,c);var N=s.memoizedState;if(h=N.cache,Ja(s,cn,h),h!==v.cache&&Vf(s,[cn],c,!0),Do(),h=N.element,v.isDehydrated)if(v={element:h,isDehydrated:!1,cache:N.cache},s.updateQueue.baseState=v,s.memoizedState=v,s.flags&256){s=jb(a,s,h,c);break e}else if(h!==x){x=kr(Error(r(424)),s),Co(x),s=jb(a,s,h,c);break e}else for(a=s.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,qt=Er(a.firstChild),jn=s,mt=!0,Za=null,Nr=!0,c=vy(s,null,h,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Oi(),h===x){s=Ea(a,s,c);break e}Cn(a,s,h,c)}s=s.child}return s;case 26:return eu(a,s),a===null?(c=P0(s.type,null,s.pendingProps,null))?s.memoizedState=c:mt||(c=s.type,a=s.pendingProps,h=xu(pe.current).createElement(c),h[Ce]=s,h[Ae]=a,En(h,c,a),ft(h),s.stateNode=h):s.memoizedState=P0(s.type,a.memoizedProps,s.pendingProps,a.memoizedState),null;case 27:return be(s),a===null&&mt&&(h=s.stateNode=I0(s.type,s.pendingProps,pe.current),jn=s,Nr=!0,x=qt,fi(s.type)?(uh=x,qt=Er(h.firstChild)):qt=x),Cn(a,s,s.pendingProps.children,c),eu(a,s),a===null&&(s.flags|=4194304),s.child;case 5:return a===null&&mt&&((x=h=qt)&&(h=NN(h,s.type,s.pendingProps,Nr),h!==null?(s.stateNode=h,jn=s,qt=Er(h.firstChild),Nr=!1,x=!0):x=!1),x||Wa(s)),be(s),x=s.type,v=s.pendingProps,N=a!==null?a.memoizedProps:null,h=v.children,ih(x,v)?h=null:N!==null&&ih(x,N)&&(s.flags|=32),s.memoizedState!==null&&(x=ap(a,s,Fj,null,null,c),el._currentValue=x),eu(a,s),Cn(a,s,h,c),s.child;case 6:return a===null&&mt&&((a=c=qt)&&(c=CN(c,s.pendingProps,Nr),c!==null?(s.stateNode=c,jn=s,qt=null,a=!0):a=!1),a||Wa(s)),null;case 13:return Nb(a,s,c);case 4:return Ie(s,s.stateNode.containerInfo),h=s.pendingProps,a===null?s.child=Pi(s,null,h,c):Cn(a,s,h,c),s.child;case 11:return xb(a,s,s.type,s.pendingProps,c);case 7:return Cn(a,s,s.pendingProps,c),s.child;case 8:return Cn(a,s,s.pendingProps.children,c),s.child;case 12:return Cn(a,s,s.pendingProps.children,c),s.child;case 10:return h=s.pendingProps,Ja(s,s.type,h.value),Cn(a,s,h.children,c),s.child;case 9:return x=s.type._context,h=s.pendingProps.children,zi(s),x=Nn(x),h=h(x),s.flags|=1,Cn(a,s,h,c),s.child;case 14:return yb(a,s,s.type,s.pendingProps,c);case 15:return bb(a,s,s.type,s.pendingProps,c);case 19:return Eb(a,s,c);case 31:return Xj(a,s,c);case 22:return vb(a,s,c,s.pendingProps);case 24:return zi(s),h=Nn(cn),a===null?(x=Kf(),x===null&&(x=Dt,v=Gf(),x.pooledCache=v,v.refCount++,v!==null&&(x.pooledCacheLanes|=c),x=v),s.memoizedState={parent:h,cache:x},Qf(s),Ja(s,cn,x)):((a.lanes&c)!==0&&(Zf(a,s),Oo(s,null,null,c),Do()),x=a.memoizedState,v=s.memoizedState,x.parent!==h?(x={parent:h,cache:h},s.memoizedState=x,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=x),Ja(s,cn,h)):(h=v.cache,Ja(s,cn,h),h!==x.cache&&Vf(s,[cn],c,!0))),Cn(a,s,s.pendingProps.children,c),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Aa(a){a.flags|=4}function Lp(a,s,c,h,x){if((s=(a.mode&32)!==0)&&(s=!1),s){if(a.flags|=16777216,(x&335544128)===x)if(a.stateNode.complete)a.flags|=8192;else if(n0())a.flags|=8192;else throw Bi=Bc,Xf}else a.flags&=-16777217}function Tb(a,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!V0(s))if(n0())a.flags|=8192;else throw Bi=Bc,Xf}function nu(a,s){s!==null&&(a.flags|=4),a.flags&16384&&(s=a.tag!==22?ya():536870912,a.lanes|=s,Ms|=s)}function Po(a,s){if(!mt)switch(a.tailMode){case"hidden":s=a.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function Vt(a){var s=a.alternate!==null&&a.alternate.child===a.child,c=0,h=0;if(s)for(var x=a.child;x!==null;)c|=x.lanes|x.childLanes,h|=x.subtreeFlags&65011712,h|=x.flags&65011712,x.return=a,x=x.sibling;else for(x=a.child;x!==null;)c|=x.lanes|x.childLanes,h|=x.subtreeFlags,h|=x.flags,x.return=a,x=x.sibling;return a.subtreeFlags|=h,a.childLanes=c,s}function Zj(a,s,c){var h=s.pendingProps;switch(Pf(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(s),null;case 1:return Vt(s),null;case 3:return c=s.stateNode,h=null,a!==null&&(h=a.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),ja(cn),Ue(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(a===null||a.child===null)&&(ws(s)?Aa(s):a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Uf())),Vt(s),null;case 26:var x=s.type,v=s.memoizedState;return a===null?(Aa(s),v!==null?(Vt(s),Tb(s,v)):(Vt(s),Lp(s,x,null,h,c))):v?v!==a.memoizedState?(Aa(s),Vt(s),Tb(s,v)):(Vt(s),s.flags&=-16777217):(a=a.memoizedProps,a!==h&&Aa(s),Vt(s),Lp(s,x,a,h,c)),null;case 27:if(de(s),c=pe.current,x=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==h&&Aa(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return Vt(s),null}a=se.current,ws(s)?cy(s):(a=I0(x,h,c),s.stateNode=a,Aa(s))}return Vt(s),null;case 5:if(de(s),x=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==h&&Aa(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return Vt(s),null}if(v=se.current,ws(s))cy(s);else{var N=xu(pe.current);switch(v){case 1:v=N.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:v=N.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":v=N.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":v=N.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":v=N.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof h.is=="string"?N.createElement("select",{is:h.is}):N.createElement("select"),h.multiple?v.multiple=!0:h.size&&(v.size=h.size);break;default:v=typeof h.is=="string"?N.createElement(x,{is:h.is}):N.createElement(x)}}v[Ce]=s,v[Ae]=h;e:for(N=s.child;N!==null;){if(N.tag===5||N.tag===6)v.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===s)break e;for(;N.sibling===null;){if(N.return===null||N.return===s)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}s.stateNode=v;e:switch(En(v,x,h),x){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Aa(s)}}return Vt(s),Lp(s,s.type,a===null?null:a.memoizedProps,s.pendingProps,c),null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==h&&Aa(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(a=pe.current,ws(s)){if(a=s.stateNode,c=s.memoizedProps,h=null,x=jn,x!==null)switch(x.tag){case 27:case 5:h=x.memoizedProps}a[Ce]=s,a=!!(a.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||N0(a.nodeValue,c)),a||Wa(s,!0)}else a=xu(a).createTextNode(h),a[Ce]=s,s.stateNode=a}return Vt(s),null;case 31:if(c=s.memoizedState,a===null||a.memoizedState!==null){if(h=ws(s),c!==null){if(a===null){if(!h)throw Error(r(318));if(a=s.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[Ce]=s}else Oi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Vt(s),a=!1}else c=Uf(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=c),a=!0;if(!a)return s.flags&256?(cr(s),s):(cr(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Vt(s),null;case 13:if(h=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(x=ws(s),h!==null&&h.dehydrated!==null){if(a===null){if(!x)throw Error(r(318));if(x=s.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[Ce]=s}else Oi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Vt(s),x=!1}else x=Uf(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=x),x=!0;if(!x)return s.flags&256?(cr(s),s):(cr(s),null)}return cr(s),(s.flags&128)!==0?(s.lanes=c,s):(c=h!==null,a=a!==null&&a.memoizedState!==null,c&&(h=s.child,x=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(x=h.alternate.memoizedState.cachePool.pool),v=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(v=h.memoizedState.cachePool.pool),v!==x&&(h.flags|=2048)),c!==a&&c&&(s.child.flags|=8192),nu(s,s.updateQueue),Vt(s),null);case 4:return Ue(),a===null&&eh(s.stateNode.containerInfo),Vt(s),null;case 10:return ja(s.type),Vt(s),null;case 19:if(K(nn),h=s.memoizedState,h===null)return Vt(s),null;if(x=(s.flags&128)!==0,v=h.rendering,v===null)if(x)Po(h,!1);else{if(Wt!==0||a!==null&&(a.flags&128)!==0)for(a=s.child;a!==null;){if(v=Hc(a),v!==null){for(s.flags|=128,Po(h,!1),a=v.updateQueue,s.updateQueue=a,nu(s,a),s.subtreeFlags=0,a=c,c=s.child;c!==null;)ay(c,a),c=c.sibling;return O(nn,nn.current&1|2),mt&&ka(s,h.treeForkCount),s.child}a=a.sibling}h.tail!==null&&Xt()>ou&&(s.flags|=128,x=!0,Po(h,!1),s.lanes=4194304)}else{if(!x)if(a=Hc(v),a!==null){if(s.flags|=128,x=!0,a=a.updateQueue,s.updateQueue=a,nu(s,a),Po(h,!0),h.tail===null&&h.tailMode==="hidden"&&!v.alternate&&!mt)return Vt(s),null}else 2*Xt()-h.renderingStartTime>ou&&c!==536870912&&(s.flags|=128,x=!0,Po(h,!1),s.lanes=4194304);h.isBackwards?(v.sibling=s.child,s.child=v):(a=h.last,a!==null?a.sibling=v:s.child=v,h.last=v)}return h.tail!==null?(a=h.tail,h.rendering=a,h.tail=a.sibling,h.renderingStartTime=Xt(),a.sibling=null,c=nn.current,O(nn,x?c&1|2:c&1),mt&&ka(s,h.treeForkCount),a):(Vt(s),null);case 22:case 23:return cr(s),tp(),h=s.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?(c&536870912)!==0&&(s.flags&128)===0&&(Vt(s),s.subtreeFlags&6&&(s.flags|=8192)):Vt(s),c=s.updateQueue,c!==null&&nu(s,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==c&&(s.flags|=2048),a!==null&&K(Ii),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),ja(cn),Vt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function Wj(a,s){switch(Pf(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return ja(cn),Ue(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return de(s),null;case 31:if(s.memoizedState!==null){if(cr(s),s.alternate===null)throw Error(r(340));Oi()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 13:if(cr(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Oi()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return K(nn),null;case 4:return Ue(),null;case 10:return ja(s.type),null;case 22:case 23:return cr(s),tp(),a!==null&&K(Ii),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return ja(cn),null;case 25:return null;default:return null}}function Rb(a,s){switch(Pf(s),s.tag){case 3:ja(cn),Ue();break;case 26:case 27:case 5:de(s);break;case 4:Ue();break;case 31:s.memoizedState!==null&&cr(s);break;case 13:cr(s);break;case 19:K(nn);break;case 10:ja(s.type);break;case 22:case 23:cr(s),tp(),a!==null&&K(Ii);break;case 24:ja(cn)}}function Fo(a,s){try{var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var x=h.next;c=x;do{if((c.tag&a)===a){h=void 0;var v=c.create,N=c.inst;h=v(),N.destroy=h}c=c.next}while(c!==x)}}catch(L){jt(s,s.return,L)}}function ii(a,s,c){try{var h=s.updateQueue,x=h!==null?h.lastEffect:null;if(x!==null){var v=x.next;h=v;do{if((h.tag&a)===a){var N=h.inst,L=N.destroy;if(L!==void 0){N.destroy=void 0,x=s;var q=c,ee=L;try{ee()}catch(ce){jt(x,q,ce)}}}h=h.next}while(h!==v)}}catch(ce){jt(s,s.return,ce)}}function Lb(a){var s=a.updateQueue;if(s!==null){var c=a.stateNode;try{wy(s,c)}catch(h){jt(a,a.return,h)}}}function Db(a,s,c){c.props=Ui(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(h){jt(a,s,h)}}function Uo(a,s){try{var c=a.ref;if(c!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof c=="function"?a.refCleanup=c(h):c.current=h}}catch(x){jt(a,s,x)}}function Wr(a,s){var c=a.ref,h=a.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(x){jt(a,s,x)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(x){jt(a,s,x)}else c.current=null}function Ob(a){var s=a.type,c=a.memoizedProps,h=a.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(x){jt(a,a.return,x)}}function Dp(a,s,c){try{var h=a.stateNode;vN(h,a.type,c,s),h[Ae]=s}catch(x){jt(a,a.return,x)}}function Mb(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&fi(a.type)||a.tag===4}function Op(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Mb(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&fi(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Mp(a,s,c){var h=a.tag;if(h===5||h===6)a=a.stateNode,s?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(a,s):(s=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,s.appendChild(a),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=va));else if(h!==4&&(h===27&&fi(a.type)&&(c=a.stateNode,s=null),a=a.child,a!==null))for(Mp(a,s,c),a=a.sibling;a!==null;)Mp(a,s,c),a=a.sibling}function ru(a,s,c){var h=a.tag;if(h===5||h===6)a=a.stateNode,s?c.insertBefore(a,s):c.appendChild(a);else if(h!==4&&(h===27&&fi(a.type)&&(c=a.stateNode),a=a.child,a!==null))for(ru(a,s,c),a=a.sibling;a!==null;)ru(a,s,c),a=a.sibling}function zb(a){var s=a.stateNode,c=a.memoizedProps;try{for(var h=a.type,x=s.attributes;x.length;)s.removeAttributeNode(x[0]);En(s,h,c),s[Ce]=a,s[Ae]=c}catch(v){jt(a,a.return,v)}}var Ta=!1,fn=!1,zp=!1,Ib=typeof WeakSet=="function"?WeakSet:Set,_n=null;function Jj(a,s){if(a=a.containerInfo,rh=Su,a=Xx(a),Af(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else e:{c=(c=a.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var x=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{c.nodeType,v.nodeType}catch{c=null;break e}var N=0,L=-1,q=-1,ee=0,ce=0,xe=a,ne=null;t:for(;;){for(var le;xe!==c||x!==0&&xe.nodeType!==3||(L=N+x),xe!==v||h!==0&&xe.nodeType!==3||(q=N+h),xe.nodeType===3&&(N+=xe.nodeValue.length),(le=xe.firstChild)!==null;)ne=xe,xe=le;for(;;){if(xe===a)break t;if(ne===c&&++ee===x&&(L=N),ne===v&&++ce===h&&(q=N),(le=xe.nextSibling)!==null)break;xe=ne,ne=xe.parentNode}xe=le}c=L===-1||q===-1?null:{start:L,end:q}}else c=null}c=c||{start:0,end:0}}else c=null;for(ah={focusedElem:a,selectionRange:c},Su=!1,_n=s;_n!==null;)if(s=_n,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,_n=a;else for(;_n!==null;){switch(s=_n,v=s.alternate,a=s.flags,s.tag){case 0:if((a&4)!==0&&(a=s.updateQueue,a=a!==null?a.events:null,a!==null))for(c=0;c<a.length;c++)x=a[c],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&v!==null){a=void 0,c=s,x=v.memoizedProps,v=v.memoizedState,h=c.stateNode;try{var Oe=Ui(c.type,x);a=h.getSnapshotBeforeUpdate(Oe,v),h.__reactInternalSnapshotBeforeUpdate=a}catch(We){jt(c,c.return,We)}}break;case 3:if((a&1024)!==0){if(a=s.stateNode.containerInfo,c=a.nodeType,c===9)oh(a);else if(c===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":oh(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=s.sibling,a!==null){a.return=s.return,_n=a;break}_n=s.return}}function $b(a,s,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:La(a,c),h&4&&Fo(5,c);break;case 1:if(La(a,c),h&4)if(a=c.stateNode,s===null)try{a.componentDidMount()}catch(N){jt(c,c.return,N)}else{var x=Ui(c.type,s.memoizedProps);s=s.memoizedState;try{a.componentDidUpdate(x,s,a.__reactInternalSnapshotBeforeUpdate)}catch(N){jt(c,c.return,N)}}h&64&&Lb(c),h&512&&Uo(c,c.return);break;case 3:if(La(a,c),h&64&&(a=c.updateQueue,a!==null)){if(s=null,c.child!==null)switch(c.child.tag){case 27:case 5:s=c.child.stateNode;break;case 1:s=c.child.stateNode}try{wy(a,s)}catch(N){jt(c,c.return,N)}}break;case 27:s===null&&h&4&&zb(c);case 26:case 5:La(a,c),s===null&&h&4&&Ob(c),h&512&&Uo(c,c.return);break;case 12:La(a,c);break;case 31:La(a,c),h&4&&Fb(a,c);break;case 13:La(a,c),h&4&&Ub(a,c),h&64&&(a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(c=lN.bind(null,c),EN(a,c))));break;case 22:if(h=c.memoizedState!==null||Ta,!h){s=s!==null&&s.memoizedState!==null||fn,x=Ta;var v=fn;Ta=h,(fn=s)&&!v?Da(a,c,(c.subtreeFlags&8772)!==0):La(a,c),Ta=x,fn=v}break;case 30:break;default:La(a,c)}}function Bb(a){var s=a.alternate;s!==null&&(a.alternate=null,Bb(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&Te(s)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Qt=null,Qn=!1;function Ra(a,s,c){for(c=c.child;c!==null;)Pb(a,s,c),c=c.sibling}function Pb(a,s,c){if(_t&&typeof _t.onCommitFiberUnmount=="function")try{_t.onCommitFiberUnmount(Rt,c)}catch{}switch(c.tag){case 26:fn||Wr(c,s),Ra(a,s,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:fn||Wr(c,s);var h=Qt,x=Qn;fi(c.type)&&(Qt=c.stateNode,Qn=!1),Ra(a,s,c),Zo(c.stateNode),Qt=h,Qn=x;break;case 5:fn||Wr(c,s);case 6:if(h=Qt,x=Qn,Qt=null,Ra(a,s,c),Qt=h,Qn=x,Qt!==null)if(Qn)try{(Qt.nodeType===9?Qt.body:Qt.nodeName==="HTML"?Qt.ownerDocument.body:Qt).removeChild(c.stateNode)}catch(v){jt(c,s,v)}else try{Qt.removeChild(c.stateNode)}catch(v){jt(c,s,v)}break;case 18:Qt!==null&&(Qn?(a=Qt,L0(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,c.stateNode),Hs(a)):L0(Qt,c.stateNode));break;case 4:h=Qt,x=Qn,Qt=c.stateNode.containerInfo,Qn=!0,Ra(a,s,c),Qt=h,Qn=x;break;case 0:case 11:case 14:case 15:ii(2,c,s),fn||ii(4,c,s),Ra(a,s,c);break;case 1:fn||(Wr(c,s),h=c.stateNode,typeof h.componentWillUnmount=="function"&&Db(c,s,h)),Ra(a,s,c);break;case 21:Ra(a,s,c);break;case 22:fn=(h=fn)||c.memoizedState!==null,Ra(a,s,c),fn=h;break;default:Ra(a,s,c)}}function Fb(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Hs(a)}catch(c){jt(s,s.return,c)}}}function Ub(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Hs(a)}catch(c){jt(s,s.return,c)}}function eN(a){switch(a.tag){case 31:case 13:case 19:var s=a.stateNode;return s===null&&(s=a.stateNode=new Ib),s;case 22:return a=a.stateNode,s=a._retryCache,s===null&&(s=a._retryCache=new Ib),s;default:throw Error(r(435,a.tag))}}function au(a,s){var c=eN(a);s.forEach(function(h){if(!c.has(h)){c.add(h);var x=cN.bind(null,a,h);h.then(x,x)}})}function Zn(a,s){var c=s.deletions;if(c!==null)for(var h=0;h<c.length;h++){var x=c[h],v=a,N=s,L=N;e:for(;L!==null;){switch(L.tag){case 27:if(fi(L.type)){Qt=L.stateNode,Qn=!1;break e}break;case 5:Qt=L.stateNode,Qn=!1;break e;case 3:case 4:Qt=L.stateNode.containerInfo,Qn=!0;break e}L=L.return}if(Qt===null)throw Error(r(160));Pb(v,N,x),Qt=null,Qn=!1,v=x.alternate,v!==null&&(v.return=null),x.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Hb(s,a),s=s.sibling}var Br=null;function Hb(a,s){var c=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Zn(s,a),Wn(a),h&4&&(ii(3,a,a.return),Fo(3,a),ii(5,a,a.return));break;case 1:Zn(s,a),Wn(a),h&512&&(fn||c===null||Wr(c,c.return)),h&64&&Ta&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(c=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var x=Br;if(Zn(s,a),Wn(a),h&512&&(fn||c===null||Wr(c,c.return)),h&4){var v=c!==null?c.memoizedState:null;if(h=a.memoizedState,c===null)if(h===null)if(a.stateNode===null){e:{h=a.type,c=a.memoizedProps,x=x.ownerDocument||x;t:switch(h){case"title":v=x.getElementsByTagName("title")[0],(!v||v[he]||v[Ce]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=x.createElement(h),x.head.insertBefore(v,x.querySelector("head > title"))),En(v,h,c),v[Ce]=a,ft(v),h=v;break e;case"link":var N=H0("link","href",x).get(h+(c.href||""));if(N){for(var L=0;L<N.length;L++)if(v=N[L],v.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&v.getAttribute("rel")===(c.rel==null?null:c.rel)&&v.getAttribute("title")===(c.title==null?null:c.title)&&v.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){N.splice(L,1);break t}}v=x.createElement(h),En(v,h,c),x.head.appendChild(v);break;case"meta":if(N=H0("meta","content",x).get(h+(c.content||""))){for(L=0;L<N.length;L++)if(v=N[L],v.getAttribute("content")===(c.content==null?null:""+c.content)&&v.getAttribute("name")===(c.name==null?null:c.name)&&v.getAttribute("property")===(c.property==null?null:c.property)&&v.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&v.getAttribute("charset")===(c.charSet==null?null:c.charSet)){N.splice(L,1);break t}}v=x.createElement(h),En(v,h,c),x.head.appendChild(v);break;default:throw Error(r(468,h))}v[Ce]=a,ft(v),h=v}a.stateNode=h}else q0(x,a.type,a.stateNode);else a.stateNode=U0(x,h,a.memoizedProps);else v!==h?(v===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):v.count--,h===null?q0(x,a.type,a.stateNode):U0(x,h,a.memoizedProps)):h===null&&a.stateNode!==null&&Dp(a,a.memoizedProps,c.memoizedProps)}break;case 27:Zn(s,a),Wn(a),h&512&&(fn||c===null||Wr(c,c.return)),c!==null&&h&4&&Dp(a,a.memoizedProps,c.memoizedProps);break;case 5:if(Zn(s,a),Wn(a),h&512&&(fn||c===null||Wr(c,c.return)),a.flags&32){x=a.stateNode;try{fs(x,"")}catch(Oe){jt(a,a.return,Oe)}}h&4&&a.stateNode!=null&&(x=a.memoizedProps,Dp(a,x,c!==null?c.memoizedProps:x)),h&1024&&(zp=!0);break;case 6:if(Zn(s,a),Wn(a),h&4){if(a.stateNode===null)throw Error(r(162));h=a.memoizedProps,c=a.stateNode;try{c.nodeValue=h}catch(Oe){jt(a,a.return,Oe)}}break;case 3:if(vu=null,x=Br,Br=yu(s.containerInfo),Zn(s,a),Br=x,Wn(a),h&4&&c!==null&&c.memoizedState.isDehydrated)try{Hs(s.containerInfo)}catch(Oe){jt(a,a.return,Oe)}zp&&(zp=!1,qb(a));break;case 4:h=Br,Br=yu(a.stateNode.containerInfo),Zn(s,a),Wn(a),Br=h;break;case 12:Zn(s,a),Wn(a);break;case 31:Zn(s,a),Wn(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,au(a,h)));break;case 13:Zn(s,a),Wn(a),a.child.flags&8192&&a.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(su=Xt()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,au(a,h)));break;case 22:x=a.memoizedState!==null;var q=c!==null&&c.memoizedState!==null,ee=Ta,ce=fn;if(Ta=ee||x,fn=ce||q,Zn(s,a),fn=ce,Ta=ee,Wn(a),h&8192)e:for(s=a.stateNode,s._visibility=x?s._visibility&-2:s._visibility|1,x&&(c===null||q||Ta||fn||Hi(a)),c=null,s=a;;){if(s.tag===5||s.tag===26){if(c===null){q=c=s;try{if(v=q.stateNode,x)N=v.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{L=q.stateNode;var xe=q.memoizedProps.style,ne=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;L.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Oe){jt(q,q.return,Oe)}}}else if(s.tag===6){if(c===null){q=s;try{q.stateNode.nodeValue=x?"":q.memoizedProps}catch(Oe){jt(q,q.return,Oe)}}}else if(s.tag===18){if(c===null){q=s;try{var le=q.stateNode;x?D0(le,!0):D0(q.stateNode,!1)}catch(Oe){jt(q,q.return,Oe)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===a)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;c===s&&(c=null),s=s.return}c===s&&(c=null),s.sibling.return=s.return,s=s.sibling}h&4&&(h=a.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,au(a,c))));break;case 19:Zn(s,a),Wn(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,au(a,h)));break;case 30:break;case 21:break;default:Zn(s,a),Wn(a)}}function Wn(a){var s=a.flags;if(s&2){try{for(var c,h=a.return;h!==null;){if(Mb(h)){c=h;break}h=h.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var x=c.stateNode,v=Op(a);ru(a,v,x);break;case 5:var N=c.stateNode;c.flags&32&&(fs(N,""),c.flags&=-33);var L=Op(a);ru(a,L,N);break;case 3:case 4:var q=c.stateNode.containerInfo,ee=Op(a);Mp(a,ee,q);break;default:throw Error(r(161))}}catch(ce){jt(a,a.return,ce)}a.flags&=-3}s&4096&&(a.flags&=-4097)}function qb(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var s=a;qb(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),a=a.sibling}}function La(a,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)$b(a,s.alternate,s),s=s.sibling}function Hi(a){for(a=a.child;a!==null;){var s=a;switch(s.tag){case 0:case 11:case 14:case 15:ii(4,s,s.return),Hi(s);break;case 1:Wr(s,s.return);var c=s.stateNode;typeof c.componentWillUnmount=="function"&&Db(s,s.return,c),Hi(s);break;case 27:Zo(s.stateNode);case 26:case 5:Wr(s,s.return),Hi(s);break;case 22:s.memoizedState===null&&Hi(s);break;case 30:Hi(s);break;default:Hi(s)}a=a.sibling}}function Da(a,s,c){for(c=c&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var h=s.alternate,x=a,v=s,N=v.flags;switch(v.tag){case 0:case 11:case 15:Da(x,v,c),Fo(4,v);break;case 1:if(Da(x,v,c),h=v,x=h.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ee){jt(h,h.return,ee)}if(h=v,x=h.updateQueue,x!==null){var L=h.stateNode;try{var q=x.shared.hiddenCallbacks;if(q!==null)for(x.shared.hiddenCallbacks=null,x=0;x<q.length;x++)_y(q[x],L)}catch(ee){jt(h,h.return,ee)}}c&&N&64&&Lb(v),Uo(v,v.return);break;case 27:zb(v);case 26:case 5:Da(x,v,c),c&&h===null&&N&4&&Ob(v),Uo(v,v.return);break;case 12:Da(x,v,c);break;case 31:Da(x,v,c),c&&N&4&&Fb(x,v);break;case 13:Da(x,v,c),c&&N&4&&Ub(x,v);break;case 22:v.memoizedState===null&&Da(x,v,c),Uo(v,v.return);break;case 30:break;default:Da(x,v,c)}s=s.sibling}}function Ip(a,s){var c=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==c&&(a!=null&&a.refCount++,c!=null&&Eo(c))}function $p(a,s){a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Eo(a))}function Pr(a,s,c,h){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Vb(a,s,c,h),s=s.sibling}function Vb(a,s,c,h){var x=s.flags;switch(s.tag){case 0:case 11:case 15:Pr(a,s,c,h),x&2048&&Fo(9,s);break;case 1:Pr(a,s,c,h);break;case 3:Pr(a,s,c,h),x&2048&&(a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Eo(a)));break;case 12:if(x&2048){Pr(a,s,c,h),a=s.stateNode;try{var v=s.memoizedProps,N=v.id,L=v.onPostCommit;typeof L=="function"&&L(N,s.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(q){jt(s,s.return,q)}}else Pr(a,s,c,h);break;case 31:Pr(a,s,c,h);break;case 13:Pr(a,s,c,h);break;case 23:break;case 22:v=s.stateNode,N=s.alternate,s.memoizedState!==null?v._visibility&2?Pr(a,s,c,h):Ho(a,s):v._visibility&2?Pr(a,s,c,h):(v._visibility|=2,Ls(a,s,c,h,(s.subtreeFlags&10256)!==0||!1)),x&2048&&Ip(N,s);break;case 24:Pr(a,s,c,h),x&2048&&$p(s.alternate,s);break;default:Pr(a,s,c,h)}}function Ls(a,s,c,h,x){for(x=x&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var v=a,N=s,L=c,q=h,ee=N.flags;switch(N.tag){case 0:case 11:case 15:Ls(v,N,L,q,x),Fo(8,N);break;case 23:break;case 22:var ce=N.stateNode;N.memoizedState!==null?ce._visibility&2?Ls(v,N,L,q,x):Ho(v,N):(ce._visibility|=2,Ls(v,N,L,q,x)),x&&ee&2048&&Ip(N.alternate,N);break;case 24:Ls(v,N,L,q,x),x&&ee&2048&&$p(N.alternate,N);break;default:Ls(v,N,L,q,x)}s=s.sibling}}function Ho(a,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var c=a,h=s,x=h.flags;switch(h.tag){case 22:Ho(c,h),x&2048&&Ip(h.alternate,h);break;case 24:Ho(c,h),x&2048&&$p(h.alternate,h);break;default:Ho(c,h)}s=s.sibling}}var qo=8192;function Ds(a,s,c){if(a.subtreeFlags&qo)for(a=a.child;a!==null;)Gb(a,s,c),a=a.sibling}function Gb(a,s,c){switch(a.tag){case 26:Ds(a,s,c),a.flags&qo&&a.memoizedState!==null&&PN(c,Br,a.memoizedState,a.memoizedProps);break;case 5:Ds(a,s,c);break;case 3:case 4:var h=Br;Br=yu(a.stateNode.containerInfo),Ds(a,s,c),Br=h;break;case 22:a.memoizedState===null&&(h=a.alternate,h!==null&&h.memoizedState!==null?(h=qo,qo=16777216,Ds(a,s,c),qo=h):Ds(a,s,c));break;default:Ds(a,s,c)}}function Yb(a){var s=a.alternate;if(s!==null&&(a=s.child,a!==null)){s.child=null;do s=a.sibling,a.sibling=null,a=s;while(a!==null)}}function Vo(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var h=s[c];_n=h,Xb(h,a)}Yb(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Kb(a),a=a.sibling}function Kb(a){switch(a.tag){case 0:case 11:case 15:Vo(a),a.flags&2048&&ii(9,a,a.return);break;case 3:Vo(a);break;case 12:Vo(a);break;case 22:var s=a.stateNode;a.memoizedState!==null&&s._visibility&2&&(a.return===null||a.return.tag!==13)?(s._visibility&=-3,iu(a)):Vo(a);break;default:Vo(a)}}function iu(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var h=s[c];_n=h,Xb(h,a)}Yb(a)}for(a=a.child;a!==null;){switch(s=a,s.tag){case 0:case 11:case 15:ii(8,s,s.return),iu(s);break;case 22:c=s.stateNode,c._visibility&2&&(c._visibility&=-3,iu(s));break;default:iu(s)}a=a.sibling}}function Xb(a,s){for(;_n!==null;){var c=_n;switch(c.tag){case 0:case 11:case 15:ii(8,c,s);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Eo(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,_n=h;else e:for(c=a;_n!==null;){h=_n;var x=h.sibling,v=h.return;if(Bb(h),h===c){_n=null;break e}if(x!==null){x.return=v,_n=x;break e}_n=v}}}var tN={getCacheForType:function(a){var s=Nn(cn),c=s.data.get(a);return c===void 0&&(c=a(),s.data.set(a,c)),c},cacheSignal:function(){return Nn(cn).controller.signal}},nN=typeof WeakMap=="function"?WeakMap:Map,wt=0,Dt=null,ct=null,pt=0,St=0,ur=null,si=!1,Os=!1,Bp=!1,Oa=0,Wt=0,oi=0,qi=0,Pp=0,dr=0,Ms=0,Go=null,Jn=null,Fp=!1,su=0,Qb=0,ou=1/0,lu=null,li=null,mn=0,ci=null,zs=null,Ma=0,Up=0,Hp=null,Zb=null,Yo=0,qp=null;function fr(){return(wt&2)!==0&&pt!==0?pt&-pt:I.T!==null?Qp():ve()}function Wb(){if(dr===0)if((pt&536870912)===0||mt){var a=Ge;Ge<<=1,(Ge&3932160)===0&&(Ge=262144),dr=a}else dr=536870912;return a=lr.current,a!==null&&(a.flags|=32),dr}function er(a,s,c){(a===Dt&&(St===2||St===9)||a.cancelPendingCommit!==null)&&(Is(a,0),ui(a,pt,dr,!1)),Fn(a,c),((wt&2)===0||a!==Dt)&&(a===Dt&&((wt&2)===0&&(qi|=c),Wt===4&&ui(a,pt,dr,!1)),Jr(a))}function Jb(a,s,c){if((wt&6)!==0)throw Error(r(327));var h=!c&&(s&127)===0&&(s&a.expiredLanes)===0||Ut(a,s),x=h?iN(a,s):Gp(a,s,!0),v=h;do{if(x===0){Os&&!h&&ui(a,s,0,!1);break}else{if(c=a.current.alternate,v&&!rN(c)){x=Gp(a,s,!1),v=!1;continue}if(x===2){if(v=s,a.errorRecoveryDisabledLanes&v)var N=0;else N=a.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){s=N;e:{var L=a;x=Go;var q=L.current.memoizedState.isDehydrated;if(q&&(Is(L,N).flags|=256),N=Gp(L,N,!1),N!==2){if(Bp&&!q){L.errorRecoveryDisabledLanes|=v,qi|=v,x=4;break e}v=Jn,Jn=x,v!==null&&(Jn===null?Jn=v:Jn.push.apply(Jn,v))}x=N}if(v=!1,x!==2)continue}}if(x===1){Is(a,0),ui(a,s,0,!0);break}e:{switch(h=a,v=x,v){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:ui(h,s,dr,!si);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(x=su+300-Xt(),10<x)){if(ui(h,s,dr,!si),It(h,0,!0)!==0)break e;Ma=s,h.timeoutHandle=T0(e0.bind(null,h,c,Jn,lu,Fp,s,dr,qi,Ms,si,v,"Throttled",-0,0),x);break e}e0(h,c,Jn,lu,Fp,s,dr,qi,Ms,si,v,null,-0,0)}}break}while(!0);Jr(a)}function e0(a,s,c,h,x,v,N,L,q,ee,ce,xe,ne,le){if(a.timeoutHandle=-1,xe=s.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:va},Gb(s,v,xe);var Oe=(v&62914560)===v?su-Xt():(v&4194048)===v?Qb-Xt():0;if(Oe=FN(xe,Oe),Oe!==null){Ma=v,a.cancelPendingCommit=Oe(l0.bind(null,a,s,v,c,h,x,N,L,q,ce,xe,null,ne,le)),ui(a,v,N,!ee);return}}l0(a,s,v,c,h,x,N,L,q)}function rN(a){for(var s=a;;){var c=s.tag;if((c===0||c===11||c===15)&&s.flags&16384&&(c=s.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var x=c[h],v=x.getSnapshot;x=x.value;try{if(!sr(v(),x))return!1}catch{return!1}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function ui(a,s,c,h){s&=~Pp,s&=~qi,a.suspendedLanes|=s,a.pingedLanes&=~s,h&&(a.warmLanes|=s),h=a.expirationTimes;for(var x=s;0<x;){var v=31-lt(x),N=1<<v;h[v]=-1,x&=~N}c!==0&&ba(a,c,s)}function cu(){return(wt&6)===0?(Ko(0),!1):!0}function Vp(){if(ct!==null){if(St===0)var a=ct.return;else a=ct,Sa=Mi=null,op(a),Cs=null,To=0,a=ct;for(;a!==null;)Rb(a.alternate,a),a=a.return;ct=null}}function Is(a,s){var c=a.timeoutHandle;c!==-1&&(a.timeoutHandle=-1,kN(c)),c=a.cancelPendingCommit,c!==null&&(a.cancelPendingCommit=null,c()),Ma=0,Vp(),Dt=a,ct=c=wa(a.current,null),pt=s,St=0,ur=null,si=!1,Os=Ut(a,s),Bp=!1,Ms=dr=Pp=qi=oi=Wt=0,Jn=Go=null,Fp=!1,(s&8)!==0&&(s|=s&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=s;0<h;){var x=31-lt(h),v=1<<x;s|=a[x],h&=~v}return Oa=s,Tc(),c}function t0(a,s){nt=null,I.H=$o,s===Ns||s===$c?(s=xy(),St=3):s===Xf?(s=xy(),St=4):St=s===kp?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,ur=s,ct===null&&(Wt=1,Wc(a,kr(s,a.current)))}function n0(){var a=lr.current;return a===null?!0:(pt&4194048)===pt?Cr===null:(pt&62914560)===pt||(pt&536870912)!==0?a===Cr:!1}function r0(){var a=I.H;return I.H=$o,a===null?$o:a}function a0(){var a=I.A;return I.A=tN,a}function uu(){Wt=4,si||(pt&4194048)!==pt&&lr.current!==null||(Os=!0),(oi&134217727)===0&&(qi&134217727)===0||Dt===null||ui(Dt,pt,dr,!1)}function Gp(a,s,c){var h=wt;wt|=2;var x=r0(),v=a0();(Dt!==a||pt!==s)&&(lu=null,Is(a,s)),s=!1;var N=Wt;e:do try{if(St!==0&&ct!==null){var L=ct,q=ur;switch(St){case 8:Vp(),N=6;break e;case 3:case 2:case 9:case 6:lr.current===null&&(s=!0);var ee=St;if(St=0,ur=null,$s(a,L,q,ee),c&&Os){N=0;break e}break;default:ee=St,St=0,ur=null,$s(a,L,q,ee)}}aN(),N=Wt;break}catch(ce){t0(a,ce)}while(!0);return s&&a.shellSuspendCounter++,Sa=Mi=null,wt=h,I.H=x,I.A=v,ct===null&&(Dt=null,pt=0,Tc()),N}function aN(){for(;ct!==null;)i0(ct)}function iN(a,s){var c=wt;wt|=2;var h=r0(),x=a0();Dt!==a||pt!==s?(lu=null,ou=Xt()+500,Is(a,s)):Os=Ut(a,s);e:do try{if(St!==0&&ct!==null){s=ct;var v=ur;t:switch(St){case 1:St=0,ur=null,$s(a,s,v,1);break;case 2:case 9:if(my(v)){St=0,ur=null,s0(s);break}s=function(){St!==2&&St!==9||Dt!==a||(St=7),Jr(a)},v.then(s,s);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:my(v)?(St=0,ur=null,s0(s)):(St=0,ur=null,$s(a,s,v,7));break;case 5:var N=null;switch(ct.tag){case 26:N=ct.memoizedState;case 5:case 27:var L=ct;if(N?V0(N):L.stateNode.complete){St=0,ur=null;var q=L.sibling;if(q!==null)ct=q;else{var ee=L.return;ee!==null?(ct=ee,du(ee)):ct=null}break t}}St=0,ur=null,$s(a,s,v,5);break;case 6:St=0,ur=null,$s(a,s,v,6);break;case 8:Vp(),Wt=6;break e;default:throw Error(r(462))}}sN();break}catch(ce){t0(a,ce)}while(!0);return Sa=Mi=null,I.H=h,I.A=x,wt=c,ct!==null?0:(Dt=null,pt=0,Tc(),Wt)}function sN(){for(;ct!==null&&!Kn();)i0(ct)}function i0(a){var s=Ab(a.alternate,a,Oa);a.memoizedProps=a.pendingProps,s===null?du(a):ct=s}function s0(a){var s=a,c=s.alternate;switch(s.tag){case 15:case 0:s=kb(c,s,s.pendingProps,s.type,void 0,pt);break;case 11:s=kb(c,s,s.pendingProps,s.type.render,s.ref,pt);break;case 5:op(s);default:Rb(c,s),s=ct=ay(s,Oa),s=Ab(c,s,Oa)}a.memoizedProps=a.pendingProps,s===null?du(a):ct=s}function $s(a,s,c,h){Sa=Mi=null,op(s),Cs=null,To=0;var x=s.return;try{if(Kj(a,x,s,c,pt)){Wt=1,Wc(a,kr(c,a.current)),ct=null;return}}catch(v){if(x!==null)throw ct=x,v;Wt=1,Wc(a,kr(c,a.current)),ct=null;return}s.flags&32768?(mt||h===1?a=!0:Os||(pt&536870912)!==0?a=!1:(si=a=!0,(h===2||h===9||h===3||h===6)&&(h=lr.current,h!==null&&h.tag===13&&(h.flags|=16384))),o0(s,a)):du(s)}function du(a){var s=a;do{if((s.flags&32768)!==0){o0(s,si);return}a=s.return;var c=Zj(s.alternate,s,Oa);if(c!==null){ct=c;return}if(s=s.sibling,s!==null){ct=s;return}ct=s=a}while(s!==null);Wt===0&&(Wt=5)}function o0(a,s){do{var c=Wj(a.alternate,a);if(c!==null){c.flags&=32767,ct=c;return}if(c=a.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!s&&(a=a.sibling,a!==null)){ct=a;return}ct=a=c}while(a!==null);Wt=6,ct=null}function l0(a,s,c,h,x,v,N,L,q){a.cancelPendingCommit=null;do fu();while(mn!==0);if((wt&6)!==0)throw Error(r(327));if(s!==null){if(s===a.current)throw Error(r(177));if(v=s.lanes|s.childLanes,v|=Of,Yr(a,c,v,N,L,q),a===Dt&&(ct=Dt=null,pt=0),zs=s,ci=a,Ma=c,Up=v,Hp=x,Zb=h,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,uN(Ne,function(){return p0(),null})):(a.callbackNode=null,a.callbackPriority=0),h=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||h){h=I.T,I.T=null,x=V.p,V.p=2,N=wt,wt|=4;try{Jj(a,s,c)}finally{wt=N,V.p=x,I.T=h}}mn=1,c0(),u0(),d0()}}function c0(){if(mn===1){mn=0;var a=ci,s=zs,c=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||c){c=I.T,I.T=null;var h=V.p;V.p=2;var x=wt;wt|=4;try{Hb(s,a);var v=ah,N=Xx(a.containerInfo),L=v.focusedElem,q=v.selectionRange;if(N!==L&&L&&L.ownerDocument&&Kx(L.ownerDocument.documentElement,L)){if(q!==null&&Af(L)){var ee=q.start,ce=q.end;if(ce===void 0&&(ce=ee),"selectionStart"in L)L.selectionStart=ee,L.selectionEnd=Math.min(ce,L.value.length);else{var xe=L.ownerDocument||document,ne=xe&&xe.defaultView||window;if(ne.getSelection){var le=ne.getSelection(),Oe=L.textContent.length,We=Math.min(q.start,Oe),Et=q.end===void 0?We:Math.min(q.end,Oe);!le.extend&&We>Et&&(N=Et,Et=We,We=N);var W=Yx(L,We),Y=Yx(L,Et);if(W&&Y&&(le.rangeCount!==1||le.anchorNode!==W.node||le.anchorOffset!==W.offset||le.focusNode!==Y.node||le.focusOffset!==Y.offset)){var J=xe.createRange();J.setStart(W.node,W.offset),le.removeAllRanges(),We>Et?(le.addRange(J),le.extend(Y.node,Y.offset)):(J.setEnd(Y.node,Y.offset),le.addRange(J))}}}}for(xe=[],le=L;le=le.parentNode;)le.nodeType===1&&xe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<xe.length;L++){var me=xe[L];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Su=!!rh,ah=rh=null}finally{wt=x,V.p=h,I.T=c}}a.current=s,mn=2}}function u0(){if(mn===2){mn=0;var a=ci,s=zs,c=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||c){c=I.T,I.T=null;var h=V.p;V.p=2;var x=wt;wt|=4;try{$b(a,s.alternate,s)}finally{wt=x,V.p=h,I.T=c}}mn=3}}function d0(){if(mn===4||mn===3){mn=0,Pn();var a=ci,s=zs,c=Ma,h=Zb;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?mn=5:(mn=0,zs=ci=null,f0(a,a.pendingLanes));var x=a.pendingLanes;if(x===0&&(li=null),ae(c),s=s.stateNode,_t&&typeof _t.onCommitFiberRoot=="function")try{_t.onCommitFiberRoot(Rt,s,void 0,(s.current.flags&128)===128)}catch{}if(h!==null){s=I.T,x=V.p,V.p=2,I.T=null;try{for(var v=a.onRecoverableError,N=0;N<h.length;N++){var L=h[N];v(L.value,{componentStack:L.stack})}}finally{I.T=s,V.p=x}}(Ma&3)!==0&&fu(),Jr(a),x=a.pendingLanes,(c&261930)!==0&&(x&42)!==0?a===qp?Yo++:(Yo=0,qp=a):Yo=0,Ko(0)}}function f0(a,s){(a.pooledCacheLanes&=s)===0&&(s=a.pooledCache,s!=null&&(a.pooledCache=null,Eo(s)))}function fu(){return c0(),u0(),d0(),p0()}function p0(){if(mn!==5)return!1;var a=ci,s=Up;Up=0;var c=ae(Ma),h=I.T,x=V.p;try{V.p=32>c?32:c,I.T=null,c=Hp,Hp=null;var v=ci,N=Ma;if(mn=0,zs=ci=null,Ma=0,(wt&6)!==0)throw Error(r(331));var L=wt;if(wt|=4,Kb(v.current),Vb(v,v.current,N,c),wt=L,Ko(0,!1),_t&&typeof _t.onPostCommitFiberRoot=="function")try{_t.onPostCommitFiberRoot(Rt,v)}catch{}return!0}finally{V.p=x,I.T=h,f0(a,s)}}function h0(a,s,c){s=kr(c,s),s=wp(a.stateNode,s,2),a=ni(a,s,2),a!==null&&(Fn(a,2),Jr(a))}function jt(a,s,c){if(a.tag===3)h0(a,a,c);else for(;s!==null;){if(s.tag===3){h0(s,a,c);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(li===null||!li.has(h))){a=kr(c,a),c=mb(2),h=ni(s,c,2),h!==null&&(gb(c,h,s,a),Fn(h,2),Jr(h));break}}s=s.return}}function Yp(a,s,c){var h=a.pingCache;if(h===null){h=a.pingCache=new nN;var x=new Set;h.set(s,x)}else x=h.get(s),x===void 0&&(x=new Set,h.set(s,x));x.has(c)||(Bp=!0,x.add(c),a=oN.bind(null,a,s,c),s.then(a,a))}function oN(a,s,c){var h=a.pingCache;h!==null&&h.delete(s),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,Dt===a&&(pt&c)===c&&(Wt===4||Wt===3&&(pt&62914560)===pt&&300>Xt()-su?(wt&2)===0&&Is(a,0):Pp|=c,Ms===pt&&(Ms=0)),Jr(a)}function m0(a,s){s===0&&(s=ya()),a=Li(a,s),a!==null&&(Fn(a,s),Jr(a))}function lN(a){var s=a.memoizedState,c=0;s!==null&&(c=s.retryLane),m0(a,c)}function cN(a,s){var c=0;switch(a.tag){case 31:case 13:var h=a.stateNode,x=a.memoizedState;x!==null&&(c=x.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),m0(a,c)}function uN(a,s){return Kt(a,s)}var pu=null,Bs=null,Kp=!1,hu=!1,Xp=!1,di=0;function Jr(a){a!==Bs&&a.next===null&&(Bs===null?pu=Bs=a:Bs=Bs.next=a),hu=!0,Kp||(Kp=!0,fN())}function Ko(a,s){if(!Xp&&hu){Xp=!0;do for(var c=!1,h=pu;h!==null;){if(a!==0){var x=h.pendingLanes;if(x===0)var v=0;else{var N=h.suspendedLanes,L=h.pingedLanes;v=(1<<31-lt(42|a)+1)-1,v&=x&~(N&~L),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(c=!0,b0(h,v))}else v=pt,v=It(h,h===Dt?v:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(v&3)===0||Ut(h,v)||(c=!0,b0(h,v));h=h.next}while(c);Xp=!1}}function dN(){g0()}function g0(){hu=Kp=!1;var a=0;di!==0&&wN()&&(a=di);for(var s=Xt(),c=null,h=pu;h!==null;){var x=h.next,v=x0(h,s);v===0?(h.next=null,c===null?pu=x:c.next=x,x===null&&(Bs=c)):(c=h,(a!==0||(v&3)!==0)&&(hu=!0)),h=x}mn!==0&&mn!==5||Ko(a),di!==0&&(di=0)}function x0(a,s){for(var c=a.suspendedLanes,h=a.pingedLanes,x=a.expirationTimes,v=a.pendingLanes&-62914561;0<v;){var N=31-lt(v),L=1<<N,q=x[N];q===-1?((L&c)===0||(L&h)!==0)&&(x[N]=Ya(L,s)):q<=s&&(a.expiredLanes|=L),v&=~L}if(s=Dt,c=pt,c=It(a,a===s?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h=a.callbackNode,c===0||a===s&&(St===2||St===9)||a.cancelPendingCommit!==null)return h!==null&&h!==null&&An(h),a.callbackNode=null,a.callbackPriority=0;if((c&3)===0||Ut(a,c)){if(s=c&-c,s===a.callbackPriority)return s;switch(h!==null&&An(h),ae(c)){case 2:case 8:c=fe;break;case 32:c=Ne;break;case 268435456:c=He;break;default:c=Ne}return h=y0.bind(null,a),c=Kt(c,h),a.callbackPriority=s,a.callbackNode=c,s}return h!==null&&h!==null&&An(h),a.callbackPriority=2,a.callbackNode=null,2}function y0(a,s){if(mn!==0&&mn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var c=a.callbackNode;if(fu()&&a.callbackNode!==c)return null;var h=pt;return h=It(a,a===Dt?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h===0?null:(Jb(a,h,s),x0(a,Xt()),a.callbackNode!=null&&a.callbackNode===c?y0.bind(null,a):null)}function b0(a,s){if(fu())return null;Jb(a,s,!0)}function fN(){SN(function(){(wt&6)!==0?Kt(Z,dN):g0()})}function Qp(){if(di===0){var a=Ss;a===0&&(a=ye,ye<<=1,(ye&261888)===0&&(ye=256)),di=a}return di}function v0(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:wc(""+a)}function _0(a,s){var c=s.ownerDocument.createElement("input");return c.name=s.name,c.value=s.value,a.id&&c.setAttribute("form",a.id),s.parentNode.insertBefore(c,s),a=new FormData(a),c.parentNode.removeChild(c),a}function pN(a,s,c,h,x){if(s==="submit"&&c&&c.stateNode===x){var v=v0((x[Ae]||null).action),N=h.submitter;N&&(s=(s=N[Ae]||null)?v0(s.formAction):N.getAttribute("formAction"),s!==null&&(v=s,N=null));var L=new Nc("action","action",null,h,x);a.push({event:L,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(di!==0){var q=N?_0(x,N):new FormData(x);gp(c,{pending:!0,data:q,method:x.method,action:v},null,q)}}else typeof v=="function"&&(L.preventDefault(),q=N?_0(x,N):new FormData(x),gp(c,{pending:!0,data:q,method:x.method,action:v},v,q))},currentTarget:x}]})}}for(var Zp=0;Zp<Df.length;Zp++){var Wp=Df[Zp],hN=Wp.toLowerCase(),mN=Wp[0].toUpperCase()+Wp.slice(1);$r(hN,"on"+mN)}$r(Wx,"onAnimationEnd"),$r(Jx,"onAnimationIteration"),$r(ey,"onAnimationStart"),$r("dblclick","onDoubleClick"),$r("focusin","onFocus"),$r("focusout","onBlur"),$r(Rj,"onTransitionRun"),$r(Lj,"onTransitionStart"),$r(Dj,"onTransitionCancel"),$r(ty,"onTransitionEnd"),Kr("onMouseEnter",["mouseout","mouseover"]),Kr("onMouseLeave",["mouseout","mouseover"]),Kr("onPointerEnter",["pointerout","pointerover"]),Kr("onPointerLeave",["pointerout","pointerover"]),vn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vn("onBeforeInput",["compositionend","keypress","textInput","paste"]),vn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xo="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(" "),gN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Xo));function w0(a,s){s=(s&4)!==0;for(var c=0;c<a.length;c++){var h=a[c],x=h.event;h=h.listeners;e:{var v=void 0;if(s)for(var N=h.length-1;0<=N;N--){var L=h[N],q=L.instance,ee=L.currentTarget;if(L=L.listener,q!==v&&x.isPropagationStopped())break e;v=L,x.currentTarget=ee;try{v(x)}catch(ce){Ac(ce)}x.currentTarget=null,v=q}else for(N=0;N<h.length;N++){if(L=h[N],q=L.instance,ee=L.currentTarget,L=L.listener,q!==v&&x.isPropagationStopped())break e;v=L,x.currentTarget=ee;try{v(x)}catch(ce){Ac(ce)}x.currentTarget=null,v=q}}}}function ut(a,s){var c=s[Ve];c===void 0&&(c=s[Ve]=new Set);var h=a+"__bubble";c.has(h)||(k0(s,a,2,!1),c.add(h))}function Jp(a,s,c){var h=0;s&&(h|=4),k0(c,a,h,s)}var mu="_reactListening"+Math.random().toString(36).slice(2);function eh(a){if(!a[mu]){a[mu]=!0,hn.forEach(function(c){c!=="selectionchange"&&(gN.has(c)||Jp(c,!1,a),Jp(c,!0,a))});var s=a.nodeType===9?a:a.ownerDocument;s===null||s[mu]||(s[mu]=!0,Jp("selectionchange",!1,s))}}function k0(a,s,c,h){switch(W0(s)){case 2:var x=qN;break;case 8:x=VN;break;default:x=mh}c=x.bind(null,s,c,a),x=void 0,!vf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(x=!0),h?x!==void 0?a.addEventListener(s,c,{capture:!0,passive:x}):a.addEventListener(s,c,!0):x!==void 0?a.addEventListener(s,c,{passive:x}):a.addEventListener(s,c,!1)}function th(a,s,c,h,x){var v=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var N=h.tag;if(N===3||N===4){var L=h.stateNode.containerInfo;if(L===x)break;if(N===4)for(N=h.return;N!==null;){var q=N.tag;if((q===3||q===4)&&N.stateNode.containerInfo===x)return;N=N.return}for(;L!==null;){if(N=De(L),N===null)return;if(q=N.tag,q===5||q===6||q===26||q===27){h=v=N;continue e}L=L.parentNode}}h=h.return}Ex(function(){var ee=v,ce=yf(c),xe=[];e:{var ne=ny.get(a);if(ne!==void 0){var le=Nc,Oe=a;switch(a){case"keypress":if(Sc(c)===0)break e;case"keydown":case"keyup":le=cj;break;case"focusin":Oe="focus",le=Sf;break;case"focusout":Oe="blur",le=Sf;break;case"beforeblur":case"afterblur":le=Sf;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=Rx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=Z2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=fj;break;case Wx:case Jx:case ey:le=ej;break;case ty:le=hj;break;case"scroll":case"scrollend":le=X2;break;case"wheel":le=gj;break;case"copy":case"cut":case"paste":le=nj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=Dx;break;case"toggle":case"beforetoggle":le=yj}var We=(s&4)!==0,Et=!We&&(a==="scroll"||a==="scrollend"),W=We?ne!==null?ne+"Capture":null:ne;We=[];for(var Y=ee,J;Y!==null;){var me=Y;if(J=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||J===null||W===null||(me=xo(Y,W),me!=null&&We.push(Qo(Y,me,J))),Et)break;Y=Y.return}0<We.length&&(ne=new le(ne,Oe,null,c,ce),xe.push({event:ne,listeners:We}))}}if((s&7)===0){e:{if(ne=a==="mouseover"||a==="pointerover",le=a==="mouseout"||a==="pointerout",ne&&c!==xf&&(Oe=c.relatedTarget||c.fromElement)&&(De(Oe)||Oe[Re]))break e;if((le||ne)&&(ne=ce.window===ce?ce:(ne=ce.ownerDocument)?ne.defaultView||ne.parentWindow:window,le?(Oe=c.relatedTarget||c.toElement,le=ee,Oe=Oe?De(Oe):null,Oe!==null&&(Et=o(Oe),We=Oe.tag,Oe!==Et||We!==5&&We!==27&&We!==6)&&(Oe=null)):(le=null,Oe=ee),le!==Oe)){if(We=Rx,me="onMouseLeave",W="onMouseEnter",Y="mouse",(a==="pointerout"||a==="pointerover")&&(We=Dx,me="onPointerLeave",W="onPointerEnter",Y="pointer"),Et=le==null?ne:$e(le),J=Oe==null?ne:$e(Oe),ne=new We(me,Y+"leave",le,c,ce),ne.target=Et,ne.relatedTarget=J,me=null,De(ce)===ee&&(We=new We(W,Y+"enter",Oe,c,ce),We.target=J,We.relatedTarget=Et,me=We),Et=me,le&&Oe)t:{for(We=xN,W=le,Y=Oe,J=0,me=W;me;me=We(me))J++;me=0;for(var Ke=Y;Ke;Ke=We(Ke))me++;for(;0<J-me;)W=We(W),J--;for(;0<me-J;)Y=We(Y),me--;for(;J--;){if(W===Y||Y!==null&&W===Y.alternate){We=W;break t}W=We(W),Y=We(Y)}We=null}else We=null;le!==null&&S0(xe,ne,le,We,!1),Oe!==null&&Et!==null&&S0(xe,Et,Oe,We,!0)}}e:{if(ne=ee?$e(ee):window,le=ne.nodeName&&ne.nodeName.toLowerCase(),le==="select"||le==="input"&&ne.type==="file")var bt=Fx;else if(Bx(ne))if(Ux)bt=Ej;else{bt=Nj;var Be=jj}else le=ne.nodeName,!le||le.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&gf(ee.elementType)&&(bt=Fx):bt=Cj;if(bt&&(bt=bt(a,ee))){Px(xe,bt,c,ce);break e}Be&&Be(a,ne,ee),a==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&mf(ne,"number",ne.value)}switch(Be=ee?$e(ee):window,a){case"focusin":(Bx(Be)||Be.contentEditable==="true")&&(gs=Be,Tf=ee,jo=null);break;case"focusout":jo=Tf=gs=null;break;case"mousedown":Rf=!0;break;case"contextmenu":case"mouseup":case"dragend":Rf=!1,Qx(xe,c,ce);break;case"selectionchange":if(Tj)break;case"keydown":case"keyup":Qx(xe,c,ce)}var rt;if(Nf)e:{switch(a){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else ms?Ix(a,c)&&(ht="onCompositionEnd"):a==="keydown"&&c.keyCode===229&&(ht="onCompositionStart");ht&&(Ox&&c.locale!=="ko"&&(ms||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&ms&&(rt=Ax()):(Xa=ce,_f="value"in Xa?Xa.value:Xa.textContent,ms=!0)),Be=gu(ee,ht),0<Be.length&&(ht=new Lx(ht,a,null,c,ce),xe.push({event:ht,listeners:Be}),rt?ht.data=rt:(rt=$x(c),rt!==null&&(ht.data=rt)))),(rt=vj?_j(a,c):wj(a,c))&&(ht=gu(ee,"onBeforeInput"),0<ht.length&&(Be=new Lx("onBeforeInput","beforeinput",null,c,ce),xe.push({event:Be,listeners:ht}),Be.data=rt)),pN(xe,a,ee,c,ce)}w0(xe,s)})}function Qo(a,s,c){return{instance:a,listener:s,currentTarget:c}}function gu(a,s){for(var c=s+"Capture",h=[];a!==null;){var x=a,v=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||v===null||(x=xo(a,c),x!=null&&h.unshift(Qo(a,x,v)),x=xo(a,s),x!=null&&h.push(Qo(a,x,v))),a.tag===3)return h;a=a.return}return[]}function xN(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function S0(a,s,c,h,x){for(var v=s._reactName,N=[];c!==null&&c!==h;){var L=c,q=L.alternate,ee=L.stateNode;if(L=L.tag,q!==null&&q===h)break;L!==5&&L!==26&&L!==27||ee===null||(q=ee,x?(ee=xo(c,v),ee!=null&&N.unshift(Qo(c,ee,q))):x||(ee=xo(c,v),ee!=null&&N.push(Qo(c,ee,q)))),c=c.return}N.length!==0&&a.push({event:s,listeners:N})}var yN=/\r\n?/g,bN=/\u0000|\uFFFD/g;function j0(a){return(typeof a=="string"?a:""+a).replace(yN,`
10
+ `).replace(bN,"")}function N0(a,s){return s=j0(s),j0(a)===s}function Ct(a,s,c,h,x,v){switch(c){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||fs(a,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&fs(a,""+h);break;case"className":tn(a,"class",h);break;case"tabIndex":tn(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":tn(a,c,h);break;case"style":Nx(a,h,v);break;case"data":if(s!=="object"){tn(a,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||c!=="href")){a.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(c);break}h=wc(""+h),a.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){a.setAttribute(c,"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 v=="function"&&(c==="formAction"?(s!=="input"&&Ct(a,s,"name",x.name,x,null),Ct(a,s,"formEncType",x.formEncType,x,null),Ct(a,s,"formMethod",x.formMethod,x,null),Ct(a,s,"formTarget",x.formTarget,x,null)):(Ct(a,s,"encType",x.encType,x,null),Ct(a,s,"method",x.method,x,null),Ct(a,s,"target",x.target,x,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(c);break}h=wc(""+h),a.setAttribute(c,h);break;case"onClick":h!=null&&(a.onclick=va);break;case"onScroll":h!=null&&ut("scroll",a);break;case"onScrollEnd":h!=null&&ut("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(c=h.__html,c!=null){if(x.children!=null)throw Error(r(60));a.innerHTML=c}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}c=wc(""+h),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,""+h):a.removeAttribute(c);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":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,""):a.removeAttribute(c);break;case"capture":case"download":h===!0?a.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,h):a.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(c,h):a.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(c):a.setAttribute(c,h);break;case"popover":ut("beforetoggle",a),ut("toggle",a),ot(a,"popover",h);break;case"xlinkActuate":Rn(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Rn(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Rn(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Rn(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Rn(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Rn(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Rn(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Rn(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Rn(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":ot(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=Y2.get(c)||c,ot(a,c,h))}}function nh(a,s,c,h,x,v){switch(c){case"style":Nx(a,h,v);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(c=h.__html,c!=null){if(x.children!=null)throw Error(r(60));a.innerHTML=c}}break;case"children":typeof h=="string"?fs(a,h):(typeof h=="number"||typeof h=="bigint")&&fs(a,""+h);break;case"onScroll":h!=null&&ut("scroll",a);break;case"onScrollEnd":h!=null&&ut("scrollend",a);break;case"onClick":h!=null&&(a.onclick=va);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Tn.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(x=c.endsWith("Capture"),s=c.slice(2,x?c.length-7:void 0),v=a[Ae]||null,v=v!=null?v[c]:null,typeof v=="function"&&a.removeEventListener(s,v,x),typeof h=="function")){typeof v!="function"&&v!==null&&(c in a?a[c]=null:a.hasAttribute(c)&&a.removeAttribute(c)),a.addEventListener(s,h,x);break e}c in a?a[c]=h:h===!0?a.setAttribute(c,""):ot(a,c,h)}}}function En(a,s,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ut("error",a),ut("load",a);var h=!1,x=!1,v;for(v in c)if(c.hasOwnProperty(v)){var N=c[v];if(N!=null)switch(v){case"src":h=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Ct(a,s,v,N,c,null)}}x&&Ct(a,s,"srcSet",c.srcSet,c,null),h&&Ct(a,s,"src",c.src,c,null);return;case"input":ut("invalid",a);var L=v=N=x=null,q=null,ee=null;for(h in c)if(c.hasOwnProperty(h)){var ce=c[h];if(ce!=null)switch(h){case"name":x=ce;break;case"type":N=ce;break;case"checked":q=ce;break;case"defaultChecked":ee=ce;break;case"value":v=ce;break;case"defaultValue":L=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,s));break;default:Ct(a,s,h,ce,c,null)}}wx(a,v,L,q,ee,N,x,!1);return;case"select":ut("invalid",a),h=N=v=null;for(x in c)if(c.hasOwnProperty(x)&&(L=c[x],L!=null))switch(x){case"value":v=L;break;case"defaultValue":N=L;break;case"multiple":h=L;default:Ct(a,s,x,L,c,null)}s=v,c=N,a.multiple=!!h,s!=null?ds(a,!!h,s,!1):c!=null&&ds(a,!!h,c,!0);return;case"textarea":ut("invalid",a),v=x=h=null;for(N in c)if(c.hasOwnProperty(N)&&(L=c[N],L!=null))switch(N){case"value":h=L;break;case"defaultValue":x=L;break;case"children":v=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:Ct(a,s,N,L,c,null)}Sx(a,h,x,v);return;case"option":for(q in c)c.hasOwnProperty(q)&&(h=c[q],h!=null)&&(q==="selected"?a.selected=h&&typeof h!="function"&&typeof h!="symbol":Ct(a,s,q,h,c,null));return;case"dialog":ut("beforetoggle",a),ut("toggle",a),ut("cancel",a),ut("close",a);break;case"iframe":case"object":ut("load",a);break;case"video":case"audio":for(h=0;h<Xo.length;h++)ut(Xo[h],a);break;case"image":ut("error",a),ut("load",a);break;case"details":ut("toggle",a);break;case"embed":case"source":case"link":ut("error",a),ut("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in c)if(c.hasOwnProperty(ee)&&(h=c[ee],h!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Ct(a,s,ee,h,c,null)}return;default:if(gf(s)){for(ce in c)c.hasOwnProperty(ce)&&(h=c[ce],h!==void 0&&nh(a,s,ce,h,c,void 0));return}}for(L in c)c.hasOwnProperty(L)&&(h=c[L],h!=null&&Ct(a,s,L,h,c,null))}function vN(a,s,c,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,v=null,N=null,L=null,q=null,ee=null,ce=null;for(le in c){var xe=c[le];if(c.hasOwnProperty(le)&&xe!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":q=xe;default:h.hasOwnProperty(le)||Ct(a,s,le,null,h,xe)}}for(var ne in h){var le=h[ne];if(xe=c[ne],h.hasOwnProperty(ne)&&(le!=null||xe!=null))switch(ne){case"type":v=le;break;case"name":x=le;break;case"checked":ee=le;break;case"defaultChecked":ce=le;break;case"value":N=le;break;case"defaultValue":L=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,s));break;default:le!==xe&&Ct(a,s,ne,le,h,xe)}}hf(a,N,L,q,ee,ce,v,x);return;case"select":le=N=L=ne=null;for(v in c)if(q=c[v],c.hasOwnProperty(v)&&q!=null)switch(v){case"value":break;case"multiple":le=q;default:h.hasOwnProperty(v)||Ct(a,s,v,null,h,q)}for(x in h)if(v=h[x],q=c[x],h.hasOwnProperty(x)&&(v!=null||q!=null))switch(x){case"value":ne=v;break;case"defaultValue":L=v;break;case"multiple":N=v;default:v!==q&&Ct(a,s,x,v,h,q)}s=L,c=N,h=le,ne!=null?ds(a,!!c,ne,!1):!!h!=!!c&&(s!=null?ds(a,!!c,s,!0):ds(a,!!c,c?[]:"",!1));return;case"textarea":le=ne=null;for(L in c)if(x=c[L],c.hasOwnProperty(L)&&x!=null&&!h.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Ct(a,s,L,null,h,x)}for(N in h)if(x=h[N],v=c[N],h.hasOwnProperty(N)&&(x!=null||v!=null))switch(N){case"value":ne=x;break;case"defaultValue":le=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==v&&Ct(a,s,N,x,h,v)}kx(a,ne,le);return;case"option":for(var Oe in c)ne=c[Oe],c.hasOwnProperty(Oe)&&ne!=null&&!h.hasOwnProperty(Oe)&&(Oe==="selected"?a.selected=!1:Ct(a,s,Oe,null,h,ne));for(q in h)ne=h[q],le=c[q],h.hasOwnProperty(q)&&ne!==le&&(ne!=null||le!=null)&&(q==="selected"?a.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":Ct(a,s,q,ne,h,le));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 We in c)ne=c[We],c.hasOwnProperty(We)&&ne!=null&&!h.hasOwnProperty(We)&&Ct(a,s,We,null,h,ne);for(ee in h)if(ne=h[ee],le=c[ee],h.hasOwnProperty(ee)&&ne!==le&&(ne!=null||le!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,s));break;default:Ct(a,s,ee,ne,h,le)}return;default:if(gf(s)){for(var Et in c)ne=c[Et],c.hasOwnProperty(Et)&&ne!==void 0&&!h.hasOwnProperty(Et)&&nh(a,s,Et,void 0,h,ne);for(ce in h)ne=h[ce],le=c[ce],!h.hasOwnProperty(ce)||ne===le||ne===void 0&&le===void 0||nh(a,s,ce,ne,h,le);return}}for(var W in c)ne=c[W],c.hasOwnProperty(W)&&ne!=null&&!h.hasOwnProperty(W)&&Ct(a,s,W,null,h,ne);for(xe in h)ne=h[xe],le=c[xe],!h.hasOwnProperty(xe)||ne===le||ne==null&&le==null||Ct(a,s,xe,ne,h,le)}function C0(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _N(){if(typeof performance.getEntriesByType=="function"){for(var a=0,s=0,c=performance.getEntriesByType("resource"),h=0;h<c.length;h++){var x=c[h],v=x.transferSize,N=x.initiatorType,L=x.duration;if(v&&L&&C0(N)){for(N=0,L=x.responseEnd,h+=1;h<c.length;h++){var q=c[h],ee=q.startTime;if(ee>L)break;var ce=q.transferSize,xe=q.initiatorType;ce&&C0(xe)&&(q=q.responseEnd,N+=ce*(q<L?1:(L-ee)/(q-ee)))}if(--h,s+=8*(v+N)/(x.duration/1e3),a++,10<a)break}}if(0<a)return s/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var rh=null,ah=null;function xu(a){return a.nodeType===9?a:a.ownerDocument}function E0(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function A0(a,s){if(a===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&s==="foreignObject"?0:a}function ih(a,s){return a==="textarea"||a==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var sh=null;function wN(){var a=window.event;return a&&a.type==="popstate"?a===sh?!1:(sh=a,!0):(sh=null,!1)}var T0=typeof setTimeout=="function"?setTimeout:void 0,kN=typeof clearTimeout=="function"?clearTimeout:void 0,R0=typeof Promise=="function"?Promise:void 0,SN=typeof queueMicrotask=="function"?queueMicrotask:typeof R0<"u"?function(a){return R0.resolve(null).then(a).catch(jN)}:T0;function jN(a){setTimeout(function(){throw a})}function fi(a){return a==="head"}function L0(a,s){var c=s,h=0;do{var x=c.nextSibling;if(a.removeChild(c),x&&x.nodeType===8)if(c=x.data,c==="/$"||c==="/&"){if(h===0){a.removeChild(x),Hs(s);return}h--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")h++;else if(c==="html")Zo(a.ownerDocument.documentElement);else if(c==="head"){c=a.ownerDocument.head,Zo(c);for(var v=c.firstChild;v;){var N=v.nextSibling,L=v.nodeName;v[he]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&v.rel.toLowerCase()==="stylesheet"||c.removeChild(v),v=N}}else c==="body"&&Zo(a.ownerDocument.body);c=x}while(c);Hs(s)}function D0(a,s){var c=a;a=0;do{var h=c.nextSibling;if(c.nodeType===1?s?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(s?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),h&&h.nodeType===8)if(c=h.data,c==="/$"){if(a===0)break;a--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||a++;c=h}while(c)}function oh(a){var s=a.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var c=s;switch(s=s.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":oh(c),Te(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}a.removeChild(c)}}function NN(a,s,c,h){for(;a.nodeType===1;){var x=c;if(a.nodeName.toLowerCase()!==s.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){if(!a[he])switch(s){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(v=a.getAttribute("rel"),v==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(v!==x.rel||a.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||a.getAttribute("title")!==(x.title==null?null:x.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(v=a.getAttribute("src"),(v!==(x.src==null?null:x.src)||a.getAttribute("type")!==(x.type==null?null:x.type)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&v&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(s==="input"&&a.type==="hidden"){var v=x.name==null?null:""+x.name;if(x.type==="hidden"&&a.getAttribute("name")===v)return a}else return a;if(a=Er(a.nextSibling),a===null)break}return null}function CN(a,s,c){if(s==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=Er(a.nextSibling),a===null))return null;return a}function O0(a,s){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!s||(a=Er(a.nextSibling),a===null))return null;return a}function lh(a){return a.data==="$?"||a.data==="$~"}function ch(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function EN(a,s){var c=a.ownerDocument;if(a.data==="$~")a._reactRetry=s;else if(a.data!=="$?"||c.readyState!=="loading")s();else{var h=function(){s(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),a._reactRetry=h}}function Er(a){for(;a!=null;a=a.nextSibling){var s=a.nodeType;if(s===1||s===3)break;if(s===8){if(s=a.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return a}var uh=null;function M0(a){a=a.nextSibling;for(var s=0;a;){if(a.nodeType===8){var c=a.data;if(c==="/$"||c==="/&"){if(s===0)return Er(a.nextSibling);s--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||s++}a=a.nextSibling}return null}function z0(a){a=a.previousSibling;for(var s=0;a;){if(a.nodeType===8){var c=a.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(s===0)return a;s--}else c!=="/$"&&c!=="/&"||s++}a=a.previousSibling}return null}function I0(a,s,c){switch(s=xu(c),a){case"html":if(a=s.documentElement,!a)throw Error(r(452));return a;case"head":if(a=s.head,!a)throw Error(r(453));return a;case"body":if(a=s.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Zo(a){for(var s=a.attributes;s.length;)a.removeAttributeNode(s[0]);Te(a)}var Ar=new Map,$0=new Set;function yu(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var za=V.d;V.d={f:AN,r:TN,D:RN,C:LN,L:DN,m:ON,X:zN,S:MN,M:IN};function AN(){var a=za.f(),s=cu();return a||s}function TN(a){var s=Qe(a);s!==null&&s.tag===5&&s.type==="form"?tb(s):za.r(a)}var Ps=typeof document>"u"?null:document;function B0(a,s,c){var h=Ps;if(h&&typeof s=="string"&&s){var x=_r(s);x='link[rel="'+a+'"][href="'+x+'"]',typeof c=="string"&&(x+='[crossorigin="'+c+'"]'),$0.has(x)||($0.add(x),a={rel:a,crossOrigin:c,href:s},h.querySelector(x)===null&&(s=h.createElement("link"),En(s,"link",a),ft(s),h.head.appendChild(s)))}}function RN(a){za.D(a),B0("dns-prefetch",a,null)}function LN(a,s){za.C(a,s),B0("preconnect",a,s)}function DN(a,s,c){za.L(a,s,c);var h=Ps;if(h&&a&&s){var x='link[rel="preload"][as="'+_r(s)+'"]';s==="image"&&c&&c.imageSrcSet?(x+='[imagesrcset="'+_r(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(x+='[imagesizes="'+_r(c.imageSizes)+'"]')):x+='[href="'+_r(a)+'"]';var v=x;switch(s){case"style":v=Fs(a);break;case"script":v=Us(a)}Ar.has(v)||(a=g({rel:"preload",href:s==="image"&&c&&c.imageSrcSet?void 0:a,as:s},c),Ar.set(v,a),h.querySelector(x)!==null||s==="style"&&h.querySelector(Wo(v))||s==="script"&&h.querySelector(Jo(v))||(s=h.createElement("link"),En(s,"link",a),ft(s),h.head.appendChild(s)))}}function ON(a,s){za.m(a,s);var c=Ps;if(c&&a){var h=s&&typeof s.as=="string"?s.as:"script",x='link[rel="modulepreload"][as="'+_r(h)+'"][href="'+_r(a)+'"]',v=x;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Us(a)}if(!Ar.has(v)&&(a=g({rel:"modulepreload",href:a},s),Ar.set(v,a),c.querySelector(x)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Jo(v)))return}h=c.createElement("link"),En(h,"link",a),ft(h),c.head.appendChild(h)}}}function MN(a,s,c){za.S(a,s,c);var h=Ps;if(h&&a){var x=kt(h).hoistableStyles,v=Fs(a);s=s||"default";var N=x.get(v);if(!N){var L={loading:0,preload:null};if(N=h.querySelector(Wo(v)))L.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":s},c),(c=Ar.get(v))&&dh(a,c);var q=N=h.createElement("link");ft(q),En(q,"link",a),q._p=new Promise(function(ee,ce){q.onload=ee,q.onerror=ce}),q.addEventListener("load",function(){L.loading|=1}),q.addEventListener("error",function(){L.loading|=2}),L.loading|=4,bu(N,s,h)}N={type:"stylesheet",instance:N,count:1,state:L},x.set(v,N)}}}function zN(a,s){za.X(a,s);var c=Ps;if(c&&a){var h=kt(c).hoistableScripts,x=Us(a),v=h.get(x);v||(v=c.querySelector(Jo(x)),v||(a=g({src:a,async:!0},s),(s=Ar.get(x))&&fh(a,s),v=c.createElement("script"),ft(v),En(v,"link",a),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(x,v))}}function IN(a,s){za.M(a,s);var c=Ps;if(c&&a){var h=kt(c).hoistableScripts,x=Us(a),v=h.get(x);v||(v=c.querySelector(Jo(x)),v||(a=g({src:a,async:!0,type:"module"},s),(s=Ar.get(x))&&fh(a,s),v=c.createElement("script"),ft(v),En(v,"link",a),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(x,v))}}function P0(a,s,c,h){var x=(x=pe.current)?yu(x):null;if(!x)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(s=Fs(c.href),c=kt(x).hoistableStyles,h=c.get(s),h||(h={type:"style",instance:null,count:0,state:null},c.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){a=Fs(c.href);var v=kt(x).hoistableStyles,N=v.get(a);if(N||(x=x.ownerDocument||x,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(a,N),(v=x.querySelector(Wo(a)))&&!v._p&&(N.instance=v,N.state.loading=5),Ar.has(a)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Ar.set(a,c),v||$N(x,a,c,N.state))),s&&h===null)throw Error(r(528,""));return N}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=c.async,c=c.src,typeof c=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Us(c),c=kt(x).hoistableScripts,h=c.get(s),h||(h={type:"script",instance:null,count:0,state:null},c.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Fs(a){return'href="'+_r(a)+'"'}function Wo(a){return'link[rel="stylesheet"]['+a+"]"}function F0(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function $N(a,s,c,h){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=a.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),En(s,"link",c),ft(s),a.head.appendChild(s))}function Us(a){return'[src="'+_r(a)+'"]'}function Jo(a){return"script[async]"+a}function U0(a,s,c){if(s.count++,s.instance===null)switch(s.type){case"style":var h=a.querySelector('style[data-href~="'+_r(c.href)+'"]');if(h)return s.instance=h,ft(h),h;var x=g({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),ft(h),En(h,"style",x),bu(h,c.precedence,a),s.instance=h;case"stylesheet":x=Fs(c.href);var v=a.querySelector(Wo(x));if(v)return s.state.loading|=4,s.instance=v,ft(v),v;h=F0(c),(x=Ar.get(x))&&dh(h,x),v=(a.ownerDocument||a).createElement("link"),ft(v);var N=v;return N._p=new Promise(function(L,q){N.onload=L,N.onerror=q}),En(v,"link",h),s.state.loading|=4,bu(v,c.precedence,a),s.instance=v;case"script":return v=Us(c.src),(x=a.querySelector(Jo(v)))?(s.instance=x,ft(x),x):(h=c,(x=Ar.get(v))&&(h=g({},c),fh(h,x)),a=a.ownerDocument||a,x=a.createElement("script"),ft(x),En(x,"link",h),a.head.appendChild(x),s.instance=x);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(h=s.instance,s.state.loading|=4,bu(h,c.precedence,a));return s.instance}function bu(a,s,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=h.length?h[h.length-1]:null,v=x,N=0;N<h.length;N++){var L=h[N];if(L.dataset.precedence===s)v=L;else if(v!==x)break}v?v.parentNode.insertBefore(a,v.nextSibling):(s=c.nodeType===9?c.head:c,s.insertBefore(a,s.firstChild))}function dh(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.title==null&&(a.title=s.title)}function fh(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.integrity==null&&(a.integrity=s.integrity)}var vu=null;function H0(a,s,c){if(vu===null){var h=new Map,x=vu=new Map;x.set(c,h)}else x=vu,h=x.get(c),h||(h=new Map,x.set(c,h));if(h.has(a))return h;for(h.set(a,null),c=c.getElementsByTagName(a),x=0;x<c.length;x++){var v=c[x];if(!(v[he]||v[Ce]||a==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var N=v.getAttribute(s)||"";N=a+N;var L=h.get(N);L?L.push(v):h.set(N,[v])}}return h}function q0(a,s,c){a=a.ownerDocument||a,a.head.insertBefore(c,s==="title"?a.querySelector("head > title"):null)}function BN(a,s,c){if(c===1||s.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(a=s.disabled,typeof s.precedence=="string"&&a==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function V0(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function PN(a,s,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var x=Fs(h.href),v=s.querySelector(Wo(x));if(v){s=v._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(a.count++,a=_u.bind(a),s.then(a,a)),c.state.loading|=4,c.instance=v,ft(v);return}v=s.ownerDocument||s,h=F0(h),(x=Ar.get(x))&&dh(h,x),v=v.createElement("link"),ft(v);var N=v;N._p=new Promise(function(L,q){N.onload=L,N.onerror=q}),En(v,"link",h),c.instance=v}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(c,s),(s=c.state.preload)&&(c.state.loading&3)===0&&(a.count++,c=_u.bind(a),s.addEventListener("load",c),s.addEventListener("error",c))}}var ph=0;function FN(a,s){return a.stylesheets&&a.count===0&&ku(a,a.stylesheets),0<a.count||0<a.imgCount?function(c){var h=setTimeout(function(){if(a.stylesheets&&ku(a,a.stylesheets),a.unsuspend){var v=a.unsuspend;a.unsuspend=null,v()}},6e4+s);0<a.imgBytes&&ph===0&&(ph=62500*_N());var x=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&ku(a,a.stylesheets),a.unsuspend)){var v=a.unsuspend;a.unsuspend=null,v()}},(a.imgBytes>ph?50:800)+s);return a.unsuspend=c,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(x)}}:null}function _u(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ku(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var wu=null;function ku(a,s){a.stylesheets=null,a.unsuspend!==null&&(a.count++,wu=new Map,s.forEach(UN,a),wu=null,_u.call(a))}function UN(a,s){if(!(s.state.loading&4)){var c=wu.get(a);if(c)var h=c.get(null);else{c=new Map,wu.set(a,c);for(var x=a.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<x.length;v++){var N=x[v];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(c.set(N.dataset.precedence,N),h=N)}h&&c.set(null,h)}x=s.instance,N=x.getAttribute("data-precedence"),v=c.get(N)||h,v===h&&c.set(null,x),c.set(N,x),this.count++,h=_u.bind(this),x.addEventListener("load",h),x.addEventListener("error",h),v?v.parentNode.insertBefore(x,v.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(x,a.firstChild)),s.state.loading|=4}}var el={$$typeof:C,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function HN(a,s,c,h,x,v,N,L,q){this.tag=1,this.containerInfo=a,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=vr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vr(0),this.hiddenUpdates=vr(null),this.identifierPrefix=h,this.onUncaughtError=x,this.onCaughtError=v,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function G0(a,s,c,h,x,v,N,L,q,ee,ce,xe){return a=new HN(a,s,c,N,q,ee,ce,xe,L),s=1,v===!0&&(s|=24),v=or(3,null,null,s),a.current=v,v.stateNode=a,s=Gf(),s.refCount++,a.pooledCache=s,s.refCount++,v.memoizedState={element:h,isDehydrated:c,cache:s},Qf(v),a}function Y0(a){return a?(a=bs,a):bs}function K0(a,s,c,h,x,v){x=Y0(x),h.context===null?h.context=x:h.pendingContext=x,h=ti(s),h.payload={element:c},v=v===void 0?null:v,v!==null&&(h.callback=v),c=ni(a,h,s),c!==null&&(er(c,a,s),Lo(c,a,s))}function X0(a,s){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var c=a.retryLane;a.retryLane=c!==0&&c<s?c:s}}function hh(a,s){X0(a,s),(a=a.alternate)&&X0(a,s)}function Q0(a){if(a.tag===13||a.tag===31){var s=Li(a,67108864);s!==null&&er(s,a,67108864),hh(a,67108864)}}function Z0(a){if(a.tag===13||a.tag===31){var s=fr();s=X(s);var c=Li(a,s);c!==null&&er(c,a,s),hh(a,s)}}var Su=!0;function qN(a,s,c,h){var x=I.T;I.T=null;var v=V.p;try{V.p=2,mh(a,s,c,h)}finally{V.p=v,I.T=x}}function VN(a,s,c,h){var x=I.T;I.T=null;var v=V.p;try{V.p=8,mh(a,s,c,h)}finally{V.p=v,I.T=x}}function mh(a,s,c,h){if(Su){var x=gh(h);if(x===null)th(a,s,h,ju,c),J0(a,h);else if(YN(x,a,s,c,h))h.stopPropagation();else if(J0(a,h),s&4&&-1<GN.indexOf(a)){for(;x!==null;){var v=Qe(x);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var N=it(v.pendingLanes);if(N!==0){var L=v;for(L.pendingLanes|=2,L.entangledLanes|=2;N;){var q=1<<31-lt(N);L.entanglements[1]|=q,N&=~q}Jr(v),(wt&6)===0&&(ou=Xt()+500,Ko(0))}}break;case 31:case 13:L=Li(v,2),L!==null&&er(L,v,2),cu(),hh(v,2)}if(v=gh(h),v===null&&th(a,s,h,ju,c),v===x)break;x=v}x!==null&&h.stopPropagation()}else th(a,s,h,null,c)}}function gh(a){return a=yf(a),xh(a)}var ju=null;function xh(a){if(ju=null,a=De(a),a!==null){var s=o(a);if(s===null)a=null;else{var c=s.tag;if(c===13){if(a=l(s),a!==null)return a;a=null}else if(c===31){if(a=d(s),a!==null)return a;a=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;a=null}else s!==a&&(a=null)}}return ju=a,null}function W0(a){switch(a){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(Sn()){case Z:return 2;case fe:return 8;case Ne:case ze:return 32;case He:return 268435456;default:return 32}default:return 32}}var yh=!1,pi=null,hi=null,mi=null,tl=new Map,nl=new Map,gi=[],GN="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 J0(a,s){switch(a){case"focusin":case"focusout":pi=null;break;case"dragenter":case"dragleave":hi=null;break;case"mouseover":case"mouseout":mi=null;break;case"pointerover":case"pointerout":tl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":nl.delete(s.pointerId)}}function rl(a,s,c,h,x,v){return a===null||a.nativeEvent!==v?(a={blockedOn:s,domEventName:c,eventSystemFlags:h,nativeEvent:v,targetContainers:[x]},s!==null&&(s=Qe(s),s!==null&&Q0(s)),a):(a.eventSystemFlags|=h,s=a.targetContainers,x!==null&&s.indexOf(x)===-1&&s.push(x),a)}function YN(a,s,c,h,x){switch(s){case"focusin":return pi=rl(pi,a,s,c,h,x),!0;case"dragenter":return hi=rl(hi,a,s,c,h,x),!0;case"mouseover":return mi=rl(mi,a,s,c,h,x),!0;case"pointerover":var v=x.pointerId;return tl.set(v,rl(tl.get(v)||null,a,s,c,h,x)),!0;case"gotpointercapture":return v=x.pointerId,nl.set(v,rl(nl.get(v)||null,a,s,c,h,x)),!0}return!1}function ev(a){var s=De(a.target);if(s!==null){var c=o(s);if(c!==null){if(s=c.tag,s===13){if(s=l(c),s!==null){a.blockedOn=s,Se(a.priority,function(){Z0(c)});return}}else if(s===31){if(s=d(c),s!==null){a.blockedOn=s,Se(a.priority,function(){Z0(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Nu(a){if(a.blockedOn!==null)return!1;for(var s=a.targetContainers;0<s.length;){var c=gh(a.nativeEvent);if(c===null){c=a.nativeEvent;var h=new c.constructor(c.type,c);xf=h,c.target.dispatchEvent(h),xf=null}else return s=Qe(c),s!==null&&Q0(s),a.blockedOn=c,!1;s.shift()}return!0}function tv(a,s,c){Nu(a)&&c.delete(s)}function KN(){yh=!1,pi!==null&&Nu(pi)&&(pi=null),hi!==null&&Nu(hi)&&(hi=null),mi!==null&&Nu(mi)&&(mi=null),tl.forEach(tv),nl.forEach(tv)}function Cu(a,s){a.blockedOn===s&&(a.blockedOn=null,yh||(yh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,KN)))}var Eu=null;function nv(a){Eu!==a&&(Eu=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Eu===a&&(Eu=null);for(var s=0;s<a.length;s+=3){var c=a[s],h=a[s+1],x=a[s+2];if(typeof h!="function"){if(xh(h||c)===null)continue;break}var v=Qe(c);v!==null&&(a.splice(s,3),s-=3,gp(v,{pending:!0,data:x,method:c.method,action:h},h,x))}}))}function Hs(a){function s(q){return Cu(q,a)}pi!==null&&Cu(pi,a),hi!==null&&Cu(hi,a),mi!==null&&Cu(mi,a),tl.forEach(s),nl.forEach(s);for(var c=0;c<gi.length;c++){var h=gi[c];h.blockedOn===a&&(h.blockedOn=null)}for(;0<gi.length&&(c=gi[0],c.blockedOn===null);)ev(c),c.blockedOn===null&&gi.shift();if(c=(a.ownerDocument||a).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var x=c[h],v=c[h+1],N=x[Ae]||null;if(typeof v=="function")N||nv(c);else if(N){var L=null;if(v&&v.hasAttribute("formAction")){if(x=v,N=v[Ae]||null)L=N.formAction;else if(xh(x)!==null)continue}else L=N.action;typeof L=="function"?c[h+1]=L:(c.splice(h,3),h-=3),nv(c)}}}function rv(){function a(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(N){return x=N})},focusReset:"manual",scroll:"manual"})}function s(){x!==null&&(x(),x=null),h||setTimeout(c,20)}function c(){if(!h&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,x=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(c,100),function(){h=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),x!==null&&(x(),x=null)}}}function bh(a){this._internalRoot=a}Au.prototype.render=bh.prototype.render=function(a){var s=this._internalRoot;if(s===null)throw Error(r(409));var c=s.current,h=fr();K0(c,h,a,s,null,null)},Au.prototype.unmount=bh.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var s=a.containerInfo;K0(a.current,2,null,a,null,null),cu(),s[Re]=null}};function Au(a){this._internalRoot=a}Au.prototype.unstable_scheduleHydration=function(a){if(a){var s=ve();a={blockedOn:null,target:a,priority:s};for(var c=0;c<gi.length&&s!==0&&s<gi[c].priority;c++);gi.splice(c,0,a),c===0&&ev(a)}};var av=t.version;if(av!=="19.2.4")throw Error(r(527,av,"19.2.4"));V.findDOMNode=function(a){var s=a._reactInternals;if(s===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=f(s),a=a!==null?m(a):null,a=a===null?null:a.stateNode,a};var XN={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tu.isDisabled&&Tu.supportsFiber)try{Rt=Tu.inject(XN),_t=Tu}catch{}}return sl.createRoot=function(a,s){if(!i(a))throw Error(r(299));var c=!1,h="",x=db,v=fb,N=pb;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(v=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError)),s=G0(a,1,!1,null,null,c,h,null,x,v,N,rv),a[Re]=s.current,eh(a),new bh(s)},sl.hydrateRoot=function(a,s,c){if(!i(a))throw Error(r(299));var h=!1,x="",v=db,N=fb,L=pb,q=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(x=c.identifierPrefix),c.onUncaughtError!==void 0&&(v=c.onUncaughtError),c.onCaughtError!==void 0&&(N=c.onCaughtError),c.onRecoverableError!==void 0&&(L=c.onRecoverableError),c.formState!==void 0&&(q=c.formState)),s=G0(a,1,!0,s,c??null,h,x,q,v,N,L,rv),s.context=Y0(null),c=s.current,h=fr(),h=X(h),x=ti(h),x.callback=null,ni(c,x,h),c=h,s.current.lanes=c,Fn(s,c),Jr(s),a[Re]=s.current,eh(a),new Au(s)},sl.version="19.2.4",sl}var Mv;function fE(){if(Mv)return Ch.exports;Mv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ch.exports=dE(),Ch.exports}var pE=fE();var Jw=e=>{throw TypeError(e)},hE=(e,t,n)=>t.has(e)||Jw("Cannot "+n),Rh=(e,t,n)=>(hE(e,t,"read from private field"),n?n.call(e):t.get(e)),mE=(e,t,n)=>t.has(e)?Jw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),zv="popstate";function Iv(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function gE(e={}){function t(r,i){let o=i.state?.masked,{pathname:l,search:d,hash:p}=o||r.location;return Bl("",{pathname:l,search:d,hash:p},i.state&&i.state.usr||null,i.state&&i.state.key||"default",o?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:ca(i)}return yE(t,n,null,e)}function st(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Jt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xE(){return Math.random().toString(36).substring(2,10)}function $v(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Bl(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Va(t):t,state:n,key:t&&t.key||r||xE(),unstable_mask:i}}function ca({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Va(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function yE(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,d="POP",p=null,f=m();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function m(){return(l.state||{idx:null}).idx}function g(){d="POP";let j=m(),S=j==null?null:j-f;f=j,p&&p({action:d,location:k.location,delta:S})}function y(j,S){d="PUSH";let E=Iv(j)?j:Bl(k.location,j,S);f=m()+1;let C=$v(E,f),z=k.createHref(E.unstable_mask||E);try{l.pushState(C,"",z)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(z)}o&&p&&p({action:d,location:k.location,delta:1})}function b(j,S){d="REPLACE";let E=Iv(j)?j:Bl(k.location,j,S);f=m();let C=$v(E,f),z=k.createHref(E.unstable_mask||E);l.replaceState(C,"",z),o&&p&&p({action:d,location:k.location,delta:0})}function w(j){return ek(j)}let k={get action(){return d},get location(){return e(i,l)},listen(j){if(p)throw new Error("A history only accepts one active listener");return i.addEventListener(zv,g),p=j,()=>{i.removeEventListener(zv,g),p=null}},createHref(j){return t(i,j)},createURL:w,encodeLocation(j){let S=w(j);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:b,go(j){return l.go(j)}};return k}function ek(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),st(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ca(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Sl,Bv=class{constructor(e){if(mE(this,Sl,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Rh(this,Sl).has(e))return Rh(this,Sl).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Rh(this,Sl).set(e,t)}};Sl=new WeakMap;var bE=new Set(["lazy","caseSensitive","path","id","index","children"]);function vE(e){return bE.has(e)}var _E=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function wE(e){return _E.has(e)}function kE(e){return e.index===!0}function Pl(e,t,n=[],r={},i=!1){return e.map((o,l)=>{let d=[...n,String(l)],p=typeof o.id=="string"?o.id:d.join("-");if(st(o.index!==!0||!o.children,"Cannot specify children on an index route"),st(i||!r[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),kE(o)){let f={...o,id:p};return r[p]=Pv(f,t(f)),f}else{let f={...o,id:p,children:void 0};return r[p]=Pv(f,t(f)),o.children&&(f.children=Pl(o.children,t,d,r,i)),f}})}function Pv(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function vi(e,t,n="/"){return jl(e,t,n,!1)}function jl(e,t,n,r){let i=typeof t=="string"?Va(t):t,o=Or(i.pathname||"/",n);if(o==null)return null;let l=tk(e);jE(l);let d=null;for(let p=0;d==null&&p<l.length;++p){let f=zE(o);d=OE(l[p],f,r)}return d}function SE(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function tk(e,t=[],n=[],r="",i=!1){let o=(l,d,p=i,f)=>{let m={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:d,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&p)return;st(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let g=Ur([r,m.relativePath]),y=n.concat(m);l.children&&l.children.length>0&&(st(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),tk(l.children,t,y,g,p)),!(l.path==null&&!l.index)&&t.push({path:g,score:LE(g,l.index),routesMeta:y})};return e.forEach((l,d)=>{if(l.path===""||!l.path?.includes("?"))o(l,d);else for(let p of nk(l.path))o(l,d,!0,p)}),t}function nk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=nk(r.join("/")),d=[];return d.push(...l.map(p=>p===""?o:[o,p].join("/"))),i&&d.push(...l),d.map(p=>e.startsWith("/")&&p===""?"/":p)}function jE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:DE(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var NE=/^:[\w-]+$/,CE=3,EE=2,AE=1,TE=10,RE=-2,Fv=e=>e==="*";function LE(e,t){let n=e.split("/"),r=n.length;return n.some(Fv)&&(r+=RE),t&&(r+=EE),n.filter(i=>!Fv(i)).reduce((i,o)=>i+(NE.test(o)?CE:o===""?AE:TE),r)}function DE(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function OE(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",l=[];for(let d=0;d<r.length;++d){let p=r[d],f=d===r.length-1,m=o==="/"?t:t.slice(o.length)||"/",g=yd({path:p.relativePath,caseSensitive:p.caseSensitive,end:f},m),y=p.route;if(!g&&f&&n&&!r[r.length-1].route.index&&(g=yd({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},m)),!g)return null;Object.assign(i,g.params),l.push({params:i,pathname:Ur([o,g.pathname]),pathnameBase:BE(Ur([o,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(o=Ur([o,g.pathnameBase]))}return l}function yd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ME(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],l=o.replace(/(.)\/+$/,"$1"),d=i.slice(1);return{params:r.reduce((f,{paramName:m,isOptional:g},y)=>{if(m==="*"){let w=d[y]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const b=d[y];return g&&!b?f[m]=void 0:f[m]=(b||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:l,pattern:e}}function ME(e,t=!1,n=!0){Jt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,d,p,f,m)=>{if(r.push({paramName:d,isOptional:p!=null}),p){let g=m.charAt(f+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function zE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Jt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Or(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function IE({basename:e,pathname:t}){return t==="/"?e:Ur([e,t])}var rk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sg=e=>rk.test(e);function $E(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Va(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=Uv(n.substring(1),"/"):o=Uv(n,t)):o=t,{pathname:o,search:PE(r),hash:FE(i)}}function Uv(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Lh(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ak(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qd(e){let t=ak(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function tc(e,t,n,r=!1){let i;typeof e=="string"?i=Va(e):(i={...e},st(!i.pathname||!i.pathname.includes("?"),Lh("?","pathname","search",i)),st(!i.pathname||!i.pathname.includes("#"),Lh("#","pathname","hash",i)),st(!i.search||!i.search.includes("#"),Lh("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,d;if(l==null)d=n;else{let g=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),g-=1;i.pathname=y.join("/")}d=g>=0?t[g]:"/"}let p=$E(i,d),f=l&&l!=="/"&&l.endsWith("/"),m=(o||l===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(f||m)&&(p.pathname+="/"),p}var Ur=e=>e.join("/").replace(/\/\/+/g,"/"),BE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),PE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,FE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,nc=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ao(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function rc(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ik=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sk(e,t){let n=e;if(typeof n!="string"||!rk.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ik)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),d=Or(l.pathname,t);l.origin===o.origin&&d!=null?n=d+l.search+l.hash:i=!0}catch{Jt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var wi=Symbol("Uninstrumented");function UE(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(i=>i({id:t.id,index:t.index,path:t.path,instrument(o){let l=Object.keys(n);for(let d of l)o[d]&&n[d].push(o[d])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let i=Ws(n.lazy,t.lazy,()=>{});i&&(r.lazy=i)}if(typeof t.lazy=="object"){let i=t.lazy;["middleware","loader","action"].forEach(o=>{let l=i[o],d=n[`lazy.${o}`];if(typeof l=="function"&&d.length>0){let p=Ws(d,l,()=>{});p&&(r.lazy=Object.assign(r.lazy||{},{[o]:p}))}})}return["loader","action"].forEach(i=>{let o=t[i];if(typeof o=="function"&&n[i].length>0){let l=o[wi]??o,d=Ws(n[i],l,(...p)=>Hv(p[0]));d&&(i==="loader"&&l.hydrate===!0&&(d.hydrate=!0),d[wi]=l,r[i]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(i=>{let o=i[wi]??i,l=Ws(n.middleware,o,(...d)=>Hv(d[0]));return l?(l[wi]=o,l):i})),r}function HE(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(i){let o=Object.keys(i);for(let l of o)i[l]&&n[l].push(i[l])}})),n.navigate.length>0){let r=e.navigate[wi]??e.navigate,i=Ws(n.navigate,r,(...o)=>{let[l,d]=o;return{to:typeof l=="number"||typeof l=="string"?l:l?ca(l):".",...qv(e,d??{})}});i&&(i[wi]=r,e.navigate=i)}if(n.fetch.length>0){let r=e.fetch[wi]??e.fetch,i=Ws(n.fetch,r,(...o)=>{let[l,,d,p]=o;return{href:d??".",fetcherKey:l,...qv(e,p??{})}});i&&(i[wi]=r,e.fetch=i)}return e}function Ws(e,t,n){return e.length===0?null:async(...r)=>{let i=await ok(e,n(...r),()=>t(...r),e.length-1);if(i.type==="error")throw i.value;return i.value}}async function ok(e,t,n,r){let i=e[r],o;if(i){let l,d=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=ok(e,t,n,r-1),o=await l,st(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await i(d,t)}catch(p){console.error("An instrumentation function threw an error:",p)}l||await d(),await l}else try{o={type:"success",value:await n()}}catch(l){o={type:"error",value:l}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Hv(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:qE(t),params:{...r},unstable_pattern:i,context:VE(n)}}function qv(e,t){return{currentUrl:ca(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function qE(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function VE(e){if(YE(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var GE=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function YE(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===GE}var lk=["POST","PUT","PATCH","DELETE"],KE=new Set(lk),XE=["GET",...lk],QE=new Set(XE),ck=new Set([301,302,303,307,308]),ZE=new Set([307,308]),Dh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},WE={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ol={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},JE=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),uk="remix-router-transitions",dk=Symbol("ResetLoaderData");function eA(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";st(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||JE,o=i;if(e.unstable_instrumentations){let H=e.unstable_instrumentations;o=X=>({...i(X),...UE(H.map(ae=>ae.route).filter(Boolean),X)})}let l={},d=Pl(e.routes,o,void 0,l),p,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let m=e.dataStrategy||iA,g={...e.future},y=null,b=new Set,w=null,k=null,j=null,S=e.hydrationData!=null,E=vi(d,e.history.location,f),C=!1,z=null,D,A;if(E==null&&!e.patchRoutesOnNavigation){let H=Rr(404,{pathname:e.history.location.pathname}),{matches:X,route:ae}=Lu(d);D=!0,A=!D,E=X,z={[ae.id]:H}}else if(E&&!e.hydrationData&&vr(E,d,e.history.location.pathname).active&&(E=null),E)if(E.some(H=>H.route.lazy))D=!1,A=!D;else if(!E.some(H=>jg(H.route)))D=!0,A=!D;else{let H=e.hydrationData?e.hydrationData.loaderData:null,X=e.hydrationData?e.hydrationData.errors:null,ae=E;if(X){let ve=E.findIndex(Se=>X[Se.route.id]!==void 0);ae=ae.slice(0,ve+1)}A=!1,D=ae.every(ve=>{let Se=fk(ve.route,H,X);return A=A||Se.renderFallback,!Se.shouldLoad})}else{D=!1,A=!D,E=[];let H=vr(null,d,e.history.location.pathname);H.active&&H.matches&&(C=!0,E=H.matches)}let P,T={historyAction:e.history.action,location:e.history.location,matches:E,initialized:D,renderFallback:A,navigation:Dh,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||z,fetchers:new Map,blockers:new Map},F="POP",M=null,G=!1,Q,re=!1,$=new Map,U=null,I=!1,V=!1,te=new Set,oe=new Map,R=0,B=-1,K=new Map,O=new Set,se=new Map,ie=new Map,pe=new Set,Ee=new Map,Ie,Ue=null;function be(){if(y=e.history.listen(({action:H,location:X,delta:ae})=>{if(Ie){Ie(),Ie=void 0;return}Jt(Ee.size===0||ae!=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 ve=Lt({currentLocation:T.location,nextLocation:X,historyAction:H});if(ve&&ae!=null){let Se=new Promise(Le=>{Ie=Le});e.history.go(ae*-1),Ge(ve,{state:"blocked",location:X,proceed(){Ge(ve,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),Se.then(()=>e.history.go(ae))},reset(){let Le=new Map(T.blockers);Le.set(ve,ol),ge({blockers:Le})}}),M?.resolve(),M=null;return}return Je(H,X)}),n){kA(t,$);let H=()=>SA(t,$);t.addEventListener("pagehide",H),U=()=>t.removeEventListener("pagehide",H)}return T.initialized||Je("POP",T.location,{initialHydration:!0}),P}function de(){y&&y(),U&&U(),b.clear(),Q&&Q.abort(),T.fetchers.forEach((H,X)=>Rt(X)),T.blockers.forEach((H,X)=>ye(X))}function ke(H){return b.add(H),()=>b.delete(H)}function ge(H,X={}){H.matches&&(H.matches=H.matches.map(Se=>{let Le=l[Se.route.id],Ce=Se.route;return Ce.element!==Le.element||Ce.errorElement!==Le.errorElement||Ce.hydrateFallbackElement!==Le.hydrateFallbackElement?{...Se,route:Le}:Se})),T={...T,...H};let ae=[],ve=[];T.fetchers.forEach((Se,Le)=>{Se.state==="idle"&&(pe.has(Le)?ae.push(Le):ve.push(Le))}),pe.forEach(Se=>{!T.fetchers.has(Se)&&!oe.has(Se)&&ae.push(Se)}),[...b].forEach(Se=>Se(T,{deletedFetchers:ae,newErrors:H.errors??null,viewTransitionOpts:X.viewTransitionOpts,flushSync:X.flushSync===!0})),ae.forEach(Se=>Rt(Se)),ve.forEach(Se=>T.fetchers.delete(Se))}function we(H,X,{flushSync:ae}={}){let ve=T.actionData!=null&&T.navigation.formMethod!=null&&On(T.navigation.formMethod)&&T.navigation.state==="loading"&&H.state?._isRedirect!==!0,Se;X.actionData?Object.keys(X.actionData).length>0?Se=X.actionData:Se=null:ve?Se=T.actionData:Se=null;let Le=X.loaderData?e1(T.loaderData,X.loaderData,X.matches||[],X.errors):T.loaderData,Ce=T.blockers;Ce.size>0&&(Ce=new Map(Ce),Ce.forEach((Ye,qe)=>Ce.set(qe,ol)));let Ae=I?!1:ya(H,X.matches||T.matches),Re=G===!0||T.navigation.formMethod!=null&&On(T.navigation.formMethod)&&H.state?._isRedirect!==!0;p&&(d=p,p=void 0),I||F==="POP"||(F==="PUSH"?e.history.push(H,H.state):F==="REPLACE"&&e.history.replace(H,H.state));let Ve;if(F==="POP"){let Ye=$.get(T.location.pathname);Ye&&Ye.has(H.pathname)?Ve={currentLocation:T.location,nextLocation:H}:$.has(H.pathname)&&(Ve={currentLocation:H,nextLocation:T.location})}else if(re){let Ye=$.get(T.location.pathname);Ye?Ye.add(H.pathname):(Ye=new Set([H.pathname]),$.set(T.location.pathname,Ye)),Ve={currentLocation:T.location,nextLocation:H}}ge({...X,actionData:Se,loaderData:Le,historyAction:F,location:H,initialized:!0,renderFallback:!1,navigation:Dh,revalidation:"idle",restoreScrollPosition:Ae,preventScrollReset:Re,blockers:Ce},{viewTransitionOpts:Ve,flushSync:ae===!0}),F="POP",G=!1,re=!1,I=!1,V=!1,M?.resolve(),M=null,Ue?.resolve(),Ue=null}async function Xe(H,X){if(M?.resolve(),M=null,typeof H=="number"){M||(M=a1());let Te=M.promise;return e.history.go(H),Te}let ae=Cm(T.location,T.matches,f,H,X?.fromRouteId,X?.relative),{path:ve,submission:Se,error:Le}=Vv(!1,ae,X),Ce;X?.unstable_mask&&(Ce={pathname:"",search:"",hash:"",...typeof X.unstable_mask=="string"?Va(X.unstable_mask):{...T.location.unstable_mask,...X.unstable_mask}});let Ae=T.location,Re=Bl(Ae,ve,X&&X.state,void 0,Ce);Re={...Re,...e.history.encodeLocation(Re)};let Ve=X&&X.replace!=null?X.replace:void 0,Ye="PUSH";Ve===!0?Ye="REPLACE":Ve===!1||Se!=null&&On(Se.formMethod)&&Se.formAction===T.location.pathname+T.location.search&&(Ye="REPLACE");let qe=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,gt=(X&&X.flushSync)===!0,he=Lt({currentLocation:Ae,nextLocation:Re,historyAction:Ye});if(he){Ge(he,{state:"blocked",location:Re,proceed(){Ge(he,{state:"proceeding",proceed:void 0,reset:void 0,location:Re}),Xe(H,X)},reset(){let Te=new Map(T.blockers);Te.set(he,ol),ge({blockers:Te})}});return}await Je(Ye,Re,{submission:Se,pendingError:Le,preventScrollReset:qe,replace:X&&X.replace,enableViewTransition:X&&X.viewTransition,flushSync:gt,callSiteDefaultShouldRevalidate:X&&X.unstable_defaultShouldRevalidate})}function Me(){Ue||(Ue=a1()),Ne(),ge({revalidation:"loading"});let H=Ue.promise;return T.navigation.state==="submitting"?H:T.navigation.state==="idle"?(Je(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),H):(Je(F||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:re===!0}),H)}async function Je(H,X,ae){Q&&Q.abort(),Q=null,F=H,I=(ae&&ae.startUninterruptedRevalidation)===!0,Ya(T.location,T.matches),G=(ae&&ae.preventScrollReset)===!0,re=(ae&&ae.enableViewTransition)===!0;let ve=p||d,Se=ae&&ae.overrideNavigation,Le=ae?.initialHydration&&T.matches&&T.matches.length>0&&!C?T.matches:vi(ve,X,f),Ce=(ae&&ae.flushSync)===!0;if(Le&&T.initialized&&!V&&pA(T.location,X)&&!(ae&&ae.submission&&On(ae.submission.formMethod))){we(X,{matches:Le},{flushSync:Ce});return}let Ae=vr(Le,ve,X.pathname);if(Ae.active&&Ae.matches&&(Le=Ae.matches),!Le){let{error:De,notFoundMatches:Qe,route:$e}=it(X.pathname);we(X,{matches:Qe,loaderData:{},errors:{[$e.id]:De}},{flushSync:Ce});return}Q=new AbortController;let Re=Xs(e.history,X,Q.signal,ae&&ae.submission),Ve=e.getContext?await e.getContext():new Bv,Ye;if(ae&&ae.pendingError)Ye=[_i(Le).route.id,{type:"error",error:ae.pendingError}];else if(ae&&ae.submission&&On(ae.submission.formMethod)){let De=await zt(Re,X,ae.submission,Le,Ve,Ae.active,ae&&ae.initialHydration===!0,{replace:ae.replace,flushSync:Ce});if(De.shortCircuited)return;if(De.pendingActionResult){let[Qe,$e]=De.pendingActionResult;if(hr($e)&&ao($e.error)&&$e.error.status===404){Q=null,we(X,{matches:De.matches,loaderData:{},errors:{[Qe]:$e.error}});return}}Le=De.matches||Le,Ye=De.pendingActionResult,Se=Oh(X,ae.submission),Ce=!1,Ae.active=!1,Re=Xs(e.history,Re.url,Re.signal)}let{shortCircuited:qe,matches:gt,loaderData:he,errors:Te}=await en(Re,X,Le,Ve,Ae.active,Se,ae&&ae.submission,ae&&ae.fetcherSubmission,ae&&ae.replace,ae&&ae.initialHydration===!0,Ce,Ye,ae&&ae.callSiteDefaultShouldRevalidate);qe||(Q=null,we(X,{matches:gt||Le,...t1(Ye),loaderData:he,errors:Te}))}async function zt(H,X,ae,ve,Se,Le,Ce,Ae={}){Ne();let Re=_A(X,ae);if(ge({navigation:Re},{flushSync:Ae.flushSync===!0}),Le){let qe=await Fn(ve,X.pathname,H.signal);if(qe.type==="aborted")return{shortCircuited:!0};if(qe.type==="error"){if(qe.partialMatches.length===0){let{matches:he,route:Te}=Lu(d);return{matches:he,pendingActionResult:[Te.id,{type:"error",error:qe.error}]}}let gt=_i(qe.partialMatches).route.id;return{matches:qe.partialMatches,pendingActionResult:[gt,{type:"error",error:qe.error}]}}else if(qe.matches)ve=qe.matches;else{let{notFoundMatches:gt,error:he,route:Te}=it(X.pathname);return{matches:gt,pendingActionResult:[Te.id,{type:"error",error:he}]}}}let Ve,Ye=ad(ve,X);if(!Ye.route.action&&!Ye.route.lazy)Ve={type:"error",error:Rr(405,{method:H.method,pathname:X.pathname,routeId:Ye.route.id})};else{let qe=Js(o,l,H,ve,Ye,Ce?[]:r,Se),gt=await Z(H,qe,Se,null);if(Ve=gt[Ye.route.id],!Ve){for(let he of ve)if(gt[he.route.id]){Ve=gt[he.route.id];break}}if(H.signal.aborted)return{shortCircuited:!0}}if(Xi(Ve)){let qe;return Ae&&Ae.replace!=null?qe=Ae.replace:qe=Zv(Ve.response.headers.get("Location"),new URL(H.url),f,e.history)===T.location.pathname+T.location.search,await Sn(H,Ve,!0,{submission:ae,replace:qe}),{shortCircuited:!0}}if(hr(Ve)){let qe=_i(ve,Ye.route.id);return(Ae&&Ae.replace)!==!0&&(F="PUSH"),{matches:ve,pendingActionResult:[qe.route.id,Ve,Ye.route.id]}}return{matches:ve,pendingActionResult:[Ye.route.id,Ve]}}async function en(H,X,ae,ve,Se,Le,Ce,Ae,Re,Ve,Ye,qe,gt){let he=Le||Oh(X,Ce),Te=Ce||Ae||r1(he),De=!I&&!Ve;if(Se){if(De){let tn=Kt(qe);ge({navigation:he,...tn!==void 0?{actionData:tn}:{}},{flushSync:Ye})}let ot=await Fn(ae,X.pathname,H.signal);if(ot.type==="aborted")return{shortCircuited:!0};if(ot.type==="error"){if(ot.partialMatches.length===0){let{matches:Rn,route:ln}=Lu(d);return{matches:Rn,loaderData:{},errors:{[ln.id]:ot.error}}}let tn=_i(ot.partialMatches).route.id;return{matches:ot.partialMatches,loaderData:{},errors:{[tn]:ot.error}}}else if(ot.matches)ae=ot.matches;else{let{error:tn,notFoundMatches:Rn,route:ln}=it(X.pathname);return{matches:Rn,loaderData:{},errors:{[ln.id]:tn}}}}let Qe=p||d,{dsMatches:$e,revalidatingFetchers:kt}=Gv(H,ve,o,l,e.history,T,ae,Te,X,Ve?[]:r,Ve===!0,V,te,pe,se,O,Qe,f,e.patchRoutesOnNavigation!=null,qe,gt);if(B=++R,!e.dataStrategy&&!$e.some(ot=>ot.shouldLoad)&&!$e.some(ot=>ot.route.middleware&&ot.route.middleware.length>0)&&kt.length===0){let ot=bn();return we(X,{matches:ae,loaderData:{},errors:qe&&hr(qe[1])?{[qe[0]]:qe[1].error}:null,...t1(qe),...ot?{fetchers:new Map(T.fetchers)}:{}},{flushSync:Ye}),{shortCircuited:!0}}if(De){let ot={};if(!Se){ot.navigation=he;let tn=Kt(qe);tn!==void 0&&(ot.actionData=tn)}kt.length>0&&(ot.fetchers=An(kt)),ge(ot,{flushSync:Ye})}kt.forEach(ot=>{yt(ot.key),ot.controller&&oe.set(ot.key,ot.controller)});let ft=()=>kt.forEach(ot=>yt(ot.key));Q&&Q.signal.addEventListener("abort",ft);let{loaderResults:hn,fetcherResults:Tn}=await fe($e,kt,H,ve);if(H.signal.aborted)return{shortCircuited:!0};Q&&Q.signal.removeEventListener("abort",ft),kt.forEach(ot=>oe.delete(ot.key));let vn=Du(hn);if(vn)return await Sn(H,vn.result,!0,{replace:Re}),{shortCircuited:!0};if(vn=Du(Tn),vn)return O.add(vn.key),await Sn(H,vn.result,!0,{replace:Re}),{shortCircuited:!0};let{loaderData:Kr,errors:Ci}=Jv(T,ae,hn,qe,kt,Tn);Ve&&T.errors&&(Ci={...T.errors,...Ci});let Xr=bn(),Ei=on(B),ls=Xr||Ei||kt.length>0;return{matches:ae,loaderData:Kr,errors:Ci,...ls?{fetchers:new Map(T.fetchers)}:{}}}function Kt(H){if(H&&!hr(H[1]))return{[H[0]]:H[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function An(H){return H.forEach(X=>{let ae=T.fetchers.get(X.key),ve=ll(void 0,ae?ae.data:void 0);T.fetchers.set(X.key,ve)}),new Map(T.fetchers)}async function Kn(H,X,ae,ve){yt(H);let Se=(ve&&ve.flushSync)===!0,Le=p||d,Ce=Cm(T.location,T.matches,f,ae,X,ve?.relative),Ae=vi(Le,Ce,f),Re=vr(Ae,Le,Ce);if(Re.active&&Re.matches&&(Ae=Re.matches),!Ae){He(H,X,Rr(404,{pathname:Ce}),{flushSync:Se});return}let{path:Ve,submission:Ye,error:qe}=Vv(!0,Ce,ve);if(qe){He(H,X,qe,{flushSync:Se});return}let gt=e.getContext?await e.getContext():new Bv,he=(ve&&ve.preventScrollReset)===!0;if(Ye&&On(Ye.formMethod)){await Pn(H,X,Ve,Ae,gt,Re.active,Se,he,Ye,ve&&ve.unstable_defaultShouldRevalidate);return}se.set(H,{routeId:X,path:Ve}),await Xt(H,X,Ve,Ae,gt,Re.active,Se,he,Ye)}async function Pn(H,X,ae,ve,Se,Le,Ce,Ae,Re,Ve){Ne(),se.delete(H);let Ye=T.fetchers.get(H);ze(H,wA(Re,Ye),{flushSync:Ce});let qe=new AbortController,gt=Xs(e.history,ae,qe.signal,Re);if(Le){let Ht=await Fn(ve,new URL(gt.url).pathname,gt.signal,H);if(Ht.type==="aborted")return;if(Ht.type==="error"){He(H,X,Ht.error,{flushSync:Ce});return}else if(Ht.matches)ve=Ht.matches;else{He(H,X,Rr(404,{pathname:ae}),{flushSync:Ce});return}}let he=ad(ve,ae);if(!he.route.action&&!he.route.lazy){let Ht=Rr(405,{method:Re.formMethod,pathname:ae,routeId:X});He(H,X,Ht,{flushSync:Ce});return}oe.set(H,qe);let Te=R,De=Js(o,l,gt,ve,he,r,Se),Qe=await Z(gt,De,Se,H),$e=Qe[he.route.id];if(!$e){for(let Ht of De)if(Qe[Ht.route.id]){$e=Qe[Ht.route.id];break}}if(gt.signal.aborted){oe.get(H)===qe&&oe.delete(H);return}if(pe.has(H)){if(Xi($e)||hr($e)){ze(H,Ba(void 0));return}}else{if(Xi($e))if(oe.delete(H),B>Te){ze(H,Ba(void 0));return}else return O.add(H),ze(H,ll(Re)),Sn(gt,$e,!1,{fetcherSubmission:Re,preventScrollReset:Ae});if(hr($e)){He(H,X,$e.error);return}}let kt=T.navigation.location||T.location,ft=Xs(e.history,kt,qe.signal),hn=p||d,Tn=T.navigation.state!=="idle"?vi(hn,T.navigation.location,f):T.matches;st(Tn,"Didn't find any matches after fetcher action");let vn=++R;K.set(H,vn);let Kr=ll(Re,$e.data);T.fetchers.set(H,Kr);let{dsMatches:Ci,revalidatingFetchers:Xr}=Gv(ft,Se,o,l,e.history,T,Tn,Re,kt,r,!1,V,te,pe,se,O,hn,f,e.patchRoutesOnNavigation!=null,[he.route.id,$e],Ve);Xr.filter(Ht=>Ht.key!==H).forEach(Ht=>{let cs=Ht.key,us=T.fetchers.get(cs),vc=ll(void 0,us?us.data:void 0);T.fetchers.set(cs,vc),yt(cs),Ht.controller&&oe.set(cs,Ht.controller)}),ge({fetchers:new Map(T.fetchers)});let Ei=()=>Xr.forEach(Ht=>yt(Ht.key));qe.signal.addEventListener("abort",Ei);let{loaderResults:ls,fetcherResults:ot}=await fe(Ci,Xr,ft,Se);if(qe.signal.aborted)return;if(qe.signal.removeEventListener("abort",Ei),K.delete(H),oe.delete(H),Xr.forEach(Ht=>oe.delete(Ht.key)),T.fetchers.has(H)){let Ht=Ba($e.data);T.fetchers.set(H,Ht)}let tn=Du(ls);if(tn)return Sn(ft,tn.result,!1,{preventScrollReset:Ae});if(tn=Du(ot),tn)return O.add(tn.key),Sn(ft,tn.result,!1,{preventScrollReset:Ae});let{loaderData:Rn,errors:ln}=Jv(T,Tn,ls,void 0,Xr,ot);on(vn),T.navigation.state==="loading"&&vn>B?(st(F,"Expected pending action"),Q&&Q.abort(),we(T.navigation.location,{matches:Tn,loaderData:Rn,errors:ln,fetchers:new Map(T.fetchers)})):(ge({errors:ln,loaderData:e1(T.loaderData,Rn,Tn,ln),fetchers:new Map(T.fetchers)}),V=!1)}async function Xt(H,X,ae,ve,Se,Le,Ce,Ae,Re){let Ve=T.fetchers.get(H);ze(H,ll(Re,Ve?Ve.data:void 0),{flushSync:Ce});let Ye=new AbortController,qe=Xs(e.history,ae,Ye.signal);if(Le){let $e=await Fn(ve,new URL(qe.url).pathname,qe.signal,H);if($e.type==="aborted")return;if($e.type==="error"){He(H,X,$e.error,{flushSync:Ce});return}else if($e.matches)ve=$e.matches;else{He(H,X,Rr(404,{pathname:ae}),{flushSync:Ce});return}}let gt=ad(ve,ae);oe.set(H,Ye);let he=R,Te=Js(o,l,qe,ve,gt,r,Se),Qe=(await Z(qe,Te,Se,H))[gt.route.id];if(oe.get(H)===Ye&&oe.delete(H),!qe.signal.aborted){if(pe.has(H)){ze(H,Ba(void 0));return}if(Xi(Qe))if(B>he){ze(H,Ba(void 0));return}else{O.add(H),await Sn(qe,Qe,!1,{preventScrollReset:Ae});return}if(hr(Qe)){He(H,X,Qe.error);return}ze(H,Ba(Qe.data))}}async function Sn(H,X,ae,{submission:ve,fetcherSubmission:Se,preventScrollReset:Le,replace:Ce}={}){ae||(M?.resolve(),M=null),X.response.headers.has("X-Remix-Revalidate")&&(V=!0);let Ae=X.response.headers.get("Location");st(Ae,"Expected a Location header on the redirect Response"),Ae=Zv(Ae,new URL(H.url),f,e.history);let Re=Bl(T.location,Ae,{_isRedirect:!0});if(n){let Te=!1;if(X.response.headers.has("X-Remix-Reload-Document"))Te=!0;else if(Sg(Ae)){const De=ek(Ae,!0);Te=De.origin!==t.location.origin||Or(De.pathname,f)==null}if(Te){Ce?t.location.replace(Ae):t.location.assign(Ae);return}}Q=null;let Ve=Ce===!0||X.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ye,formAction:qe,formEncType:gt}=T.navigation;!ve&&!Se&&Ye&&qe&&gt&&(ve=r1(T.navigation));let he=ve||Se;if(ZE.has(X.response.status)&&he&&On(he.formMethod))await Je(Ve,Re,{submission:{...he,formAction:Ae},preventScrollReset:Le||G,enableViewTransition:ae?re:void 0});else{let Te=Oh(Re,ve);await Je(Ve,Re,{overrideNavigation:Te,fetcherSubmission:Se,preventScrollReset:Le||G,enableViewTransition:ae?re:void 0})}}async function Z(H,X,ae,ve){let Se,Le={};try{Se=await oA(m,H,X,ve,ae,!1)}catch(Ce){return X.filter(Ae=>Ae.shouldLoad).forEach(Ae=>{Le[Ae.route.id]={type:"error",error:Ce}}),Le}if(H.signal.aborted)return Le;if(!On(H.method))for(let Ce of X){if(Se[Ce.route.id]?.type==="error")break;!Se.hasOwnProperty(Ce.route.id)&&!T.loaderData.hasOwnProperty(Ce.route.id)&&(!T.errors||!T.errors.hasOwnProperty(Ce.route.id))&&Ce.shouldCallHandler()&&(Se[Ce.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Ce.route.id}`)})}for(let[Ce,Ae]of Object.entries(Se))if(xA(Ae)){let Re=Ae.result;Le[Ce]={type:"redirect",response:dA(Re,H,Ce,X,f)}}else Le[Ce]=await uA(Ae);return Le}async function fe(H,X,ae,ve){let Se=Z(ae,H,ve,null),Le=Promise.all(X.map(async Re=>{if(Re.matches&&Re.match&&Re.request&&Re.controller){let Ye=(await Z(Re.request,Re.matches,ve,Re.key))[Re.match.route.id];return{[Re.key]:Ye}}else return Promise.resolve({[Re.key]:{type:"error",error:Rr(404,{pathname:Re.path})}})})),Ce=await Se,Ae=(await Le).reduce((Re,Ve)=>Object.assign(Re,Ve),{});return{loaderResults:Ce,fetcherResults:Ae}}function Ne(){V=!0,se.forEach((H,X)=>{oe.has(X)&&te.add(X),yt(X)})}function ze(H,X,ae={}){T.fetchers.set(H,X),ge({fetchers:new Map(T.fetchers)},{flushSync:(ae&&ae.flushSync)===!0})}function He(H,X,ae,ve={}){let Se=_i(T.matches,X);Rt(H),ge({errors:{[Se.route.id]:ae},fetchers:new Map(T.fetchers)},{flushSync:(ve&&ve.flushSync)===!0})}function Tt(H){return ie.set(H,(ie.get(H)||0)+1),pe.has(H)&&pe.delete(H),T.fetchers.get(H)||WE}function Ft(H,X){yt(H,X?.reason),ze(H,Ba(null))}function Rt(H){let X=T.fetchers.get(H);oe.has(H)&&!(X&&X.state==="loading"&&K.has(H))&&yt(H),se.delete(H),K.delete(H),O.delete(H),pe.delete(H),te.delete(H),T.fetchers.delete(H)}function _t(H){let X=(ie.get(H)||0)-1;X<=0?(ie.delete(H),pe.add(H)):ie.set(H,X),ge({fetchers:new Map(T.fetchers)})}function yt(H,X){let ae=oe.get(H);ae&&(ae.abort(X),oe.delete(H))}function lt(H){for(let X of H){let ae=Tt(X),ve=Ba(ae.data);T.fetchers.set(X,ve)}}function bn(){let H=[],X=!1;for(let ae of O){let ve=T.fetchers.get(ae);st(ve,`Expected fetcher: ${ae}`),ve.state==="loading"&&(O.delete(ae),H.push(ae),X=!0)}return lt(H),X}function on(H){let X=[];for(let[ae,ve]of K)if(ve<H){let Se=T.fetchers.get(ae);st(Se,`Expected fetcher: ${ae}`),Se.state==="loading"&&(yt(ae),K.delete(ae),X.push(ae))}return lt(X),X.length>0}function xa(H,X){let ae=T.blockers.get(H)||ol;return Ee.get(H)!==X&&Ee.set(H,X),ae}function ye(H){T.blockers.delete(H),Ee.delete(H)}function Ge(H,X){let ae=T.blockers.get(H)||ol;st(ae.state==="unblocked"&&X.state==="blocked"||ae.state==="blocked"&&X.state==="blocked"||ae.state==="blocked"&&X.state==="proceeding"||ae.state==="blocked"&&X.state==="unblocked"||ae.state==="proceeding"&&X.state==="unblocked",`Invalid blocker state transition: ${ae.state} -> ${X.state}`);let ve=new Map(T.blockers);ve.set(H,X),ge({blockers:ve})}function Lt({currentLocation:H,nextLocation:X,historyAction:ae}){if(Ee.size===0)return;Ee.size>1&&Jt(!1,"A router only supports one blocker at a time");let ve=Array.from(Ee.entries()),[Se,Le]=ve[ve.length-1],Ce=T.blockers.get(Se);if(!(Ce&&Ce.state==="proceeding")&&Le({currentLocation:H,nextLocation:X,historyAction:ae}))return Se}function it(H){let X=Rr(404,{pathname:H}),ae=p||d,{matches:ve,route:Se}=Lu(ae);return{notFoundMatches:ve,route:Se,error:X}}function It(H,X,ae){if(w=H,j=X,k=ae||null,!S&&T.navigation===Dh){S=!0;let ve=ya(T.location,T.matches);ve!=null&&ge({restoreScrollPosition:ve})}return()=>{w=null,j=null,k=null}}function Ut(H,X){return k&&k(H,X.map(ve=>SE(ve,T.loaderData)))||H.key}function Ya(H,X){if(w&&j){let ae=Ut(H,X);w[ae]=j()}}function ya(H,X){if(w){let ae=Ut(H,X),ve=w[ae];if(typeof ve=="number")return ve}return null}function vr(H,X,ae){if(e.patchRoutesOnNavigation)if(H){if(Object.keys(H[0].params).length>0)return{active:!0,matches:jl(X,ae,f,!0)}}else return{active:!0,matches:jl(X,ae,f,!0)||[]};return{active:!1,matches:null}}async function Fn(H,X,ae,ve){if(!e.patchRoutesOnNavigation)return{type:"success",matches:H};let Se=H;for(;;){let Le=p==null,Ce=p||d,Ae=l;try{await e.patchRoutesOnNavigation({signal:ae,path:X,matches:Se,fetcherKey:ve,patch:(Ye,qe)=>{ae.aborted||Yv(Ye,qe,Ce,Ae,o,!1)}})}catch(Ye){return{type:"error",error:Ye,partialMatches:Se}}finally{Le&&!ae.aborted&&(d=[...d])}if(ae.aborted)return{type:"aborted"};let Re=vi(Ce,X,f),Ve=null;if(Re){if(Object.keys(Re[0].params).length===0)return{type:"success",matches:Re};if(Ve=jl(Ce,X,f,!0),!(Ve&&Se.length<Ve.length&&Yr(Se,Ve.slice(0,Se.length))))return{type:"success",matches:Re}}if(Ve||(Ve=jl(Ce,X,f,!0)),!Ve||Yr(Se,Ve))return{type:"success",matches:null};Se=Ve}}function Yr(H,X){return H.length===X.length&&H.every((ae,ve)=>ae.route.id===X[ve].route.id)}function ba(H){l={},p=Pl(H,o,void 0,l)}function Ka(H,X,ae=!1){let ve=p==null;Yv(H,X,p||d,l,o,ae),ve&&(d=[...d],ge({}))}return P={get basename(){return f},get future(){return g},get state(){return T},get routes(){return d},get window(){return t},initialize:be,subscribe:ke,enableScrollRestoration:It,navigate:Xe,fetch:Kn,revalidate:Me,createHref:H=>e.history.createHref(H),encodeLocation:H=>e.history.encodeLocation(H),getFetcher:Tt,resetFetcher:Ft,deleteFetcher:_t,dispose:de,getBlocker:xa,deleteBlocker:ye,patchRoutes:Ka,_internalFetchControllers:oe,_internalSetRoutes:ba,_internalSetStateDoNotUseOrYouWillBreakYourApp(H){ge(H)}},e.unstable_instrumentations&&(P=HE(P,e.unstable_instrumentations.map(H=>H.router).filter(Boolean))),P}function tA(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Cm(e,t,n,r,i,o){let l,d;if(i){l=[];for(let f of t)if(l.push(f),f.route.id===i){d=f;break}}else l=t,d=t[t.length-1];let p=tc(r||".",qd(l),Or(e.pathname,n)||e.pathname,o==="path");if(r==null&&(p.search=e.search,p.hash=e.hash),(r==null||r===""||r===".")&&d){let f=Cg(p.search);if(d.route.index&&!f)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&f){let m=new URLSearchParams(p.search),g=m.getAll("index");m.delete("index"),g.filter(b=>b).forEach(b=>m.append("index",b));let y=m.toString();p.search=y?`?${y}`:""}}return n!=="/"&&(p.pathname=IE({basename:n,pathname:p.pathname})),ca(p)}function Vv(e,t,n){if(!n||!tA(n))return{path:t};if(n.formMethod&&!vA(n.formMethod))return{path:t,error:Rr(405,{method:n.formMethod})};let r=()=>({path:t,error:Rr(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),l=yk(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!On(o))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[b,w])=>`${y}${b}=${w}
11
+ `,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!On(o))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}st(typeof FormData=="function","FormData is not available in this environment");let d,p;if(n.formData)d=Am(n.formData),p=n.formData;else if(n.body instanceof FormData)d=Am(n.body),p=n.body;else if(n.body instanceof URLSearchParams)d=n.body,p=Wv(d);else if(n.body==null)d=new URLSearchParams,p=new FormData;else try{d=new URLSearchParams(n.body),p=Wv(d)}catch{return r()}let f={formMethod:o,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(On(f.formMethod))return{path:t,submission:f};let m=Va(t);return e&&m.search&&Cg(m.search)&&d.append("index",""),m.search=`?${d}`,{path:ca(m),submission:f}}function Gv(e,t,n,r,i,o,l,d,p,f,m,g,y,b,w,k,j,S,E,C,z){let D=C?hr(C[1])?C[1].error:C[1].data:void 0,A=i.createURL(o.location),P=i.createURL(p),T;if(m&&o.errors){let U=Object.keys(o.errors)[0];T=l.findIndex(I=>I.route.id===U)}else if(C&&hr(C[1])){let U=C[0];T=l.findIndex(I=>I.route.id===U)-1}let F=C?C[1].statusCode:void 0,M=F&&F>=400,G={currentUrl:A,currentParams:o.matches[0]?.params||{},nextUrl:P,nextParams:l[0].params,...d,actionResult:D,actionStatus:F},Q=rc(l),re=l.map((U,I)=>{let{route:V}=U,te=null;if(T!=null&&I>T)te=!1;else if(V.lazy)te=!0;else if(!jg(V))te=!1;else if(m){let{shouldLoad:K}=fk(V,o.loaderData,o.errors);te=K}else nA(o.loaderData,o.matches[I],U)&&(te=!0);if(te!==null)return Em(n,r,e,Q,U,f,t,te);let oe=!1;typeof z=="boolean"?oe=z:M?oe=!1:(g||A.pathname+A.search===P.pathname+P.search||A.search!==P.search||rA(o.matches[I],U))&&(oe=!0);let R={...G,defaultShouldRevalidate:oe},B=Ll(U,R);return Em(n,r,e,Q,U,f,t,B,R,z)}),$=[];return w.forEach((U,I)=>{if(m||!l.some(se=>se.route.id===U.routeId)||b.has(I))return;let V=o.fetchers.get(I),te=V&&V.state!=="idle"&&V.data===void 0,oe=vi(j,U.path,S);if(!oe){if(E&&te)return;$.push({key:I,routeId:U.routeId,path:U.path,matches:null,match:null,request:null,controller:null});return}if(k.has(I))return;let R=ad(oe,U.path),B=new AbortController,K=Xs(i,U.path,B.signal),O=null;if(y.has(I))y.delete(I),O=Js(n,r,K,oe,R,f,t);else if(te)g&&(O=Js(n,r,K,oe,R,f,t));else{let se;typeof z=="boolean"?se=z:M?se=!1:se=g;let ie={...G,defaultShouldRevalidate:se};Ll(R,ie)&&(O=Js(n,r,K,oe,R,f,t,ie))}O&&$.push({key:I,routeId:U.routeId,path:U.path,matches:O,match:R,request:K,controller:B})}),{dsMatches:re,revalidatingFetchers:$}}function jg(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function fk(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!jg(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let o=!r&&!i;return{shouldLoad:o,renderFallback:o}}function nA(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function rA(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ll(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Yv(e,t,n,r,i,o){let l;if(e){let f=r[e];st(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),l=f.children}else l=n;let d=[],p=[];if(t.forEach(f=>{let m=l.find(g=>pk(f,g));m?p.push({existingRoute:m,newRoute:f}):d.push(f)}),d.length>0){let f=Pl(d,i,[e||"_","patch",String(l?.length||"0")],r);l.push(...f)}if(o&&p.length>0)for(let f=0;f<p.length;f++){let{existingRoute:m,newRoute:g}=p[f],y=m,[b]=Pl([g],i,[],{},!0);Object.assign(y,{element:b.element?b.element:y.element,errorElement:b.errorElement?b.errorElement:y.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:y.hydrateFallbackElement})}}function pk(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((n,r)=>t.children?.some(i=>pk(n,i)))??!1:!1}var Kv=new WeakMap,hk=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(st(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let o=i.lazy[e];if(!o)return;let l=Kv.get(i);l||(l={},Kv.set(i,l));let d=l[e];if(d)return d;let p=(async()=>{let f=vE(e),g=i[e]!==void 0&&e!=="hasErrorBoundary";if(f)Jt(!f,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(g)Jt(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await o();y!=null&&(Object.assign(i,{[e]:y}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(y=>y===void 0)&&(i.lazy=void 0))})();return l[e]=p,p},Xv=new WeakMap;function aA(e,t,n,r,i){let o=n[e.id];if(st(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=Xv.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{st(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),b={};for(let w in y){let k=y[w];if(k===void 0)continue;let j=wE(w),E=o[w]!==void 0&&w!=="hasErrorBoundary";j?Jt(!j,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):E?Jt(!E,`Route "${o.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):b[w]=k}Object.assign(o,b),Object.assign(o,{...r(o),lazy:void 0})})();return Xv.set(o,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let l=Object.keys(e.lazy),d=[],p;for(let m of l){if(i&&i.includes(m))continue;let g=hk({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(d.push(g),m===t&&(p=g))}let f=d.length>0?Promise.all(d).then(()=>{}):void 0;return f?.catch(()=>{}),p?.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:p}}async function Qv(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,o)=>{n[t[o].route.id]=i}),n}async function iA(e){return e.matches.some(t=>t.route.middleware)?mk(e,()=>Qv(e)):Qv(e)}function mk(e,t){return sA(e,t,r=>{if(bA(r))throw r;return r},mA,n);function n(r,i,o){if(o)return Promise.resolve(Object.assign(o.value,{[i]:{type:"error",result:r}}));{let{matches:l}=e,d=Math.min(Math.max(l.findIndex(f=>f.route.id===i),0),Math.max(l.findIndex(f=>f.shouldCallHandler()),0)),p=_i(l,l[d].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:r}})}}}async function sA(e,t,n,r,i){let{matches:o,request:l,params:d,context:p,unstable_pattern:f}=e,m=o.flatMap(y=>y.route.middleware?y.route.middleware.map(b=>[y.route.id,b]):[]);return await gk({request:l,params:d,context:p,unstable_pattern:f},m,t,n,r,i)}async function gk(e,t,n,r,i,o,l=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let p=t[l];if(!p)return await n();let[f,m]=p,g,y=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await gk(e,t,n,r,i,o,l+1)},g.value}catch(b){return g={value:await o(b,f,g)},g.value}};try{let b=await m(e,y),w=b!=null?r(b):void 0;return i(w)?w:g?w??g.value:(g={value:await y()},g.value)}catch(b){return await o(b,f,g)}}function xk(e,t,n,r,i){let o=hk({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),l=aA(r.route,On(n.method)?"action":"loader",t,e,i);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function Em(e,t,n,r,i,o,l,d,p=null,f){let m=!1,g=xk(e,t,n,i,o);return{...i,_lazyPromises:g,shouldLoad:d,shouldRevalidateArgs:p,shouldCallHandler(y){return m=!0,p?typeof f=="boolean"?Ll(i,{...p,defaultShouldRevalidate:f}):typeof y=="boolean"?Ll(i,{...p,defaultShouldRevalidate:y}):Ll(i,p):d},resolve(y){let{lazy:b,loader:w,middleware:k}=i.route,j=m||d||y&&!On(n.method)&&(b||w),S=k&&k.length>0&&!w&&!b;return j&&(On(n.method)||!S)?lA({request:n,unstable_pattern:r,match:i,lazyHandlerPromise:g?.handler,lazyRoutePromise:g?.route,handlerOverride:y,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Js(e,t,n,r,i,o,l,d=null){return r.map(p=>p.route.id!==i.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:d,shouldCallHandler:()=>!1,_lazyPromises:xk(e,t,n,p,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Em(e,t,n,rc(r),p,o,l,!0,d))}async function oA(e,t,n,r,i,o){n.some(f=>f._lazyPromises?.middleware)&&await Promise.all(n.map(f=>f._lazyPromises?.middleware));let l={request:t,unstable_pattern:rc(n),params:n[0].params,context:i,matches:n},p=await e({...l,fetcherKey:r,runClientMiddleware:f=>{let m=l;return mk(m,()=>f({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(f=>[f._lazyPromises?.handler,f._lazyPromises?.route]))}catch{}return p}async function lA({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:i,handlerOverride:o,scopedContext:l}){let d,p,f=On(e.method),m=f?"action":"loader",g=y=>{let b,w=new Promise((S,E)=>b=E);p=()=>b(),e.signal.addEventListener("abort",p);let k=S=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:l},...S!==void 0?[S]:[]),j=(async()=>{try{return{type:"data",result:await(o?o(E=>k(E)):k())}}catch(S){return{type:"error",result:S}}})();return Promise.race([j,w])};try{let y=f?n.route.action:n.route.loader;if(r||i)if(y){let b,[w]=await Promise.all([g(y).catch(k=>{b=k}),r,i]);if(b!==void 0)throw b;d=w}else{await r;let b=f?n.route.action:n.route.loader;if(b)[d]=await Promise.all([g(b),i]);else if(m==="action"){let w=new URL(e.url),k=w.pathname+w.search;throw Rr(405,{method:e.method,pathname:k,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)d=await g(y);else{let b=new URL(e.url),w=b.pathname+b.search;throw Rr(404,{pathname:w})}}catch(y){return{type:"error",result:y}}finally{p&&e.signal.removeEventListener("abort",p)}return d}async function cA(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function uA(e){let{result:t,type:n}=e;if(Ng(t)){let r;try{r=await cA(t)}catch(i){return{type:"error",error:i}}return n==="error"?{type:"error",error:new nc(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?n1(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:hA(t),statusCode:ao(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ao(t)?t.status:void 0}:n1(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function dA(e,t,n,r,i){let o=e.headers.get("Location");if(st(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Sg(o)){let l=r.slice(0,r.findIndex(d=>d.route.id===n)+1);o=Cm(new URL(t.url),l,i,o),e.headers.set("Location",o)}return e}function Zv(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Sg(e)){let o=e,l=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(i.includes(l.protocol))throw new Error("Invalid redirect location");let d=Or(l.pathname,n)!=null;if(l.origin===t.origin&&d)return l.pathname+l.search+l.hash}try{let o=r.createURL(e);if(i.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Xs(e,t,n,r){let i=e.createURL(yk(t)).toString(),o={signal:n};if(r&&On(r.formMethod)){let{formMethod:l,formEncType:d}=r;o.method=l.toUpperCase(),d==="application/json"?(o.headers=new Headers({"Content-Type":d}),o.body=JSON.stringify(r.json)):d==="text/plain"?o.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?o.body=Am(r.formData):o.body=r.formData}return new Request(i,o)}function Am(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Wv(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function fA(e,t,n,r=!1,i=!1){let o={},l=null,d,p=!1,f={},m=n&&hr(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let y=g.route.id,b=t[y];if(st(!Xi(b),"Cannot handle redirect results in processLoaderData"),hr(b)){let w=b.error;if(m!==void 0&&(w=m,m=void 0),l=l||{},i)l[y]=w;else{let k=_i(e,y);l[k.route.id]==null&&(l[k.route.id]=w)}r||(o[y]=dk),p||(p=!0,d=ao(b.error)?b.error.status:500),b.headers&&(f[y]=b.headers)}else o[y]=b.data,b.statusCode&&b.statusCode!==200&&!p&&(d=b.statusCode),b.headers&&(f[y]=b.headers)}),m!==void 0&&n&&(l={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:l,statusCode:d||200,loaderHeaders:f}}function Jv(e,t,n,r,i,o){let{loaderData:l,errors:d}=fA(t,n,r);return i.filter(p=>!p.matches||p.matches.some(f=>f.shouldLoad)).forEach(p=>{let{key:f,match:m,controller:g}=p;if(g&&g.signal.aborted)return;let y=o[f];if(st(y,"Did not find corresponding fetcher result"),hr(y)){let b=_i(e.matches,m?.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:y.error}),e.fetchers.delete(f)}else if(Xi(y))st(!1,"Unhandled fetcher revalidation redirect");else{let b=Ba(y.data);e.fetchers.set(f,b)}}),{loaderData:l,errors:d}}function e1(e,t,n,r){let i=Object.entries(t).filter(([,o])=>o!==dk).reduce((o,[l,d])=>(o[l]=d,o),{});for(let o of n){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(i[l]=e[l]),r&&r.hasOwnProperty(l))break}return i}function t1(e){return e?hr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function _i(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Lu(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Rr(e,{pathname:t,routeId:n,method:r,type:i,message:o}={}){let l="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(l="Bad Request",r&&t&&n?d=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i==="invalid-body"&&(d="Unable to encode submission body")):e===403?(l="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(l="Not Found",d=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",r&&t&&n?d=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(d=`Invalid request method "${r.toUpperCase()}"`)),new nc(e||500,l,new Error(d),!0)}function Du(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Xi(i))return{key:r,result:i}}}function yk(e){let t=typeof e=="string"?Va(e):e;return ca({...t,hash:""})}function pA(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function hA(e){return new nc(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function mA(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&gA(n))}function gA(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function xA(e){return Ng(e.result)&&ck.has(e.result.status)}function hr(e){return e.type==="error"}function Xi(e){return(e&&e.type)==="redirect"}function n1(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ng(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function yA(e){return ck.has(e)}function bA(e){return Ng(e)&&yA(e.status)&&e.headers.has("Location")}function vA(e){return QE.has(e.toUpperCase())}function On(e){return KE.has(e.toUpperCase())}function Cg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ad(e,t){let n=typeof t=="string"?Va(t).search:t.search;if(e[e.length-1].route.index&&Cg(n||""))return e[e.length-1];let r=ak(e);return r[r.length-1]}function r1(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:l}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function Oh(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function _A(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ll(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function wA(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ba(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function kA(e,t){try{let n=e.sessionStorage.getItem(uk);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function SA(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(uk,JSON.stringify(n))}catch(r){Jt(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function a1(){let e,t,n=new Promise((r,i)=>{e=async o=>{r(o);try{await n}catch{}},t=async o=>{i(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var is=_.createContext(null);is.displayName="DataRouter";var ac=_.createContext(null);ac.displayName="DataRouterState";var bk=_.createContext(!1);function jA(){return _.useContext(bk)}var Eg=_.createContext({isTransitioning:!1});Eg.displayName="ViewTransition";var vk=_.createContext(new Map);vk.displayName="Fetchers";var NA=_.createContext(null);NA.displayName="Await";var yr=_.createContext(null);yr.displayName="Navigation";var Vd=_.createContext(null);Vd.displayName="Location";var zr=_.createContext({outlet:null,matches:[],isDataRoute:!1});zr.displayName="Route";var Ag=_.createContext(null);Ag.displayName="RouteError";var _k="REACT_ROUTER_ERROR",CA="REDIRECT",EA="ROUTE_ERROR_RESPONSE";function AA(e){if(e.startsWith(`${_k}:${CA}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function TA(e){if(e.startsWith(`${_k}:${EA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new nc(t.status,t.statusText,t.data)}catch{}}function RA(e,{relative:t}={}){st(uo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=_.useContext(yr),{hash:i,pathname:o,search:l}=ic(e,{relative:t}),d=o;return n!=="/"&&(d=o==="/"?n:Ur([n,o])),r.createHref({pathname:d,search:l,hash:i})}function uo(){return _.useContext(Vd)!=null}function Ir(){return st(uo(),"useLocation() may be used only in the context of a <Router> component."),_.useContext(Vd).location}var wk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function kk(e){_.useContext(yr).static||_.useLayoutEffect(e)}function Pt(){let{isDataRoute:e}=_.useContext(zr);return e?VA():LA()}function LA(){st(uo(),"useNavigate() may be used only in the context of a <Router> component.");let e=_.useContext(is),{basename:t,navigator:n}=_.useContext(yr),{matches:r}=_.useContext(zr),{pathname:i}=Ir(),o=JSON.stringify(qd(r)),l=_.useRef(!1);return kk(()=>{l.current=!0}),_.useCallback((p,f={})=>{if(Jt(l.current,wk),!l.current)return;if(typeof p=="number"){n.go(p);return}let m=tc(p,JSON.parse(o),i,f.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Ur([t,m.pathname])),(f.replace?n.replace:n.push)(m,f.state,f)},[t,n,o,i,e])}var DA=_.createContext(null);function OA(e){let t=_.useContext(zr).outlet;return _.useMemo(()=>t&&_.createElement(DA.Provider,{value:e},t),[t,e])}function fo(){let{matches:e}=_.useContext(zr),t=e[e.length-1];return t?t.params:{}}function ic(e,{relative:t}={}){let{matches:n}=_.useContext(zr),{pathname:r}=Ir(),i=JSON.stringify(qd(n));return _.useMemo(()=>tc(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function MA(e,t,n){st(uo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=_.useContext(yr),{matches:i}=_.useContext(zr),o=i[i.length-1],l=o?o.params:{},d=o?o.pathname:"/",p=o?o.pathnameBase:"/",f=o&&o.route;{let j=f&&f.path||"";Nk(d,!f||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${j}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
12
+
13
+ Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let m=Ir(),g;g=m;let y=g.pathname||"/",b=y;if(p!=="/"){let j=p.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(j.length).join("/")}let w=vi(e,{pathname:b});return Jt(f||w!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Jt(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.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.`),PA(w&&w.map(j=>Object.assign({},j,{params:Object.assign({},l,j.params),pathname:Ur([p,r.encodeLocation?r.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?p:Ur([p,r.encodeLocation?r.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),i,n)}function zA(){let e=jk(),t=ao(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=_.createElement(_.Fragment,null,_.createElement("p",null,"๐Ÿ’ฟ Hey developer ๐Ÿ‘‹"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:o},"ErrorBoundary")," or"," ",_.createElement("code",{style:o},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),n?_.createElement("pre",{style:i},n):null,l)}var IA=_.createElement(zA,null),Sk=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=TA(e.digest);n&&(e=n)}let t=e!==void 0?_.createElement(zr.Provider,{value:this.props.routeContext},_.createElement(Ag.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?_.createElement($A,{error:e},t):t}};Sk.contextType=bk;var Mh=new WeakMap;function $A({children:e,error:t}){let{basename:n}=_.useContext(yr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=AA(t.digest);if(r){let i=Mh.get(t);if(i)throw i;let o=sk(r.location,n);if(ik&&!Mh.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw Mh.set(t,l),l}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function BA({routeContext:e,match:t,children:n}){let r=_.useContext(is);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(zr.Provider,{value:e},n)}function PA(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,o=r?.errors;if(o!=null){let m=i.findIndex(g=>g.route.id&&o?.[g.route.id]!==void 0);st(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,m+1))}let l=!1,d=-1;if(n&&r){l=r.renderFallback;for(let m=0;m<i.length;m++){let g=i[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(d=m),g.route.id){let{loaderData:y,errors:b}=r,w=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!b||b[g.route.id]===void 0);if(g.route.lazy||w){n.isStatic&&(l=!0),d>=0?i=i.slice(0,d+1):i=[i[0]];break}}}}let p=n?.onError,f=r&&p?(m,g)=>{p(m,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:rc(r.matches),errorInfo:g})}:void 0;return i.reduceRight((m,g,y)=>{let b,w=!1,k=null,j=null;r&&(b=o&&g.route.id?o[g.route.id]:void 0,k=g.route.errorElement||IA,l&&(d<0&&y===0?(Nk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,j=null):d===y&&(w=!0,j=g.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,y+1)),E=()=>{let C;return b?C=k:w?C=j:g.route.Component?C=_.createElement(g.route.Component,null):g.route.element?C=g.route.element:C=m,_.createElement(BA,{match:g,routeContext:{outlet:m,matches:S,isDataRoute:r!=null},children:C})};return r&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?_.createElement(Sk,{location:r.location,revalidation:r.revalidation,component:k,error:b,children:E(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:f}):E()},null)}function Tg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function FA(e){let t=_.useContext(is);return st(t,Tg(e)),t}function UA(e){let t=_.useContext(ac);return st(t,Tg(e)),t}function HA(e){let t=_.useContext(zr);return st(t,Tg(e)),t}function Rg(e){let t=HA(e),n=t.matches[t.matches.length-1];return st(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function qA(){return Rg("useRouteId")}function jk(){let e=_.useContext(Ag),t=UA("useRouteError"),n=Rg("useRouteError");return e!==void 0?e:t.errors?.[n]}function VA(){let{router:e}=FA("useNavigate"),t=Rg("useNavigate"),n=_.useRef(!1);return kk(()=>{n.current=!0}),_.useCallback(async(i,o={})=>{Jt(n.current,wk),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var i1={};function Nk(e,t,n){!t&&!i1[e]&&(i1[e]=!0,Jt(!1,n))}var s1={};function o1(e,t){!e&&!s1[t]&&(s1[t]=!0,console.warn(t))}var GA="useOptimistic",l1=kC[GA],YA=()=>{};function KA(e){return l1?l1(e):[e,YA]}function XA(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Jt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:_.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Jt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Jt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var QA=["HydrateFallback","hydrateFallbackElement"],ZA=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function WA({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=jA()||r;let[o,l]=_.useState(e.state),[d,p]=KA(o),[f,m]=_.useState(),[g,y]=_.useState({isTransitioning:!1}),[b,w]=_.useState(),[k,j]=_.useState(),[S,E]=_.useState(),C=_.useRef(new Map),z=_.useCallback((T,{deletedFetchers:F,newErrors:M,flushSync:G,viewTransitionOpts:Q})=>{M&&n&&Object.values(M).forEach($=>n($,{location:T.location,params:T.matches[0]?.params??{},unstable_pattern:rc(T.matches)})),T.fetchers.forEach(($,U)=>{$.data!==void 0&&C.current.set(U,$.data)}),F.forEach($=>C.current.delete($)),o1(G===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let re=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(o1(Q==null||re,"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||!re){t&&G?t(()=>l(T)):r===!1?l(T):_.startTransition(()=>{r===!0&&p($=>c1($,T)),l(T)});return}if(t&&G){t(()=>{k&&(b?.resolve(),k.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation})});let $=e.window.document.startViewTransition(()=>{t(()=>l(T))});$.finished.finally(()=>{t(()=>{w(void 0),j(void 0),m(void 0),y({isTransitioning:!1})})}),t(()=>j($));return}k?(b?.resolve(),k.skipTransition(),E({state:T,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation})):(m(T),y({isTransitioning:!0,flushSync:!1,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation}))},[e.window,t,k,b,r,p,n]);_.useLayoutEffect(()=>e.subscribe(z),[e,z]),_.useEffect(()=>{g.isTransitioning&&!g.flushSync&&w(new ZA)},[g]),_.useEffect(()=>{if(b&&f&&e.window){let T=f,F=b.promise,M=e.window.document.startViewTransition(async()=>{r===!1?l(T):_.startTransition(()=>{r===!0&&p(G=>c1(G,T)),l(T)}),await F});M.finished.finally(()=>{w(void 0),j(void 0),m(void 0),y({isTransitioning:!1})}),j(M)}},[f,b,e.window,r,p]),_.useEffect(()=>{b&&f&&d.location.key===f.location.key&&b.resolve()},[b,k,d.location,f]),_.useEffect(()=>{!g.isTransitioning&&S&&(m(S.state),y({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),E(void 0))},[g.isTransitioning,S]);let D=_.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,F,M)=>e.navigate(T,{state:F,preventScrollReset:M?.preventScrollReset}),replace:(T,F,M)=>e.navigate(T,{replace:!0,state:F,preventScrollReset:M?.preventScrollReset})}),[e]),A=e.basename||"/",P=_.useMemo(()=>({router:e,navigator:D,static:!1,basename:A,onError:n}),[e,D,A,n]);return _.createElement(_.Fragment,null,_.createElement(is.Provider,{value:P},_.createElement(ac.Provider,{value:d},_.createElement(vk.Provider,{value:C.current},_.createElement(Eg.Provider,{value:g},_.createElement(nT,{basename:A,location:d.location,navigationType:d.historyAction,navigator:D,unstable_useTransitions:r},_.createElement(JA,{routes:e.routes,future:e.future,state:d,isStatic:!1,onError:n})))))),null)}function c1(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var JA=_.memo(eT);function eT({routes:e,future:t,state:n,isStatic:r,onError:i}){return MA(e,void 0,{state:n,isStatic:r,onError:i})}function tT({to:e,replace:t,state:n,relative:r}){st(uo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=_.useContext(yr);Jt(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=_.useContext(zr),{pathname:l}=Ir(),d=Pt(),p=tc(e,qd(o),l,r==="path"),f=JSON.stringify(p);return _.useEffect(()=>{d(JSON.parse(f),{replace:t,state:n,relative:r})},[d,f,r,t,n]),null}function Ck(e){return OA(e.context)}function nT({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1,unstable_useTransitions:l}){st(!uo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),p=_.useMemo(()=>({basename:d,navigator:i,static:o,unstable_useTransitions:l,future:{}}),[d,i,o,l]);typeof n=="string"&&(n=Va(n));let{pathname:f="/",search:m="",hash:g="",state:y=null,key:b="default",unstable_mask:w}=n,k=_.useMemo(()=>{let j=Or(f,d);return j==null?null:{location:{pathname:j,search:m,hash:g,state:y,key:b,unstable_mask:w},navigationType:r}},[d,f,m,g,y,b,r,w]);return Jt(k!=null,`<Router basename="${d}"> is not able to match the URL "${f}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:_.createElement(yr.Provider,{value:p},_.createElement(Vd.Provider,{children:t,value:k}))}var id="get",sd="application/x-www-form-urlencoded";function Gd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function rT(e){return Gd(e)&&e.tagName.toLowerCase()==="button"}function aT(e){return Gd(e)&&e.tagName.toLowerCase()==="form"}function iT(e){return Gd(e)&&e.tagName.toLowerCase()==="input"}function sT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oT(e,t){return e.button===0&&(!t||t==="_self")&&!sT(e)}function Tm(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function lT(e,t){let n=Tm(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}var Ou=null;function cT(){if(Ou===null)try{new FormData(document.createElement("form"),0),Ou=!1}catch{Ou=!0}return Ou}var uT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function zh(e){return e!=null&&!uT.has(e)?(Jt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${sd}"`),null):e}function dT(e,t){let n,r,i,o,l;if(aT(e)){let d=e.getAttribute("action");r=d?Or(d,t):null,n=e.getAttribute("method")||id,i=zh(e.getAttribute("enctype"))||sd,o=new FormData(e)}else if(rT(e)||iT(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||d.getAttribute("action");if(r=p?Or(p,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||id,i=zh(e.getAttribute("formenctype"))||zh(d.getAttribute("enctype"))||sd,o=new FormData(d,e),!cT()){let{name:f,type:m,value:g}=e;if(m==="image"){let y=f?`${f}.`:"";o.append(`${y}x`,"0"),o.append(`${y}y`,"0")}else f&&o.append(f,g)}}else{if(Gd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=id,r=null,i=sd,l=e}return o&&i==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Lg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function fT(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&Or(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function pT(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function hT(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function mT(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let l=await pT(o,n);return l.links?l.links():[]}return[]}));return bT(r.flat(1).filter(hT).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function u1(e,t,n,r,i,o){let l=(p,f)=>n[f]?p.route.id!==n[f].route.id:!0,d=(p,f)=>n[f].pathname!==p.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==p.params["*"];return o==="assets"?t.filter((p,f)=>l(p,f)||d(p,f)):o==="data"?t.filter((p,f)=>{let m=r.routes[p.route.id];if(!m||!m.hasLoader)return!1;if(l(p,f)||d(p,f))return!0;if(p.route.shouldRevalidate){let g=p.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function gT(e,t,{includeHydrateFallback:n}={}){return xT(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function xT(e){return[...new Set(e)]}function yT(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function bT(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify(yT(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function Ek(){let e=_.useContext(is);return Lg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function vT(){let e=_.useContext(ac);return Lg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Dg=_.createContext(void 0);Dg.displayName="FrameworkContext";function Ak(){let e=_.useContext(Dg);return Lg(e,"You must render this element inside a <HydratedRouter> element"),e}function _T(e,t){let n=_.useContext(Dg),[r,i]=_.useState(!1),[o,l]=_.useState(!1),{onFocus:d,onBlur:p,onMouseEnter:f,onMouseLeave:m,onTouchStart:g}=t,y=_.useRef(null);_.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let k=S=>{S.forEach(E=>{l(E.isIntersecting)})},j=new IntersectionObserver(k,{threshold:.5});return y.current&&j.observe(y.current),()=>{j.disconnect()}}},[e]),_.useEffect(()=>{if(r){let k=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(k)}}},[r]);let b=()=>{i(!0)},w=()=>{i(!1),l(!1)};return n?e!=="intent"?[o,y,{}]:[o,y,{onFocus:cl(d,b),onBlur:cl(p,w),onMouseEnter:cl(f,b),onMouseLeave:cl(m,w),onTouchStart:cl(g,b)}]:[!1,y,{}]}function cl(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function wT({page:e,...t}){let{router:n}=Ek(),r=_.useMemo(()=>vi(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?_.createElement(ST,{page:e,matches:r,...t}):null}function kT(e){let{manifest:t,routeModules:n}=Ak(),[r,i]=_.useState([]);return _.useEffect(()=>{let o=!1;return mT(e,t,n).then(l=>{o||i(l)}),()=>{o=!0}},[e,t,n]),r}function ST({page:e,matches:t,...n}){let r=Ir(),{future:i,manifest:o,routeModules:l}=Ak(),{basename:d}=Ek(),{loaderData:p,matches:f}=vT(),m=_.useMemo(()=>u1(e,t,f,o,r,"data"),[e,t,f,o,r]),g=_.useMemo(()=>u1(e,t,f,o,r,"assets"),[e,t,f,o,r]),y=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let k=new Set,j=!1;if(t.forEach(E=>{let C=o.routes[E.route.id];!C||!C.hasLoader||(!m.some(z=>z.route.id===E.route.id)&&E.route.id in p&&l[E.route.id]?.shouldRevalidate||C.hasClientLoader?j=!0:k.add(E.route.id))}),k.size===0)return[];let S=fT(e,d,i.unstable_trailingSlashAwareDataRequests,"data");return j&&k.size>0&&S.searchParams.set("_routes",t.filter(E=>k.has(E.route.id)).map(E=>E.route.id).join(",")),[S.pathname+S.search]},[d,i.unstable_trailingSlashAwareDataRequests,p,r,o,m,t,e,l]),b=_.useMemo(()=>gT(g,o),[g,o]),w=kT(g);return _.createElement(_.Fragment,null,y.map(k=>_.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...n})),b.map(k=>_.createElement("link",{key:k,rel:"modulepreload",href:k,...n})),w.map(({key:k,link:j})=>_.createElement("link",{key:k,nonce:n.nonce,...j,crossOrigin:j.crossOrigin??n.crossOrigin})))}function jT(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var NT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{NT&&(window.__reactRouterVersion="7.13.1")}catch{}function CT(e,t){return eA({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:gE({window:t?.window}),hydrationData:ET(),routes:e,mapRouteProperties:XA,hydrationRouteProperties:QA,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function ET(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:AT(e.errors)}),e}function AT(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new nc(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let l=new o(i.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}var Tk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mr=_.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:l,unstable_mask:d,state:p,target:f,to:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b,...w},k){let{basename:j,navigator:S,unstable_useTransitions:E}=_.useContext(yr),C=typeof m=="string"&&Tk.test(m),z=sk(m,j);m=z.to;let D=RA(m,{relative:i}),A=Ir(),P=null;if(d){let U=tc(d,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);j!=="/"&&(U.pathname=U.pathname==="/"?j:Ur([j,U.pathname])),P=S.createHref(U)}let[T,F,M]=_T(r,w),G=LT(m,{replace:l,unstable_mask:d,state:p,target:f,preventScrollReset:g,relative:i,viewTransition:y,unstable_defaultShouldRevalidate:b,unstable_useTransitions:E});function Q(U){t&&t(U),U.defaultPrevented||G(U)}let re=!(z.isExternal||o),$=_.createElement("a",{...w,...M,href:(re?P:void 0)||z.absoluteURL||D,onClick:re?Q:t,ref:jT(k,F),target:f,"data-discover":!C&&n==="render"?"true":void 0});return T&&!C?_.createElement(_.Fragment,null,$,_.createElement(wT,{page:D})):$});Mr.displayName="Link";var io=_.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:l,viewTransition:d,children:p,...f},m){let g=ic(l,{relative:f.relative}),y=Ir(),b=_.useContext(ac),{navigator:w,basename:k}=_.useContext(yr),j=b!=null&&IT(g)&&d===!0,S=w.encodeLocation?w.encodeLocation(g).pathname:g.pathname,E=y.pathname,C=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(E=E.toLowerCase(),C=C?C.toLowerCase():null,S=S.toLowerCase()),C&&k&&(C=Or(C,k)||C);const z=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let D=E===S||!i&&E.startsWith(S)&&E.charAt(z)==="/",A=C!=null&&(C===S||!i&&C.startsWith(S)&&C.charAt(S.length)==="/"),P={isActive:D,isPending:A,isTransitioning:j},T=D?t:void 0,F;typeof r=="function"?F=r(P):F=[r,D?"active":null,A?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let M=typeof o=="function"?o(P):o;return _.createElement(Mr,{...f,"aria-current":T,className:F,ref:m,style:M,to:l,viewTransition:d},typeof p=="function"?p(P):p)});io.displayName="NavLink";var TT=_.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:l=id,action:d,onSubmit:p,relative:f,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:y,...b},w)=>{let{unstable_useTransitions:k}=_.useContext(yr),j=MT(),S=zT(d,{relative:f}),E=l.toLowerCase()==="get"?"get":"post",C=typeof d=="string"&&Tk.test(d),z=D=>{if(p&&p(D),D.defaultPrevented)return;D.preventDefault();let A=D.nativeEvent.submitter,P=A?.getAttribute("formmethod")||l,T=()=>j(A||D.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:i,state:o,relative:f,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:y});k&&n!==!1?_.startTransition(()=>T()):T()};return _.createElement("form",{ref:w,method:E,action:S,onSubmit:r?p:z,...b,"data-discover":!C&&e==="render"?"true":void 0})});TT.displayName="Form";function RT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Rk(e){let t=_.useContext(is);return st(t,RT(e)),t}function LT(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:o,relative:l,viewTransition:d,unstable_defaultShouldRevalidate:p,unstable_useTransitions:f}={}){let m=Pt(),g=Ir(),y=ic(e,{relative:l});return _.useCallback(b=>{if(oT(b,t)){b.preventDefault();let w=n!==void 0?n:ca(g)===ca(y),k=()=>m(e,{replace:w,unstable_mask:r,state:i,preventScrollReset:o,relative:l,viewTransition:d,unstable_defaultShouldRevalidate:p});f?_.startTransition(()=>k()):k()}},[g,m,y,n,r,i,t,e,o,l,d,p,f])}function sc(e){Jt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(Tm(e)),n=_.useRef(!1),r=Ir(),i=_.useMemo(()=>lT(r.search,n.current?null:t.current),[r.search]),o=Pt(),l=_.useCallback((d,p)=>{const f=Tm(typeof d=="function"?d(new URLSearchParams(i)):d);n.current=!0,o("?"+f,p)},[o,i]);return[i,l]}var DT=0,OT=()=>`__${String(++DT)}__`;function MT(){let{router:e}=Rk("useSubmit"),{basename:t}=_.useContext(yr),n=qA(),r=e.fetch,i=e.navigate;return _.useCallback(async(o,l={})=>{let{action:d,method:p,encType:f,formData:m,body:g}=dT(o,t);if(l.navigate===!1){let y=l.fetcherKey||OT();await r(y,n,l.action||d,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||p,formEncType:l.encType||f,flushSync:l.flushSync})}else await i(l.action||d,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||p,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,i,t,n])}function zT(e,{relative:t}={}){let{basename:n}=_.useContext(yr),r=_.useContext(zr);st(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...ic(e||".",{relative:t})},l=Ir();if(e==null){o.search=l.search;let d=new URLSearchParams(o.search),p=d.getAll("index");if(p.some(m=>m==="")){d.delete("index"),p.filter(g=>g).forEach(g=>d.append("index",g));let m=d.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ur([n,o.pathname])),ca(o)}function IT(e,{relative:t}={}){let n=_.useContext(Eg);st(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Rk("useViewTransitionState"),i=ic(e,{relative:t});if(!n.isTransitioning)return!1;let o=Or(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Or(n.nextLocation.pathname,r)||n.nextLocation.pathname;return yd(i.pathname,l)!=null||yd(i.pathname,o)!=null}const $T="modulepreload",BT=function(e){return"/"+e},d1={},ue=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let p=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),d=l?.nonce||l?.getAttribute("nonce");i=p(n.map(f=>{if(f=BT(f),f in d1)return;d1[f]=!0;const m=f.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":$T,m||(y.as="script"),y.crossOrigin="",y.href=f,d&&y.setAttribute("nonce",d),document.head.appendChild(y),m)return new Promise((b,w)=>{y.addEventListener("load",b),y.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return i.then(l=>{for(const d of l||[])d.status==="rejected"&&o(d.reason);return t().catch(o)})};const Lk=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const PT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const FT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const f1=e=>{const t=FT(e);return t.charAt(0).toUpperCase()+t.slice(1)};var UT={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 HT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const qT=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...d},p)=>_.createElement("svg",{ref:p,...UT,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Lk("lucide",i),...!o&&!HT(d)&&{"aria-hidden":"true"},...d},[...l.map(([f,m])=>_.createElement(f,m)),...Array.isArray(o)?o:[o]]));const Fe=(e,t)=>{const n=_.forwardRef(({className:r,...i},o)=>_.createElement(qT,{ref:o,iconNode:t,className:Lk(`lucide-${PT(f1(e))}`,`lucide-${e}`,r),...i}));return n.displayName=f1(e),n};const VT=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],GT=Fe("arrow-right-left",VT);const YT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Dk=Fe("arrow-right",YT);const KT=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],p1=Fe("arrow-up-right",KT);const XT=[["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"}]],Ok=Fe("boxes",XT);const QT=[["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"}]],ZT=Fe("brain",QT);const WT=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],JT=Fe("chart-column",WT);const eR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ua=Fe("check",eR);const tR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Gt=Fe("chevron-right",tR);const nR=[["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"}]],Mk=Fe("circle-alert",nR);const rR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],aR=Fe("circle",rR);const iR=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],sR=Fe("cloud",iR);const oR=[["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"}]],bd=Fe("copy",oR);const lR=[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]],Og=Fe("corner-left-up",lR);const cR=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 15 21.84",key:"14ibmq"}],["path",{d:"M21 5V8",key:"1marbg"}],["path",{d:"M21 12L18 17H22L19 22",key:"zafso"}],["path",{d:"M3 12A9 3 0 0 0 14.59 14.87",key:"1y4wr8"}]],uR=Fe("database-zap",cR);const dR=[["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"}]],zk=Fe("database",dR);const fR=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],Mg=Fe("file-code",fR);const pR=[["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"}]],hR=Fe("file-spreadsheet",pR);const mR=[["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"}]],Vn=Fe("file-text",mR);const gR=[["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"}]],zg=Fe("file",gR);const xR=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]],yR=Fe("files",xR);const bR=[["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"}]],oc=Fe("folder-git-2",bR);const vR=[["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"}]],_R=Fe("folder-input",vR);const wR=[["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"}]],kR=Fe("folder-open",wR);const SR=[["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"}]],Ik=Fe("folder-plus",SR);const jR=[["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"}]],nr=Fe("folder",jR);const NR=[["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"}]],vd=Fe("git-branch",NR);const CR=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],ER=Fe("git-commit-horizontal",CR);const AR=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]],TR=Fe("git-fork",AR);const RR=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],h1=Fe("github",RR);const LR=[["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"}]],DR=Fe("globe",LR);const OR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],MR=Fe("grid-3x3",OR);const zR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],IR=Fe("info",zR);const $R=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],BR=Fe("key",$R);const PR=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],FR=Fe("laptop",PR);const UR=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],HR=Fe("layers",UR);const qR=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],VR=Fe("link-2",qR);const GR=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],YR=Fe("list-filter",GR);const KR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],sn=Fe("loader-circle",KR);const XR=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],QR=Fe("log-out",XR);const ZR=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],WR=Fe("menu",ZR);const JR=[["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"}]],e3=Fe("monitor",JR);const t3=[["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"}]],n3=Fe("moon",t3);const r3=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],a3=Fe("network",r3);const i3=[["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"}]],Hr=Fe("package",i3);const s3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],o3=Fe("panel-left",s3);const l3=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Rm=Fe("pencil",l3);const c3=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],u3=Fe("phone",c3);const d3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ig=Fe("plus",d3);const f3=[["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"}]],p3=Fe("refresh-cw",f3);const h3=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],m3=Fe("rotate-cw",h3);const g3=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Fl=Fe("search",g3);const x3=[["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"}]],y3=Fe("settings",x3);const b3=[["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"}]],v3=Fe("share-2",b3);const _3=[["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"}]],w3=Fe("sparkles",_3);const k3=[["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"}]],S3=Fe("sun",k3);const j3=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Yd=Fe("trash-2",j3);const N3=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],C3=Fe("triangle-alert",N3);const E3=[["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"}]],Lm=Fe("upload",E3);const A3=[["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"}]],T3=Fe("users",A3);const R3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vr=Fe("x",R3);const L3=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],D3=Fe("zap",L3),m1=e=>Symbol.iterator in e,g1=e=>"entries"in e,x1=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[i,o]of n)if(!r.has(i)||!Object.is(o,r.get(i)))return!1;return!0},O3=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let i=n.next(),o=r.next();for(;!i.done&&!o.done;){if(!Object.is(i.value,o.value))return!1;i=n.next(),o=r.next()}return!!i.done&&!!o.done};function M3(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:m1(e)&&m1(t)?g1(e)&&g1(t)?x1(e,t):O3(e,t):x1({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function ji(e){const t=Zs.useRef(void 0);return n=>{const r=e(n);return M3(t.current,r)?t.current:t.current=r}}const y1=e=>{let t;const n=new Set,r=(f,m)=>{const g=typeof f=="function"?f(t):f;if(!Object.is(g,t)){const y=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,y))}},i=()=>t,d={setState:r,getState:i,getInitialState:()=>p,subscribe:f=>(n.add(f),()=>n.delete(f))},p=t=e(r,i,d);return d},z3=(e=>e?y1(e):y1),I3=e=>e;function $3(e,t=I3){const n=Zs.useSyncExternalStore(e.subscribe,Zs.useCallback(()=>t(e.getState()),[e,t]),Zs.useCallback(()=>t(e.getInitialState()),[e,t]));return Zs.useDebugValue(n),n}const b1=e=>{const t=z3(e),n=r=>$3(t,r);return Object.assign(n,t),n},da=(e=>e?b1(e):b1),ul="c4a_token";function v1(e){try{const t=e.split(".");if(t.length!==3)return null;const n=t[1].replace(/-/g,"+").replace(/_/g,"/"),r=atob(n),i=Uint8Array.from(r,l=>l.charCodeAt(0));return JSON.parse(new TextDecoder().decode(i))}catch{return null}}function _1(e){const t=e.userId,n=e.name,r=e.email,i=e.avatar_url,o=e.workspaceId;if(!t||!r||!o)return null;const l={id:t,name:n??r,email:r,personal_workspace_id:o};return i&&(l.avatar_url=i),l}function w1(e){const t=e.exp;return t?Date.now()>=t*1e3:!1}const ar=da(e=>({token:null,user:null,isAuthenticated:!1,init:()=>{const t=localStorage.getItem(ul);if(!t){e({token:null,user:null,isAuthenticated:!1});return}const n=v1(t);if(!n||w1(n)){localStorage.removeItem(ul),e({token:null,user:null,isAuthenticated:!1});return}const r=_1(n);if(!r){localStorage.removeItem(ul),e({token:null,user:null,isAuthenticated:!1});return}e({token:t,user:r,isAuthenticated:!0})},login:t=>{const n=v1(t);if(!n||w1(n))return;const r=_1(n);r&&(localStorage.setItem(ul,t),e({token:t,user:r,isAuthenticated:!0}))},logout:()=>{localStorage.removeItem(ul),e({token:null,user:null,isAuthenticated:!1})}})),Ul=da(e=>({activeWorkspaceId:null,init:()=>{const t=ar.getState().user;t?.personal_workspace_id&&e({activeWorkspaceId:t.personal_workspace_id})},setActiveWorkspace:t=>{e({activeWorkspaceId:t})}}));ar.subscribe((e,t)=>{e.user!==t.user&&(e.user?.personal_workspace_id?Ul.getState().setActiveWorkspace(e.user.personal_workspace_id):Ul.getState().setActiveWorkspace(null))});const $k="/api/v1";class kn extends Error{constructor(t,n,r){super(r),this.status=t,this.code=n,this.name="ApiError"}}async function dl(e,t,n,r,i){let o=`${$k}${t}`;if(r){const g=new URLSearchParams(r).toString();g&&(o+=`?${g}`)}const l={"Content-Type":"application/json"},d=ar.getState().token;d&&(l.Authorization=`Bearer ${d}`);const p=Ul.getState().activeWorkspaceId;p&&(l["X-Workspace-Id"]=p);const f={method:e,headers:l};n!==void 0&&(f.body=JSON.stringify(n)),i?.signal&&(f.signal=i.signal);const m=await fetch(o,f);if(!m.ok){let g="UNKNOWN",y=m.statusText;try{const b=await m.json();b.code&&(g=b.code),b.message&&(y=b.message)}catch{}throw m.status===401&&ar.getState().logout(),new kn(m.status,g,y)}return m.json()}const Ih=new Map;function B3(e,t){let n=`${$k}${e}`;if(t){const r=new URLSearchParams(t).toString();r&&(n+=`?${r}`)}return n}const Pe={get(e,t,n){if(n?.skipDedup)return dl("GET",e,void 0,t,n);const i=`${Ul.getState().activeWorkspaceId??""}::${B3(e,t)}`,o=Ih.get(i);if(o)return o;const l=dl("GET",e,void 0,t,n).finally(()=>{Ih.delete(i)});return Ih.set(i,l),l},post(e,t,n){return dl("POST",e,t,void 0,n)},put(e,t){return dl("PUT",e,t)},delete(e){return dl("DELETE",e)}},P3=3e4,F3=1e3,U3=3e4;class H3{ws=null;url="";handlers=new Map;statusHandlers=new Set;heartbeatTimer=null;reconnectTimer=null;reconnectAttempt=0;intentionalClose=!1;disconnectTimer=null;_status="disconnected";get status(){return this._status}setStatus(t){this._status=t;for(const n of this.statusHandlers)n(t)}onStatusChange(t){return this.statusHandlers.add(t),()=>{this.statusHandlers.delete(t)}}connect(t){this.disconnectTimer&&(clearTimeout(this.disconnectTimer),this.disconnectTimer=null),!(this.url===t&&this.ws&&this.ws.readyState<=WebSocket.OPEN)&&(this.url=t,this.intentionalClose=!1,this.reconnectAttempt=0,this.open())}disconnect(){this.disconnectTimer||(this.disconnectTimer=setTimeout(()=>{this.disconnectTimer=null,this.intentionalClose=!0,this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")},50))}on(t,n){let r=this.handlers.get(t);return r||(r=new Set,this.handlers.set(t,r)),r.add(n),()=>{r.delete(n),r.size===0&&this.handlers.delete(t)}}send(t,n){if(this.ws?.readyState!==WebSocket.OPEN)return;const r={event:t,payload:n,timestamp:Date.now()};this.ws.send(JSON.stringify(r))}open(){this.setStatus("connecting");const t=new WebSocket(this.url);t.onopen=()=>{this.reconnectAttempt=0,this.setStatus("connected"),this.startHeartbeat()},t.onmessage=n=>{try{const r=JSON.parse(String(n.data));if(r.event==="pong")return;const i=this.handlers.get(r.event);if(i)for(const o of i)o(r.payload)}catch{}},t.onclose=()=>{this.stopHeartbeat(),this.intentionalClose||(this.setStatus("reconnecting"),this.scheduleReconnect())},t.onerror=()=>{},this.ws=t}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({event:"ping",payload:null,timestamp:Date.now()}))},P3)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}scheduleReconnect(){if(this.reconnectTimer)return;const t=Math.min(F3*2**this.reconnectAttempt,U3);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.open()},t)}clearTimers(){this.stopHeartbeat(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.disconnectTimer&&(clearTimeout(this.disconnectTimer),this.disconnectTimer=null)}}const In=new H3,an=da((e,t)=>({libraries:[],loading:!1,error:null,fetchLibraries:async()=>{e({loading:!0,error:null});try{const n=await Pe.get("/libraries");e({libraries:n,loading:!1})}catch(n){e({error:n instanceof Error?n.message:"Failed to load libraries",loading:!1})}},createLibrary:async n=>{const r=await Pe.post("/libraries",n);return e(i=>({libraries:[...i.libraries,r]})),r},deleteLibrary:async n=>{await Pe.delete(`/libraries/${n}`),e(r=>({libraries:r.libraries.filter(i=>i.id!==n)}))},updateLibraryName:async(n,r)=>{const i=await Pe.put(`/libraries/${n}`,{name:r});e(o=>({libraries:o.libraries.map(l=>l.id===n?i:l)}))},_updateLibraryOnline:(n,r)=>{e(i=>({libraries:i.libraries.map(o=>o.id===n?{...o,is_online:r}:o)}))},_refreshLibrary:async n=>{try{const r=await Pe.get(`/libraries/${n}`);e(i=>({libraries:i.libraries.map(o=>o.id===n?r:o)}))}catch{t().fetchLibraries()}}})),ss=e=>{const t=e.libraries.filter(r=>r.type==="cloud").sort((r,i)=>r.created_at.localeCompare(i.created_at)),n=e.libraries.filter(r=>r.type==="daemon").sort((r,i)=>r.name.localeCompare(i.name));return[...t,...n]},q3=e=>e.libraries.filter(t=>t.type==="daemon");In.on("ws:daemon:status",e=>{const t=e;t.lib_id&&an.getState()._updateLibraryOnline(t.lib_id,t.is_online),an.getState().fetchLibraries()});In.on("ws:daemon:connected",e=>{const t=e;t.lib_id&&an.getState()._updateLibraryOnline(t.lib_id,!0),an.getState().fetchLibraries()});In.on("ws:library:updated",e=>{const t=e;an.getState()._refreshLibrary(t.library_id)});function V3({name:e,avatarUrl:t,size:n=24}){const[r,i]=_.useState(!1),o=e.charAt(0).toUpperCase();return t&&!r?u.jsx("img",{src:t,alt:"",className:"rounded-full object-cover",style:{width:n,height:n},onError:()=>i(!0)}):u.jsx("span",{className:"inline-flex items-center justify-center rounded-full bg-c4a-accent font-mono font-bold text-white",style:{width:n,height:n,fontSize:n*.48},children:o})}function G3(){const{t:e}=_e(),t=Pt(),n=ar(y=>y.user),r=ar(y=>y.logout),[i,o]=_.useState(!1),l=_.useRef(null),d=an(ji(q3)),p=d.some(y=>y.is_online),f=_.useCallback(()=>{r(),o(!1),t("/login",{replace:!0})},[r,t]),m=()=>{l.current&&clearTimeout(l.current),o(!0)},g=()=>{l.current=setTimeout(()=>o(!1),150)};return n?u.jsxs("div",{className:"relative",onMouseEnter:m,onMouseLeave:g,children:[u.jsxs("button",{className:"relative flex cursor-pointer items-center gap-1",children:[u.jsx(V3,{name:n.name,avatarUrl:n.avatar_url,size:30}),u.jsx("span",{className:`absolute right-0 top-0 h-2 w-2 rounded-full ${p?"bg-c4a-success":"bg-c4a-text-muted"}`})]}),i&&u.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 min-w-[180px] rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-c4a-md",children:[u.jsxs("div",{className:"px-4 py-3",children:[u.jsx("p",{className:"text-sm text-c4a-text-primary",children:n.name}),u.jsx("p",{className:"text-xs text-c4a-text-muted",children:n.email})]}),u.jsx("div",{className:"border-t border-c4a-border-subtle",children:d.length===0?u.jsxs("button",{onClick:()=>{o(!1),t("/studio/sources/add-client")},className:"flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-left text-xs font-medium text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx("span",{className:"flex h-3 w-3 shrink-0 items-center justify-center",children:u.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-c4a-text-muted"})}),e("user.menu.connect_source")]}):d.map(y=>u.jsxs("button",{onClick:()=>{o(!1),t(`/studio/sources/${y.id}`)},className:"flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-left text-xs font-medium text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx("span",{className:"flex h-3 w-3 shrink-0 items-center justify-center",children:u.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${y.is_online?"bg-c4a-success":"bg-c4a-error"}`})}),y.name]},y.id))}),u.jsx("div",{className:"border-t border-c4a-border-subtle",children:u.jsxs("button",{onClick:f,className:"flex w-full cursor-pointer items-center gap-2 px-4 py-2.5 text-left text-xs font-medium text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx(QR,{size:12,className:"shrink-0"}),e("user.menu.sign_out")]})})]})]}):null}function Dm({onLoginClick:e}){const{t}=_e();return ar(r=>r.isAuthenticated)?u.jsx(G3,{}):u.jsx(Mr,{to:"/login",onClick:e,className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-primary",children:t("nav.login")})}const k1=[{to:"/",labelKey:"nav.home"},{to:"/studio",labelKey:"nav.studio"},{to:"/docs",labelKey:"nav.docs"}];function Y3(){const{t:e}=_e(),[t,n]=_.useState(!1);return u.jsxs("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-base/95 backdrop-blur-sm",children:[u.jsxs("div",{className:"flex h-14 items-center justify-between px-4",children:[u.jsxs(Mr,{to:"/",className:"flex items-center gap-2 text-c4a-text-primary",children:[u.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),u.jsx("span",{className:"hidden font-mono text-sm font-semibold uppercase tracking-tight md:inline",children:"Context4AI"})]}),u.jsxs("div",{className:"hidden items-center gap-6 md:flex",children:[u.jsx("nav",{className:"flex items-center gap-4",children:k1.map(({to:r,labelKey:i})=>u.jsx(io,{to:r,end:r==="/",className:({isActive:o})=>`font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${o?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:e(i)},r))}),u.jsx(Dm,{})]}),u.jsx("button",{onClick:()=>n(!t),className:"text-c4a-text-secondary md:hidden",children:t?u.jsx(Vr,{size:20}):u.jsx(WR,{size:20})})]}),t&&u.jsxs("div",{className:"border-t border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2 md:hidden",children:[u.jsx("nav",{className:"flex flex-col gap-2",children:k1.map(({to:r,labelKey:i})=>u.jsx(io,{to:r,end:r==="/",onClick:()=>n(!1),className:({isActive:o})=>`block py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${o?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:e(i)},r))}),u.jsx("div",{className:"mt-2 border-t border-c4a-border-subtle pt-2",children:u.jsx(Dm,{onLoginClick:()=>n(!1)})})]})]})}function K3(e){return e==="system"&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e==="system"?"dark":e}function Bk(e){if(typeof window>"u")return;const t=K3(e);document.documentElement.setAttribute("data-theme",t),localStorage.setItem("theme",e)}function X3(){try{return localStorage.getItem("theme")||"system"}catch{return"system"}}const Kd=da(e=>({theme:X3(),setTheme:t=>{Bk(t),e({theme:t})}}));let S1=!1;function Q3(){if(S1||typeof window>"u")return;S1=!0;const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{const{theme:n}=Kd.getState();n==="system"&&Bk("system")};e.addEventListener("change",t)}Q3();const Z3=[{mode:"light",icon:S3,labelKey:"footer.theme.light"},{mode:"dark",icon:n3,labelKey:"footer.theme.dark"},{mode:"system",icon:e3,labelKey:"footer.theme.system"}];function Pk(){const{t:e}=_e(),{theme:t,setTheme:n}=Kd();return u.jsx("div",{className:"flex items-center gap-1",children:Z3.map(({mode:r,icon:i,labelKey:o})=>u.jsx("button",{onClick:()=>n(r),title:e(o),className:`cursor-pointer rounded p-1.5 transition-colors duration-150 ${t===r?"bg-c4a-bg-active text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:u.jsx(i,{size:14})},r))})}function Fk(){const{i18n:e}=_e(),t=()=>{const n=e.language==="en"?"zh":"en";e.changeLanguage(n)};return u.jsx("button",{onClick:t,className:"cursor-pointer rounded px-2 py-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted transition-colors duration-150 hover:text-c4a-text-secondary hover:bg-c4a-bg-hover",children:e.language==="en"?"CN":"EN"})}function Uk({compact:e}){const{t}=_e(),n=new Date().getFullYear(),r=e?"footer.copyright_compact":"footer.copyright";return u.jsx("p",{className:"font-mono text-[11px] text-c4a-text-muted",children:t(r,{year:n})})}const W3="_brandIcon_1c7st_1",J3="_iconPulse_1c7st_35",j1={brandIcon:W3,iconPulse:J3};function eL({variant:e}){const{t}=_e(),n=e==="studio"?"bg-c4a-bg-surface":"bg-c4a-bg-base";return u.jsx("footer",{className:`border-t border-c4a-border-subtle ${n} px-4 py-4`,children:u.jsxs("div",{className:"flex items-end justify-between gap-4",children:[u.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[u.jsx("div",{className:j1.brandIcon,children:u.jsx("span",{className:j1.iconPulse,children:"C4A"})}),u.jsxs("div",{className:"flex flex-col",children:[u.jsx("span",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-primary",children:"Context4AI"}),u.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-c4a-text-muted",children:t("footer.tagline")})]})]}),u.jsxs("div",{className:"ml-auto flex flex-col items-end gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Pk,{}),u.jsx(Fk,{})]}),u.jsx(Uk,{})]})]})})}let tL=1;const Om=da(e=>({items:[],show:(t,n=6e3)=>{const r=tL++;e(i=>({items:[...i.items,{id:r,message:t,duration:n}]})),setTimeout(()=>{e(i=>({items:i.items.filter(o=>o.id!==r)}))},n)},dismiss:t=>{e(n=>({items:n.items.filter(r=>r.id!==t)}))}})),oa=(e,t)=>Om.getState().show(e,t);function Hk(){const e=Om(n=>n.items),t=Om(n=>n.dismiss);return e.length===0?null:u.jsx("div",{className:"fixed top-4 left-1/2 z-50 flex -translate-x-1/2 flex-col items-center gap-2",children:e.map(n=>u.jsx("div",{role:"status",onClick:()=>t(n.id),className:"flex cursor-pointer items-center gap-2 rounded border border-c4a-accent/30 bg-c4a-bg-elevated px-5 py-3 font-mono text-xs uppercase tracking-tight text-c4a-accent shadow-c4a-lg transition-opacity",children:n.message},n.id))})}function nL(){return u.jsxs("div",{className:"flex min-h-screen flex-col",children:[u.jsx(Y3,{}),u.jsx("main",{className:"mx-auto flex w-full max-w-[1200px] flex-1 flex-col px-4",children:u.jsx(Ck,{})}),u.jsx(eL,{}),u.jsx(Hk,{})]})}function rL({onToggleSidebar:e}){return u.jsx("header",{className:"sticky top-0 z-40 border-b border-c4a-border-subtle bg-c4a-bg-surface/95 backdrop-blur-sm",children:u.jsxs("div",{className:"relative flex h-14 items-center justify-between px-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[e&&u.jsx("button",{onClick:e,className:"text-c4a-text-secondary transition-colors duration-150 hover:text-c4a-text-primary md:hidden",children:u.jsx(o3,{size:20})}),u.jsxs(Mr,{to:"/",className:"hidden items-center gap-2 text-c4a-text-primary md:flex",children:[u.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"}),u.jsx("span",{className:"font-mono text-sm font-semibold uppercase tracking-tight",children:"Context4AI"})]})]}),u.jsx(Mr,{to:"/",className:"absolute left-1/2 flex -translate-x-1/2 items-center gap-2 text-c4a-text-primary md:hidden",children:u.jsx("span",{className:"font-mono text-lg font-bold text-c4a-accent",children:"C4A"})}),u.jsx(Dm,{})]})})}const aL=e=>`flex items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${e?"c4a-sidebar-active text-c4a-accent":"c4a-sidebar-item text-c4a-text-secondary hover:text-c4a-text-primary"}`,iL=[{to:"/studio/modeling",icon:Ok,i18nKey:"studio.sidebar.modeling"},{to:"/studio/brain",icon:ZT,i18nKey:"studio.sidebar.brain"},{to:"/studio/discovery",icon:Fl,i18nKey:"studio.sidebar.discovery"},{to:"/studio/sharing",icon:v3,i18nKey:"studio.sidebar.sharing"},{to:"/studio/collaboration",icon:T3,i18nKey:"studio.sidebar.collaboration"}],sL=[{to:"/studio/settings/api-keys",i18nKey:"settings.tab.api_keys",icon:BR}],oL=["My Drive","ไธชไบบไบ‘","ๆˆ‘็š„ไบ‘็›˜"];function lL({onNavigate:e}){const{t}=_e(),r=Ir().pathname.startsWith("/studio/settings"),[i,o]=_.useState(r);return _.useEffect(()=>{r&&o(!0)},[r]),u.jsxs("div",{children:[u.jsxs("button",{onClick:()=>o(l=>!l),className:`flex w-full cursor-pointer items-center gap-2 rounded px-3 py-2 font-mono text-xs uppercase tracking-tight transition-colors duration-150 ${r?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[u.jsx(y3,{size:14}),t("studio.sidebar.settings"),u.jsx(Gt,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${i?"rotate-90":""}`})]}),i&&u.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:sL.map(({to:l,i18nKey:d,icon:p})=>u.jsxs(io,{to:l,onClick:e,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?"c4a-sidebar-active text-c4a-accent":"c4a-sidebar-item text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[u.jsx(p,{size:13,className:"shrink-0 opacity-60"}),t(d)]},l))})]})}function N1({onNavigate:e}){const{t}=_e(),n=Ir(),r=Pt(),i=an(ji(ss)),o=n.pathname.startsWith("/studio/sources")||n.pathname.startsWith("/studio/source/"),[l,d]=_.useState(o);_.useEffect(()=>{o&&d(!0)},[o]);const p=f=>f.is_default&&oL.includes(f.name)?t("sources.library.default_cloud_name"):f.name;return u.jsxs("aside",{className:"flex h-full w-[220px] shrink-0 flex-col border-r border-c4a-border-subtle bg-c4a-bg-base p-4",children:[u.jsxs("nav",{className:"flex flex-col gap-1",children:[u.jsxs("div",{className:"group/sources",children:[u.jsxs("button",{onClick:()=>d(f=>!f),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 ${o?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[u.jsx(zk,{size:14}),t("studio.sidebar.sources"),u.jsx("span",{role:"button",tabIndex:0,onClick:f=>{f.stopPropagation(),r("/studio/sources/add-client"),e?.()},onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.stopPropagation(),r("/studio/sources/add-client"),e?.())},className:"rounded p-0.5 text-c4a-text-muted opacity-0 transition-all hover:bg-c4a-bg-hover max-md:opacity-100 group-hover/sources:opacity-100 group-hover/sources:text-c4a-accent",title:t("sources.menu.add_client"),children:u.jsx(Ig,{size:12})}),u.jsx(Gt,{size:12,className:`ml-auto shrink-0 transition-transform duration-200 ${l?"rotate-90":""}`})]}),l&&u.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:i.map(f=>{const m=p(f);return u.jsxs(io,{to:`/studio/sources/${f.id}`,onClick:e,className:({isActive:g})=>`flex items-center gap-2 rounded py-1.5 pl-8 pr-3 font-mono text-xs tracking-tight transition-colors duration-150 ${g?"c4a-sidebar-active text-c4a-accent":"c4a-sidebar-item text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[f.type==="cloud"?u.jsx(sR,{size:13,className:"shrink-0 opacity-60"}):u.jsx(FR,{size:13,className:"shrink-0 opacity-60"}),u.jsx("span",{className:"truncate",children:m}),f.type==="daemon"&&(()=>{const g=f.config?.machine_id;return u.jsxs("span",{role:"button",tabIndex:0,onClick:y=>{y.preventDefault(),y.stopPropagation(),r("/studio/sources/add-client"),e?.()},onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),y.stopPropagation(),r("/studio/sources/add-client"),e?.())},className:"group/dot relative ml-auto shrink-0 cursor-pointer rounded-full p-1",children:[u.jsx("span",{className:`block h-[7px] w-[7px] rounded-full ${f.is_online?"bg-c4a-success":"bg-c4a-error"}`}),u.jsx("span",{className:"pointer-events-none absolute left-full top-1/2 z-50 ml-2 hidden -translate-y-1/2 whitespace-nowrap rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/dot:block",children:f.is_online?t("sources.menu.status_online",{machine:g??""}):t("sources.menu.status_offline",{machine:g??""})})]})})()]},f.id)})})]}),iL.map(({to:f,icon:m,i18nKey:g})=>u.jsxs(io,{to:f,onClick:e,className:({isActive:y})=>aL(y),children:[u.jsx(m,{size:14}),t(g)]},f)),u.jsx(lL,{...e?{onNavigate:e}:{}})]}),u.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Pk,{}),u.jsx(Fk,{})]}),u.jsx(Uk,{compact:!0})]})]})}const Hl=da(e=>({status:"disconnected",onlineCount:0,connections:[],setStatus:t=>e({status:t}),fetchDaemonStatus:async()=>{try{const t=await Pe.get("/daemons/status");e({onlineCount:t.online_count,connections:t.connections})}catch{}}})),cL=e=>e==="connecting"?"disconnected":e;In.onStatusChange(e=>{Hl.getState().setStatus(cL(e))});In.on("ws:daemon:connected",e=>{const t=e;Hl.setState(n=>{if(n.connections.some(l=>l.machine_id===t.machine_id))return n;const i={machine_id:t.machine_id};t.lib_id&&(i.lib_id=t.lib_id);const o=[...n.connections,i];return{connections:o,onlineCount:o.length}})});In.on("ws:daemon:status",e=>{const t=e;Hl.setState(n=>{if(t.is_online){if(n.connections.some(d=>d.machine_id===t.machine_id))return n;const o={machine_id:t.machine_id};t.lib_id&&(o.lib_id=t.lib_id);const l=[...n.connections,o];return{connections:l,onlineCount:l.length}}const r=n.connections.filter(i=>i.machine_id!==t.machine_id);return{connections:r,onlineCount:r.length}})});function uL(){const e=Pt(),[t,n]=_.useState(!1),r=ar(l=>l.isAuthenticated),[i,o]=_.useState(!1);return _.useEffect(()=>{const l=ar.getState();l.isAuthenticated||l.init(),o(!0)},[]),_.useEffect(()=>{i&&!r&&e("/login",{replace:!0})},[i,r,e]),_.useEffect(()=>{!i||!r||(an.getState().fetchLibraries(),Hl.getState().fetchDaemonStatus())},[i,r]),_.useEffect(()=>{if(!(!i||!r))return In.onStatusChange(l=>{l==="connected"&&(an.getState().fetchLibraries(),Hl.getState().fetchDaemonStatus())})},[i,r]),!i||!r?null:u.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[u.jsx(rL,{onToggleSidebar:()=>n(!t)}),u.jsxs("div",{className:"flex min-h-0 flex-1",children:[u.jsx("div",{className:"hidden md:block",children:u.jsx(N1,{})}),t&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 top-14 z-30 bg-black/40 md:hidden",onClick:()=>n(!1)}),u.jsx("div",{className:"fixed bottom-0 left-0 top-14 z-30 md:hidden",children:u.jsx(N1,{onNavigate:()=>n(!1)})})]}),u.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-x-hidden",children:u.jsx(Ck,{})})]}),u.jsx(Hk,{})]})}function dL(){const{t:e}=_e();return u.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center py-20 text-center",children:[u.jsx("h1",{className:"font-mono text-4xl font-bold uppercase tracking-wide text-c4a-text-primary md:text-5xl",children:e("home.hero.title")}),u.jsx("p",{className:"mt-6 max-w-lg text-base text-c4a-text-secondary",children:e("home.hero.description")}),u.jsxs("div",{className:"mt-10 flex items-center gap-4",children:[u.jsxs(Mr,{to:"/studio",className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[e("home.hero.cta.studio"),u.jsx(Dk,{size:14})]}),u.jsx("a",{href:"https://github.com/context4ai/c4a",target:"_blank",rel:"noopener noreferrer",className:"rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:e("home.hero.cta.github")})]})]})}const fL=new Set(["github","google","feishu"]),pL=new Set(["oidc","oauth2"]);function hL(){const{t:e}=_e(),t=Pt(),n=ar(z=>z.login),r=ar(z=>z.isAuthenticated),[i,o]=_.useState([]),[l,d]=_.useState(!0),[p,f]=_.useState(null),[m,g]=_.useState(!1);_.useEffect(()=>{r&&t("/studio",{replace:!0})},[r,t]);const y=_.useCallback(async()=>{d(!0),f(null);try{const z=await Pe.get("/auth/providers");o(z)}catch{f(e("login.error"))}finally{d(!1)}},[e]);_.useEffect(()=>{y()},[y]);const b=z=>{g(!0),window.location.href=`/api/v1/auth/${z}/login`},w=async()=>{g(!0);try{const z=await Pe.post("/auth/test-account/login");n(z.token),t("/studio",{replace:!0})}catch{g(!1),f(e("login.error"))}},k=i.filter(z=>fL.has(z.type)),j=i.filter(z=>pL.has(z.type)),S=i.find(z=>z.type==="test_account"),E=k.length>0||j.length>0,C=(k.length>0?1:0)+(j.length>0?1:0)+(S?1:0)>1;return u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 py-12",children:u.jsxs("div",{className:`relative w-full max-w-sm bg-c4a-bg-surface px-8 pt-8 pb-10 transition-all duration-300 border-t-2 border-x border-b ${m?"border-transparent":"border-c4a-border-subtle border-t-c4a-accent"}`,children:[m&&u.jsxs(u.Fragment,{children:[u.jsx("style",{children:`
14
+ .login-animated-border {
15
+ stroke-dasharray: 92 8;
16
+ animation:
17
+ border-accel 2s cubic-bezier(0.33, 0, 0.67, 0.33) forwards,
18
+ border-fast 0.75s linear 2s infinite,
19
+ border-grow 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
20
+ }
21
+ @keyframes border-accel {
22
+ 0% { stroke-dashoffset: 0; }
23
+ 100% { stroke-dashoffset: -200; }
24
+ }
25
+ @keyframes border-fast {
26
+ 0% { stroke-dashoffset: 0; }
27
+ 100% { stroke-dashoffset: -100; }
28
+ }
29
+ @keyframes border-grow {
30
+ 0% { stroke-dasharray: 25 75; }
31
+ 100% { stroke-dasharray: 92 8; }
32
+ }
33
+ `}),u.jsx("svg",{className:"pointer-events-none absolute -inset-x-[1px] -bottom-[1px] -top-[2px] h-[calc(100%+3px)] w-[calc(100%+2px)] overflow-visible",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("rect",{x:"1",y:"1",width:"calc(100% - 2px)",height:"calc(100% - 2px)",fill:"none",stroke:"var(--c4a-accent)",strokeWidth:"2",pathLength:"100",className:"login-animated-border"})})]}),l&&!m&&u.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:u.jsx(sn,{size:24,className:"animate-spin text-c4a-text-muted"})}),!l&&!m&&p&&u.jsxs("div",{className:"flex min-h-[160px] flex-col items-center justify-center gap-4",children:[u.jsx("p",{className:"text-center font-mono text-xs text-c4a-text-muted",children:p}),u.jsx("button",{onClick:y,className:"border border-c4a-border-default bg-transparent px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:text-c4a-text-primary",children:e("login.retry")})]}),!l&&!p&&u.jsxs("div",{className:"flex flex-col gap-6",children:[u.jsx("h2",{className:"text-center font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:e("login.title")}),u.jsxs("div",{className:"flex flex-col gap-2",children:[k.map(z=>u.jsx(C1,{provider:z,onClick:()=>b(z.id),label:e("login.provider_cta",{name:z.display_name}),disabled:m},z.id)),k.length>0&&j.length>0&&u.jsx(E1,{label:e("login.or")}),j.map(z=>u.jsx(C1,{provider:z,onClick:()=>b(z.id),label:e("login.provider_cta",{name:z.display_name}),disabled:m},z.id)),E&&S&&C&&u.jsx(E1,{label:e("login.or")}),S&&u.jsxs("button",{disabled:m,onClick:w,className:"c4a-flash-accent flex h-11 w-full cursor-pointer items-center justify-center gap-3 bg-c4a-accent font-mono text-xs font-bold uppercase tracking-widest text-white transition-all duration-300 disabled:cursor-not-allowed",children:[S.icon&&u.jsx("img",{src:S.icon,alt:"",className:"relative z-10 h-5 w-5 shrink-0 opacity-90"}),u.jsx("span",{className:`relative z-10 ${m?"opacity-50":""}`,children:e("login.provider_cta",{name:e("login.test_account")})})]})]})]})]})})}function C1({provider:e,onClick:t,label:n,disabled:r}){return u.jsxs("button",{onClick:t,disabled:r,className:"group c4a-flash-outline flex h-11 w-full cursor-pointer items-center justify-center gap-3 border border-c4a-border-default bg-transparent font-mono text-xs font-bold uppercase tracking-tight text-c4a-text-primary transition-opacity duration-150 ease-out disabled:cursor-not-allowed",children:[e.icon&&u.jsx("img",{src:e.icon,alt:"",className:"login-provider-btn-icon relative z-10 h-5 w-5 shrink-0 opacity-70 grayscale transition-all duration-[250ms] ease-out group-hover:opacity-100 group-hover:grayscale-0 group-disabled:opacity-100 group-disabled:grayscale-0"}),u.jsx("span",{className:`relative z-10 ${r?"opacity-50":""}`,children:n})]})}function E1({label:e}){return u.jsxs("div",{className:"flex items-center gap-3 py-1",children:[u.jsx("div",{className:"h-px flex-1 border-t border-dashed border-c4a-border-default"}),u.jsx("span",{className:"font-mono text-xs uppercase text-c4a-text-muted",children:e}),u.jsx("div",{className:"h-px flex-1 border-t border-dashed border-c4a-border-default"})]})}const mL="animate-pulse font-mono text-xs uppercase tracking-tight text-c4a-text-muted";function fa({labelKey:e="login.loading",className:t}){const{t:n}=_e();return u.jsx("span",{className:t??mL,children:n(e)})}function gL(){const e=Pt(),t=ar(n=>n.login);return _.useEffect(()=>{const r=new URLSearchParams(window.location.search).get("token");if(r){t(r);const i=ar.getState().isAuthenticated;e(i?"/studio":"/login",{replace:!0})}else e("/login",{replace:!0})},[t,e]),u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx(fa,{labelKey:"login.authenticating",className:"animate-pulse font-mono text-sm uppercase tracking-tight text-c4a-text-muted"})})}function At({icon:e,title:t,description:n,action:r,fullPage:i}){const o=u.jsxs("div",{className:i?"w-full max-w-[800px] text-center":"flex flex-col items-center text-center",children:[e&&u.jsx("div",{className:"mb-3 text-c4a-text-muted",children:e}),i?u.jsx("h3",{className:"font-mono text-lg font-bold uppercase text-c4a-text-primary",children:t}):u.jsx("p",{className:"font-mono text-sm text-c4a-text-secondary",children:t}),u.jsx("p",{className:`mt-2 ${i?"mt-3 text-sm text-c4a-text-secondary":"max-w-md text-xs text-c4a-text-muted"}`,children:n}),r&&u.jsx("div",{className:i?"mt-6 flex justify-center":"mt-4",children:r})]});return u.jsx("div",{className:`flex flex-1 items-center justify-center ${i?"p-8 pb-24":"p-8 pb-23"}`,children:o})}function pa({title:e,version:t,description:n}){const{t:r}=_e();return u.jsx(At,{fullPage:!0,title:e,description:n,action:t?u.jsx("span",{className:"inline-block rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1 font-mono text-xs uppercase text-c4a-accent",children:r("placeholder.coming",{version:t})}):void 0})}function xL(){const{t:e}=_e();return u.jsx(pa,{title:e("page.docs.title"),version:"0.4.13",description:e("page.docs.description")})}function yL(){const{t:e}=_e();return u.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[u.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:e("notfound.title")}),u.jsx("p",{className:"mt-4 text-base text-c4a-text-secondary",children:e("notfound.description")}),u.jsx(Mr,{to:"/",className:"mt-8 rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:e("notfound.back")})]})}function A1(){const{t:e}=_e(),t=jk();let n="500",r=e("error.description");return ao(t)?(n=String(t.status),t.status===404?r=e("notfound.description"):t.statusText&&(r=t.statusText)):t instanceof Error&&(r=t.message),console.error(`[ErrorPage] ${n}:`,t),u.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-c4a-bg-base p-8 text-center",children:[u.jsx("h1",{className:"font-mono text-6xl font-bold text-c4a-accent",children:n}),u.jsx("p",{className:"mt-4 max-w-md text-base text-c4a-text-secondary",children:r}),u.jsxs("div",{className:"mt-8 flex items-center gap-3",children:[u.jsxs("button",{onClick:()=>window.location.reload(),className:"flex items-center gap-2 rounded bg-c4a-accent px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-white transition-colors duration-150 hover:bg-c4a-accent-hover",children:[u.jsx(m3,{size:14}),e("error.reload")]}),u.jsx(Mr,{to:"/",className:"rounded border border-c4a-border-default px-5 py-2.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors duration-150 hover:border-c4a-border-strong hover:text-c4a-text-primary",children:e("notfound.back")})]})]})}function bL(){const{t:e}=_e();return u.jsx(pa,{title:e("page.modeling.title"),version:"0.4.16",description:e("page.modeling.description")})}function vL(){const{t:e}=_e();return u.jsx(pa,{title:e("page.brain.title"),version:"0.4.18",description:e("page.brain.description")})}function _L(){const{t:e}=_e();return u.jsx(pa,{title:e("page.discovery.title"),version:"0.6.x",description:e("page.discovery.description")})}function wL(){const{t:e}=_e();return u.jsx(pa,{title:e("page.sharing.title"),version:"0.4.39",description:e("page.sharing.description")})}function kL(){const{t:e}=_e();return u.jsx(pa,{title:e("page.collaboration.title"),version:"0.5.x",description:e("page.collaboration.description")})}function br({children:e,onClose:t,className:n="",overlayClass:r="bg-black/50",closeOnOverlay:i=!0,closeOnEsc:o=!0,disableClose:l=!1}){const d=_.useRef(null);_.useEffect(()=>{if(!o)return;const f=m=>{m.key==="Escape"&&!l&&t()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[t,o,l]);const p=_.useCallback(f=>{i&&!l&&d.current&&!d.current.contains(f.target)&&t()},[t,i,l]);return u.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center ${r}`,onClick:p,children:u.jsx("div",{ref:d,className:n,children:e})})}function SL(){const{t:e}=_e(),[t,n]=_.useState([]),[r,i]=_.useState(!0),[o,l]=_.useState(!1),[d,p]=_.useState(null),f=[{label:e("page.settings.title")},{label:e("settings.tab.api_keys")}],m=_.useCallback(async()=>{i(!0);try{const b=await Pe.get("/auth/api-keys");n(b)}catch{}finally{i(!1)}},[]);_.useEffect(()=>{m()},[m]);const g=b=>{l(!1),p(b),m()},y=async b=>{if(confirm(e("api_keys.delete.confirm")))try{await Pe.delete(`/auth/api-keys/${b}`),m()}catch{}};return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:f.map((b,w)=>{const k=w===f.length-1;return u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[w>0&&u.jsx(Gt,{size:12,className:"shrink-0 text-c4a-text-muted"}),u.jsx("span",{className:k?"text-c4a-text-primary":"",children:b.label})]},w)})}),r&&u.jsx("div",{className:"flex flex-1 items-center justify-center pb-24",children:u.jsx(fa,{})}),!r&&t.length===0&&u.jsx(At,{fullPage:!0,title:e("api_keys.empty.title"),description:e("api_keys.empty.description"),action:u.jsx("button",{onClick:()=>l(!0),className:"cursor-pointer rounded bg-c4a-accent/75 px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent",children:e("api_keys.create")})}),!r&&t.length>0&&u.jsxs("div",{className:"mt-4",children:[u.jsxs("div",{className:"mb-4 flex items-center justify-between gap-4",children:[u.jsx("p",{className:"text-xs text-c4a-text-muted",children:e("api_keys.description")}),u.jsxs("button",{onClick:()=>l(!0),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:[u.jsx(Ig,{size:14}),e("api_keys.create")]})]}),u.jsx("div",{className:"flex flex-col gap-3",children:t.map(b=>u.jsx(jL,{apiKey:b,onDelete:()=>y(b.id)},b.id))})]}),o&&u.jsx(NL,{onClose:()=>l(!1),onCreated:g}),d&&u.jsx(CL,{apiKey:d,onClose:()=>p(null)})]})}function jL({apiKey:e,onDelete:t}){const{t:n}=_e(),r=e.last_used_at?new Date(e.last_used_at).toLocaleDateString():n("api_keys.never_used"),i=new Date(e.created_at).toLocaleDateString();return u.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-mono text-sm text-c4a-text-primary",children:e.name}),u.jsxs("p",{className:"mt-1 text-xs text-c4a-text-muted",children:[u.jsxs("span",{className:"font-mono",children:[e.key_prefix,"****"]}),u.jsx("span",{className:"mx-2",children:"ยท"}),r]}),u.jsx("p",{className:"mt-0.5 text-xs text-c4a-text-muted",children:n("api_keys.created_at",{date:i})})]}),u.jsx("button",{onClick:t,className:"cursor-pointer p-1 text-c4a-text-muted transition-colors hover:text-c4a-error",title:"Delete",children:u.jsx(Yd,{size:14})})]})})}function NL({onClose:e,onCreated:t}){const{t:n}=_e(),[r,i]=_.useState(""),[o,l]=_.useState("never"),[d,p]=_.useState(!1),f=_.useRef(null),[m,g]=_.useState(!1),y=[{value:"never",label:n("api_keys.expires.never")},{value:"30d",label:n("api_keys.expires.30d")},{value:"90d",label:n("api_keys.expires.90d")},{value:"1y",label:n("api_keys.expires.1y")}],b=y.find(k=>k.value===o);_.useEffect(()=>{if(!d)return;const k=j=>{f.current&&!f.current.contains(j.target)&&p(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[d]);const w=async()=>{if(r.trim()){g(!0);try{const k=EL(o),j=await Pe.post("/auth/api-keys",{name:r.trim(),scope:["read"],expires_at:k});t(j)}catch{g(!1)}}};return u.jsxs(br,{onClose:e,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-8 shadow-c4a-lg",children:[u.jsx("h2",{className:"mb-6 font-mono text-sm uppercase tracking-tight text-c4a-text-primary",children:n("api_keys.create")}),u.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:n("api_keys.form.name")}),u.jsx("input",{value:r,onChange:k=>i(k.target.value),placeholder:n("api_keys.form.name_placeholder"),className:"mb-4 w-full rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none"}),u.jsx("label",{className:"mb-1 block text-sm text-c4a-text-secondary",children:n("api_keys.form.expiry")}),u.jsxs("div",{ref:f,className:"relative mb-6",children:[u.jsxs("button",{type:"button",onClick:()=>p(k=>!k),className:"flex w-full cursor-pointer items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-2 text-sm text-c4a-text-primary transition-colors hover:border-c4a-border-strong",children:[u.jsx("span",{children:b?.label}),u.jsx(Gt,{size:14,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${d?"rotate-90":""}`})]}),d&&u.jsx("div",{className:"absolute left-0 top-full z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg",children:y.map(k=>u.jsxs("button",{type:"button",onClick:()=>{l(k.value),p(!1)},className:`flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors hover:bg-c4a-bg-hover ${k.value===o?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,children:[u.jsx(ua,{size:12,className:`shrink-0 ${k.value===o?"opacity-100":"opacity-0"}`}),k.label]},k.value))})]}),u.jsxs("div",{className:"flex justify-end gap-3",children:[u.jsx("button",{onClick:e,disabled:m,className:"cursor-pointer rounded border border-c4a-border-default px-4 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:text-c4a-text-primary",children:n("common.cancel")}),u.jsx("button",{onClick:w,disabled:!r.trim()||m,className:"cursor-pointer rounded bg-c4a-accent/75 px-4 py-2 font-mono text-xs uppercase tracking-tight text-white transition-colors hover:bg-c4a-accent disabled:opacity-50",children:n("api_keys.create")})]})]})}function CL({apiKey:e,onClose:t}){const{t:n}=_e(),[r,i]=_.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(e.key),i(!0),setTimeout(()=>i(!1),2e3)}catch{const l=document.querySelector("[data-api-key-value]");if(l){const d=document.createRange();d.selectNodeContents(l);const p=window.getSelection();p?.removeAllRanges(),p?.addRange(d)}}};return u.jsxs(br,{onClose:t,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-8 shadow-c4a-lg",closeOnOverlay:!1,closeOnEsc:!1,children:[u.jsx("h2",{className:"mb-4 font-mono text-sm uppercase tracking-tight text-c4a-accent",children:n("api_keys.created")}),u.jsx("p",{className:"mb-4 text-sm text-c4a-text-secondary",children:n("api_keys.copy_warning")}),u.jsxs("div",{className:"mb-6 flex items-center gap-2 rounded border border-c4a-accent/30 bg-c4a-bg-base px-3 py-2",children:[u.jsx("code",{"data-api-key-value":!0,className:"flex-1 truncate font-mono text-xs text-c4a-text-primary",children:e.key}),u.jsx("button",{onClick:o,className:"cursor-pointer shrink-0 font-mono text-xs uppercase text-c4a-accent transition-colors hover:text-c4a-accent/80",children:n(r?"api_keys.copied":"api_keys.copy")})]}),u.jsx("div",{className:"flex justify-end",children:u.jsx("button",{onClick:t,className:"cursor-pointer rounded bg-c4a-accent/75 px-4 py-2 font-mono text-xs uppercase tracking-tight text-white transition-colors hover:bg-c4a-accent",children:n("api_keys.done")})})]})}function EL(e){if(e==="never")return null;const t=new Date;switch(e){case"30d":t.setDate(t.getDate()+30);break;case"90d":t.setDate(t.getDate()+90);break;case"1y":t.setFullYear(t.getFullYear()+1);break;default:return null}return t.toISOString()}function AL(){const{t:e}=_e();return u.jsx(pa,{title:e("page.code_setup.title"),version:"0.4.13",description:e("page.code_setup.description")})}function TL(){const{t:e}=_e();return u.jsx(pa,{title:e("page.code_compile.title"),version:"0.4.13",description:e("page.code_compile.description")})}function RL(){const{t:e}=_e();return u.jsx(pa,{title:e("page.code_review.title"),version:"0.4.14",description:e("page.code_review.description")})}function LL(){const{t:e}=_e();return u.jsx(pa,{title:e("page.code_result.title"),version:"0.4.14",description:e("page.code_result.description")})}const eo=new Map;let Pa=null;const Mm=()=>{if(Pa=null,eo.size===0)return;const e=[...eo.entries()];eo.clear();const t=Ot.getState(),n=new Map(t.indexingTasks);let r=!1;for(const[i,o]of e){const l=n.get(i);l?.terminalState||(n.set(i,{...l,...o,pendingSkips:l?.pendingSkips,unchangedCount:l?.unchangedCount,modules:o.modules??l?.modules}),r=!0)}r&&Ot.setState({indexingTasks:n})},DL=e=>{const t=eo.get(e.sourceId);t&&t.stage!==e.stage&&(Pa!==null&&(cancelAnimationFrame(Pa),Pa=null),Mm()),eo.set(e.sourceId,e),Pa===null&&(Pa=requestAnimationFrame(Mm))},lc=(e,t)=>{for(const n of e){if(n.path===t)return n;if(n.children){const r=lc(n.children,t);if(r)return r}}return null},OL=(e,t)=>t===""?e:lc(e,t)?.children??[],Nl=(e,t)=>{if(!t)return[];const n=t.split("/"),r=[];let i="";for(const o of n){i=i?`${i}/${o}`:o;const l=lc(e,i);l&&r.push(l)}return r},Ot=da((e,t)=>({rootSources:[],currentRoot:null,loading:!1,error:null,total:0,limit:100,offset:0,filter:"all",indexingTasks:new Map,fetchRootSources:async({library_id:n,limit:r,offset:i})=>{e({loading:!0,error:null});try{const o={library_id:n};r!==void 0&&(o.limit=String(r)),i!==void 0&&(o.offset=String(i));const l=await Pe.get("/sources",o);e({rootSources:l.items,total:l.total,limit:l.limit,offset:l.offset,loading:!1})}catch(o){e({error:o instanceof Error?o.message:"Failed to load sources",loading:!1})}},fetchRootSource:async n=>{e({loading:!0,error:null,currentRoot:null});try{const r=await Pe.get(`/sources/${n}`);return e({currentRoot:r,loading:!1}),r}catch(r){throw e({currentRoot:null,loading:!1,error:r instanceof Error?r.message:"Source not found"}),r}},createSource:async n=>await Pe.post("/sources",n),addTreeNode:async(n,r)=>{const i=await Pe.post(`/sources/${n}/tree`,r);return e(o=>({rootSources:o.rootSources.map(l=>l.id===n?i:l),currentRoot:o.currentRoot?.id===n?i:o.currentRoot})),i},updateSource:async(n,r)=>{const i=await Pe.put(`/sources/${n}`,r);e(o=>({rootSources:o.rootSources.map(l=>l.id===n?i:l),currentRoot:o.currentRoot?.id===n?i:o.currentRoot}))},deleteSource:async n=>{await Pe.delete(`/sources/${n}`),e(r=>({rootSources:r.rootSources.filter(i=>i.id!==n),currentRoot:r.currentRoot?.id===n?null:r.currentRoot}))},deleteTreeNode:async(n,r)=>{const i=await Pe.delete(`/sources/${n}/tree?path=${encodeURIComponent(r)}`);return e(o=>({rootSources:o.rootSources.map(l=>l.id===n?i:l),currentRoot:o.currentRoot?.id===n?i:o.currentRoot})),i},uploadDoc:async n=>await Pe.post("/sources/upload",n),triggerIndex:async(n,r)=>{const i=new Map(t().indexingTasks);i.set(n,{sourceId:n,stage:"pending",progress:0,modules:r?.map(l=>l.path)}),e({indexingTasks:i});const o={};r&&(o.modules=r);try{const l=await Pe.post(`/sources/${n}/index`,o);if(l.status!=="started")t().clearIndexTask(n);else if(l.dirty_skipped&&l.dirty_skipped.length>0){const d=new Map(t().indexingTasks),p=d.get(n);p&&(d.set(n,{...p,unchangedCount:l.dirty_skipped.length}),e({indexingTasks:d}))}return l}catch(l){throw t().clearIndexTask(n),l}},updateIndexProgress:n=>{if(!t().indexingTasks.get(n.sourceId)?.terminalState){if(n.stage==="skipping"&&n.message){const i=new Map(t().indexingTasks),o=i.get(n.sourceId),l=typeof n.message=="string"?n.message:JSON.stringify(n.message),d=[...o?.pendingSkips??[],l];i.set(n.sourceId,{...o??n,pendingSkips:d}),e({indexingTasks:i});return}DL(n)}},markIndexTerminal:(n,r,i)=>{eo.has(n)&&Pa!==null&&(cancelAnimationFrame(Pa),Pa=null,Mm());const o=new Map(t().indexingTasks),l=o.get(n);l&&o.set(n,{...l,terminalState:r,errorMessage:i}),e({indexingTasks:o})},clearIndexTask:n=>{const r=new Map(t().indexingTasks);r.delete(n),e({indexingTasks:r})},deleteIndex:async(n,r)=>{const i=r?`?modules=${r.map(l=>encodeURIComponent(l.path)).join(",")}`:"";return{deleted:(await Pe.delete(`/sources/${n}/index${i}`)).deleted}},setFilter:n=>e({filter:n}),clearSources:()=>e({rootSources:[],currentRoot:null,total:0,offset:0})})),zm="__c4a_indexWsSubs",Im=globalThis;if(Im[zm])for(const e of Im[zm])e();const cc=[];Im[zm]=cc;cc.push(In.on("index/progress",e=>{const t=e;Ot.getState().updateIndexProgress({sourceId:t.source_id,stage:t.stage,progress:t.progress,moduleName:t.module_name,currentFile:t.current_file,totalFiles:t.total_files,processedFiles:t.processed_files,message:t.message,modules:t.modules})}));cc.push(In.on("index/done",e=>{const t=e;Ot.getState().markIndexTerminal(t.source_id,"done")}));cc.push(In.on("index/error",e=>{const t=e;if(Ot.getState().markIndexTerminal(t.source_id,"error",t.error),t.errorCode){const r={DOC_INDEX_LLM_UNAVAILABLE:"index.doc.error.llm_unavailable",DOC_INDEX_EMBEDDING_UNAVAILABLE:"index.doc.error.embedding_unavailable",DOC_INDEX_CONTENT_MISSING:"index.doc.error.content_missing",DOC_INDEX_PARSE_FAILED:"index.doc.error.parse_failed",DOC_INDEX_LLM_EXHAUSTED:"index.doc.error.llm_exhausted"}[t.errorCode];r?oa($n.t(r,{message:t.error??""}),5e3):t.error&&oa(t.error,5e3)}else t.error&&oa(t.error,5e3)}));cc.push(In.on("index/timeout",e=>{const t=e;Ot.getState().markIndexTerminal(t.source_id,"timeout")}));function Ha({segments:e}){const{t}=_e(),n=_.useRef(null),r=_.useRef(null),[i,o]=_.useState(0),l=[{label:t("sources.breadcrumb.sources")},...e],d=Math.max(0,l.length-3);_.useEffect(()=>{const f=n.current,m=r.current;if(!f||!m)return;const g=()=>{const b=f.clientWidth,w=Array.from(m.children);if(w.length===0)return;const k=w.map(P=>P.offsetWidth),j=4;if(k.reduce((P,T)=>P+T,0)+j*(k.length-1)<=b){o(0);return}const E=20,C=(k[0]??0)+(k[1]??0)+j,z=k[k.length-1]??0,D=C+j+E+j+z;let A=d;for(let P=1;P<=d;P++){let T=0;for(let F=2+P;F<k.length-1;F++)T+=k[F]+j;if(D+T<=b){A=P;break}}o(A)};g();const y=new ResizeObserver(g);return y.observe(f),()=>y.disconnect()},[d,e,t]);const p=(()=>{if(i===0||l.length<=3)return l;const f=l.slice(0,2),m=l[l.length-1],g=l.slice(2+i,l.length-1);return[...f,{label:"โ€ฆ"},...g,m]})();return u.jsxs("div",{ref:n,className:"relative min-w-0 overflow-hidden",children:[u.jsx("nav",{className:"flex min-h-8 items-center gap-1 font-mono text-xs tracking-tight text-c4a-text-muted",children:p.map((f,m)=>{const g=m===p.length-1;return u.jsxs("span",{className:`flex shrink-0 items-center gap-1 ${m===0?"uppercase":""}`,children:[m>0&&u.jsx(Gt,{size:12,className:"shrink-0 text-c4a-text-muted"}),f.to&&!g?u.jsx(Mr,{to:f.to,className:"cursor-pointer whitespace-nowrap transition-colors hover:text-c4a-text-primary",children:f.label}):u.jsx("span",{className:`whitespace-nowrap ${g?"text-c4a-text-primary":""}`,children:f.label})]},m)})}),u.jsx("div",{ref:r,"aria-hidden":!0,className:"pointer-events-none invisible absolute left-0 top-0 flex h-0 items-center gap-1 overflow-visible whitespace-nowrap font-mono text-xs tracking-tight",children:l.map((f,m)=>u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[m>0&&u.jsx(Gt,{size:12}),u.jsx("span",{className:"whitespace-nowrap",children:f.label})]},m))})]})}const ML=["all","indexed","not_indexed"];function zL({value:e,onChange:t}){const{t:n}=_e(),[r,i]=_.useState(!1),o=_.useRef(null),l=_.useRef(null),d={all:n("sources.filter.all"),indexed:n("sources.filter.indexed"),not_indexed:n("sources.filter.not_indexed")},p=_.useCallback(g=>{o.current&&!o.current.contains(g.target)&&i(!1)},[]);_.useEffect(()=>{if(r)return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[r,p]);const f=_.useCallback(()=>{l.current&&(clearTimeout(l.current),l.current=null),i(!0)},[]),m=_.useCallback(()=>{l.current=setTimeout(()=>i(!1),150)},[]);return u.jsxs("div",{ref:o,className:"relative",onMouseEnter:f,onMouseLeave:m,children:[u.jsxs("button",{className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[u.jsx(YR,{size:12}),u.jsx("span",{className:"hidden sm:inline",children:d[e]}),u.jsx(Gt,{size:12,className:`hidden transition-transform duration-200 sm:block ${r?"rotate-90":""}`})]}),r&&u.jsx("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[120px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg",children:ML.map(g=>u.jsxs("button",{onClick:()=>{t(g),i(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${g===e?"text-c4a-accent":"text-c4a-text-secondary"}`,children:[u.jsx(ua,{size:12,className:g===e?"opacity-100":"opacity-0"}),d[g]]},g))})]})}function T1({target:e,onConfirm:t,onCancel:n}){const{t:r}=_e();return u.jsxs(br,{onClose:n,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:r("sources.delete.confirm_title")}),u.jsxs("div",{className:"mt-4 space-y-3 text-sm text-c4a-text-secondary",children:[e.type==="resource"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:r("sources.delete.resource",{name:e.name})}),u.jsx("p",{children:r("sources.delete.resource_impact")}),u.jsx("p",{className:"text-c4a-warning",children:r("sources.delete.session_warning")}),u.jsx("p",{children:r("sources.delete.entity_safe")})]}),e.type==="folder"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:r("sources.delete.folder",{name:e.name})}),e.folderCount!==void 0&&e.sourceCount!==void 0?u.jsxs(u.Fragment,{children:[u.jsx("p",{children:r("sources.delete.folder_contents",{folders:e.folderCount,sources:e.sourceCount})}),e.indexedCount!==void 0&&e.indexedCount>0&&u.jsx("p",{children:r("sources.delete.indexed_hint",{indexed:e.indexedCount,total:e.sourceCount})})]}):u.jsx("p",{children:r("sources.delete.folder_impact_generic")}),u.jsx("p",{className:"text-c4a-warning",children:r("sources.delete.irreversible")})]}),e.type==="repo"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:r("sources.delete.repo",{name:e.name,library:e.libraryName})}),e.packageCount!==void 0&&e.docCount!==void 0?u.jsxs(u.Fragment,{children:[u.jsx("p",{children:r("sources.delete.repo_contents",{packages:e.packageCount,docs:e.docCount})}),e.indexedCount!==void 0&&e.indexedCount>0&&u.jsx("p",{children:r("sources.delete.indexed_hint",{indexed:e.indexedCount,total:e.packageCount+e.docCount})})]}):u.jsx("p",{children:r("sources.delete.repo_impact_generic")}),u.jsx("p",{children:r("sources.delete.local_safe")}),u.jsx("p",{children:r("sources.delete.entity_safe")})]}),e.type==="client"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:r("sources.delete.client",{name:e.name})}),u.jsx("p",{children:r("sources.delete.client_impact")}),u.jsx("p",{children:r("sources.delete.local_safe")}),u.jsx("p",{children:r("sources.delete.entity_safe")}),u.jsx("p",{className:"text-c4a-warning",children:r("sources.delete.irreversible")}),u.jsx("p",{className:"text-c4a-text-muted",children:r("sources.delete.client_reregister")})]})]}),u.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[u.jsx("button",{onClick:n,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:r("common.cancel")}),u.jsx("button",{onClick:t,className:"rounded bg-c4a-error px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-error/80",children:r("common.confirm")})]})]})}function IL({onConfirm:e,onCancel:t,error:n}){const{t:r}=_e(),[i,o]=_.useState(""),l=_.useRef(null);_.useEffect(()=>{l.current?.focus()},[]);const d=_.useCallback(()=>{const f=i.trim();f&&e(f)},[i,e]),p=_.useCallback(f=>{f.key==="Enter"&&(f.preventDefault(),d())},[d]);return u.jsxs(br,{onClose:t,className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ik,{size:16,className:"shrink-0 text-c4a-accent"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:r("sources.actions.new_folder")})]}),u.jsxs("div",{className:"mt-4",children:[u.jsx("input",{ref:l,value:i,onChange:f=>o(f.target.value),onKeyDown:p,placeholder:r("sources.folder.name_placeholder"),className:"w-full rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 text-sm text-c4a-text-primary outline-none transition-colors focus:border-c4a-accent",autoFocus:!0}),n&&u.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:n})]}),u.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[u.jsx("button",{onClick:t,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:r("common.cancel")}),u.jsx("button",{onClick:d,disabled:!i.trim(),className:"rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:r("common.confirm")})]})]})}function $h({label:e,icon:t,items:n,alignRight:r}){const[i,o]=_.useState(!1),l=_.useRef(null),d=_.useRef(null),p=_.useCallback(g=>{l.current&&!l.current.contains(g.target)&&o(!1)},[]);_.useEffect(()=>{if(i)return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[i,p]);const f=_.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null),o(!0)},[]),m=_.useCallback(()=>{d.current=setTimeout(()=>o(!1),150)},[]);return u.jsxs("div",{ref:l,className:"relative",onMouseEnter:f,onMouseLeave:m,children:[u.jsxs("button",{className:`flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary ${e?"p-1 sm:px-2 sm:py-1":"p-1"}`,children:[t,e&&u.jsx("span",{className:"hidden sm:inline",children:e}),e&&u.jsx(Gt,{size:12,className:`hidden transition-transform duration-200 sm:block ${i?"rotate-90":""}`})]}),i&&u.jsx("div",{className:`absolute top-full z-20 mt-1 min-w-[160px] rounded border border-c4a-border-default bg-c4a-bg-elevated py-1 shadow-c4a-lg ${r?"right-0":"left-0"}`,children:n.map(g=>u.jsxs("button",{onClick:()=>{g.onClick(),o(!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:[g.icon,g.label]},g.label))})]})}function $L({onClose:e}){const{t}=_e();return u.jsxs(br,{onClose:e,closeOnEsc:!1,className:"w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(w3,{size:18,className:"text-c4a-accent"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:t("sources.upgrade.title")})]}),u.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:t("sources.upgrade.description")}),u.jsx("div",{className:"mt-6 flex justify-end",children:u.jsx("button",{onClick:e,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:t("common.confirm")})})]})}const BL=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),PL=new Set([".ts",".tsx",".md"]),FL=new Set([".md",".txt",".ts",".tsx",".doc",".docx",".pdf",".ppt",".pptx"]),UL=new Set([".md",".txt"]),HL=5*1024*1024,qL=10;function $m(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}function VL(e){const t=e.includes("/")?e.split("/").pop():e;if(BL.has(t.toLowerCase()))return!0;const n=$m(t);return PL.has(n)}function GL(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function YL({onConfirm:e,onCancel:t,error:n,uploading:r}){const{t:i}=_e(),[o,l]=_.useState([]),[d,p]=_.useState(null),[f,m]=_.useState(!1),[g,y]=_.useState(!1),b=_.useRef(null),w=_.useCallback(A=>{p(null);for(const P of A){const T=$m(P.name);if(!FL.has(T)){p(i("sources.upload.unsupported_type",{name:P.name}));return}if(P.size>HL){p(i("sources.upload.file_too_large",{name:P.name}));return}}l(P=>{const T=new Map(P.map(M=>[M.name,M]));for(const M of A)T.set(M.name,{name:M.name,size:M.size,file:M});const F=Array.from(T.values());return F.length>qL?(p(i("sources.upload.too_many_files")),P):F})},[i]),k=_.useCallback(A=>{const P=A.target.files;!P||P.length===0||(w(Array.from(P)),A.target.value="")},[w]),j=_.useCallback(A=>{l(P=>P.filter((T,F)=>F!==A)),p(null)},[]),S=_.useCallback(A=>{A.preventDefault(),m(!1);const P=A.dataTransfer?.files;!P||P.length===0||w(Array.from(P))},[w]),E=_.useCallback(A=>{A.preventDefault(),m(!0)},[]),C=_.useCallback(A=>{A.preventDefault(),m(!1)},[]),z=_.useCallback(async()=>{if(!(o.length===0||g)){y(!0);try{const A=await Promise.all(o.map(P=>new Promise((T,F)=>{const M=$m(P.name),G=UL.has(M),Q=new FileReader;Q.onerror=()=>F(Q.error),G?(Q.onload=()=>T({name:P.name,content:Q.result,encoding:"utf-8"}),Q.readAsText(P.file)):(Q.onload=()=>{const re=Q.result,$=re.slice(re.indexOf(",")+1);T({name:P.name,content:$,encoding:"base64"})},Q.readAsDataURL(P.file))})));e(A)}catch{y(!1)}}},[o,g,e]),D=n||d;return u.jsxs(br,{onClose:t,disableClose:g||(r??!1),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Lm,{size:16,className:"shrink-0 text-c4a-accent"}),u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:i("sources.upload.title")})]}),u.jsxs("div",{className:"mt-4",children:[u.jsx("input",{ref:b,type:"file",accept:".md,.doc,.docx,.pdf,.ppt,.pptx,.txt",multiple:!0,onChange:k,className:"hidden"}),u.jsxs("button",{type:"button",onClick:()=>b.current?.click(),onDrop:S,onDragOver:E,onDragLeave:C,disabled:g||r,className:`flex w-full flex-col items-center justify-center rounded border-2 border-dashed px-4 py-8 transition-colors ${f?"border-c4a-accent bg-c4a-accent/5":"border-c4a-border-default hover:border-c4a-accent/50"} ${g||r?"cursor-not-allowed opacity-40":"cursor-pointer"}`,children:[u.jsx(Lm,{size:24,className:"text-c4a-text-muted"}),u.jsx("p",{className:"mt-2 text-sm text-c4a-text-secondary",children:i("sources.upload.drop_hint")}),u.jsx("p",{className:"mt-1 text-[10px] text-c4a-text-muted",children:i("sources.upload.supported_formats")})]})]}),o.length>0&&u.jsxs("div",{className:"mt-3",children:[u.jsx("p",{className:"text-xs text-c4a-text-muted",children:i("sources.upload.selected",{count:o.length})}),u.jsx("div",{className:"mt-1 max-h-40 space-y-1 overflow-y-auto c4a-scrollbar",children:o.map((A,P)=>u.jsxs("div",{className:"flex items-center gap-2 rounded bg-c4a-bg-surface px-2 py-1",children:[u.jsx(Vn,{size:12,className:"shrink-0 text-c4a-text-muted"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-primary",children:A.name}),u.jsx("span",{className:"shrink-0 text-[10px] text-c4a-text-muted",children:GL(A.size)}),!g&&!r&&u.jsx("button",{type:"button",onClick:()=>j(P),className:"shrink-0 text-c4a-text-muted transition-colors hover:text-c4a-text-primary",title:i("sources.upload.remove"),children:u.jsx(Vr,{size:12})})]},`${A.name}-${P}`))})]}),D&&u.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:D}),u.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[u.jsx("button",{onClick:t,disabled:g||r,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:i("common.cancel")}),u.jsxs("button",{onClick:z,disabled:o.length===0||g||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:[(g||r)&&u.jsx(sn,{size:12,className:"animate-spin"}),i(g||r?"sources.upload.uploading":"common.confirm")]})]})]})}const KL=/^v\d+\.\d+\.\d+$/;function Bm(e){const t=/^v(\d+)\.(\d+)\.(\d+)$/.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function XL(e,t){const n=Bm(e),r=Bm(t);return!n||!r?!1:n[0]!==r[0]?n[0]>r[0]:n[1]!==r[1]?n[1]>r[1]:n[2]>r[2]}function QL(e){const t=Bm(e);return t?`v${t[0]}.${t[1]}.${t[2]+1}`:"v0.0.1"}function ZL({currentVersion:e,onConfirm:t,onCancel:n,uploading:r,serverError:i}){const{t:o}=_e(),[l,d]=_.useState(()=>QL(e)),p=_.useMemo(()=>KL.test(l)?XL(l,e)?null:o("upload.version_must_increase",{version:e}):o("upload.version_must_increase",{version:e}),[l,e,o]),f=_.useCallback(()=>{p||r||t(l)},[p,r,t,l]);return u.jsxs(br,{onClose:n,disableClose:r??!1,className:"mx-4 w-full max-w-sm rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-text-primary",children:o("upload.new_version_title")}),u.jsx("p",{className:"mt-3 text-sm text-c4a-text-secondary",children:o("upload.new_version_desc")}),u.jsxs("div",{className:"mt-4",children:[u.jsx("label",{className:"block text-xs text-c4a-text-muted uppercase",children:o("upload.version_label")}),u.jsx("input",{type:"text",value:l,onChange:m=>d(m.target.value),disabled:r,className:"mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-base px-3 py-1.5 font-mono text-sm text-c4a-text-primary focus:border-c4a-accent focus:outline-none disabled:opacity-40"}),u.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:o("upload.current_version",{version:e})}),p&&u.jsx("p",{className:"mt-1 text-xs text-c4a-error",children:p}),i&&!p&&u.jsx("p",{className:"mt-1 text-xs text-c4a-error",children:i})]}),u.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[u.jsx("button",{type:"button",onClick:n,disabled:r,className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:opacity-40",children:o("common.cancel")}),u.jsxs("button",{type:"button",onClick:f,disabled:!!p||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&&u.jsx(sn,{size:12,className:"animate-spin"}),o("upload.confirm")]})]})]})}function WL({pathLabel:e,loading:t,badge:n,onNavigateUp:r,children:i}){return u.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2.5",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[u.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:e}),n]}),u.jsx("hr",{className:"my-2 border-c4a-border-subtle"}),u.jsx("div",{className:"c4a-scrollbar flex min-h-0 flex-1 flex-col overflow-y-auto",children:t?u.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:u.jsx(sn,{size:14,className:"animate-spin text-c4a-text-muted"})}):u.jsxs(u.Fragment,{children:[r&&u.jsxs("button",{onClick:r,className:"flex w-full cursor-pointer items-center gap-3 rounded pl-3 pr-5 py-2 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx(Og,{size:14,className:"shrink-0 text-c4a-text-muted"}),u.jsx("span",{className:"leading-none pb-1",children:".."})]}),i]})})]})}function JL(e){const t=e.match(/^[\w.-]+@([\w.-]+):([\w./-]+?)(?:\.git)?$/);if(t){const n=t[1],r=t[2];return{slug:r,repoUrl:`https://${n}/${r}`,host:n}}try{const n=new URL(e),r=n.hostname,i=n.pathname.replace(/^\//,"").replace(/\.git$/,"");return i?{slug:i,repoUrl:`https://${r}/${i}`,host:r}:null}catch{return null}}function e5(e,t){return`${e}/tree/${encodeURIComponent(t)}`}function t5(e,t){return`${e}/commit/${t}`}function qk({remoteUrl:e,fallbackName:t,branch:n,commit:r}){const i=e?JL(e):null,o=r.slice(0,7);return u.jsxs("div",{className:"flex min-w-0 shrink flex-wrap items-center gap-1.5 font-mono text-xs leading-none text-c4a-accent",children:[i?u.jsxs("a",{href:i.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 truncate hover:underline",title:i.repoUrl,children:[u.jsx(h1,{size:12,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:i.slug})]}):u.jsxs("span",{className:"flex items-center gap-1 truncate",children:[u.jsx(h1,{size:12,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:t||"repo"})]}),u.jsx("span",{className:"text-c4a-text-muted",children:"/"}),i?u.jsxs("a",{href:e5(i.repoUrl,n),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:underline",children:[u.jsx(vd,{size:10,className:"shrink-0"}),u.jsx("span",{children:n})]}):u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(vd,{size:10,className:"shrink-0"}),u.jsx("span",{children:n})]}),u.jsx("span",{className:"text-c4a-text-muted",children:"/"}),i?u.jsx("a",{href:t5(i.repoUrl,r),target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:o}):u.jsx("span",{children:o})]})}function Vk({currentName:e,onConfirm:t,onCancel:n,error:r}){const[i,o]=_.useState(e),l=_.useRef(null);_.useEffect(()=>{l.current?.select()},[]);const d=_.useCallback(()=>{const f=i.trim();f&&f!==e?t(f):n()},[i,e,t,n]),p=_.useCallback(f=>{f.key==="Enter"?(f.preventDefault(),d()):f.key==="Escape"&&n()},[d,n]);return u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("input",{ref:l,value:i,onChange:f=>o(f.target.value),onKeyDown:p,onBlur:d,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}),u.jsx("button",{onClick:f=>{f.stopPropagation(),d()},className:"rounded p-0.5 text-c4a-success hover:bg-c4a-bg-hover",children:u.jsx(ua,{size:14})}),u.jsx("button",{onClick:f=>{f.stopPropagation(),n()},className:"rounded p-0.5 text-c4a-error hover:bg-c4a-bg-hover",children:u.jsx(Vr,{size:14})}),r&&u.jsx("span",{className:"ml-1 text-xs text-c4a-error",children:r})]})}const n5=e=>{const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=i=>String(i).padStart(2,"0"),r=`${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`;return t.getFullYear()===new Date().getFullYear()?r:`${t.getFullYear()}-${r}`},R1={none:"bg-c4a-text-muted/40",indexed:"bg-c4a-success",stale:"bg-c4a-warning"};function r5({source:e,isDaemonLibrary:t,isRepoRoot:n}){const{t:r}=_e(),i=e.kind==="source",o=i&&(e.source_type==="code"||VL(e.name)),d=o&&e.index_status!=="none"?"text-c4a-accent":"text-c4a-text-secondary",p=e.metadata?.origin==="remote";let f;if(e.kind==="folder"?f=n||p?u.jsx(oc,{size:14,className:`shrink-0 ${d}`}):t?u.jsx(kR,{size:14,className:`shrink-0 ${d}`}):u.jsx(nr,{size:14,className:`shrink-0 ${d}`}):e.source_type==="code"?f=u.jsx(Hr,{size:14,className:`shrink-0 ${d}`}):f=u.jsx(Vn,{size:14,className:`shrink-0 ${d}`}),!i||!o)return u.jsx(u.Fragment,{children:f});const m=R1[e.index_status]??R1.none,g=r(`sources.status.${e.index_status}`);return u.jsxs("span",{className:"group/dot relative shrink-0",children:[f,u.jsx("span",{className:`absolute -right-[2px] -top-[2px] block h-[5px] w-[5px] rounded-full ${m}`}),u.jsx("span",{className:"pointer-events-none absolute bottom-full left-1/2 z-50 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded bg-c4a-bg-elevated px-2 py-1 font-mono text-[10px] text-c4a-text-secondary opacity-0 shadow-lg transition-opacity group-hover/dot:opacity-100",children:g})]})}function L1({source:e,displayName:t,childCount:n,isDaemonLibrary:r,isRepoRoot:i,onClick:o,onRename:l,onDelete:d}){const{t:p}=_e(),[f,m]=_.useState(!1),[g,y]=_.useState(null),b=_.useCallback(async E=>{if(!l)return;const C=await l(E);C?y(C):(m(!1),y(null))},[l]),w=_.useCallback(()=>{m(!1),y(null)},[]),k=!i&&l,j=d,S=e.updated_at||e.created_at;return u.jsxs("div",{className:"group flex cursor-pointer items-center gap-3 rounded py-2 pl-3 pr-5 transition-colors hover:bg-c4a-bg-hover",onClick:f?void 0:o,children:[u.jsx(r5,{source:e,isDaemonLibrary:r??!1,isRepoRoot:i??!1}),f?u.jsx("div",{className:"min-w-0 flex-1",onClick:E=>E.stopPropagation(),children:u.jsx(Vk,{currentName:e.name,onConfirm:b,onCancel:w,error:g})}):u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-c4a-text-secondary",children:t??e.name}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.kind==="folder"&&n!==void 0&&u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:p("common.items",{count:n})}),S&&u.jsx("span",{className:"hidden font-mono text-[11px] text-c4a-text-muted lg:inline",children:n5(S)})]}),(k||j)&&u.jsxs("div",{className:"flex items-center gap-1 md:opacity-0 md:transition-opacity md:group-hover:opacity-100",children:[k?u.jsx("button",{title:p("sources.actions.rename"),onClick:E=>{E.stopPropagation(),m(!0)},className:"-my-0.5 rounded p-0.5 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:u.jsx(Rm,{size:14})}):j?u.jsx("span",{className:"inline-block h-[14px] w-[14px]"}):null,j&&u.jsx("button",{title:p("sources.actions.delete"),onClick:E=>{E.stopPropagation(),d()},className:"-my-0.5 rounded p-0.5 text-c4a-text-muted transition-colors hover:text-c4a-accent",children:u.jsx(Yd,{size:14})})]})]})}function a5({library:e,onNewFolder:t,onUploadDoc:n,onImportRepo:r,onImportDir:i,onUpgrade:o}){const{t:l}=_e(),d=e.type==="daemon",p="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",f=d?u.jsxs("div",{className:"flex gap-3",children:[i&&u.jsx("button",{onClick:i,disabled:!e.is_online,className:p,children:l("sources.actions.import_dir")}),r&&u.jsx("button",{onClick:r,disabled:!e.is_online,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:l("sources.actions.import_repo")})]}):u.jsxs("div",{className:"flex gap-3",children:[u.jsx("button",{onClick:t,className:p,children:l("sources.actions.new_folder")}),n&&u.jsx("button",{onClick:n,className:p,children:l("sources.actions.upload_document")}),o&&u.jsx("button",{onClick:o,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:l("sources.actions.import_repo_url")})]});return u.jsx(At,{fullPage:!0,title:l(d?"sources.empty.daemon.title":"sources.empty.cloud.title"),description:l(d?"sources.empty.daemon.description":"sources.empty.cloud.description"),action:f})}function i5(){const{t:e}=_e();return u.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6 text-center",children:[u.jsx("h4",{className:"font-mono text-sm font-bold text-c4a-text-primary",children:e("sources.empty.indexed.title")}),u.jsx("p",{className:"mt-2 text-xs text-c4a-text-secondary",children:e("sources.empty.indexed.description")})]})}const Pm=e=>{let t=0,n=0,r=0,i=0,o=0;const l=d=>{for(const p of d.children??[])p.kind==="folder"?(t++,l(p)):p.kind==="source"&&(n++,p.source_type==="code"?r++:i++,(p.index_status==="indexed"||p.index_status==="stale")&&o++)};return l(e),{folders:t,sources:n,codeSources:r,docSources:i,indexedSources:o}};function s5({items:e,isDaemon:t,isCloud:n,onItemClick:r,onRename:i,onDelete:o}){return u.jsx("div",{className:"flex flex-col gap-0.5",children:e.map(l=>{if(l.type==="root"){const m=l.root,g=t,y=g?m.metadata?.local_path:void 0,b=m.tree.length>0?Pm({children:m.tree}):void 0,w=b?b.folders+b.sources:0,k=m.metadata,j=k?.origin==="remote",S=k?.import_type==="directory",E=j||g&&!S;return u.jsx(L1,{source:{id:m.id,library_id:m.library_id,owner_id:m.owner_id,path:"",kind:m.kind,source_type:m.source_type,name:m.name,content_hash:m.content_hash,metadata:m.metadata,index_status:m.index_status,created_at:m.created_at,updated_at:m.updated_at},...typeof y=="string"?{displayName:y}:{},...m.kind==="folder"?{childCount:w}:{},isDaemonLibrary:t??!1,isRepoRoot:E,onClick:()=>r(l),...j?{}:{onRename:C=>i(m.id,C)},onDelete:()=>o(l)},m.id)}const d=l.node,p=`${l.root.id}:${d.path}`,f=d.kind==="folder"?d.children?.length??0:void 0;return u.jsx(L1,{source:{id:l.root.id,library_id:l.root.library_id,owner_id:l.root.owner_id,path:d.path,kind:d.kind,source_type:d.source_type??null,name:d.name,content_hash:null,metadata:d.metadata??null,index_status:d.index_status??"none",created_at:l.root.created_at,updated_at:l.root.updated_at},...f!==void 0?{childCount:f}:{},isDaemonLibrary:t??!1,onClick:()=>r(l),...n&&l.root.metadata?.origin!=="remote"?{onDelete:()=>o(l)}:{}},p)})})}function o5({libId:e,isBrowsingTree:t,rootSourceId:n,treePath:r}){const{t:i}=_e(),{uploadDoc:o,fetchRootSources:l,fetchRootSource:d}=Ot(),[p,f]=_.useState(!1),[m,g]=_.useState(null),[y,b]=_.useState(!1),[w,k]=_.useState(null),j=_.useCallback(async(E,C)=>{if(e){b(!0),g(null);try{const z={library_id:e,files:E.map(M=>{const G={file_name:M.name,content:M.content};return M.encoding&&(G.encoding=M.encoding),C&&(G.version_label=C),G})};t&&n&&(z.root_source_id=n,z.parent_path=r);const D=await o(z),A=D.results??[],P=A.some(M=>M.status==="created")||(D.created?.length??0)>0,T=A.some(M=>M.status==="hash_changed"),F=A.filter(M=>M.status==="no_change").length;if(T&&!C){const M=A.find(G=>G.status==="hash_changed");k({files:E,currentVersion:M?.current_version_label??"v0.0.0"}),f(!1)}else if(P&&(t&&n?d(n):l({library_id:e})),f(!1),k(null),F>0){const M=F===A.length?i("upload.no_change"):i("upload.partial_no_change",{count:F});oa(M,4e3)}}catch(z){z instanceof kn&&z.status===409?g(i("sources.error.name_conflict",{name:E[0]?.name??""})):z instanceof kn&&g(z.message)}finally{b(!1)}}},[e,t,n,r,o,l,d,i]),S=_.useCallback(async E=>{w&&await j(w.files,E)},[w,j]);return{showUploadDoc:p,setShowUploadDoc:f,uploadError:m,setUploadError:g,uploading:y,versionDialogData:w,setVersionDialogData:k,handleUploadDoc:j,handleVersionConfirm:S}}function l5(e){const t=Pt(),n=an(w=>w.updateLibraryName),r=an(w=>w.deleteLibrary),[i,o]=_.useState(!1),[l,d]=_.useState(null),[p,f]=_.useState(!1),m=_.useCallback(async w=>{if(e)try{await n(e,w),o(!1),d(null)}catch(k){const j=k instanceof Error?k.message:String(k);d(j)}},[e,n]),g=_.useCallback(()=>{o(!1),d(null)},[]),y=_.useCallback(async()=>{if(e){try{await r(e),t("/studio/sources/add-client")}catch{}f(!1)}},[e,r,t]),b=_.useCallback(()=>{f(!1)},[]);return{renamingLib:i,setRenamingLib:o,renameLibError:l,deletingLib:p,setDeletingLib:f,handleLibRenameConfirm:m,handleLibRenameCancel:g,handleLibDeleteConfirm:y,handleLibDeleteCancel:b}}function c5(){const{t:e}=_e(),t=Pt(),{libId:n}=fo(),[r,i]=sc(),o=r.get("rootId")||null,l=r.get("path")||"",p=an(ji(ss)).find(ye=>ye.id===n),{rootSources:f,currentRoot:m,loading:g,filter:y,fetchRootSources:b,fetchRootSource:w,createSource:k,addTreeNode:j,updateSource:S,deleteSource:E,deleteTreeNode:C,setFilter:z}=Ot(),D=o!==null,{showUploadDoc:A,setShowUploadDoc:P,uploadError:T,setUploadError:F,uploading:M,versionDialogData:G,setVersionDialogData:Q,handleUploadDoc:re,handleVersionConfirm:$}=o5({libId:n,isBrowsingTree:D,rootSourceId:o,treePath:l}),[U,I]=_.useState(!1),[V,te]=_.useState(null),[oe,R]=_.useState(null),[B,K]=_.useState(null),[O,se]=_.useState(null),[ie,pe]=_.useState(!1),{renamingLib:Ee,setRenamingLib:Ie,renameLibError:Ue,deletingLib:be,setDeletingLib:de,handleLibRenameConfirm:ke,handleLibRenameCancel:ge,handleLibDeleteConfirm:we,handleLibDeleteCancel:Xe}=l5(n);_.useEffect(()=>{n&&b({library_id:n})},[n,b]),_.useEffect(()=>{o&&w(o)},[o,w]),_.useEffect(()=>{const ye=sessionStorage.getItem("c4a_batch_toast");ye&&(sessionStorage.removeItem("c4a_batch_toast"),oa(ye,4e3))},[r]);const Me=_.useMemo(()=>D?m?[...OL(m.tree,l)].sort((Lt,it)=>Lt.kind!==it.kind?Lt.kind==="folder"?-1:1:Lt.name.localeCompare(it.name)).map(Lt=>({type:"node",root:m,node:Lt})):[]:[...f].sort((it,It)=>it.kind!==It.kind?it.kind==="folder"?-1:1:new Date(It.created_at).getTime()-new Date(it.created_at).getTime()).map(it=>({type:"root",root:it,node:null})),[D,f,m,l]),Je=_.useMemo(()=>y==="all"?Me:Me.filter(ye=>ye.type==="root"||!ye.node||ye.node.kind==="folder"?!0:y==="indexed"?ye.node.index_status==="indexed":ye.node.index_status==="none"||!ye.node.index_status),[Me,y]),zt=p?.type==="daemon",en=p?.type==="cloud",Kt=zt&&!D,An=p?.type==="cloud"?!0:p?.is_online??!1,Kn=Ot(ye=>ye.indexingTasks),Pn=_.useMemo(()=>{if(D&&o){const ye=Kn.get(o);return!!ye&&!ye.terminalState}return f.some(ye=>{const Ge=Kn.get(ye.id);return!!Ge&&!Ge.terminalState})},[D,o,Kn,f]),Xt=_.useMemo(()=>{if(!p)return[];const ye=[{label:p.is_default?e("sources.library.default_cloud_name"):p.name,to:`/studio/sources/${p.id}`}];return D&&m&&(ye.push({label:m.name,to:`/studio/sources/${p.id}?rootId=${m.id}`}),l&&Nl(m.tree,l).forEach(Lt=>{ye.push({label:Lt.name,to:`/studio/sources/${p.id}?rootId=${m.id}&path=${encodeURIComponent(Lt.path)}`})})),ye},[p,D,m,l,e]),Sn=_.useCallback(async ye=>{if(n)try{D&&o?await j(o,{parent_path:l,kind:"folder",name:ye}):(await k({library_id:n,kind:"folder",name:ye}),b({library_id:n})),I(!1),te(null)}catch(Ge){Ge instanceof kn&&Ge.status===409&&te(e("sources.error.name_conflict",{name:ye}))}},[n,D,o,l,k,j,b,e]),Z=_.useCallback(ye=>{n&&(ye.type==="root"?ye.root.kind==="source"?t(`/studio/source/${ye.root.id}`):i({rootId:ye.root.id}):ye.node&&(ye.node.kind==="folder"?i({rootId:ye.root.id,path:ye.node.path}):t(`/studio/source/${ye.root.id}?path=${encodeURIComponent(ye.node.path)}`)))},[n,t,i]),fe=_.useCallback(()=>{if(!(!o||!n))if(l){const ye=l.split("/");ye.pop();const Ge=ye.join("/");i(Ge?{rootId:o,path:Ge}:{rootId:o})}else i({})},[o,n,l,i]),Ne=_.useCallback(async(ye,Ge)=>{try{return await S(ye,{name:Ge}),b({library_id:n}),null}catch(Lt){return Lt instanceof kn&&Lt.status===409?e("sources.error.name_conflict",{name:Ge}):null}},[n,S,b,e]),ze=_.useCallback(ye=>{if(ye.type==="root"){K(ye.root.id),se(null);const Ge=ye.root.tree.length>0?Pm({children:ye.root.tree}):void 0;R(zt?{type:"repo",name:ye.root.name,libraryName:p.name,...Ge?{packageCount:Ge.codeSources,docCount:Ge.docSources,indexedCount:Ge.indexedSources}:{}}:{type:ye.root.kind==="folder"?"folder":"resource",name:ye.root.name,...ye.root.kind==="folder"&&Ge?{folderCount:Ge.folders,sourceCount:Ge.sources,indexedCount:Ge.indexedSources}:{}})}else if(ye.node)if(K(ye.root.id),se(ye.node.path),ye.node.kind==="folder"){const Ge=Pm(ye.node);R({type:"folder",name:ye.node.name,folderCount:Ge.folders,sourceCount:Ge.sources,indexedCount:Ge.indexedSources})}else R({type:"resource",name:ye.node.name})},[zt,p]),He=_.useCallback(async()=>{if(!(!B||!n)){try{O?await C(B,O):(await E(B),b({library_id:n}))}catch{}R(null),K(null),se(null)}},[B,O,n,E,C,b]),Tt=_.useCallback(()=>{if(!n)return;const ye=new URLSearchParams;o&&(ye.set("parentId",o),m&&ye.set("parentName",m.name)),l&&ye.set("parentPath",l);const Ge=ye.toString();t(`/studio/sources/import/${n}${Ge?`?${Ge}`:""}`)},[n,t,o,l,m]),Ft=_.useCallback(()=>{n&&t(`/studio/sources/import-dir/${n}`)},[n,t]),Rt=p?.is_default===!0;if(!p)return u.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const _t=f.length===0&&y==="all"&&!g&&!D,yt=Je.filter(ye=>ye.type==="node"&&ye.node?.kind==="source").length===0&&y==="indexed"&&!g,lt=!D||!m?!1:m.metadata?.origin==="remote"?!0:l?Nl(m.tree,l).some(Ge=>Ge.metadata?.origin==="remote"):!1,bn=!Kt,on=en&&!lt,xa=Kt;return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("div",{className:"min-w-0 flex-1",children:Ee?u.jsx(Vk,{currentName:p.name,onConfirm:ke,onCancel:ge,error:Ue}):u.jsx(Ha,{segments:Xt})}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[on&&u.jsxs(u.Fragment,{children:[u.jsx($h,{label:e("sources.actions.upload"),icon:u.jsx(Lm,{size:14}),items:[{label:e("sources.actions.upload_doc"),icon:u.jsx(Vn,{size:14}),onClick:()=>P(!0)}]}),u.jsx($h,{label:e("sources.actions.add"),icon:u.jsx(Ig,{size:14}),items:[{label:e("sources.actions.add_folder"),icon:u.jsx(Ik,{size:14}),onClick:()=>I(!0)},{label:e("sources.actions.add_web"),icon:u.jsx(DR,{size:14}),onClick:()=>pe(!0)},{label:e("sources.actions.add_feishu"),icon:u.jsx(hR,{size:14}),onClick:()=>pe(!0)}]}),u.jsxs("button",{onClick:()=>{const ye=new URLSearchParams;o&&(ye.set("parentId",o),m&&ye.set("parentName",m.name)),l&&ye.set("parentPath",l);const Ge=ye.toString();t(`/studio/sources/import-remote/${n}${Ge?`?${Ge}`:""}`)},className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary sm:px-2 sm:py-1",children:[u.jsx(p1,{size:14}),u.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_repo_url")})]})]}),xa&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{onClick:Ft,disabled:!p.is_online,title:p.is_online?void 0:e("sources.import.daemon_offline",{name:p.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[u.jsx(_R,{size:14}),u.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_dir")})]}),u.jsxs("button",{onClick:Tt,disabled:!p.is_online,title:p.is_online?void 0:e("sources.import.daemon_offline",{name:p.name}),className:"flex items-center gap-1.5 rounded border border-c4a-border-default bg-c4a-bg-surface p-1 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary disabled:cursor-not-allowed disabled:opacity-40 sm:px-2 sm:py-1",children:[u.jsx(p1,{size:14}),u.jsx("span",{className:"hidden sm:inline",children:e("sources.actions.import_repo")})]}),u.jsx($h,{label:"",icon:u.jsx(Rm,{size:14}),alignRight:!0,items:[{label:e("sources.library.rename"),icon:u.jsx(Rm,{size:14}),onClick:()=>Ie(!0)},...Rt?[]:[{label:e("sources.actions.delete"),icon:u.jsx(Yd,{size:14}),onClick:()=>de(!0)}]]})]}),(D||en)&&u.jsxs("button",{onClick:()=>{const ye=new URLSearchParams;o&&ye.set("rootId",o),l&&ye.set("path",l),t(`/studio/sources/${n}/batch-index?${ye.toString()}`)},disabled:!An||Pn,title:e(An?Pn?"index.batch.tooltip_indexing":"index.batch.tooltip":"daemon.offline_tooltip"),className:`flex items-center gap-1.5 rounded border p-1 font-mono text-xs uppercase transition-colors sm:px-2 sm:py-1 ${Pn?"border-c4a-accent/30 bg-c4a-bg-surface text-c4a-accent":An?"border-c4a-border-default bg-c4a-bg-surface text-c4a-text-secondary hover:bg-c4a-bg-hover hover:text-c4a-text-primary":"border-c4a-border-default bg-c4a-bg-surface text-c4a-text-secondary opacity-40"}`,children:[Pn?u.jsx(sn,{size:14,className:"animate-spin"}):u.jsx(uR,{size:14}),u.jsx("span",{className:"hidden sm:inline",children:e("index.batch.tooltip")})]}),bn&&u.jsx(zL,{value:y,onChange:z})]})]}),_t?u.jsx(a5,{library:p,onNewFolder:()=>I(!0),...zt?{onImportRepo:Tt,onImportDir:Ft}:{},...en?{onUploadDoc:()=>P(!0),onUpgrade:()=>{const ye=new URLSearchParams;o&&(ye.set("parentId",o),m&&ye.set("parentName",m.name)),l&&ye.set("parentPath",l);const Ge=ye.toString();t(`/studio/sources/import-remote/${n}${Ge?`?${Ge}`:""}`)}}:{}}):u.jsx(WL,{pathLabel:(()=>{if(!D||!m)return"/";const ye=m.metadata,Ge=zt?typeof ye?.local_path=="string"?ye.local_path:m.name:"/"+m.name;if(!l)return Ge;const Lt=Nl(m.tree,l);return Ge+"/"+Lt.map(it=>it.name).join("/")})(),loading:g,badge:(()=>{if(!D||!m)return;let ye=m.metadata,Ge=m.name;if(!ye?.origin&&l){const It=Nl(m.tree,l);for(const Ut of It){const Ya=Ut.metadata;if(Ya?.origin==="remote"){ye=Ya,Ge=Ut.name;break}}}const Lt=ye?.pinned_branch??ye?.remote_ref,it=ye?.pinned_hash??ye?.remote_commit;if(!(!Lt||!it))return u.jsx(qk,{remoteUrl:ye?.remote_url,fallbackName:Ge,branch:Lt,commit:it})})(),onNavigateUp:D?fe:void 0,children:Je.length===0?yt?u.jsx(i5,{}):D?null:u.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:e("common.items",{count:0})}):u.jsx(s5,{items:Je,isDaemon:zt??!1,isCloud:en??!1,onItemClick:Z,onRename:Ne,onDelete:ze})}),U&&u.jsx(IL,{onConfirm:Sn,onCancel:()=>{I(!1),te(null)},error:V}),A&&u.jsx(YL,{onConfirm:re,onCancel:()=>{P(!1),F(null)},error:T,uploading:M}),G&&u.jsx(ZL,{currentVersion:G.currentVersion,onConfirm:$,onCancel:()=>{Q(null),F(null)},uploading:M,serverError:T}),ie&&u.jsx($L,{onClose:()=>pe(!1)}),oe&&u.jsx(T1,{target:oe,onConfirm:He,onCancel:()=>{R(null),K(null),se(null)}}),be&&p&&u.jsx(T1,{target:{type:"client",name:p.name},onConfirm:we,onCancel:Xe})]})}function u5(){const{t:e}=_e(),t=Pt(),n=an(l=>l.libraries),r=an(l=>l.loading),[i,o]=_.useState(!1);return _.useEffect(()=>{if(r)return;if(n.length===0&&!i){o(!0),an.getState().fetchLibraries();return}const l=n.find(d=>d.is_default);l?t(`/studio/sources/${l.id}`,{replace:!0}):n.length>0&&t(`/studio/sources/${n[0].id}`,{replace:!0})},[n,r,t,i]),i&&!r&&n.length===0?u.jsx(At,{fullPage:!0,icon:u.jsx(zk,{size:32}),title:e("sources.empty.cloud.title"),description:e("sources.empty.cloud.description")}):u.jsx("div",{className:"flex flex-1 items-center justify-center p-8 pb-24",children:u.jsx(fa,{})})}function sa({active:e,current:t}){return u.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full border-2 ${t?"border-c4a-accent bg-c4a-accent":e?"border-c4a-accent bg-transparent":"border-c4a-border-default bg-transparent"}`})}function Ji(){return u.jsx("span",{className:"h-px flex-1 bg-c4a-border-default"})}function Gk({libraryName:e}){const{t}=_e();return u.jsxs("div",{className:"rounded border border-c4a-warning/30 bg-c4a-bg-surface p-6 text-center",children:[u.jsx("p",{className:"text-sm text-c4a-warning",children:t("sources.import.daemon_offline",{name:e})}),u.jsx(Mr,{to:"/studio/sources/add-client",className:"mt-4 inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:t("sources.import.view_guide")})]})}function $g({step:e,totalSteps:t,importing:n,stepBusy:r,canProceed:i,safetyNoticeKey:o,confirmLabelKey:l,onPrev:d,onNext:p,onImport:f}){const{t:m}=_e();return u.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-4 sm:mt-6",children:[u.jsx("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-c4a-text-muted line-clamp-1 sm:line-clamp-none",title:m(o),onClick:g=>g.currentTarget.classList.toggle("line-clamp-1"),children:m(o)}),u.jsxs("div",{className:"flex shrink-0 gap-2",children:[e>1&&u.jsx("button",{onClick:d,disabled:n||r,className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover disabled:opacity-40",children:m("common.previous")}),e<t?u.jsx("button",{onClick:p,disabled:!i||r,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:m("common.next")}):u.jsxs("button",{onClick:f,disabled:n||r||!i,className:"flex items-center gap-1.5 rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[n&&u.jsx(sn,{size:12,className:"animate-spin"}),m(n?"sources.import.importing":l)]})]})]})}function Yk(e,t){const n=_.useCallback(async(l,d)=>{if(!e)throw new Error("No library");const p=await Pe.post(`/libraries/${e}/rpc`,{method:l,params:d});if(p.error){const f=p.error;throw new Error(f.message??JSON.stringify(p.error))}return p.result??p},[e]),[r,i]=_.useState([]);_.useEffect(()=>{if(!e)return;let l=!1;return(async()=>{try{const d=await Pe.get("/sources",{library_id:e,limit:"500"});if(l)return;const p=d.items.map(f=>{const m=f.metadata;return typeof m?.local_path=="string"?m.local_path:null}).filter(f=>f!==null);i(p)}catch{}})(),()=>{l=!0}},[e]);const o=_.useMemo(()=>{const l=t?.config;return!l||!Array.isArray(l.allowed_paths)?[]:l.allowed_paths},[t]);return{rpc:n,importedPaths:r,allowedPaths:o}}function d5(e,t){const n=e.toLowerCase();try{if(n.endsWith("package.json")){const r=JSON.parse(t);if(typeof r.name=="string"&&r.name.trim())return r.name.trim()}if(n.endsWith("pyproject.toml"))return t.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(n.endsWith("go.mod"))return t.match(/^\s*module\s+([^\s]+)\s*$/m)?.[1]??null;if(n.endsWith("cargo.toml"))return t.match(/^\s*name\s*=\s*["']([^"']+)["']/m)?.[1]??null;if(n.endsWith("pom.xml"))return t.match(/<artifactId>([^<]+)<\/artifactId>/)?.[1]?.trim()??null;if(n.endsWith("build.gradle"))return t.match(/rootProject\.name\s*=\s*["']([^"']+)["']/)?.[1]??null}catch{return null}return null}function Fm(e,t,n="repo"){const r=[];for(const o of e){const l=o.path.split("/"),d=l.slice(0,-1).join("/")||".",p=l.length===1||o.path==="package.json",f=d==="."?n:l[l.length-2]||d,m=d5(o.path,o.content);r.push({name:m||f,path:d,isRoot:p})}const i=t.filter(o=>/\.md$/i.test(o.path)).map(o=>o.path);return{packages:r,mdFiles:i}}const D1=new Set(["tree","blob","commit","commits","raw","src"]),f5=new Set(["commit","commits"]);function p5(e){let t;try{t=new URL(e.trim())}catch{return{repoUrl:e.trim()}}const n=t.pathname.split("/").filter(Boolean);let r=-1;for(let f=2;f<n.length;f++){const m=n[f];if(m==="-"&&f+1<n.length&&D1.has(n[f+1])){r=f;break}if(D1.has(m)){r=f;break}}if(r===-1)return{repoUrl:`${t.protocol}//${t.host}${t.pathname}`.replace(/\/+$/,"")};const i=n.slice(0,r).join("/"),o=`${t.protocol}//${t.host}/${i}`;let l,d;if(n[r]==="-"?(l=n[r+1],d=r+2):(l=n[r],d=r+1),d>=n.length)return{repoUrl:o};const p=n[d];return f5.has(l)?{repoUrl:o,commit:p}:{repoUrl:o,ref:p}}function Qi(e){try{return(new URL(e).pathname.split("/").pop()??"repo").replace(/\.git$/i,"")||"repo"}catch{return e.split("/").pop()||e}}function Um(){const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`}const h5=1500;async function Kk(e){const t=h5-(Date.now()-e);t>0&&await new Promise(n=>setTimeout(n,t))}function Xk(){const{t:e}=_e(),[t,n]=_.useState(!1),[r,i]=_.useState(null),o=_.useRef(),l=_.useRef(),d=window.location.host,p=`c4a-daemon --server ${d} --allow <dir1> <dir2>`,f=`c4a-daemon --server ${d}`,m=_.useCallback((b,w)=>{navigator.clipboard.writeText(b),i(w),clearTimeout(o.current),o.current=setTimeout(()=>i(null),1500)},[]),g=_.useCallback(()=>{clearTimeout(l.current),n(!0)},[]),y=_.useCallback(()=>{l.current=setTimeout(()=>n(!1),150)},[]);return u.jsxs("span",{className:"relative",onMouseEnter:g,onMouseLeave:y,children:[u.jsx(Mk,{size:12,className:"text-c4a-warning"}),t&&u.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:g,onMouseLeave:y,children:[u.jsx("span",{className:"block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:e("sources.import.allowed_dirs_tooltip_restrict")}),u.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[u.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:p}),u.jsx("button",{onClick:()=>m(p,0),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:r===0?u.jsx(ua,{size:10}):u.jsx(bd,{size:10})})]}),u.jsx("span",{className:"mt-2 block whitespace-nowrap font-mono text-xs text-c4a-text-secondary",children:e("sources.import.allowed_dirs_tooltip_all")}),u.jsxs("span",{className:"mt-1 flex items-center gap-1.5 whitespace-nowrap",children:[u.jsx("span",{className:"font-mono text-xs text-c4a-accent",children:f}),u.jsx("button",{onClick:()=>m(f,1),className:"shrink-0 rounded p-0.5 text-c4a-accent transition-colors hover:bg-c4a-bg-hover",title:"Copy",children:r===1?u.jsx(ua,{size:10}):u.jsx(bd,{size:10})})]})]})]})}function Qk({open:e,onClose:t,rpc:n,onNavigate:r,defaultPath:i}){const{t:o}=_e(),[l,d]=_.useState(i??""),[p,f]=_.useState(null),[m,g]=_.useState(!1),y=_.useRef(null);_.useEffect(()=>{i&&!l&&d(i)},[i]);const b=_.useCallback(async()=>{const k=l.trim();if(k){g(!0),f(null);try{(await n("fs/exists",{path:k})).exists?(r(k),d(i??""),f(null),t()):f(o("sources.import.wildcard_path_not_found"))}catch(j){f(j instanceof Error?j.message:String(j))}finally{g(!1)}}},[l,n,o,r,t]),w=_.useCallback(()=>{d(i??""),f(null),t()},[t,i]);return e?u.jsxs(br,{onClose:w,closeOnOverlay:!1,closeOnEsc:!1,overlayClass:"bg-black/40",className:"w-full max-w-md rounded-lg border border-c4a-border-default bg-c4a-bg-surface p-5 shadow-xl",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h3",{className:"font-mono text-sm font-medium text-c4a-text-primary",children:o("sources.import.wildcard_go_title")}),u.jsx("button",{onClick:w,className:"rounded p-1 text-c4a-text-muted transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-secondary",children:u.jsx(Vr,{size:14})})]}),u.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[u.jsx("input",{ref:y,type:"text",value:l,onChange:k=>{d(k.target.value),f(null)},onKeyDown:k=>{k.key==="Enter"&&b()},placeholder:o("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"}),u.jsxs("button",{onClick:b,disabled:m||!l.trim(),className:"flex shrink-0 items-center gap-1.5 rounded bg-c4a-accent px-3 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40",children:[m?u.jsx(sn,{size:12,className:"animate-spin"}):u.jsx(Dk,{size:12}),o("sources.import.wildcard_go")]})]}),p&&u.jsx("p",{className:"mt-2 text-xs text-c4a-error",children:p})]}):null}function Zk({rpc:e,allowedPaths:t,importedPaths:n,onNavigateUpExtra:r}){const i=!!t&&t.length>0,o=i&&t.length===1&&t[0]==="*",[l,d]=_.useState(i),[p,f]=_.useState(i&&!o?"":"/"),[m,g]=_.useState([]),[y,b]=_.useState(!1),[w,k]=_.useState(null),[j,S]=_.useState(null);_.useEffect(()=>{if(i&&!o)return;let F=!1;return(async()=>{try{const M=await e("fs/homeDir",{});F||S(M.home_dir)}catch{F||S("/")}})(),()=>{F=!0}},[i,o,e]);const[E,C]=_.useState(!1),z=_.useCallback(async F=>{b(!0),k(null);try{const M=await e("fs/listTree",{path:F,depth:1});g(M.entries||[]),f(F),d(!1)}catch(M){const G=M instanceof Error?M.message:String(M);k(G)}finally{b(!1)}},[e]);_.useEffect(()=>{i&&!o||j!==null&&z(j)},[j,i,o,z]);const D=_.useMemo(()=>new Set(n??[]),[n]),A=_.useCallback(()=>{if(i&&!o&&t.some(G=>G===p)){d(!0),f(""),g([]),k(null),r?.();return}const F=p.split("/").slice(0,-1).join("/")||"/";r?.(),z(F)},[i,o,t,p,z,r]),P=_.useMemo(()=>m.filter(F=>F.type==="directory"),[m]),T=_.useMemo(()=>m.filter(F=>F.type==="file"),[m]);return{atRoot:l,currentPath:p,entries:m,loading:y,error:w,homeDir:j,goToOpen:E,hasAllowedPaths:i,isWildcard:o,importedSet:D,dirs:P,files:T,loadTree:z,handleNavigateUp:A,setGoToOpen:C}}function m5({rpc:e,selectedPath:t,onSelect:n,allowedPaths:r,importedPaths:i}){const{t:o}=_e(),[l,d]=_.useState(null),{atRoot:p,currentPath:f,entries:m,loading:g,error:y,homeDir:b,goToOpen:w,isWildcard:k,importedSet:j,dirs:S,files:E,loadTree:C,handleNavigateUp:z,setGoToOpen:D}=Zk({rpc:e,allowedPaths:r??[],importedPaths:i??[],onNavigateUpExtra:()=>d(null)}),[A,P]=_.useState(null),[T,F]=_.useState(!1);_.useEffect(()=>{if(!t){P(null),F(!1);return}P(null),F(!0);let re=!1;return(async()=>{try{const $=await e("fs/repoStatus",{path:t});re||(P({branch:$.branch,hash:$.head_hash,remoteUrl:$.remote_url}),F(!1))}catch{re||(P(null),F(!1))}})(),()=>{re=!0}},[t,e]);const M=_.useCallback(re=>{if(re.type==="directory")if(re.is_git_repo){if(j.has(re.path))return;d(null),n(re.path,re.name)}else d(re.path),C(re.path)},[n,C,j]),G=_.useMemo(()=>S.sort((re,$)=>re.is_git_repo&&!$.is_git_repo?-1:!re.is_git_repo&&$.is_git_repo?1:re.name.localeCompare($.name)),[S]),Q=_.useMemo(()=>E.sort((re,$)=>re.name.localeCompare($.name)),[E]);return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2.5",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[p?u.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[u.jsx("span",{children:o("sources.import.allowed_dirs")}),u.jsx(Xk,{})]}):u.jsx("p",{className:"min-w-0 shrink truncate font-mono text-xs text-c4a-text-muted",children:f}),t&&T?u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-xs text-c4a-accent",children:[u.jsx(sn,{size:12,className:"animate-spin"}),u.jsx("span",{children:o("common.loading")})]}):t&&A?u.jsx(qk,{remoteUrl:A.remoteUrl,fallbackName:t.split("/").pop()||t,branch:A.branch,commit:A.hash}):!t&&k&&p?u.jsx("button",{onClick:()=>D(!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:o("sources.import.wildcard_goto")}):null]}),u.jsx("hr",{className:"my-2 border-c4a-border-subtle"}),p?k?u.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:b&&u.jsxs("button",{onClick:()=>C(b),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx(nr,{size:14,className:"shrink-0"}),u.jsxs("span",{className:"truncate",children:[b,u.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",o("sources.import.wildcard_home"),")"]})]}),u.jsx(Gt,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):u.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:r.map(re=>u.jsxs("button",{onClick:()=>C(re),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx(nr,{size:14,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:re}),u.jsx(Gt,{size:12,className:"shrink-0 text-c4a-text-muted"})]},re))}):y&&!g?u.jsx("p",{className:"py-4 text-xs text-c4a-error",children:y}):u.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[g&&u.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:u.jsx(sn,{size:14,className:"animate-spin text-c4a-text-muted"})}),f!=="/"&&u.jsxs("button",{onClick:z,disabled:g,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[u.jsx(Og,{size:14,className:"text-c4a-text-muted"}),u.jsx("span",{className:"leading-none pb-1",children:".."})]}),G.map(re=>{const $=re.is_git_repo&&j.has(re.path),U=re.is_git_repo?oc:nr;return u.jsxs("div",{className:`flex w-full items-center rounded pl-2 pr-4 text-left text-xs transition-colors ${$?"cursor-not-allowed text-c4a-accent/60":t===re.path?"bg-c4a-bg-hover":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[u.jsxs("button",{onClick:()=>M(re),disabled:$||g,className:"flex flex-1 items-center gap-2 py-1.5",children:[u.jsx(U,{size:14,className:"shrink-0"}),u.jsx("span",{className:"flex-1 truncate text-left",children:re.name}),$&&u.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:o("sources.import.already_imported")})]}),!$&&u.jsx("button",{onClick:I=>{I.stopPropagation(),C(re.path)},disabled:g,className:"shrink-0 rounded p-1 text-c4a-text-muted transition-colors hover:text-c4a-accent disabled:pointer-events-none",title:re.path,children:u.jsx(Gt,{size:12})})]},re.path)}),Q.map(re=>u.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-xs text-c4a-text-muted",children:[u.jsx(zg,{size:14,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:re.name})]},re.path)),m.length===0&&!g&&u.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:o("sources.import.no_entries")})]}),l&&!t&&u.jsx("p",{className:"mt-3 text-xs text-c4a-warning",children:o("sources.import.not_git")}),u.jsx(Qk,{open:w,onClose:()=>D(!1),rpc:e,onNavigate:C,defaultPath:b??void 0})]})}const Gs=50,Bh=["main","master"];function g5(e){const t=[],n=[];for(const r of e)Bh.includes(r.name)?t.push(r):n.push(r);return t.sort((r,i)=>Bh.indexOf(r.name)-Bh.indexOf(i.name)),[...t,...n]}function O1(e,t,n){_.useEffect(()=>{if(!n)return;const r=i=>{e.current&&!e.current.contains(i.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t,n])}function Wk({refs:e,loading:t,error:n,selectedRef:r,commit:i,onRefChange:o,onCommitChange:l,onValidChange:d,onBranchSwitch:p}){const{t:f}=_e(),[m,g]=_.useState(!1),[y,b]=_.useState(""),[w,k]=_.useState(!0),[j,S]=_.useState(!0),E=_.useRef(null),C=_.useRef(null),[z,D]=_.useState(!1),[A,P]=_.useState(""),T=_.useRef(null),F=_.useRef(null);O1(E,()=>{g(!1),b("")},m),O1(T,()=>{D(!1),P("")},z),_.useEffect(()=>{m&&setTimeout(()=>C.current?.focus(),0)},[m]),_.useEffect(()=>{z&&setTimeout(()=>F.current?.focus(),0)},[z]),_.useEffect(()=>{d(!!r)},[r,d]);const M=_.useCallback(R=>{o(R.name),l(R.commit),g(!1),b(""),p?.(R.name)},[o,l,p]),G=_.useCallback((R,B)=>{l(R),o(B),D(!1),P("")},[l,o]),Q=_.useMemo(()=>e?g5(e.branches):[],[e]),re=_.useMemo(()=>{const R=y.toLowerCase();return(R?Q.filter(K=>K.name.toLowerCase().includes(R)):Q).slice(0,Gs)},[Q,y]),$=_.useMemo(()=>{if(!e)return[];const R=y.toLowerCase();return(R?e.tags.filter(K=>K.name.toLowerCase().includes(R)):e.tags).slice(0,Gs)},[e,y]),U=_.useMemo(()=>{if(!e)return[];if(e.commits&&e.commits.length>0){const se=A.toLowerCase(),ie=e.commits.map(pe=>({hash:pe.hash,refName:r||"",label:`${pe.hash.slice(0,8)} ${pe.message?`โ€” ${pe.message.slice(0,50)}`:""}`.trim()}));return se?ie.filter(pe=>pe.hash.toLowerCase().includes(se)||pe.label.toLowerCase().includes(se)).slice(0,Gs):ie.slice(0,Gs)}const R=new Set,B=[],K=[...e.branches??[],...e.tags??[]];for(const se of K){const ie=se.commit.slice(0,8);R.has(se.commit)||(R.add(se.commit),B.push({hash:se.commit,refName:se.name,label:`${ie} (${se.name})`}))}if(!A)return B.slice(0,Gs);const O=A.toLowerCase();return B.filter(se=>se.hash.toLowerCase().includes(O)||se.label.toLowerCase().includes(O)).slice(0,Gs)},[e,A,r]),[I,V]=_.useState(!1);if(_.useEffect(()=>{if(!t){V(!1);return}const R=setTimeout(()=>V(!0),5e3);return()=>clearTimeout(R)},[t]),t)return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsx(sn,{size:20,className:"animate-spin text-c4a-accent"}),u.jsx("span",{className:"mt-2 text-sm text-c4a-accent",children:f("sources.import_remote.loading_refs")}),I&&u.jsx("span",{className:"mt-1.5 text-xs text-c4a-text-muted",children:f("sources.import_remote.loading_refs_slow")})]});if(n)return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-sm font-medium text-red-400",children:[u.jsx(Vr,{size:14,className:"shrink-0"}),f("sources.import.error_title")]}),u.jsx("p",{className:"mt-2 max-h-40 overflow-y-auto break-all font-mono text-xs leading-relaxed text-red-400/70",children:n})]});if(!e)return null;const te=e.branches.find(R=>R.name===r)?.name??e.tags.find(R=>R.name===r)?.name??r,oe=i?i.slice(0,8):"";return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col space-y-4 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:f("sources.import_remote.ref_label")}),u.jsxs("div",{ref:E,className:"relative mt-2",children:[u.jsxs("button",{onClick:()=>g(!m),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[u.jsx("span",{children:te||"โ€”"}),u.jsx(Gt,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${m?"rotate-90":""}`})]}),m&&u.jsxs("div",{className:"absolute z-20 mt-1 w-full rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[u.jsx("div",{className:"border-b border-c4a-border-default px-3 py-2.5",children:u.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-1.5",children:[u.jsx(Fl,{size:14,className:"shrink-0 text-c4a-text-muted"}),u.jsx("input",{ref:C,type:"text",value:y,onChange:R=>b(R.target.value),placeholder:f("sources.import_remote.ref_search"),className:"w-full bg-transparent font-mono text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),u.jsxs("div",{className:"flex max-h-80 flex-col md:flex-row",children:[re.length>0&&u.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto md:border-r md:border-c4a-border-default",children:[u.jsxs("button",{onClick:()=>k(!w),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[u.jsx(Gt,{size:12,className:`transition-transform duration-200 ${w?"rotate-90":""}`}),f("sources.import_remote.ref_branches")," (",e.branches.length,")"]}),w&&re.map(R=>u.jsxs("button",{onClick:()=>M(R),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${R.name===r?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[u.jsx("span",{className:"truncate",children:R.name}),R.name===r&&u.jsx("span",{children:"โœ“"})]},`b-${R.name}`))]}),$.length>0&&u.jsxs("div",{className:"c4a-scrollbar min-w-0 flex-1 overflow-y-auto border-t border-c4a-border-default md:border-t-0",children:[u.jsxs("button",{onClick:()=>S(!j),className:"flex w-full items-center gap-1.5 px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:[u.jsx(Gt,{size:12,className:`transition-transform duration-200 ${j?"rotate-90":""}`}),f("sources.import_remote.ref_tags")," (",e.tags.length,")"]}),j&&$.map(R=>u.jsxs("button",{onClick:()=>M(R),className:`flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm transition-colors hover:bg-c4a-bg-hover ${R.name===r?"font-semibold text-c4a-accent":"text-c4a-text-secondary"}`,children:[u.jsx("span",{className:"truncate",children:R.name}),R.name===r&&u.jsx("span",{children:"โœ“"})]},`t-${R.name}`))]})]}),re.length===0&&$.length===0&&u.jsx("div",{className:"px-3 py-4 text-center font-mono text-sm text-c4a-text-muted",children:"No matches"})]})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:f("sources.import_remote.commit_label")}),u.jsxs("div",{ref:T,className:"relative mt-2",children:[u.jsxs("button",{onClick:()=>D(!z),className:"flex w-full items-center justify-between rounded border border-c4a-border-default bg-c4a-bg-surface px-3 py-2 font-mono text-sm font-semibold text-c4a-accent transition-colors hover:bg-c4a-bg-hover",children:[u.jsx("span",{className:i?"":"font-normal text-c4a-text-muted",children:oe||"โ€”"}),u.jsx(Gt,{size:14,className:`text-c4a-text-muted transition-transform duration-200 ${z?"rotate-90":""}`})]}),z&&u.jsxs("div",{className:"c4a-scrollbar absolute z-20 mt-1 max-h-64 w-full overflow-y-auto rounded border border-c4a-border-default bg-c4a-bg-elevated shadow-lg",children:[u.jsx("div",{className:"sticky top-0 z-10 border-b border-c4a-border-default bg-c4a-bg-elevated px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded border border-c4a-border-default bg-c4a-bg-surface px-2 py-1",children:[u.jsx(Fl,{size:12,className:"shrink-0 text-c4a-text-muted"}),u.jsx("input",{ref:F,type:"text",value:A,onChange:R=>P(R.target.value),placeholder:f("sources.import_remote.commit_search"),className:"w-full bg-transparent font-mono text-xs text-c4a-text-primary placeholder:text-c4a-text-muted focus:outline-none"})]})}),U.map(R=>u.jsxs("button",{onClick:()=>G(R.hash,R.refName),className:"flex w-full items-center justify-between px-3 py-1.5 font-mono text-sm text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx("span",{className:"truncate",children:R.label}),R.hash===i&&u.jsx("span",{className:"text-c4a-accent",children:"โœ“"})]},R.hash)),U.length===0&&u.jsx("div",{className:"px-3 py-4 text-center font-mono text-xs text-c4a-text-muted",children:"No matches"})]})]}),u.jsxs("p",{className:"mt-3 flex items-center gap-1.5 text-xs text-c4a-text-muted",children:[u.jsx(IR,{size:12,className:"shrink-0"}),f("sources.import_remote.commit_hint")]})]})]})}const x5="_progressTrack_1cl9k_1",y5="_progressFill_1cl9k_9",b5="_progressFillComplete_1cl9k_45",v5="_progressFillFailed_1cl9k_49",Mu={progressTrack:x5,progressFill:y5,progressFillComplete:b5,progressFillFailed:v5};function _5(e){const t={},n=100/e.length;return e.forEach((r,i)=>{t[r.key]=Math.round(n*(i+1))}),t}function w5(e,t,n,r,i,o){const l=m=>m>0?t[e[m-1].key]??0:0;if(i){const m=e.findIndex(b=>b.key===i),g=l(m),y=t[i]??100;return g+o/100*(y-g)}if(!n)return r.length===e.length?100:0;const d=e.findIndex(m=>m.key===n);if(d<0)return 0;const p=l(d),f=t[n]??100;return o>=0?p+o/100*(f-p):p}function Jk({stages:e,currentStage:t,completedStages:n,failedStage:r,progress:i,breakpoints:o,headerRight:l}){const d=o??_5(e),p=i?.percent??-1,f=_.useRef(0),[m,g]=_.useState(0),y=_.useRef(null),b=w5(e,d,t,n,r,p>=0?p:-1);f.current=b,_.useEffect(()=>{b>m&&g(b)},[b]),_.useEffect(()=>{if(!t||r){y.current&&(clearInterval(y.current),y.current=null);return}const C=e.findIndex(T=>T.key===t),z=d[t]??100,D=C===e.length-1?z-1:z-2,A=500,P=.025;return y.current=setInterval(()=>{g(T=>{const F=f.current;if(T>=F&&T<D){const M=Math.max(.1,(D-T)*P);return Math.min(T+M,D)}return T})},A),()=>{y.current&&(clearInterval(y.current),y.current=null)}},[t,r,e,d]);const w=_.useRef(null);_.useEffect(()=>{if(n.length===e.length&&!r)return y.current&&(clearInterval(y.current),y.current=null),w.current=setInterval(()=>{g(C=>C>=100?(w.current&&clearInterval(w.current),w.current=null,100):Math.min(100,C+4))},32),()=>{w.current&&(clearInterval(w.current),w.current=null)}},[n.length,e.length,r]);const k=Math.min(100,Math.max(0,m)),j=!!t&&!r,S=!!r,E=n.length===e.length&&!r;return u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2 flex-wrap",children:e.map(C=>{const z=n.includes(C.key),D=r===C.key,A=t===C.key;let P="inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-mono text-[11px] uppercase tracking-tight transition-colors";return D?P+=" bg-red-500/10 text-red-400":z?P+=" bg-c4a-accent/10 text-c4a-accent":A?P+=" bg-c4a-accent/15 text-c4a-accent":P+=" bg-c4a-bg-elevated text-c4a-text-muted",u.jsxs("span",{className:P,children:[D?u.jsx(Vr,{size:10,className:"shrink-0"}):z?u.jsx(ua,{size:10,className:"shrink-0"}):A?u.jsx(sn,{size:10,className:"shrink-0 animate-spin"}):u.jsx(aR,{size:8,className:"shrink-0 opacity-40"}),C.label]},C.key)})}),l&&u.jsx("div",{className:"shrink-0",children:l})]}),u.jsx("div",{className:Mu.progressTrack,children:k>0?u.jsx("div",{className:`${Mu.progressFill} ${S?Mu.progressFillFailed:E?Mu.progressFillComplete:""}`,style:{width:`${k}%`}},"fill"):null}),u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"font-mono text-[11px] text-c4a-text-muted tabular-nums",children:E?"100%":j||S?`${Math.round(k)}%`:""}),i?.label&&j&&u.jsx("span",{className:"hidden truncate font-mono text-[11px] text-c4a-text-muted sm:block",children:i.label})]})]})}function eS({stages:e,currentStage:t,completedStages:n,failedStage:r,progress:i,breakpoints:o,failedError:l,logs:d}){const p=_.useRef(null);return _.useEffect(()=>{p.current?.scrollIntoView({behavior:"smooth"})},[d.length]),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsx(Jk,{stages:e,currentStage:t,completedStages:n,failedStage:r,progress:i,...o?{breakpoints:o}:{}}),u.jsxs("div",{className:"mt-4 min-h-0 flex-1 rounded bg-c4a-bg-base p-3 c4a-scrollbar overflow-y-auto",children:[d.map((f,m)=>u.jsx("p",{className:"font-mono text-xs text-c4a-text-muted leading-relaxed",children:f},m)),u.jsx("div",{ref:p})]}),r&&l&&u.jsx("div",{className:"mt-3 max-h-32 overflow-y-auto rounded-sm bg-red-500/5 px-4 py-3",children:u.jsx("p",{className:"break-all font-mono text-xs leading-relaxed text-red-400/80",children:l})})]})}function xn({icon:e,label:t,value:n,tooltip:r,size:i="sm"}){const o=i==="sm";return u.jsxs("div",{className:"group/stat relative rounded-lg border border-c4a-border-subtle bg-c4a-bg-base p-3",children:[u.jsxs("div",{className:"flex items-center gap-1.5 text-c4a-text-muted [&>svg]:size-4",children:[e,u.jsx("span",{className:"font-mono text-xs uppercase",children:t})]}),u.jsx("p",{className:`mt-1 font-mono font-bold text-c4a-text-secondary ${o?"text-sm truncate":"text-lg"}`,title:o?String(n):void 0,children:n}),r&&u.jsx("div",{className:"pointer-events-none absolute bottom-full left-0 z-30 mb-1.5 hidden w-max max-w-[260px] rounded border border-c4a-border-default bg-c4a-bg-elevated px-2.5 py-1.5 text-[11px] leading-relaxed text-c4a-text-secondary shadow-c4a-lg group-hover/stat:block",children:r})]})}const Ph=100;function tS({repoName:e,repoIdentifier:t,branch:n,commit:r,packages:i,mdFiles:o,importing:l,completed:d,importMethod:p}){const{t:f}=_e(),m=r?r.slice(0,7):"",[g,y]=_.useState("packages"),[b,w]=_.useState(Ph),k=_.useRef(null),j=_.useRef(null);_.useEffect(()=>{w(Ph),j.current?.scrollTo(0,0)},[g]),_.useEffect(()=>{const D=k.current;if(!D)return;const A=g==="packages"?i.length:o.length;if(b>=A)return;const P=new IntersectionObserver(T=>{T[0]?.isIntersecting&&w(F=>Math.min(F+Ph,A))},{root:j.current,threshold:.1});return P.observe(D),()=>P.disconnect()},[g,b,i.length,o.length]);const S=g==="packages"?i:o,E=S.slice(0,b),C=b<S.length,z=_.useMemo(()=>d?f("sources.import_remote.complete"):l?f("sources.import.importing"):f("sources.import.confirm_heading",{name:e}),[d,l,e,f]);return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[u.jsx("p",{className:"text-sm text-c4a-text-secondary",children:z}),u.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1",children:[u.jsx("span",{className:"font-mono text-sm font-bold text-c4a-accent",children:e}),u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:t})]}),u.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",children:[u.jsx(xn,{icon:u.jsx(vd,{size:14}),label:f("sources.import.branch"),value:n}),u.jsx(xn,{icon:u.jsx(ER,{size:14}),label:f("sources.import.commit"),value:m}),u.jsx(xn,{icon:u.jsx(Hr,{size:14}),label:f("sources.import.packages"),value:String(i.length),tooltip:f("sources.import.dir_code_packages_tip")}),u.jsx(xn,{icon:u.jsx(Vn,{size:14}),label:f("sources.import.documents"),value:String(o.length),tooltip:f("sources.import.dir_doc_files_tip")})]}),p&&u.jsxs("p",{className:"mt-3 font-mono text-xs text-c4a-text-muted",children:[f("sources.import_remote.api.method"),":"," ",u.jsx("span",{className:"text-c4a-accent",children:f(p==="api"?"sources.import_remote.api.method_api":"sources.import_remote.api.method_clone")})]}),l&&u.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[u.jsx(sn,{size:14,className:"animate-spin text-c4a-accent"}),u.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:f("sources.import.importing")})]}),(i.length>0||o.length>0)&&u.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-base",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between px-4 py-3",children:[u.jsx("p",{className:"hidden font-mono text-xs text-c4a-text-secondary sm:block",children:f("sources.import.recognized",{packages:i.length,docs:o.length})}),u.jsxs("div",{className:"flex rounded border border-c4a-border-subtle",children:[u.jsxs("button",{onClick:()=>y("packages"),className:`flex items-center gap-1 px-2.5 py-1 text-xs transition-colors ${g==="packages"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[u.jsx(Hr,{size:13}),u.jsx("span",{className:"font-mono",children:i.length})]}),u.jsxs("button",{onClick:()=>y("docs"),className:`flex items-center gap-1 border-l border-c4a-border-subtle px-2.5 py-1 text-xs transition-colors ${g==="docs"?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:[u.jsx(Vn,{size:13}),u.jsx("span",{className:"font-mono",children:o.length})]})]})]}),u.jsx("hr",{className:"border-c4a-border-subtle"}),u.jsx("div",{ref:j,className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto px-2 py-1",children:S.length===0?u.jsx("p",{className:"py-8 text-center text-xs text-c4a-text-muted",children:g==="packages"?f("sources.import.no_packages"):"โ€”"}):u.jsxs(u.Fragment,{children:[g==="packages"?E.map(D=>u.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[u.jsx(Hr,{size:14,className:"shrink-0 text-c4a-accent"}),u.jsx("span",{className:"text-c4a-text-secondary",children:D.name}),u.jsx("span",{className:"hidden truncate text-c4a-text-muted sm:inline",children:D.path}),D.isRoot&&u.jsx("span",{className:"rounded bg-c4a-bg-active px-1 py-0.5 font-mono text-[10px] text-c4a-text-muted",children:"root"})]},D.path)):E.map(D=>u.jsxs("div",{className:"flex items-center gap-2 rounded pl-2 pr-4 py-1 text-xs",children:[u.jsx(Vn,{size:14,className:"shrink-0 text-c4a-text-secondary"}),u.jsx("span",{className:"truncate text-c4a-text-secondary",children:D})]},D)),C&&u.jsx("div",{ref:k,className:"h-4"})]})})]})]})}const k5=["scan","save"],zu={scan:"sources.import.stage.scan",save:"sources.import.stage.save"},S5={scan:20,save:90};function j5(){const{t:e}=_e(),t=Pt(),{libId:n}=fo(),[r]=sc(),o=an(ji(ss)).find(Z=>Z.id===n),l=Ot(Z=>Z.createSource),d=r.get("parentId")||"",p=r.get("parentName")||"",f=r.get("parentPath")||"",[m,g]=_.useState(1),[y,b]=_.useState(null),[w,k]=_.useState({repoPath:"",repoName:"",branch:"",branches:[],commit:"",commits:[],isDirty:!1,repoFiles:[],packages:[],mdFiles:[],repoFileContents:[]}),[j,S]=_.useState(null),[E,C]=_.useState(!1),[z,D]=_.useState(null),[A,P]=_.useState(""),[T,F]=_.useState(""),[M,G]=_.useState(!1),[Q,re]=_.useState(!1),[$,U]=_.useState(!1),[I,V]=_.useState(null),[te,oe]=_.useState([]),[R,B]=_.useState(null),[K,O]=_.useState(null),[se,ie]=_.useState([]),pe=_.useRef(null),Ee=o?.is_online??!1,{rpc:Ie,importedPaths:Ue,allowedPaths:be}=Yk(n,o),de=_.useMemo(()=>k5.map(Z=>({key:Z,label:zu[Z]?e(zu[Z]):Z})),[e]),ke=_.useCallback(Z=>{ie(fe=>[...fe,`[${Um()}] ${Z}`])},[]),ge=_.useRef(null),we=_.useCallback(Z=>{const fe=ge.current;fe&&fe!==Z&&(oe(Ne=>Ne.includes(fe)?Ne:[...Ne,fe]),ke(`${e(zu[fe]??fe)} ${e("sources.import.stage.done_suffix")}`)),ke(`${e(zu[Z]??Z)}...`),ge.current=Z,V(Z),O(null)},[ke,e]),Xe=_.useCallback((Z,fe)=>{k(Ne=>({...Ne,repoPath:Z,repoName:fe}))},[]),Me=_.useCallback(async()=>{C(!0),D(null);try{const Z=await Ie("fs/repoStatus",{path:w.repoPath}),fe={branches:Z.branches??[{name:Z.branch,commit:Z.head_hash}],tags:Z.tags??[],default:Z.branch,commits:Z.commits??[{hash:Z.head_hash,message:"HEAD"}]};S(fe),k(Ne=>({...Ne,isDirty:Z.is_dirty})),P(Ne=>{if(Ne)return Ne;const ze=fe.branches.find(Ft=>Ft.name===fe.default),He=fe.branches[0],Tt=ze??He;return Tt?(F(Tt.commit),Tt.name):Ne})}catch(Z){const fe=Z instanceof Error?Z.message:"Failed to load repository info";D(fe)}finally{C(!1)}},[Ie,w.repoPath]);_.useEffect(()=>{m===2&&w.repoPath&&!j&&Me()},[m,w.repoPath,j,Me]);const Je=_.useCallback(async Z=>{try{const fe=await Ie("fs/repoStatus",{path:w.repoPath,branch:Z});S(Ne=>Ne&&{...Ne,commits:fe.commits??[]})}catch{}},[Ie,w.repoPath]),zt=_.useCallback(async()=>{if(!n)return;const Z=Date.now();re(!0),U(!1),b(null),B(null),oe([]),ge.current=null,V(null),O(null),ie([]),g(3);try{we("scan");const fe=await Ie("fs/repoScan",{path:w.repoPath,hash:T}),Ne=fe.files||[],ze=fe.manifests||[],He=Qi(w.repoPath),{packages:Tt,mdFiles:Ft}=Fm(ze,Ne,He);k(yt=>({...yt,branch:A,commit:T,repoFiles:Ne,packages:Tt,mdFiles:Ft,repoFileContents:ze})),we("save");const Rt=await l({library_id:n,repo_name:w.repoName||He,repo_root_path:w.repoPath,repo_branch:A,repo_commit:T,repo_files:Ne.map(yt=>yt.path),repo_file_contents:ze,...d?{parent_source_id:d,parent_path:f}:{}});oe(["scan","save"]),ge.current=null,V(null),ke(`${e("sources.import.stage.save")} ${e("sources.import.stage.done_suffix")}`),ke(e("sources.import.stage.complete"));const _t=Array.isArray(Rt)?Rt[0]:Rt;pe.current=_t?.id??null,await Kk(Z),U(!0),re(!1),g(4)}catch(fe){const Ne=ge.current??"scan";B(Ne),ge.current=null,V(null);const ze=fe instanceof Error?fe.message:String(fe);ke(`ERROR: ${ze}`),b(ze),re(!1)}},[n,w,A,T,d,f,Ie,l,we,ke]),en=_.useCallback(()=>{B(null),b(null),zt()},[zt]),Kt=_.useCallback(()=>{if(n)if(d){const Z=w.repoName||Qi(w.repoPath),fe=f?`${f}/${Z}`:Z;t(`/studio/sources/${n}?rootId=${d}&path=${encodeURIComponent(fe)}`)}else pe.current?t(`/studio/sources/${n}?rootId=${pe.current}`):t(`/studio/sources/${n}`)},[n,t,d,f,w.repoPath,w.repoName]),An=_.useMemo(()=>m===1?!!w.repoPath:m===2?M:m===3?$:!1,[m,w.repoPath,M,$]),Kn=_.useMemo(()=>{if(!o)return[];const Z=[{label:o.is_default?e("sources.library.default_cloud_name"):o.name,to:`/studio/sources/${o.id}`}];if(d&&(Z.push({label:p||d,to:`/studio/sources/${o.id}?rootId=${d}`}),f)){const fe=f.split("/").filter(Boolean);for(const[Ne,ze]of fe.entries()){const He=fe.slice(0,Ne+1).join("/");Z.push({label:ze,to:`/studio/sources/${o.id}?rootId=${d}&path=${encodeURIComponent(He)}`})}}return Z.push({label:e("sources.import.title")}),Z},[o,d,p,f,e]);if(!o)return u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Pn=m===4,Xt=m===3&&!!R&&!Q,Sn=m<=2;return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsx("div",{className:"shrink-0",children:u.jsx(Ha,{segments:Kn})}),u.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[u.jsx(sa,{active:m>=1,current:m===1}),u.jsx("span",{className:m===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.select")}),u.jsx(Ji,{}),u.jsx(sa,{active:m>=2,current:m===2}),u.jsx("span",{className:m===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.version")}),u.jsx(Ji,{}),u.jsx(sa,{active:m>=3,current:m===3}),u.jsx("span",{className:m===3?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.loading")}),u.jsx(Ji,{}),u.jsx(sa,{active:m>=4,current:m===4}),u.jsx("span",{className:m===4?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.confirm")})]}),u.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:Ee?u.jsxs(u.Fragment,{children:[m===1&&u.jsx(m5,{rpc:Ie,selectedPath:w.repoPath,onSelect:Xe,allowedPaths:be,importedPaths:Ue}),m===2&&u.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:u.jsx(Wk,{refs:j,loading:E,error:z,selectedRef:A,commit:T,onRefChange:P,onCommitChange:F,onValidChange:G,onRetry:Me,onBranchSwitch:Je})}),m===3&&u.jsx(eS,{stages:de,currentStage:I,completedStages:te,failedStage:R,progress:K,breakpoints:S5,failedError:y,logs:se}),m===4&&u.jsx(tS,{repoName:w.repoName||Qi(w.repoPath),repoIdentifier:w.repoPath,branch:A,commit:T,packages:w.packages,mdFiles:w.mdFiles,importing:!1,completed:$})]}):u.jsx(Gk,{libraryName:o.name})}),Ee&&u.jsx(u.Fragment,{children:Pn?u.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:u.jsx("button",{onClick:Kt,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.done")})}):Xt?u.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[u.jsx("button",{onClick:()=>{g(2),B(null),b(null),oe([]),ge.current=null,V(null),ie([])},className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:e("sources.import.back")}),u.jsx("button",{onClick:en,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.retry")})]}):Sn?u.jsx($g,{step:m,totalSteps:4,importing:Q,stepBusy:E||m===3&&Q,canProceed:An,safetyNoticeKey:"sources.safety.notice.repo",confirmLabelKey:"sources.import.step.confirm",onPrev:()=>g(Z=>Z-1),onNext:()=>{m===2?zt():g(Z=>Z+1)},onImport:zt}):null}),y&&m!==3&&u.jsxs(br,{onClose:()=>b(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:e("sources.import.error_title")}),u.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:y}),u.jsx("div",{className:"mt-6 flex justify-end",children:u.jsx("button",{onClick:()=>b(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("common.confirm")})})]})]})}const M1=(e,t)=>{let n=0,r=0,i=0;const o=[],l=d=>{for(const p of d)if(p.type==="directory")r++,p.is_git_repo&&i++,p.children&&l(p.children);else if(n++,/\.md$/i.test(p.name)){const f=p.path.startsWith(t)?p.path.slice(t.length).replace(/^\//,""):p.name;o.push(f)}};return l(e),{files:n,dirs:r,gitRepos:i,mdFiles:o}};function N5({rpc:e,selectedPath:t,onSelect:n,allowedPaths:r,importedPaths:i}){const{t:o}=_e(),{atRoot:l,currentPath:d,entries:p,loading:f,error:m,homeDir:g,goToOpen:y,isWildcard:b,importedSet:w,dirs:k,files:j,loadTree:S,handleNavigateUp:E,setGoToOpen:C}=Zk({rpc:e,allowedPaths:r??[],importedPaths:i??[]}),z=_.useCallback(T=>{if(T.type!=="directory"||w.has(T.path))return;const F=M1(T.children||[],T.path);n(T.path,T.name,F),S(T.path)},[n,S,w]);_.useEffect(()=>{if(d&&!l&&p.length>=0&&!f){const T=d.split("/").pop()||d,F=M1(p,d);n(d,T,F)}},[d,l,p,f,n]);const D=_.useMemo(()=>t?t.split("/").pop()||t:"",[t]),A=_.useMemo(()=>k.sort((T,F)=>T.is_git_repo&&!F.is_git_repo?-1:!T.is_git_repo&&F.is_git_repo?1:T.name.localeCompare(F.name)),[k]),P=_.useMemo(()=>j.sort((T,F)=>T.name.localeCompare(F.name)),[j]);return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface px-4 pb-4 pt-2.5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l?u.jsxs("p",{className:"flex items-center gap-1.5 font-mono text-xs text-c4a-text-muted",children:[u.jsx("span",{children:o("sources.import.allowed_dirs")}),u.jsx(Xk,{})]}):u.jsx("p",{className:"min-w-0 truncate font-mono text-xs text-c4a-text-muted",children:d}),t?u.jsxs("p",{className:"flex shrink-0 items-center gap-2 font-mono text-xs text-c4a-accent",children:[u.jsx(nr,{size:12}),u.jsx("span",{children:D})]}):b&&l?u.jsx("button",{onClick:()=>C(!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:o("sources.import.wildcard_goto")}):null]}),u.jsx("hr",{className:"my-2 border-c4a-border-subtle"}),l?b?u.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:g&&u.jsxs("button",{onClick:()=>S(g),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx(nr,{size:14,className:"shrink-0"}),u.jsxs("span",{className:"truncate",children:[g,u.jsxs("span",{className:"ml-1.5 text-c4a-text-muted",children:["(",o("sources.import.wildcard_home"),")"]})]}),u.jsx(Gt,{size:12,className:"shrink-0 text-c4a-text-muted"})]})}):u.jsx("div",{className:"min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:r.map(T=>u.jsxs("button",{onClick:()=>S(T),className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:[u.jsx(nr,{size:14,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:T}),u.jsx(Gt,{size:12,className:"shrink-0 text-c4a-text-muted"})]},T))}):m&&!f?u.jsx("p",{className:"py-4 text-xs text-c4a-error",children:m}):u.jsxs("div",{className:"relative min-h-[5rem] min-h-0 flex-1 c4a-scrollbar overflow-y-auto",children:[f&&u.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-c4a-bg-surface/60",children:u.jsx(sn,{size:14,className:"animate-spin text-c4a-text-muted"})}),d!=="/"&&u.jsxs("button",{onClick:E,disabled:f,className:"flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover disabled:pointer-events-none",children:[u.jsx(Og,{size:14,className:"text-c4a-text-muted"}),u.jsx("span",{className:"leading-none pb-1",children:".."})]}),A.map(T=>{const F=w.has(T.path),M=T.is_git_repo?oc:nr;return u.jsxs("button",{onClick:()=>z(T),disabled:F||f,className:`flex w-full items-center gap-2 rounded pl-2 pr-4 py-1.5 text-left text-xs transition-colors ${F?"cursor-not-allowed text-c4a-accent/60":t===T.path?"bg-c4a-accent/10 text-c4a-accent":"text-c4a-text-secondary hover:bg-c4a-bg-hover"}`,children:[u.jsx(M,{size:14,className:"shrink-0"}),u.jsx("span",{className:"flex-1 truncate",children:T.name}),F&&u.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] text-c4a-accent/60",children:o("sources.import.already_imported")}),u.jsx(Gt,{size:12,className:"shrink-0 text-c4a-text-muted"})]},T.path)}),P.map(T=>u.jsxs("div",{className:"flex w-full items-center gap-2 pl-2 pr-4 py-1.5 text-xs text-c4a-text-muted",children:[u.jsx(zg,{size:14,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:T.name})]},T.path)),p.length===0&&!f&&u.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",children:o("sources.import.no_entries")})]}),u.jsx(Qk,{open:y,onClose:()=>C(!1),rpc:e,onNavigate:S,defaultPath:g??void 0})]})}const C5=new Set(["package.json","pyproject.toml","setup.py","go.mod","cargo.toml","pom.xml","build.gradle"]),E5=e=>{let t=0,n=0,r=0,i=0,o=0;const l=new Set;for(const d of e)if(d.type==="directory")n++,d.is_git_repo&&o++;else{t++,d.path.toLowerCase().endsWith(".md")&&i++;const f=d.path.split("/").pop();if(f&&C5.has(f.toLowerCase())){const m=d.path.split("/").slice(0,-1).join("/");e.some(y=>y.type==="directory"&&y.is_git_repo&&(m===y.path||m.startsWith(`${y.path}/`)))||l.add(m)}}return r=l.size,{totalFiles:t,totalDirs:n,codePackages:r,docFiles:i,gitRepos:o}};function A5({dirPath:e,rpc:t,importing:n,onScanComplete:r,onBusyChange:i}){const{t:o}=_e(),[l,d]=_.useState(!1),[p,f]=_.useState(null),[m,g]=_.useState(null),y=_.useCallback(async()=>{d(!0),i?.(!0),f(null),g(null);try{const b=await t("fs/dirScan",{path:e}),w=b.entries||[],k=b.manifests||[],j=E5(w);g(j),r(w,j,k)}catch(b){const w=b instanceof Error?b.message:String(b);f(w)}finally{d(!1),i?.(!1)}},[e,t,r,i]);return _.useEffect(()=>{y()},[y]),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded border border-c4a-border-subtle bg-c4a-bg-surface p-6",children:[u.jsx("p",{className:"shrink-0 font-mono text-xs text-c4a-text-muted",children:e}),u.jsx("div",{className:"mt-3 shrink-0 border-t border-c4a-border-subtle"}),u.jsxs("div",{className:"c4a-scrollbar min-h-0 flex-1 overflow-y-auto",children:[l&&u.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-4",children:[u.jsx(sn,{size:14,className:"animate-spin text-c4a-accent"}),u.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:o("sources.import.dir_scanning")})]}),p&&u.jsxs("div",{className:"mt-6",children:[u.jsxs("p",{className:"flex items-start gap-2 text-xs text-c4a-error",children:[u.jsx(Mk,{size:14,className:"mt-0.5 shrink-0"}),o("sources.import.dir_scan_error")]}),u.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:p}),u.jsxs("button",{onClick:y,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:[u.jsx(p3,{size:12}),o("sources.import.dir_scan_retry")]})]}),m&&!l&&!p&&u.jsxs("div",{className:"mt-6 space-y-3",children:[u.jsxs("p",{className:"font-mono text-sm uppercase text-c4a-accent",children:[o("sources.import.dir_scan_complete"),"!"]}),u.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:[u.jsx(xn,{icon:u.jsx(Vn,{size:14}),label:o("sources.import.dir_doc_files"),value:m.docFiles,tooltip:o("sources.import.dir_doc_files_tip"),size:"lg"}),u.jsx(xn,{icon:u.jsx(Hr,{size:14}),label:o("sources.import.dir_code_packages"),value:m.codePackages,tooltip:o("sources.import.dir_code_packages_tip"),size:"lg"}),m.gitRepos>0&&u.jsx(xn,{icon:u.jsx(oc,{size:14}),label:o("sources.import.dir_git_repos"),value:m.gitRepos,size:"lg"}),u.jsx(xn,{icon:u.jsx(nr,{size:14}),label:o("sources.import.dir_total_dirs"),value:m.totalDirs,size:"lg"}),u.jsx(xn,{icon:u.jsx(yR,{size:14}),label:o("sources.import.dir_total_files"),value:m.totalFiles,size:"lg"})]}),m.gitRepos>0&&u.jsx("p",{className:"text-xs text-c4a-warning",children:o("sources.import.dir_git_skip_hint",{count:m.gitRepos})})]}),n&&u.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 rounded bg-c4a-bg-base p-3",children:[u.jsx(sn,{size:14,className:"animate-spin text-c4a-accent"}),u.jsx("p",{className:"font-mono text-xs text-c4a-accent",children:o("sources.import.importing")})]})]})]})}function T5(){const{t:e}=_e(),t=Pt(),{libId:n}=fo(),i=an(ji(ss)).find(F=>F.id===n),o=Ot(F=>F.createSource),[l,d]=_.useState(1),[p,f]=_.useState(!1),[m,g]=_.useState(null),[y,b]=_.useState(!1),[w,k]=_.useState({dirPath:"",dirName:"",fileCount:0,subDirCount:0,gitRepoCount:0,mdFiles:[],scanEntries:[],scanStats:null,manifests:[]}),j=i?.is_online??!1,{rpc:S,importedPaths:E,allowedPaths:C}=Yk(n,i),z=_.useCallback((F,M,G)=>{k(Q=>({...Q,dirPath:F,dirName:M,fileCount:G.files,subDirCount:G.dirs,gitRepoCount:G.gitRepos,mdFiles:G.mdFiles}))},[]),D=_.useCallback((F,M,G)=>{k(Q=>({...Q,scanEntries:F,scanStats:M,manifests:G}))},[]),A=_.useCallback(async()=>{if(n){f(!0);try{const F=await o({library_id:n,dir_files:w.scanEntries,dir_name:w.dirName,dir_path:w.dirPath,dir_file_contents:w.manifests}),M=Array.isArray(F)?F[0]:F;M?.id?t(`/studio/sources/${n}?rootId=${M.id}`):t(`/studio/sources/${n}`)}catch(F){const M=F instanceof Error?F.message:String(F);g(M),f(!1)}}},[n,w,o,t]),P=_.useMemo(()=>l===1?!!w.dirPath:l===2?w.scanEntries.length>0:!0,[l,w]),T=_.useMemo(()=>i?[{label:i.is_default?e("sources.library.default_cloud_name"):i.name,to:`/studio/sources/${i.id}`},{label:e("sources.import.dir_title")}]:[],[i,e]);return i?u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsx("div",{className:"shrink-0",children:u.jsx(Ha,{segments:T})}),u.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[u.jsx(sa,{active:l>=1,current:l===1}),u.jsx("span",{className:l===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.dir_step.select")}),u.jsx(Ji,{}),u.jsx(sa,{active:l>=2,current:l===2}),u.jsx("span",{className:l===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.dir_step.confirm")})]}),u.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:j?u.jsxs(u.Fragment,{children:[l===1&&u.jsx(N5,{rpc:S,selectedPath:w.dirPath,onSelect:z,allowedPaths:C,importedPaths:E}),l===2&&u.jsx(A5,{dirPath:w.dirPath,rpc:S,importing:p,onScanComplete:D,onBusyChange:b})]}):u.jsx(Gk,{libraryName:i.name})}),j&&u.jsx($g,{step:l,totalSteps:2,importing:p,stepBusy:y,canProceed:P,safetyNoticeKey:"sources.safety.notice.dir",confirmLabelKey:"sources.import.dir_step.confirm",onPrev:()=>d(F=>F-1),onNext:()=>d(F=>F+1),onImport:A}),m&&u.jsxs(br,{onClose:()=>g(null),className:"mx-4 w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[u.jsx("h3",{className:"font-mono text-sm font-bold uppercase text-c4a-error",children:e("sources.import.error_title")}),u.jsx("p",{className:"mt-3 whitespace-pre-wrap break-all text-sm text-c4a-text-secondary",children:m}),u.jsx("div",{className:"mt-6 flex justify-end",children:u.jsx("button",{onClick:()=>g(null),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("common.confirm")})})]})]}):u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})})}function R5(e){return new Promise((t,n)=>{let r=!1,i=null,o=null;const l=()=>{r=!0,i&&(clearInterval(i),i=null),o&&(o(),o=null)},d=(f,m,g)=>{r||(l(),f==="done"&&m?t(m):n(new Error(g??"Clone failed")))};o=In.on("task/complete",f=>{const m=f;m.task_id===e&&d(m.status??"error",m.result,m.error)}),i=setInterval(async()=>{if(!r)try{const f=await Pe.get(`/import/remote/tasks/${e}`);f.status!=="running"&&d(f.status,f.result,f.error)}catch{}},5e3)})}async function L5(e){const{task_id:t}=await Pe.post("/import/remote/clone",{library_id:e.libraryId,url:e.url,ref:e.ref,...e.commit?{commit:e.commit}:{},repo_name:e.repoName});return R5(t)}async function D5(e,t,n){const{libraryId:r,url:i,ref:o,commitHash:l,scanResult:d,sourceUuid:p,parentSourceId:f,parentPath:m}=e,g={library_id:r,url:i,ref:o,commit:l,repo_files:d.files,repo_file_contents:d.manifests,...p?{source_uuid:p}:{},...f?{parent_source_id:f,parent_path:m}:{}},y=m?`${m}/${t}`:t;if(n.length>0){const j=[],S=[],E=new Set;for(const C of n){const z=C.split("/").pop()??C,D=C.endsWith("/")?C:`${C}/`,A=d.files.filter(G=>G.path.startsWith(D)||G.path===C).map(G=>({...G,path:G.path.startsWith(D)?G.path.slice(D.length):G.path})),P=d.manifests.filter(G=>G.path.startsWith(D)||G.path===C).map(G=>({...G,path:G.path.startsWith(D)?G.path.slice(D.length):G.path})),T=await Pe.post("/import/remote/import",{...g,repo_files:A,repo_file_contents:P,repo_name:y,dir_name:z,sub_path:C});j.push(T.id);const{packages:F,mdFiles:M}=Fm(P,A,z);for(const G of F)S.push(G);for(const G of M)E.add(G)}return{importIds:j,packages:S,mdFiles:Array.from(E)}}const b=await Pe.post("/import/remote/import",{...g,repo_name:y,dir_name:t}),{packages:w,mdFiles:k}=Fm(d.manifests,d.files,t);return{importIds:[b.id],packages:w,mdFiles:k}}function O5(e,t,n){if(e instanceof kn){const r=e.message.toLowerCase();if(e.status===503)return n("sources.import_remote.error.capacity");if(r.includes("connect")||r.includes("connectionrefused")||r.includes("unavailable")||r.includes("econnrefused"))return n("sources.import_remote.error.network");if(r.includes("authentication")||r.includes("token")||r.includes("credential")||r.includes("401")||r.includes("403"))try{return n("sources.import_remote.error.auth_required",{host:new URL(t).hostname})}catch{return n("sources.import_remote.error.auth_required",{host:t})}return r.includes("not found")||r.includes("404")||r.includes("does not exist")?n("sources.import_remote.error.not_found"):e.message||n("sources.import_remote.error.network")}return e instanceof TypeError&&e.message.includes("fetch")?n("sources.import_remote.error.network"):e instanceof Error?e.message:n("sources.import_remote.error.network")}function M5(e){return e==="cloning"?"clone":e==="detecting"||e==="extracting"?"scan":e==="saving"?"save":e}const Iu=/^https:\/\/[^/]+\/.+/,z1=e=>e.toLowerCase().replace(/:\d+$/,""),z5={"github.com":"github"};function Fh(e,t){try{const n=z1(new URL(e.trim()).hostname),r=t.find(i=>z1(i.host)===n&&i.api_import);return r?r.platform:z5[n]??null}catch{}return null}function I5({url:e,onUrlChange:t,onValidChange:n,onRefHint:r,onImportModeChange:i,forceClone:o}){const{t:l}=_e(),[d,p]=_.useState(null),[f,m]=_.useState([]),[g,y]=_.useState(null),[b,w]=_.useState("clone"),k=_.useRef(null);_.useEffect(()=>{Pe.get("/import/remote/git-hosts").then(F=>m(F.hosts),()=>{})},[]);const j=o?"clone":g&&b==="api"?"api":"clone",S=_.useRef(j);_.useEffect(()=>{j!==S.current&&(S.current=j,i?.(j))},[j,i]);const E=_.useCallback(F=>{if(!F){p(null),n(!1),y(null);return}Iu.test(F.trim())?(p(null),n(!0),y(Fh(F,f))):(p(l("sources.import_remote.url_invalid")),n(!1),y(null))},[n,l,f]),C=_.useCallback(F=>{if(!F){p(null),n(!1),y(null);return}const M=p5(F),G=M.repoUrl!==F.trim(),Q=G?M.repoUrl:F;G&&(t(Q),r?.(M.ref,M.commit)),Iu.test(Q)?(p(null),n(!0),y(Fh(Q,f))):(p(l("sources.import_remote.url_invalid")),n(!1),y(null))},[t,n,r,l,f]),z=_.useCallback(F=>{const M=F.target.value;t(M),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>E(M),500)},[t,E]),D=_.useCallback(()=>{k.current&&clearTimeout(k.current),e&&C(e)},[e,C]),A=_.useCallback(F=>{F.preventDefault();const M=F.clipboardData.getData("text").trim();t(M),k.current&&clearTimeout(k.current),C(M)},[t,C]);_.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]),_.useEffect(()=>{e&&C(e)},[]),_.useEffect(()=>{e&&Iu.test(e.trim())&&f.length>0&&y(Fh(e,f))},[f]),_.useEffect(()=>{i?.(o?"clone":g&&b==="api"?"api":"clone")},[g,o]);const P=F=>{w(F),i?.(o?"clone":F==="api"&&g?"api":"clone")},T=e&&Iu.test(e.trim());return u.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center rounded border border-c4a-border-subtle bg-c4a-bg-surface px-6 py-10",children:u.jsxs("div",{className:"w-full max-w-2xl space-y-5",children:[u.jsx("input",{type:"text",value:e,onChange:z,onBlur:D,onPaste:A,placeholder:l("sources.import_remote.url_placeholder"),className:"w-full rounded-md border border-c4a-border-default bg-c4a-bg-surface px-4 py-3 text-center font-mono text-base font-semibold text-c4a-accent placeholder:font-normal placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none",autoFocus:!0}),u.jsx("div",{className:"min-h-14 text-center text-sm leading-relaxed text-c4a-text-muted",children:d?u.jsx("p",{className:"text-red-400",children:d}):T?u.jsx("div",{className:"flex flex-col items-center gap-2",children:g&&!o?u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[u.jsx("input",{type:"checkbox",className:"c4a-check",checked:b==="clone",onChange:()=>P("clone")}),u.jsx("span",{className:b==="clone"?"text-c4a-accent":"text-c4a-text-muted",children:l("sources.import_remote.api.use_clone")})]}),u.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[u.jsx("input",{type:"checkbox",className:"c4a-check",checked:b==="api",onChange:()=>P("api")}),u.jsx("span",{className:b==="api"?"text-c4a-accent":"text-c4a-text-muted",children:l("sources.import_remote.api.detected",{platform:g})})]})]}):u.jsx("p",{className:"text-c4a-text-muted",children:l("sources.import_remote.api.will_use_clone")})}):u.jsxs(u.Fragment,{children:[u.jsx("p",{children:f.length>0?u.jsxs(u.Fragment,{children:[l("sources.import_remote.url_hint_public"),f.map((F,M)=>u.jsxs("span",{children:[M>0&&"ใ€",u.jsx("span",{className:"font-mono font-medium text-c4a-accent",children:F.host})]},F.host))]}):l("sources.import_remote.url_hint_no_auth")}),u.jsx("p",{className:"mt-1 text-c4a-text-muted/60",children:l("sources.import_remote.url_hint_format")})]})})]})})}function $5({repoUrl:e,ref:t,selected:n,fetchTree:r,onConfirm:i,onCancel:o}){const{t:l}=_e(),[d,p]=_.useState([]),[f,m]=_.useState(!0),[g,y]=_.useState(new Set),[b,w]=_.useState(new Set(n));_.useEffect(()=>{(async()=>{m(!0);try{const D=await r(e,t,"");p(D.map(A=>({entry:A,children:null,loading:!1})))}catch{p([])}finally{m(!1)}})()},[]);const k=_.useCallback((D,A,P)=>D.map(T=>T.entry.path===A?P(T):T.children?{...T,children:k(T.children,A,P)}:T),[]),j=_.useCallback(async D=>{const A=D.entry.path;if(g.has(A)){y(T=>{const F=new Set(T);return F.delete(A),F});return}if(y(T=>new Set(T).add(A)),D.children===null&&!D.loading){p(T=>k(T,A,F=>({...F,loading:!0})));try{const F=(await r(e,t,A)).map(M=>({entry:M,children:null,loading:!1}));p(M=>k(M,A,G=>({...G,children:F,loading:!1})))}catch{p(T=>k(T,A,F=>({...F,children:[],loading:!1})))}}},[g,e,t,r,k]),S=_.useCallback(D=>{w(A=>{const P=new Set(A);return P.has(D)?P.delete(D):P.add(D),P})},[]),E=_.useCallback(D=>{w(A=>{const P=new Set(A);return P.delete(D),P})},[]),C=_.useCallback(()=>{i(Array.from(b))},[i,b]),z=Array.from(b);return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 lg:flex-row",children:[u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded-lg border border-c4a-border-default lg:w-1/2",children:[u.jsx("div",{className:"border-b border-c4a-border-subtle px-3 py-2",children:u.jsx("span",{className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:l("sources.import_remote.api.sub_path")})}),u.jsx("div",{className:"c4a-scrollbar flex-1 overflow-y-auto",children:f?u.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:u.jsx(fa,{labelKey:"common.loading"})}):u.jsx(nS,{nodes:d,depth:0,expandedPaths:g,selectedPaths:b,onToggleExpand:j,onToggleSelect:S})})]}),u.jsxs("div",{className:"flex min-h-0 flex-col rounded-lg border border-c4a-border-default lg:w-1/2",children:[u.jsx("div",{className:"border-b border-c4a-border-subtle px-3 py-2 font-mono text-xs uppercase tracking-tight text-c4a-text-muted",children:l("sources.import_remote.api.panel_selected")}),u.jsx("div",{className:"px-3 py-2",children:u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:l("sources.import_remote.api.selected_count",{count:z.length}).split(/(\d+)/).map((D,A)=>/^\d+$/.test(D)?u.jsx("span",{className:"font-extrabold text-c4a-accent",children:D},A):u.jsx("span",{children:D},A))})}),u.jsx("div",{className:"c4a-scrollbar flex-1 overflow-y-auto px-3",children:z.length===0?null:u.jsx("div",{className:"flex flex-col gap-0.5",children:z.map(D=>u.jsxs("div",{className:"flex items-center gap-2 rounded-sm px-2 py-1 text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover",children:[u.jsx(nr,{size:12,className:"shrink-0"}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:D}),u.jsx("button",{onClick:()=>E(D),className:"shrink-0 text-c4a-text-muted hover:text-c4a-accent",children:u.jsx(Vr,{size:12})})]},D))})})]})]}),u.jsxs("div",{className:"mt-4 flex items-center justify-end gap-3",children:[u.jsx("button",{onClick:o,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:l("sources.import.back")}),u.jsx("button",{onClick:C,disabled:z.length===0,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover disabled:cursor-not-allowed disabled:opacity-40",children:z.length>0?`${l("sources.import.step.confirm")} (${z.length})`:l("sources.import.step.confirm")})]})]})}function nS({nodes:e,depth:t,expandedPaths:n,selectedPaths:r,onToggleExpand:i,onToggleSelect:o}){const l=e.filter(p=>p.entry.type==="tree"),d=e.filter(p=>p.entry.type==="blob");return u.jsxs(u.Fragment,{children:[l.map(p=>{const f=p.entry.path,m=n.has(f);return u.jsxs("div",{children:[u.jsxs("div",{className:"flex h-8 items-center font-mono text-[12px] transition-colors hover:bg-c4a-bg-hover",style:{paddingLeft:`${t*16+8}px`},children:[u.jsx("button",{onClick:()=>i(p),className:"flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center text-c4a-text-muted",children:p.loading?u.jsx(sn,{size:12,className:"animate-spin"}):u.jsx(Gt,{size:12,className:`transition-transform duration-200 ${m?"rotate-90":""}`})}),u.jsx("input",{type:"checkbox",checked:r.has(f),onChange:()=>o(f),className:"c4a-check mx-1.5 h-3 w-3 cursor-pointer"}),u.jsx(nr,{size:14,className:"mr-1.5 shrink-0 text-c4a-text-muted"}),u.jsx("span",{className:"truncate text-c4a-text-secondary",children:p.entry.name})]}),m&&p.children&&u.jsx(nS,{nodes:p.children,depth:t+1,expandedPaths:n,selectedPaths:r,onToggleExpand:i,onToggleSelect:o})]},f)}),d.map(p=>u.jsxs("div",{className:"flex h-8 items-center font-mono text-[12px]",style:{paddingLeft:`${t*16+8+20+6+12+6}px`},children:[u.jsx(zg,{size:14,className:"mr-1.5 shrink-0 text-c4a-text-muted opacity-50"}),u.jsx("span",{className:"truncate text-c4a-text-muted",children:p.entry.name})]},p.entry.path)),l.length===0&&d.length===0&&u.jsx("p",{className:"py-4 text-center text-xs text-c4a-text-muted",style:{paddingLeft:`${t*16+8}px`},children:"โ€”"})]})}function B5(){const e=_.useRef(new Map),t=_.useCallback(async(o,l)=>{const d=await Pe.post("/import/remote/branches",{repo_url:o,...l?{search:l}:{}});if(!d.provider_matched)return{refs:{branches:[],tags:[],default:""},providerMatched:!1,platform:null};const p=d.branches.find(m=>m.isDefault)?.name??"";return{refs:{branches:d.branches.map(m=>({name:m.name,commit:m.commitSha})),tags:[],default:p},providerMatched:!0,platform:d.platform}},[]),n=_.useCallback(async(o,l,d)=>{const p=`${o}::${l}::${d}`,f=e.current.get(p);if(f)return f;const m=await Pe.post("/import/remote/tree",{repo_url:o,ref:l,path:d});return e.current.set(p,m.entries),m.entries},[]),r=_.useCallback(async o=>{const l=await Pe.post("/import/remote/import",{library_id:o.libraryId,url:o.url,import_method:"api",branch:o.branch,commit_sha:o.commitSha,...o.subPaths&&o.subPaths.length>0?{sub_paths:o.subPaths}:{},...o.forceTruncated?{force_truncated:!0}:{},...o.sourceUuid?{source_uuid:o.sourceUuid}:{},...o.parentSourceId?{parent_source_id:o.parentSourceId,parent_path:o.parentPath}:{}}),d=l.results?.flatMap(f=>f.packages)??[],p=new Set;for(const f of l.results??[])for(const m of f.md_files)p.add(m);return{response:l,packages:d,mdFiles:Array.from(p)}},[]),i=_.useCallback(()=>{e.current.clear()},[]);return{fetchApiBranches:t,fetchRemoteTree:n,importViaApi:r,clearTreeCache:i}}function uc({error:e,onClose:t}){const{t:n}=_e(),[r,i]=_.useState(!1),o=_.useCallback(async()=>{try{await navigator.clipboard.writeText(e.detail),i(!0),setTimeout(()=>i(!1),2e3)}catch{const l=document.createElement("textarea");l.value=e.detail,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select(),document.execCommand("copy"),document.body.removeChild(l),i(!0),setTimeout(()=>i(!1),2e3)}},[e.detail]);return u.jsxs(br,{onClose:t,className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[u.jsx("p",{className:"font-mono text-sm font-bold uppercase tracking-tight text-c4a-text-primary",children:e.title}),u.jsx("p",{className:"mt-3 text-xs text-c4a-text-muted",children:n("error.dialog.console_hint")}),u.jsxs("div",{className:"mt-5 flex items-center justify-end gap-3",children:[u.jsxs("button",{onClick:o,className:"flex items-center gap-1.5 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary transition-colors hover:border-c4a-border-strong hover:text-c4a-text-primary",children:[r?u.jsx(ua,{size:12}):u.jsx(bd,{size:12}),n(r?"error.dialog.copied":"error.dialog.copy")]}),u.jsx("button",{onClick:t,className:"rounded bg-c4a-accent px-4 py-1.5 font-mono text-xs uppercase tracking-tight text-white transition-colors hover:bg-c4a-accent-hover",children:n("error.dialog.confirm")})]})]})}const Uh=["prepare","clone","scan","save"],rS={prepare:"sources.import.stage.prepare",clone:"sources.import.stage.clone",scan:"sources.import.stage.scan",save:"sources.import.stage.save"},P5={prepare:5,clone:90,scan:95,save:100},I1=["prepare","fetch_tree","read_packages","save"],aS={prepare:"sources.import.stage.prepare",fetch_tree:"sources.import.stage.fetch_tree",read_packages:"sources.import.stage.read_packages",save:"sources.import.stage.save"},F5={prepare:5,fetch_tree:50,read_packages:90,save:100},$1={...rS,...aS};function U5(){const{t:e}=_e(),t=Pt(),{libId:n}=fo(),[r]=sc(),i=r.get("url")||"",o=r.get("ref")||"",l=r.get("sourceUuid")||"",d=r.get("parentId")||"",p=r.get("parentName")||"",f=r.get("parentPath")||"",g=an(ji(ss)).find(he=>he.id===n),[y,b]=_.useState(new Set),w=_.useCallback(async()=>{if(n)try{const he=new Set;if(d){const De=(await Pe.get(`/sources/${d}`)).tree??[];let Qe=f===""?De:[];if(f){const $e=(kt,ft)=>{for(const hn of kt){if(hn.path===ft)return hn.children??[];if(hn.children){const Tn=$e(hn.children,ft);if(Tn.length>0)return Tn}}return[]};Qe=$e(De,f)}for(const $e of Qe)he.add($e.name.toLowerCase())}else{const Te=await Pe.get("/sources",{library_id:n});for(const De of Te.items)he.add(De.name.toLowerCase())}b(he)}catch{}},[n,d,f]);_.useEffect(()=>{w()},[w]);const[k,j]=_.useState(i?2:1),[S,E]=_.useState(i),[C,z]=_.useState(!!i),[D,A]=_.useState(o),[P,T]=_.useState(""),[F,M]=_.useState(!!o),[G,Q]=_.useState(""),re=_.useRef(void 0),$=_.useRef(void 0),[U,I]=_.useState("clone"),[V,te]=_.useState([]),[oe,R]=_.useState(!1),[B,K]=_.useState(null),[O,se]=_.useState(null),ie=_.useRef(0),{fetchApiBranches:pe,fetchRemoteTree:Ee,importViaApi:Ie,clearTreeCache:Ue}=B5(),be=V.length>0,de=_.useCallback(he=>{I(he)},[]),ke=_.useRef(S);_.useEffect(()=>{S!==ke.current&&(ke.current=S,A(""),T(""),M(!1),we(null),zt(null),te([]))},[S]);const[ge,we]=_.useState(null),[Xe,Me]=_.useState(!1),[Je,zt]=_.useState(null),[en,Kt]=_.useState(!1),[An,Kn]=_.useState(!1),[Pn,Xt]=_.useState(null),[Sn,Z]=_.useState(null),[fe,Ne]=_.useState(null),[ze,He]=_.useState(null),[Tt,Ft]=_.useState([]),[Rt,_t]=_.useState(null),[yt,lt]=_.useState([]),bn=_.useRef(null),on=_.useRef(""),xa=U==="api"?aS:rS,ye=U==="api"?I1:Uh,Ge=U==="api"?F5:P5,Lt=_.useMemo(()=>ye.map(he=>({key:he,label:xa[he]?e(xa[he]):he})),[e,ye,xa]),it=_.useCallback(he=>{lt(Te=>[...Te,`[${Um()}] ${he}`])},[]),It=_.useRef(null),Ut=_.useCallback(he=>{const Te=It.current;Te&&Te!==he&&(Ft(De=>De.includes(Te)?De:[...De,Te]),it(`${e($1[Te]??Te)} ${e("sources.import.stage.done_suffix")}`)),it(`${e($1[he]??he)}...`),It.current=he,He(he),_t(null)},[it,e]),Ya=_.useCallback((he,Te)=>{re.current=he,$.current=Te},[]),ya=_.useCallback((he,Te)=>{he.length!==0&&A(De=>{if(De)return De;const Qe=re.current,$e=$.current;if(Qe){const hn=he.find(Tn=>Tn.name===Qe);if(hn)return T(hn.commit),hn.name}$e&&T($e);const ft=he.find(hn=>hn.name===Te)??he[0];return ft?($e||T(ft.commit),ft.name):De})},[]),vr=_.useCallback(async he=>{if(!n)return;Me(!0),zt(null);const Te=async()=>{const De=await Pe.post("/import/remote/refs",{library_id:n,url:S},he?{signal:he}:void 0);he?.aborted||(we(De),ya([...De.branches??[],...De.tags??[]],De.default))};try{if(U==="api"){const{refs:De,providerMatched:Qe}=await pe(S);if(he?.aborted)return;if(!Qe){I("clone"),te([]),await Te();return}we(De),ya(De.branches,De.default)}else await Te()}catch(De){if(he?.aborted)return;zt(O5(De,S,e))}finally{he?.aborted||Me(!1)}},[n,S,e,U,pe,ya]);_.useEffect(()=>{if(k!==2||!n)return;const he=new AbortController;return vr(he.signal),()=>he.abort()},[k,n,vr]),_.useEffect(()=>{if(!en||U!=="clone")return;let he="";return In.on("task/progress",De=>{const Qe=De,$e=M5(Qe.stage??"");$e&&Uh.includes($e)&&(_t({percent:Qe.percent??-1,label:Qe.detail??Qe.label??""}),Qe.detail&&Qe.detail!==he&&(he=Qe.detail,lt(kt=>[...kt,`[${Um()}] ${Qe.detail}`])))})},[en,U]);const Fn=_.useCallback(async(he,Te)=>{Ft([...he]),It.current=null,He(null),it(`${e("sources.import.stage.save")} ${e("sources.import.stage.done_suffix")}`),it(e("sources.import.stage.complete")),await Kk(Te),Kn(!0),Kt(!1),j(4)},[it,e]),Yr=_.useCallback(async he=>{if(!n)return;const Te=G||Qi(S);Ut("clone");const De=f?`${f}/${Te}`:Te,Qe=await L5({libraryId:n,url:S,ref:D,commit:P||void 0,repoName:De});on.current=Qe.commit_hash,Ut("scan");const $e=await Pe.post("/import/remote/scan",{library_id:n,path:Qe.path,hash:Qe.commit_hash});Ut("save");const kt=await D5({libraryId:n,url:S,ref:D,commitHash:Qe.commit_hash,scanResult:$e,sourceUuid:l||void 0,parentSourceId:d||void 0,parentPath:f||void 0},Te,[]);bn.current=kt.importIds[0]??null,Xt({packages:kt.packages,mdFiles:kt.mdFiles}),await Fn(Uh,he)},[n,S,D,P,G,l,d,f,Ut,Fn]),ba=_.useCallback(async(he,Te=!1)=>{if(!n)return;Ut("fetch_tree");const De=await Ie({libraryId:n,url:S,branch:D,commitSha:P,subPaths:V.length>0?V:void 0,forceTruncated:Te,sourceUuid:l||void 0,parentSourceId:d||void 0,parentPath:f||void 0});if(De.response.status==="truncated"){it(e("sources.import_remote.api.truncated_warning")),K({treeEntries:De.response.tree_entries??0,message:De.response.message??""}),Kt(!1);return}Ut("read_packages"),on.current=P,Ut("save");const Qe=De.response.results?.[0];Qe&&(bn.current=Qe.source_id),Xt({packages:De.packages,mdFiles:De.mdFiles});for(const $e of De.response.warnings??[])oa($e.message);await Fn(I1,he)},[n,S,D,P,V,l,d,f,Ie,Ut,it,e,Fn]),Ka=_.useCallback(async()=>{if(!n)return;const he=Date.now();ie.current=he,Kt(!0),Kn(!1),Z(null),Ne(null),Ft([]),It.current=null,He(null),_t(null),lt([]),j(3);try{Ut("prepare"),await new Promise(Te=>setTimeout(Te,300)),U==="api"?await ba(he):await Yr(he)}catch(Te){const De=It.current??"prepare";if(Te instanceof kn&&Te.code==="GIT_HOST_NOT_CONFIGURED"){It.current=null,He(null),Kt(!1);let $e=S;try{$e=new URL(S).hostname}catch{}console.error("GIT_HOST_NOT_CONFIGURED:",Te.message),se({title:e("sources.import_remote.api.git_host_not_configured",{host:$e}),detail:Te.message});return}if(U==="api"){it(e("sources.import_remote.api.fallback_msg")),I("clone"),te([]),Ft([]),It.current=null,He(null),_t(null);try{Ut("prepare"),await new Promise($e=>setTimeout($e,300)),await Yr(he);return}catch($e){const kt=It.current??"prepare";Ne(kt),It.current=null,He(null);const ft=$e instanceof Error?$e.message:String($e);it(`ERROR: ${ft}`),Z(ft),Kt(!1);return}}Ne(De),It.current=null,He(null);const Qe=Te instanceof Error?Te.message:String(Te);it(`ERROR: ${Qe}`),Z(Qe),Kt(!1)}},[n,S,U,Ut,ba,Yr,it,e]),H=_.useCallback(()=>{Ne(null),Z(null),Ka()},[Ka]),X=_.useCallback(he=>{const Te=he instanceof Error?he.message:String(he);it(`ERROR: ${Te}`),Z(Te),Ne(It.current??"prepare"),It.current=null,He(null),Kt(!1)},[it]),ae=_.useCallback(async()=>{K(null),Kt(!0);try{await ba(ie.current,!0)}catch(he){X(he)}},[ba,X]),ve=_.useCallback(async()=>{K(null),I("clone"),te([]),Kt(!0),Ft([]),It.current=null,He(null),_t(null);try{Ut("prepare"),await new Promise(he=>setTimeout(he,300)),await Yr(ie.current)}catch(he){X(he)}},[Yr,Ut,X]),Se=_.useCallback(()=>{if(n)if(d){const he=`/studio/sources/${n}?rootId=${d}`;t(f?`${he}&path=${encodeURIComponent(f)}`:he)}else bn.current&&!be?t(`/studio/sources/${n}?rootId=${bn.current}`):t(`/studio/sources/${n}`)},[n,t,d,f,be]),Le=_.useCallback(()=>{j(2),Ne(null),Z(null),Ft([]),It.current=null,He(null),lt([])},[]),Ce=(G||Qi(S)).toLowerCase(),Ae=!be&&y.has(Ce),Re=_.useMemo(()=>k===1?C:k===2?F&&!Ae&&!Xe&&!Je:!1,[k,C,F,Ae,Xe,Je]),Ve=_.useMemo(()=>{if(!g)return[];const he=[{label:g.is_default?e("sources.library.default_cloud_name"):g.name,to:`/studio/sources/${g.id}`}];if(d&&(he.push({label:p||d,to:`/studio/sources/${g.id}?rootId=${d}`}),f)){const Te=f.split("/").filter(Boolean);for(const[De,Qe]of Te.entries()){const $e=Te.slice(0,De+1).join("/");he.push({label:Qe,to:`/studio/sources/${g.id}?rootId=${d}&path=${encodeURIComponent($e)}`})}}return he.push({label:e("sources.import_remote.title")}),he},[g,d,p,f,e]);if(!g)return u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Ye=k===4&&An,qe=k===3&&!!fe&&!en,gt=k<=2&&!oe;return k===2&&oe&&U==="api"?u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsx("div",{className:"shrink-0",children:u.jsx(Ha,{segments:Ve})}),u.jsx("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:u.jsx($5,{repoUrl:S,ref:D,selected:V,fetchTree:Ee,onConfirm:he=>{te(he),R(!1),Ue()},onCancel:()=>{R(!1),Ue()}})})]}):u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4 md:p-6",children:[u.jsx("div",{className:"shrink-0",children:u.jsx(Ha,{segments:Ve})}),u.jsxs("div",{className:"mt-3 flex shrink-0 items-center gap-2 font-mono text-sm sm:mt-6 md:gap-3",children:[u.jsx(sa,{active:k>=1,current:k===1}),u.jsx("span",{className:k===1?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.select")}),u.jsx(Ji,{}),u.jsx(sa,{active:k>=2,current:k===2}),u.jsx("span",{className:k===2?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.version")}),u.jsx(Ji,{}),u.jsx(sa,{active:k>=3,current:k===3}),u.jsx("span",{className:k===3?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.loading")}),u.jsx(Ji,{}),u.jsx(sa,{active:k>=4,current:k===4}),u.jsx("span",{className:k===4?"text-c4a-accent":"text-c4a-text-muted",children:e("sources.import.step.confirm")})]}),u.jsxs("div",{className:"mt-3 flex min-h-0 flex-1 flex-col sm:mt-6",children:[k===1&&u.jsx(I5,{url:S,onUrlChange:E,onValidChange:z,onRefHint:Ya,onImportModeChange:de,forceClone:!!d}),k===2&&n&&u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[u.jsx(Wk,{refs:ge,loading:Xe,error:Je,selectedRef:D,commit:P,onRefChange:A,onCommitChange:T,onValidChange:M,onRetry:()=>vr()}),!Xe&&ge&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:e("sources.import.dir_name")}),u.jsx("input",{type:"text",value:G,onChange:he=>Q(he.target.value),placeholder:Qi(S),disabled:be,className:`mt-2 w-full rounded border bg-c4a-bg-surface px-3 py-2 font-mono text-sm text-c4a-accent placeholder:text-c4a-text-muted focus:outline-none ${be?"opacity-50":""} ${Ae?"border-red-400 focus:border-red-400":"border-c4a-border-default focus:border-c4a-accent"}`}),Ae?u.jsx("p",{className:"mt-1.5 text-xs text-red-400",children:e("sources.import.dir_name_duplicate")}):u.jsx("p",{className:"mt-1.5 text-xs text-c4a-text-muted",children:e("sources.import.dir_name_hint")})]}),!d&&U==="api"&&u.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsx("label",{className:"block font-mono text-xs uppercase tracking-tight text-c4a-text-secondary",children:e("sources.import_remote.api.sub_path")}),u.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:e("sources.import_remote.api.sub_path_hint")}),u.jsx("button",{onClick:()=>R(!0),className:"mt-2 rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:e("sources.import_remote.api.select_sub_paths")}),V.length>0&&u.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:V.map(he=>u.jsxs("span",{className:"inline-flex items-center gap-1 rounded border border-c4a-border-subtle bg-c4a-bg-subtle px-1.5 py-0.5 font-mono text-[11px] text-c4a-text-secondary",children:[he,u.jsx("button",{onClick:()=>te(Te=>Te.filter(De=>De!==he)),className:"cursor-pointer text-c4a-text-muted hover:text-c4a-text-primary",children:u.jsx(Vr,{size:10})})]},he))})]})]})]}),k===3&&u.jsx(eS,{stages:Lt,currentStage:ze,completedStages:Tt,failedStage:fe,progress:Rt,breakpoints:Ge,failedError:Sn,logs:yt}),k===4&&u.jsx(tS,{repoName:Qi(S),repoIdentifier:S,branch:D,commit:on.current||P,packages:Pn?.packages??[],mdFiles:Pn?.mdFiles??[],importing:!1,completed:An,importMethod:U})]}),Ye?u.jsx("div",{className:"mt-3 flex shrink-0 justify-end sm:mt-6",children:u.jsx("button",{onClick:Se,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.done")})}):qe?u.jsxs("div",{className:"mt-3 flex shrink-0 justify-end gap-2 sm:mt-6",children:[u.jsx("button",{onClick:Le,className:"rounded border border-c4a-border-default px-4 py-2 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:e("sources.import.back")}),u.jsx("button",{onClick:H,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import.retry")})]}):gt?u.jsx($g,{step:k,totalSteps:2,importing:!1,stepBusy:Xe,canProceed:Re,safetyNoticeKey:"sources.safety.notice.remote",confirmLabelKey:"common.next",onPrev:()=>j(he=>he-1),onNext:()=>j(he=>he+1),onImport:Ka}):null,B&&u.jsxs(br,{onClose:()=>K(null),className:"w-full max-w-md rounded border border-c4a-border-default bg-c4a-bg-elevated p-6 shadow-c4a-lg",children:[u.jsxs("p",{className:"font-mono text-sm font-bold uppercase tracking-tight text-c4a-text-primary",children:["โš  ",e("sources.import_remote.api.truncated_warning")]}),u.jsx("p",{className:"mt-3 text-xs text-c4a-text-muted",children:e("sources.import_remote.api.truncated_suggest")}),u.jsxs("div",{className:"mt-5 flex items-center justify-end gap-3",children:[u.jsx("button",{onClick:ae,className:"rounded border border-c4a-border-default px-4 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:e("sources.import_remote.api.truncated_continue")}),u.jsx("button",{onClick:ve,className:"rounded bg-c4a-accent px-4 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.import_remote.api.truncated_use_clone")})]})]}),O&&u.jsx(uc,{error:O,onClose:()=>{se(null),j(1)}})]})}function H5(){const{t:e}=_e(),t=Pt(),n=an(y=>y.createLibrary),[r,i]=_.useState("waiting"),[o,l]=_.useState(null),[d,p]=_.useState(""),[f,m]=_.useState(!1);_.useEffect(()=>In.on("ws:daemon:connected",b=>{const w=b;l(w),p(w.machine_id),i(w.needs_registration?"new_client":"reconnected")}),[]),_.useEffect(()=>{let y=!1;return(async()=>{try{const b=await Pe.get("/daemons/pending");if(y||b.pending.length===0)return;const w=b.pending[0];l({machine_id:w.machine_id,needs_registration:!0}),p(w.machine_id),i("new_client")}catch{}})(),()=>{y=!0}},[]);const g=_.useCallback(async()=>{if(o){m(!0);try{const y=await n({type:"daemon",name:d||o.machine_id,config:{machine_id:o.machine_id,os:o.os||"",daemon_version:o.daemon_version||""}});t(`/studio/sources/${y.id}`)}catch{m(!1)}}},[o,d,n,t]);return u.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[u.jsx(Ha,{segments:[{label:e("sources.add_client.title")}]}),u.jsx("p",{className:"mt-4 text-sm text-c4a-text-secondary",children:e("sources.add_client.description")}),u.jsx("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:u.jsxs("ol",{className:"space-y-4 text-sm text-c4a-text-secondary",children:[u.jsxs("li",{children:[u.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["1. ",e("sources.add_client.step1")]}),u.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:["npm install -g @c4a/daemon ",u.jsx(Hh,{text:"npm install -g @c4a/daemon"})]})]}),u.jsxs("li",{children:[u.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["2. ",e("sources.add_client.step2")]}),u.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:[`c4a-daemon --server ${window.location.host}`," ",u.jsx(Hh,{text:`c4a-daemon --server ${window.location.host}`})]}),u.jsx("p",{className:"mt-2 text-xs text-c4a-text-muted",children:e("sources.add_client.step2_allow")}),u.jsxs("pre",{className:"mt-1 flex items-center gap-1.5 rounded bg-c4a-bg-base px-3 py-2 font-mono text-xs text-c4a-accent",children:[`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`," ",u.jsx(Hh,{text:`c4a-daemon --server ${window.location.host} --allow ~/dir1,~/dir2`})]})]}),u.jsxs("li",{children:[u.jsxs("span",{className:"font-mono text-xs font-bold text-c4a-text-primary",children:["3. ",e("sources.add_client.step3")]}),u.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted",children:e("sources.add_client.step3_desc")})]})]})}),u.jsxs("div",{className:"mt-6 rounded border border-c4a-border-subtle bg-c4a-bg-surface p-5",children:[r==="waiting"&&u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(sn,{size:16,className:"animate-spin text-c4a-warning"}),u.jsx("span",{className:"text-sm text-c4a-warning",children:e("sources.add_client.waiting")})]}),r==="new_client"&&o&&u.jsxs("div",{className:"space-y-4",children:[u.jsx("h3",{className:"font-mono text-sm font-bold text-c4a-accent",children:e("sources.add_client.detected")}),u.jsxs("div",{className:"space-y-2 text-sm",children:[u.jsx(qh,{label:e("sources.add_client.machine_name"),value:o.machine_id}),o.os&&u.jsx(qh,{label:e("sources.add_client.os"),value:o.os}),o.daemon_version&&u.jsx(qh,{label:e("sources.add_client.daemon_version"),value:o.daemon_version})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:e("sources.add_client.client_name")}),u.jsx("input",{value:d,onChange:y=>p(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"})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[u.jsx("button",{onClick:()=>t("/studio/sources"),className:"rounded border border-c4a-border-default px-3 py-1.5 font-mono text-xs text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover",children:e("common.cancel")}),u.jsxs("button",{onClick:g,disabled:f||!d.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:[f&&u.jsx(sn,{size:12,className:"animate-spin"}),e("sources.add_client.confirm")]})]})]}),r==="reconnected"&&o&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ua,{size:16,className:"text-c4a-success"}),u.jsx("span",{className:"text-sm text-c4a-text-primary",children:e("sources.add_client.reconnected",{name:o.machine_id})})]}),o.lib_id&&u.jsx(Mr,{to:`/studio/sources/${o.lib_id}`,className:"inline-block rounded bg-c4a-accent px-3 py-1.5 font-mono text-xs text-white transition-colors hover:bg-c4a-accent-hover",children:e("sources.add_client.go_to",{name:o.machine_id})})]})]})]})}function Hh({text:e}){const[t,n]=_.useState(!1),r=_.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})},[e]);return u.jsx("button",{type:"button",onClick:r,className:"shrink-0 rounded p-0.5 text-c4a-accent opacity-60 transition-opacity hover:opacity-100",title:"Copy",children:t?u.jsx(ua,{size:13}):u.jsx(bd,{size:13})})}function qh({label:e,value:t}){return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"w-32 font-mono text-xs text-c4a-text-muted",children:e}),u.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:t})]})}const B1={accent:"bg-c4a-accent/10 text-c4a-accent/60",success:"bg-c4a-success/10 text-c4a-success",warning:"bg-c4a-warning/10 text-c4a-warning",error:"bg-c4a-error/10 text-c4a-error",muted:"bg-c4a-bg-active text-c4a-text-secondary"};function Yt({children:e,variant:t="accent",tooltip:n}){return n?u.jsxs("span",{className:"relative inline-block group cursor-default",children:[u.jsx("span",{className:`inline-block font-mono text-[10px] uppercase px-1.5 py-0.5 rounded-sm ${B1[t]}`,children:e}),u.jsx("span",{className:"pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-1.5 px-2 py-1 rounded bg-c4a-bg-elevated text-c4a-text-primary text-[11px] font-sans normal-case whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity duration-150 shadow-lg border border-c4a-border-subtle z-50",children:n})]}):u.jsx("span",{className:`inline-block font-mono text-[10px] uppercase px-1.5 py-0.5 rounded-sm ${B1[t]}`,children:e})}function po(e){return e===void 0?null:e>=.9?{labelKey:"confidence.high",tipKey:"confidence.high.tip",variant:"success",value:e}:e>=.7?{labelKey:"confidence.ai",tipKey:"confidence.ai.tip",variant:"warning",value:e}:{labelKey:"confidence.low",tipKey:"confidence.low.tip",variant:"error",value:e}}const iS="c4a_explorer_mode";function q5(){try{const e=localStorage.getItem(iS);if(e==="append"||e==="replace")return e}catch{}return"append"}const Fa=da((e,t)=>({tabs:[],activeTabId:null,mode:q5(),openTab:n=>{const{tabs:r,mode:i}=t(),o=r.find(l=>l.id===n.id);if(o){e({activeTabId:o.id});return}if(i==="append")e({tabs:[...r,{...n,isAnchor:!1}],activeTabId:n.id});else{const l=r.find(d=>d.id===t().activeTabId);if(!l||l.isAnchor)e({tabs:[...r,{...n,isAnchor:!1}],activeTabId:n.id});else{const d=r.findIndex(f=>f.id===t().activeTabId),p=[...r];p[d]={...n,isAnchor:!1},e({tabs:p,activeTabId:n.id})}}},closeTab:n=>{const{tabs:r,activeTabId:i}=t(),o=r.find(f=>f.id===n);if(!o||o.isAnchor)return;const l=r.findIndex(f=>f.id===n),d=r.filter(f=>f.id!==n);let p=i;i===n&&(p=d[l-1]?.id??d[0]?.id??null),e({tabs:d,activeTabId:p})},activateTab:n=>{e({activeTabId:n})},closeAll:()=>{const{tabs:n}=t(),r=n.filter(i=>i.isAnchor);e({tabs:r,activeTabId:r[0]?.id??null})},setAnchor:n=>{const r={...n,isAnchor:!0};e({tabs:[r],activeTabId:r.id})},toggleMode:()=>{const n=t().mode==="append"?"replace":"append";try{localStorage.setItem(iS,n)}catch{}e({mode:n})},reset:()=>{e({tabs:[],activeTabId:null})}})),sS=_.createContext(null);function V5({children:e}){const t=Fa(r=>r.openTab),n=_.useCallback((r,i,o,l)=>{t({id:`${r}:${i}`,type:r,resourceId:i,label:o,...l!=null&&{icon:l}})},[t]);return u.jsx(sS.Provider,{value:{active:!0,navigate:n},children:e})}function ho(){return _.useContext(sS)}const oS=_.createContext(null);function lS(){const e=_.useContext(oS);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}function cS({value:e,onChange:t,children:n}){return u.jsx(oS.Provider,{value:{value:e,onChange:t},children:u.jsx("div",{className:"flex flex-1 flex-col",children:n})})}function uS({children:e}){return u.jsx("div",{className:"flex border-b border-c4a-border-subtle",children:e})}function ra({value:e,children:t}){const{value:n,onChange:r}=lS(),i=n===e;return u.jsx("button",{onClick:()=>r(e),className:`border-b-2 px-4 py-2 font-mono text-xs uppercase transition-colors ${i?"border-c4a-accent text-c4a-accent":"border-transparent text-c4a-text-muted hover:text-c4a-text-secondary"}`,children:t})}function aa({value:e,children:t}){const{value:n}=lS();return n!==e?null:u.jsx("div",{className:"flex flex-1 flex-col",children:t})}function dS(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const G5=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Y5=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,K5={};function P1(e,t){return(K5.jsx?Y5:G5).test(e)}const X5=/[ \t\n\f\r]/g;function Xd(e){return typeof e=="object"?e.type==="text"?F1(e.value):!1:F1(e)}function F1(e){return e.replace(X5,"")===""}class dc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}dc.prototype.normal={};dc.prototype.property={};dc.prototype.space=void 0;function fS(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new dc(n,r,t)}function Hm(e){return e.toLowerCase()}class ir{constructor(t,n){this.attribute=n,this.property=t}}ir.prototype.attribute="";ir.prototype.booleanish=!1;ir.prototype.boolean=!1;ir.prototype.commaOrSpaceSeparated=!1;ir.prototype.commaSeparated=!1;ir.prototype.defined=!1;ir.prototype.mustUseProperty=!1;ir.prototype.number=!1;ir.prototype.overloadedBoolean=!1;ir.prototype.property="";ir.prototype.spaceSeparated=!1;ir.prototype.space=void 0;let Q5=0;const at=os(),pn=os(),qm=os(),je=os(),$t=os(),to=os(),pr=os();function os(){return 2**++Q5}const Vm=Object.freeze(Object.defineProperty({__proto__:null,boolean:at,booleanish:pn,commaOrSpaceSeparated:pr,commaSeparated:to,number:je,overloadedBoolean:qm,spaceSeparated:$t},Symbol.toStringTag,{value:"Module"})),Vh=Object.keys(Vm);class Bg extends ir{constructor(t,n,r,i){let o=-1;if(super(t,n),U1(this,"space",i),typeof r=="number")for(;++o<Vh.length;){const l=Vh[o];U1(this,Vh[o],(r&Vm[l])===Vm[l])}}}Bg.prototype.defined=!0;function U1(e,t,n){n&&(e[t]=n)}function mo(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Bg(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Hm(r)]=r,n[Hm(o.attribute)]=r}return new dc(t,n,e.space)}const pS=mo({properties:{ariaActiveDescendant:null,ariaAtomic:pn,ariaAutoComplete:null,ariaBusy:pn,ariaChecked:pn,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:$t,ariaCurrent:null,ariaDescribedBy:$t,ariaDetails:null,ariaDisabled:pn,ariaDropEffect:$t,ariaErrorMessage:null,ariaExpanded:pn,ariaFlowTo:$t,ariaGrabbed:pn,ariaHasPopup:null,ariaHidden:pn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$t,ariaLevel:je,ariaLive:null,ariaModal:pn,ariaMultiLine:pn,ariaMultiSelectable:pn,ariaOrientation:null,ariaOwns:$t,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:pn,ariaReadOnly:pn,ariaRelevant:null,ariaRequired:pn,ariaRoleDescription:$t,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:pn,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function hS(e,t){return t in e?e[t]:t}function mS(e,t){return hS(e,t.toLowerCase())}const Z5=mo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:to,acceptCharset:$t,accessKey:$t,action:null,allow:null,allowFullScreen:at,allowPaymentRequest:at,allowUserMedia:at,alt:null,as:null,async:at,autoCapitalize:null,autoComplete:$t,autoFocus:at,autoPlay:at,blocking:$t,capture:null,charSet:null,checked:at,cite:null,className:$t,cols:je,colSpan:null,content:null,contentEditable:pn,controls:at,controlsList:$t,coords:je|to,crossOrigin:null,data:null,dateTime:null,decoding:null,default:at,defer:at,dir:null,dirName:null,disabled:at,download:qm,draggable:pn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:at,formTarget:null,headers:$t,height:je,hidden:qm,high:je,href:null,hrefLang:null,htmlFor:$t,httpEquiv:$t,id:null,imageSizes:null,imageSrcSet:null,inert:at,inputMode:null,integrity:null,is:null,isMap:at,itemId:null,itemProp:$t,itemRef:$t,itemScope:at,itemType:$t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:at,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:at,muted:at,name:null,nonce:null,noModule:at,noValidate:at,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:at,optimum:je,pattern:null,ping:$t,placeholder:null,playsInline:at,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:at,referrerPolicy:null,rel:$t,required:at,reversed:at,rows:je,rowSpan:je,sandbox:$t,scope:null,scoped:at,seamless:at,selected:at,shadowRootClonable:at,shadowRootDelegatesFocus:at,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:pn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:at,useMap:null,value:pn,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$t,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:at,declare:at,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:at,noHref:at,noShade:at,noWrap:at,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:pn,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:at,disableRemotePlayback:at,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:mS}),W5=mo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:pr,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:$t,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:at,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:to,g2:to,glyphName:to,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:pr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:je,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pr,rev:pr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pr,requiredFeatures:pr,requiredFonts:pr,requiredFormats:pr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:pr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pr,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hS}),gS=mo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),xS=mo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mS}),yS=mo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),J5={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},eD=/[A-Z]/g,H1=/-[a-z]/g,tD=/^data[-\w.:]+$/i;function bS(e,t){const n=Hm(t);let r=t,i=ir;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&tD.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(H1,rD);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!H1.test(o)){let l=o.replace(eD,nD);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Bg}return new i(r,t)}function nD(e){return"-"+e.toLowerCase()}function rD(e){return e.charAt(1).toUpperCase()}const vS=fS([pS,Z5,gS,xS,yS],"html"),fc=fS([pS,W5,gS,xS,yS],"svg");function _S(e){return e.join(" ").trim()}var Ys={},Gh,q1;function aD(){if(q1)return Gh;q1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,d=/^\s+|\s+$/g,p=`
34
+ `,f="/",m="*",g="",y="comment",b="declaration";function w(j,S){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];S=S||{};var E=1,C=1;function z($){var U=$.match(t);U&&(E+=U.length);var I=$.lastIndexOf(p);C=~I?$.length-I:C+$.length}function D(){var $={line:E,column:C};return function(U){return U.position=new A($),F(),U}}function A($){this.start=$,this.end={line:E,column:C},this.source=S.source}A.prototype.content=j;function P($){var U=new Error(S.source+":"+E+":"+C+": "+$);if(U.reason=$,U.filename=S.source,U.line=E,U.column=C,U.source=j,!S.silent)throw U}function T($){var U=$.exec(j);if(U){var I=U[0];return z(I),j=j.slice(I.length),U}}function F(){T(n)}function M($){var U;for($=$||[];U=G();)U!==!1&&$.push(U);return $}function G(){var $=D();if(!(f!=j.charAt(0)||m!=j.charAt(1))){for(var U=2;g!=j.charAt(U)&&(m!=j.charAt(U)||f!=j.charAt(U+1));)++U;if(U+=2,g===j.charAt(U-1))return P("End of comment missing");var I=j.slice(2,U-2);return C+=2,z(I),j=j.slice(U),C+=2,$({type:y,comment:I})}}function Q(){var $=D(),U=T(r);if(U){if(G(),!T(i))return P("property missing ':'");var I=T(o),V=$({type:b,property:k(U[0].replace(e,g)),value:I?k(I[0].replace(e,g)):g});return T(l),V}}function re(){var $=[];M($);for(var U;U=Q();)U!==!1&&($.push(U),M($));return $}return F(),re()}function k(j){return j?j.replace(d,g):g}return Gh=w,Gh}var V1;function iD(){if(V1)return Ys;V1=1;var e=Ys&&Ys.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.default=n;const t=e(aD());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),d=typeof i=="function";return l.forEach(p=>{if(p.type!=="declaration")return;const{property:f,value:m}=p;d?i(f,m,p):m&&(o=o||{},o[f]=m)}),o}return Ys}var fl={},G1;function sD(){if(G1)return fl;G1=1,Object.defineProperty(fl,"__esModule",{value:!0}),fl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},l=function(f,m){return m.toUpperCase()},d=function(f,m){return"".concat(m,"-")},p=function(f,m){return m===void 0&&(m={}),o(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(i,d):f=f.replace(r,d),f.replace(t,l))};return fl.camelCase=p,fl}var pl,Y1;function oD(){if(Y1)return pl;Y1=1;var e=pl&&pl.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(iD()),n=sD();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(d,p){d&&p&&(l[(0,n.camelCase)(d,o)]=p)}),l}return r.default=r,pl=r,pl}var lD=oD();const cD=kg(lD),wS=kS("end"),Pg=kS("start");function kS(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function uD(e){const t=Pg(e),n=wS(e);if(t&&n)return{start:t,end:n}}function Dl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?K1(e.position):"start"in e||"end"in e?K1(e):"line"in e||"column"in e?Gm(e):""}function Gm(e){return X1(e&&e.line)+":"+X1(e&&e.column)}function K1(e){return Gm(e&&e.start)+"-"+Gm(e&&e.end)}function X1(e){return e&&typeof e=="number"?e:1}class Bn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const p=r.indexOf(":");p===-1?o.ruleId=r:(o.source=r.slice(0,p),o.ruleId=r.slice(p+1))}if(!o.place&&o.ancestors&&o.ancestors){const p=o.ancestors[o.ancestors.length-1];p&&(o.place=p.position)}const d=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=d?d.line:void 0,this.name=Dl(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Bn.prototype.file="";Bn.prototype.name="";Bn.prototype.reason="";Bn.prototype.message="";Bn.prototype.stack="";Bn.prototype.column=void 0;Bn.prototype.line=void 0;Bn.prototype.ancestors=void 0;Bn.prototype.cause=void 0;Bn.prototype.fatal=void 0;Bn.prototype.place=void 0;Bn.prototype.ruleId=void 0;Bn.prototype.source=void 0;const Fg={}.hasOwnProperty,dD=new Map,fD=/[A-Z]/g,pD=new Set(["table","tbody","thead","tfoot","tr"]),hD=new Set(["td","th"]),SS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function jS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=wD(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_D(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?fc:vS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=NS(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function NS(e,t,n){if(t.type==="element")return mD(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return gD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return yD(e,t,n);if(t.type==="mdxjsEsm")return xD(e,t);if(t.type==="root")return bD(e,t,n);if(t.type==="text")return vD(e,t)}function mD(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=fc,e.schema=i),e.ancestors.push(t);const o=ES(e,t.tagName,!1),l=kD(e,t);let d=Hg(e,t);return pD.has(t.tagName)&&(d=d.filter(function(p){return typeof p=="string"?!Xd(p):!0})),CS(e,l,o,t),Ug(l,d),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function gD(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ql(e,t.position)}function xD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ql(e,t.position)}function yD(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=fc,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:ES(e,t.name,!0),l=SD(e,t),d=Hg(e,t);return CS(e,l,o,t),Ug(l,d),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function bD(e,t,n){const r={};return Ug(r,Hg(e,t)),e.create(t,e.Fragment,r,n)}function vD(e,t){return t.value}function CS(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ug(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function _D(e,t,n){return r;function r(i,o,l,d){const f=Array.isArray(l.children)?n:t;return d?f(o,l,d):f(o,l)}}function wD(e,t){return n;function n(r,i,o,l){const d=Array.isArray(o.children),p=Pg(r);return t(i,o,l,d,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function kD(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Fg.call(t.properties,i)){const o=jD(e,i,t.properties[i]);if(o){const[l,d]=o;e.tableCellAlignToStyle&&l==="align"&&typeof d=="string"&&hD.has(t.tagName)?r=d:n[l]=d}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function SD(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const d=l.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else ql(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const d=r.value.data.estree.body[0];d.type,o=e.evaluater.evaluateExpression(d.expression)}else ql(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Hg(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:dD;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const p=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(p){const f=i.get(p)||0;l=p+"-"+f,i.set(p,f+1)}}const d=NS(e,o,l);d!==void 0&&n.push(d)}return n}function jD(e,t,n){const r=bS(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?dS(n):_S(n)),r.property==="style"){let i=typeof n=="object"?n:ND(e,String(n));return e.stylePropertyNameCase==="css"&&(i=CD(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?J5[r.property]||r.property:r.attribute,n]}}function ND(e,t){try{return cD(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Bn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=SS+"#cannot-parse-style-attribute",i}}function ES(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const d=P1(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:d,computed:!!(o&&d.type==="Literal"),optional:!1}:d}r=l}else r=P1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Fg.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ql(e)}function ql(e,t){const n=new Bn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=SS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function CD(e){const t={};let n;for(n in e)Fg.call(e,n)&&(t[ED(n)]=e[n]);return t}function ED(e){let t=e.replace(fD,AD);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function AD(e){return"-"+e.toLowerCase()}var Ym=Object.defineProperty,TD=Object.getOwnPropertyDescriptor,RD=Object.getOwnPropertyNames,LD=Object.prototype.hasOwnProperty,DD=(e,t)=>{let n={};for(var r in e)Ym(n,r,{get:e[r],enumerable:!0});return Ym(n,Symbol.toStringTag,{value:"Module"}),n},OD=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=RD(t),o=0,l=i.length,d;o<l;o++)d=i[o],!LD.call(e,d)&&d!==n&&Ym(e,d,{get:(p=>t[p]).bind(null,d),enumerable:!(r=TD(t,d))||r.enumerable});return e},MD=(e,t,n)=>(OD(e,t,"default"),n),Bt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function zD(e){return qg(e)}function qg(e){return Array.isArray(e)?ID(e):e instanceof RegExp?e:typeof e=="object"?$D(e):e}function ID(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=qg(e[n]);return t}function $D(e){let t={};for(let n in e)t[n]=qg(e[n]);return t}function AS(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function TS(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?TS(e.substring(0,e.length-1)):e.substr(~t+1)}var Yh=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,$u=class{static hasCaptures(e){return e===null?!1:(Yh.lastIndex=0,Yh.test(e))}static replaceCaptures(e,t,n){return e.replace(Yh,(r,i,o,l)=>{let d=n[parseInt(i||o,10)];if(d){let p=t.substring(d.start,d.end);for(;p[0]===".";)p=p.substring(1);switch(l){case"downcase":return p.toLowerCase();case"upcase":return p.toUpperCase();default:return p}}else return r})}};function RS(e,t){return e<t?-1:e>t?1:0}function LS(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;i<n;i++){let o=RS(e[i],t[i]);if(o!==0)return o}return 0}return n-r}function Q1(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function DS(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var OS=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},_d=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(FD(e),t)}static createFromParsedTheme(e,t){return HD(e,t)}_cachedMatchRoot=new OS(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>BD(e.parent,i.parentScopes));return r?new MS(r.fontStyle,r.foreground,r.background):null}},Kh=class od{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new od(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new od(n,t[r]);return n}push(t){return new od(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function BD(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!PD(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function PD(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var MS=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function FD(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i<o;i++){let l=t[i];if(!l.settings)continue;let d;if(typeof l.scope=="string"){let g=l.scope;g=g.replace(/^[,]+/,""),g=g.replace(/[,]+$/,""),d=g.split(",")}else Array.isArray(l.scope)?d=l.scope:d=[""];let p=-1;if(typeof l.settings.fontStyle=="string"){p=0;let g=l.settings.fontStyle.split(" ");for(let y=0,b=g.length;y<b;y++)switch(g[y]){case"italic":p=p|1;break;case"bold":p=p|2;break;case"underline":p=p|4;break;case"strikethrough":p=p|8;break}}let f=null;typeof l.settings.foreground=="string"&&Q1(l.settings.foreground)&&(f=l.settings.foreground);let m=null;typeof l.settings.background=="string"&&Q1(l.settings.background)&&(m=l.settings.background);for(let g=0,y=d.length;g<y;g++){let w=d[g].trim().split(" "),k=w[w.length-1],j=null;w.length>1&&(j=w.slice(0,w.length-1),j.reverse()),n[r++]=new UD(k,j,i,p,f,m)}}return n}var UD=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},Mn=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Mn||{});function HD(e,t){e.sort((p,f)=>{let m=RS(p.scope,f.scope);return m!==0||(m=LS(p.parentScopes,f.parentScopes),m!==0)?m:p.index-f.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let p=e.shift();p.fontStyle!==-1&&(n=p.fontStyle),p.foreground!==null&&(r=p.foreground),p.background!==null&&(i=p.background)}let o=new qD(t),l=new MS(n,o.getId(r),o.getId(i)),d=new GD(new Km(0,null,-1,0,0),[]);for(let p=0,f=e.length;p<f;p++){let m=e[p];d.insert(0,m.scope,m.parentScopes,m.fontStyle,o.getId(m.foreground),o.getId(m.background))}return new _d(o,l,d)}var qD=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},VD=Object.freeze([]),Km=class zS{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,i,o){this.scopeDepth=t,this.parentScopes=n||VD,this.fontStyle=r,this.foreground=i,this.background=o}clone(){return new zS(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,i=t.length;r<i;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},GD=class Xm{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Xm._cmpBySpecificity),n}insert(t,n,r,i,o,l){if(n===""){this._doInsertHere(t,r,i,o,l);return}let d=n.indexOf("."),p,f;d===-1?(p=n,f=""):(p=n.substring(0,d),f=n.substring(d+1));let m;this._children.hasOwnProperty(p)?m=this._children[p]:(m=new Xm(this._mainRule.clone(),Km.cloneArr(this._rulesWithParentScopes)),this._children[p]=m),m.insert(t+1,f,r,i,o,l)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let l=0,d=this._rulesWithParentScopes.length;l<d;l++){let p=this._rulesWithParentScopes[l];if(LS(p.parentScopes,n)===0){p.acceptOverwrite(t,r,i,o);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new Km(t,n,r,i,o))}},so=class Tr{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Tr.getLanguageId(t),r=Tr.getTokenType(t),i=Tr.getFontStyle(t),o=Tr.getForeground(t),l=Tr.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:o,background:l})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,o,l,d){let p=Tr.getLanguageId(t),f=Tr.getTokenType(t),m=Tr.containsBalancedBrackets(t)?1:0,g=Tr.getFontStyle(t),y=Tr.getForeground(t),b=Tr.getBackground(t);return n!==0&&(p=n),r!==8&&(f=r),i!==null&&(m=i?1:0),o!==-1&&(g=o),l!==0&&(y=l),d!==0&&(b=d),(p<<0|f<<8|m<<10|g<<11|y<<15|b<<24)>>>0}};function wd(e,t){const n=[],r=YD(e);let i=r.next();for(;i!==null;){let p=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":p=1;break;case"L":p=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let f=l();if(n.push({matcher:f,priority:p}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const p=o();return f=>!!p&&!p(f)}if(i==="("){i=r.next();const p=d();return i===")"&&(i=r.next()),p}if(Z1(i)){const p=[];do p.push(i),i=r.next();while(Z1(i));return f=>t(p,f)}return null}function l(){const p=[];let f=o();for(;f;)p.push(f),f=o();return m=>p.every(g=>g(m))}function d(){const p=[];let f=l();for(;f&&(p.push(f),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");f=l()}return m=>p.some(g=>g(m))}}function Z1(e){return!!e&&!!e.match(/[\w\.:]+/)}function YD(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function IS(e){typeof e.dispose=="function"&&e.dispose()}var Vl=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},KD=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},XD=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},QD=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Vl(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new XD;for(const n of e)ZD(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Vl){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function ZD(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Vl?ld({baseGrammar:o,selfGrammar:i},r):Qm(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const l=n.injections(e.scopeName);if(l)for(const d of l)r.add(new Vl(d))}function Qm(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];kd([r],t,n)}}function ld(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&kd(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&kd(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function kd(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?AS({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&kd(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const l=$S(o);switch(l.kind){case 0:ld({...t,selfGrammar:t.baseGrammar},n);break;case 1:ld(t,n);break;case 2:Qm(l.ruleName,{...t,repository:i},n);break;case 3:case 4:const d=l.scopeName===t.selfGrammar.scopeName?t.selfGrammar:l.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(d){const p={baseGrammar:t.baseGrammar,selfGrammar:d,repository:i};l.kind===4?Qm(l.ruleName,p,n):ld(p,n)}else l.kind===4?n.add(new KD(l.scopeName,l.ruleName)):n.add(new Vl(l.scopeName));break}}}var WD=class{kind=0},JD=class{kind=1},eO=class{constructor(e){this.ruleName=e}kind=2},tO=class{constructor(e){this.scopeName=e}kind=3},nO=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function $S(e){if(e==="$base")return new WD;if(e==="$self")return new JD;const t=e.indexOf("#");if(t===-1)return new tO(e);if(t===0)return new eO(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new nO(n,r)}}var rO=/\\(\d+)/,W1=/\\(\d+)/g,aO=-1,BS=-2;var pc=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=$u.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=$u.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${TS(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:$u.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:$u.replaceCaptures(this._contentName,e,t)}},iO=class extends pc{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},sO=class extends pc{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Gl(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Yl,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},J1=class extends pc{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Yl,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Zm=class extends pc{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,o,l,d,p,f){super(e,t,n,r),this._begin=new Gl(i,this.id),this.beginCaptures=o,this._end=new Gl(l||"๏ฟฟ",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=d,this.applyEndPatternLast=p||!1,this.patterns=f.patterns,this.hasMissingPatterns=f.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Yl;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Sd=class extends pc{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,o,l,d,p){super(e,t,n,r),this._begin=new Gl(i,this.id),this.beginCaptures=o,this.whileCaptures=d,this._while=new Gl(l,BS),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=p.patterns,this.hasMissingPatterns=p.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Yl;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Yl,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"๏ฟฟ"),this._cachedCompiledWhilePatterns}},PS=class Dn{static createCaptureRule(t,n,r,i,o){return t.registerRule(l=>new iO(n,l,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new sO(t.$vscodeTextmateLocation,t.id,t.name,t.match,Dn._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=AS({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new J1(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Dn._compilePatterns(o,n,r))}return t.while?new Sd(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Dn._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,Dn._compileCaptures(t.whileCaptures||t.captures,n,r),Dn._compilePatterns(t.patterns,n,r)):new Zm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Dn._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,Dn._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,Dn._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const d=parseInt(l,10);d>o&&(o=d)}for(let l=0;l<=o;l++)i[l]=null;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const d=parseInt(l,10);let p=0;t[l].patterns&&(p=Dn.getCompiledRuleId(t[l],n,r)),i[d]=Dn.createCaptureRule(n,t[l].$vscodeTextmateLocation,t[l].name,t[l].contentName,p)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,l=t.length;o<l;o++){const d=t[o];let p=-1;if(d.include){const f=$S(d.include);switch(f.kind){case 0:case 1:p=Dn.getCompiledRuleId(r[d.include],n,r);break;case 2:let m=r[f.ruleName];m&&(p=Dn.getCompiledRuleId(m,n,r));break;case 3:case 4:const g=f.scopeName,y=f.kind===4?f.ruleName:null,b=n.getExternalGrammar(g,r);if(b)if(y){let w=b.repository[y];w&&(p=Dn.getCompiledRuleId(w,n,b.repository))}else p=Dn.getCompiledRuleId(b.repository.$self,n,b.repository);break}}else p=Dn.getCompiledRuleId(d,n,r);if(p!==-1){const f=n.getRule(p);let m=!1;if((f instanceof J1||f instanceof Zm||f instanceof Sd)&&f.hasMissingPatterns&&f.patterns.length===0&&(m=!0),m)continue;i.push(p)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Gl=class FS{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const r=t.length;let i=0,o=[],l=!1;for(let d=0;d<r;d++)if(t.charAt(d)==="\\"&&d+1<r){const f=t.charAt(d+1);f==="z"?(o.push(t.substring(i,d)),o.push("$(?!\\n)(?<!\\n)"),i=d+2):(f==="A"||f==="G")&&(l=!0),d++}this.hasAnchor=l,i===0?this.source=t:(o.push(t.substring(i,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=rO.test(this.source):this.hasBackReferences=!1}clone(){return new FS(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>t.substring(i.start,i.end));return W1.lastIndex=0,this.source.replace(W1,(i,o)=>DS(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],o,l,d,p;for(o=0,l=this.source.length;o<l;o++)d=this.source.charAt(o),t[o]=d,n[o]=d,r[o]=d,i[o]=d,d==="\\"&&o+1<l&&(p=this.source.charAt(o+1),p==="A"?(t[o+1]="๏ฟฟ",n[o+1]="๏ฟฟ",r[o+1]="A",i[o+1]="A"):p==="G"?(t[o+1]="๏ฟฟ",n[o+1]="G",r[o+1]="๏ฟฟ",i[o+1]="G"):(t[o+1]=p,n[o+1]=p,r[o+1]=p,i[o+1]=p),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Yl=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new e_(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new e_(e,r,this._items.map(i=>i.ruleId))}},e_=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
35
+ `)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Xh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},oO=class Wm{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Xh(t,8),this._embeddedLanguagesMatcher=new lO(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Wm._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Xh(0,0);_getBasicScopeAttributes=new OS(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Xh(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Wm.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},lO=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>DS(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},t_=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function US(e,t,n,r,i,o,l,d){const p=t.content.length;let f=!1,m=-1;if(l){const b=cO(e,t,n,r,i,o);i=b.stack,r=b.linePos,n=b.isFirstLine,m=b.anchorPosition}const g=Date.now();for(;!f;){if(d!==0&&Date.now()-g>d)return new t_(i,!0);y()}return new t_(i,!1);function y(){const b=uO(e,t,n,r,i,m);if(!b){o.produce(i,p),f=!0;return}const w=b.captureIndices,k=b.matchedRuleId,j=w&&w.length>0?w[0].end>r:!1;if(k===aO){const S=i.getRule(e);o.produce(i,w[0].start),i=i.withContentNameScopesList(i.nameScopesList),Cl(e,t,n,i,o,S.endCaptures,w),o.produce(i,w[0].end);const E=i;if(i=i.parent,m=E.getAnchorPos(),!j&&E.getEnterPos()===r){i=E,o.produce(i,p),f=!0;return}}else{const S=e.getRule(k);o.produce(i,w[0].start);const E=i,C=S.getName(t.content,w),z=i.contentNameScopesList.pushAttributed(C,e);if(i=i.push(k,r,m,w[0].end===p,null,z,z),S instanceof Zm){const D=S;Cl(e,t,n,i,o,D.beginCaptures,w),o.produce(i,w[0].end),m=w[0].end;const A=D.getContentName(t.content,w),P=z.pushAttributed(A,e);if(i=i.withContentNameScopesList(P),D.endHasBackReferences&&(i=i.withEndRule(D.getEndWithResolvedBackReferences(t.content,w))),!j&&E.hasSameRuleAs(i)){i=i.pop(),o.produce(i,p),f=!0;return}}else if(S instanceof Sd){const D=S;Cl(e,t,n,i,o,D.beginCaptures,w),o.produce(i,w[0].end),m=w[0].end;const A=D.getContentName(t.content,w),P=z.pushAttributed(A,e);if(i=i.withContentNameScopesList(P),D.whileHasBackReferences&&(i=i.withEndRule(D.getWhileWithResolvedBackReferences(t.content,w))),!j&&E.hasSameRuleAs(i)){i=i.pop(),o.produce(i,p),f=!0;return}}else if(Cl(e,t,n,i,o,S.captures,w),o.produce(i,w[0].end),i=i.pop(),!j){i=i.safePop(),o.produce(i,p),f=!0;return}}w[0].end>r&&(r=w[0].end,n=!1)}}function cO(e,t,n,r,i,o){let l=i.beginRuleCapturedEOL?0:-1;const d=[];for(let p=i;p;p=p.pop()){const f=p.getRule(e);f instanceof Sd&&d.push({rule:f,stack:p})}for(let p=d.pop();p;p=d.pop()){const{ruleScanner:f,findOptions:m}=pO(p.rule,e,p.stack.endRule,n,r===l),g=f.findNextMatchSync(t,r,m);if(g){if(g.ruleId!==BS){i=p.stack.pop();break}g.captureIndices&&g.captureIndices.length&&(o.produce(p.stack,g.captureIndices[0].start),Cl(e,t,n,p.stack,o,p.rule.whileCaptures,g.captureIndices),o.produce(p.stack,g.captureIndices[0].end),l=g.captureIndices[0].end,g.captureIndices[0].end>r&&(r=g.captureIndices[0].end,n=!1))}else{i=p.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:l,isFirstLine:n}}function uO(e,t,n,r,i,o){const l=dO(e,t,n,r,i,o),d=e.getInjections();if(d.length===0)return l;const p=fO(d,e,t,n,r,i,o);if(!p)return l;if(!l)return p;const f=l.captureIndices[0].start,m=p.captureIndices[0].start;return m<f||p.priorityMatch&&m===f?p:l}function dO(e,t,n,r,i,o){const l=i.getRule(e),{ruleScanner:d,findOptions:p}=HS(l,e,i.endRule,n,r===o),f=d.findNextMatchSync(t,r,p);return f?{captureIndices:f.captureIndices,matchedRuleId:f.ruleId}:null}function fO(e,t,n,r,i,o,l){let d=Number.MAX_VALUE,p=null,f,m=0;const g=o.contentNameScopesList.getScopeNames();for(let y=0,b=e.length;y<b;y++){const w=e[y];if(!w.matcher(g))continue;const k=t.getRule(w.ruleId),{ruleScanner:j,findOptions:S}=HS(k,t,null,r,i===l),E=j.findNextMatchSync(n,i,S);if(!E)continue;const C=E.captureIndices[0].start;if(!(C>=d)&&(d=C,p=E.captureIndices,f=E.ruleId,m=w.priority,d===i))break}return p?{priorityMatch:m===-1,captureIndices:p,matchedRuleId:f}:null}function HS(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function pO(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Cl(e,t,n,r,i,o,l){if(o.length===0)return;const d=t.content,p=Math.min(o.length,l.length),f=[],m=l[0].end;for(let g=0;g<p;g++){const y=o[g];if(y===null)continue;const b=l[g];if(b.length===0)continue;if(b.start>m)break;for(;f.length>0&&f[f.length-1].endPos<=b.start;)i.produceFromScopes(f[f.length-1].scopes,f[f.length-1].endPos),f.pop();if(f.length>0?i.produceFromScopes(f[f.length-1].scopes,b.start):i.produce(r,b.start),y.retokenizeCapturedWithRuleId){const k=y.getName(d,l),j=r.contentNameScopesList.pushAttributed(k,e),S=y.getContentName(d,l),E=j.pushAttributed(S,e),C=r.push(y.retokenizeCapturedWithRuleId,b.start,-1,!1,null,j,E),z=e.createOnigString(d.substring(0,b.end));US(e,z,n&&b.start===0,b.start,C,i,!1,0),IS(z);continue}const w=y.getName(d,l);if(w!==null){const j=(f.length>0?f[f.length-1].scopes:r.contentNameScopesList).pushAttributed(w,e);f.push(new hO(j,b.end))}}for(;f.length>0;)i.produceFromScopes(f[f.length-1].scopes,f[f.length-1].endPos),f.pop()}var hO=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function mO(e,t,n,r,i,o,l,d){return new xO(e,t,n,r,i,o,l,d)}function n_(e,t,n,r,i){const o=wd(t,jd),l=PS.getCompiledRuleId(n,r,i.repository);for(const d of o)e.push({debugSelector:t,matcher:d.matcher,ruleId:l,grammar:i,priority:d.priority})}function jd(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let i=n;i<t.length;i++)if(gO(t[i],r))return n=i+1,!0;return!1})}function gO(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var xO=class{constructor(e,t,n,r,i,o,l,d){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=d,this._basicScopeAttributesProvider=new oO(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=r_(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const p of Object.keys(i)){const f=wd(p,jd);for(const m of f)this._tokenTypeMatchers.push({matcher:m.matcher,type:i[p]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let l in i)n_(t,l,i[l],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(l=>{const d=this.getExternalGrammar(l);if(d){const p=d.injectionSelector;p&&n_(t,p,d,this,d)}})}return t.sort((i,o)=>i.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=r_(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=PS.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Jm.NULL){i=!0;const f=this._basicScopeAttributesProvider.getDefaultAttributes(),m=this.themeProvider.getDefaults(),g=so.set(0,f.languageId,f.tokenType,null,m.fontStyle,m.foregroundId,m.backgroundId),y=this.getRule(this._rootId).getName(null,null);let b;y?b=Ol.createRootAndLookUpScopeName(y,g,this):b=Ol.createRoot("unknown",g),t=new Jm(null,this._rootId,-1,-1,!1,null,b,b)}else i=!1,t.reset();e=e+`
36
+ `;const o=this.createOnigString(e),l=o.content.length,d=new bO(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),p=US(this,o,i,0,t,d,!0,r);return IS(o),{lineLength:l,lineTokens:d,ruleStack:p.stack,stoppedEarly:p.stoppedEarly}}};function r_(e,t){return e=zD(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Ol=class ea{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const o of n)i=Kh.push(i,o.scopeNames),r=new ea(r,i,o.encodedTokenAttributes);return r}static createRoot(t,n){return new ea(null,new Kh(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),o=new Kh(null,t),l=r.themeProvider.themeMatch(o),d=ea.mergeAttributes(n,i,l);return new ea(null,o,d)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return ea.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,o=0,l=0;return r!==null&&(i=r.fontStyle,o=r.foregroundId,l=r.backgroundId),so.set(t,n.languageId,n.tokenType,null,i,o,l)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return ea._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const o of r)i=ea._pushAttributed(i,o,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),o=t.scopePath.push(n),l=r.themeProvider.themeMatch(o),d=ea.mergeAttributes(t.tokenAttributes,i,l);return new ea(t,o,d)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Jm=class Ki{constructor(t,n,r,i,o,l,d,p){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=l,this.nameScopesList=d,this.contentNameScopesList=p,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new Ki(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Ki._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ol.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Ki._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,o,l,d){return new Ki(this,t,n,r,i,o,l,d)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Ki(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=Ol.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Ki(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ol.fromExtension(r,n.contentNameScopesList))}},yO=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):wd(n,jd).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>wd(n,jd).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},bO=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=e?.getScopeNames()??[];for(const l of this._tokenTypeOverrides)l.matcher(o)&&(r=so.set(r,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(r=so.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},vO=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,mO(e,o,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},_O=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new vO(_d.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(_d.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new yO(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,o){const l=new QD(this._syncRegistry,t);for(;l.Q.length>0;)l.Q.map(d=>this._loadSingleGrammar(d.scopeName)),l.processQueue();return this._grammarForScopeName(t,n,r,i,o)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,o)}},eg=Jm.NULL;function Nd(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[i]=o:i===r&&Object.assign(n,o);return n}function Si(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function wO(e){return Array.isArray(e)?e:[e]}async function qS(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Qd(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Vg(e){return e==="ansi"||Qd(e)}function Zd(e){return e==="none"}function VS(e){return Zd(e)}function Wd(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let o=0;o<n.length;o+=2){const l=t?n[o]+(n[o+1]||""):n[o];i.push([l,r]),r+=n[o].length,r+=n[o+1]?.length||0}return i}const a_={light:"#333333",dark:"#bbbbbb"},i_={light:"#fffffe",dark:"#1e1e1e"},s_="__shiki_resolved";function Gg(e){if(e?.[s_])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){const d=t.settings?t.settings.find(p=>!p.name&&!p.scope):void 0;d?.settings?.foreground&&(r=d.settings.foreground),d?.settings?.background&&(n=d.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?a_.light:a_.dark),n||(n=t.type==="light"?i_.light:i_.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const o=new Map;function l(d){if(o.has(d))return o.get(d);i+=1;const p=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${p}`]?l(d):(o.set(d,p),p)}t.settings=t.settings.map(d=>{const p=d.settings?.foreground&&!d.settings.foreground.startsWith("#"),f=d.settings?.background&&!d.settings.background.startsWith("#");if(!p&&!f)return d;const m={...d,settings:{...d.settings}};if(p){const g=l(d.settings.foreground);t.colorReplacements[g]=d.settings.foreground,m.settings.foreground=g}if(f){const g=l(d.settings.background);t.colorReplacements[g]=d.settings.background,m.settings.background=g}return m});for(const d of Object.keys(t.colors||{}))if((d==="editor.foreground"||d==="editor.background"||d.startsWith("terminal.ansi"))&&!t.colors[d]?.startsWith("#")){const p=l(t.colors[d]);t.colorReplacements[p]=t.colors[d],t.colors[d]=p}return Object.defineProperty(t,s_,{enumerable:!1,writable:!1,value:!0}),t}async function GS(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Vg(t)).map(async t=>await qS(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function YS(e){return(await Promise.all(e.map(async t=>VS(t)?null:Gg(await qS(t))))).filter(t=>!!t)}function KS(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Bt(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}var kO=class extends _O{_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=Gg(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=_d.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=KS(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,t.size)for(const i of t)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=Array.from(this._langGraph.entries()),n=t.filter(([r,i])=>!i);if(n.length){const r=t.filter(([i,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(l=>n.map(([d])=>d).includes(l)):!1).filter(i=>!n.includes(i));throw new Bt(`Missing languages ${n.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of t)this._resolver.addLanguage(i);for(const[r,i]of t)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},SO=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const i=t.slice(0,r).join(".");n=[...n,...this._injections.get(i)||[]]}return n}};let hl=0;function jO(e){hl+=1,e.warnings!==!1&&hl>=10&&hl%10===0&&console.warn(`[Shiki] ${hl} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Bt("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Gg),i=new kO(new SO(e.engine,n),r,n,e.langAlias);let o;function l(E){return KS(E,e.langAlias)}function d(E){j();const C=i.getGrammar(typeof E=="string"?E:E.name);if(!C)throw new Bt(`Language \`${E}\` not found, you may need to load it first`);return C}function p(E){if(E==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};j();const C=i.getTheme(E);if(!C)throw new Bt(`Theme \`${E}\` not found, you may need to load it first`);return C}function f(E){j();const C=p(E);return o!==E&&(i.setTheme(C),o=E),{theme:C,colorMap:i.getColorMap()}}function m(){return j(),i.getLoadedThemes()}function g(){return j(),i.getLoadedLanguages()}function y(...E){j(),i.loadLanguages(E.flat(1))}async function b(...E){return y(await GS(E))}function w(...E){j();for(const C of E.flat(1))i.loadTheme(C)}async function k(...E){return j(),w(await YS(E))}function j(){if(t)throw new Bt("Shiki instance has been disposed")}function S(){t||(t=!0,i.dispose(),hl-=1)}return{setTheme:f,getTheme:p,getLanguage:d,getLoadedThemes:m,getLoadedLanguages:g,resolveLangAlias:l,loadLanguage:b,loadLanguageSync:y,loadTheme:k,loadThemeSync:w,dispose:S,[Symbol.dispose]:S}}async function NO(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([YS(e.themes||[]),GS(e.langs||[]),e.engine]);return jO({...e,themes:t,langs:n,engine:r})}const XS=new WeakMap;function Jd(e,t){XS.set(e,t)}function Kl(e){return XS.get(e)}var ef=class QS{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new QS(Object.fromEntries(wO(n).map(r=>[r,eg])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return CO(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function CO(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const o=i?.nameScopesList?.scopeName;o&&t.push(o),i.parent&&r(i.parent)}return r(e),t}function EO(e,t){if(!(e instanceof ef))throw new Bt("Invalid grammar state");return e.getInternalStack(t)}function ZS(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(Qd(e.resolveLangAlias(n.lang||"text"))||Zd(r))return Wd(t).map(d=>[{content:d[0],offset:d[1]}]);const{theme:i,colorMap:o}=e.setTheme(r),l=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==l.name)throw new Bt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Bt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return TO(t,l,i,o,n)}function AO(...e){if(e.length===2)return Kl(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:o=t.getLoadedThemes()[0]}=r;if(Qd(i)||Zd(o))throw new Bt("Plain language does not have grammar state");if(i==="ansi")throw new Bt("ANSI language does not have grammar state");const{theme:l,colorMap:d}=t.setTheme(o),p=t.getLanguage(i);return new ef(Yg(n,p,l,d,r).stateStack,p.name,l.name)}function TO(e,t,n,r,i){const o=Yg(e,t,n,r,i),l=new ef(o.stateStack,t.name,n.name);return Jd(o.tokens,l),o.tokens}function Yg(e,t,n,r,i){const o=Nd(n,i),{tokenizeMaxLineLength:l=0,tokenizeTimeLimit:d=500}=i,p=Wd(e);let f=i.grammarState?EO(i.grammarState,n.name)??eg:i.grammarContextCode!=null?Yg(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:eg,m=[];const g=[];for(let y=0,b=p.length;y<b;y++){const[w,k]=p[y];if(w===""){m=[],g.push([]);continue}if(l>0&&w.length>=l){m=[],g.push([{content:w,offset:k,color:"",fontStyle:0}]);continue}let j,S,E;i.includeExplanation&&(j=t.tokenizeLine(w,f,d),S=j.tokens,E=0);const C=t.tokenizeLine2(w,f,d),z=C.tokens.length/2;for(let D=0;D<z;D++){const A=C.tokens[2*D],P=D+1<z?C.tokens[2*D+2]:w.length;if(A===P)continue;const T=C.tokens[2*D+1],F=Si(r[so.getForeground(T)],o),M=so.getFontStyle(T),G={content:w.substring(A,P),offset:k+A,color:F,fontStyle:M};if(i.includeExplanation){const Q=[];if(i.includeExplanation!=="scopeName")for(const $ of n.settings){let U;switch(typeof $.scope){case"string":U=$.scope.split(/,/).map(I=>I.trim());break;case"object":U=$.scope;break;default:continue}Q.push({settings:$,selectors:U.map(I=>I.split(/ /))})}G.explanation=[];let re=0;for(;A+re<P;){const $=S[E],U=w.substring($.startIndex,$.endIndex);re+=U.length,G.explanation.push({content:U,scopes:i.includeExplanation==="scopeName"?RO($.scopes):LO(Q,$.scopes)}),E+=1}}m.push(G)}g.push(m),m=[],f=C.ruleStack}return{tokens:g,stateStack:f}}function RO(e){return e.map(t=>({scopeName:t}))}function LO(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const o=t[r];n[r]={scopeName:o,themeMatches:OO(e,o,t.slice(0,r))}}return n}function o_(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function DO(e,t,n){if(!o_(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)o_(e[r],n[i])&&(r-=1),i-=1;return r===-1}function OO(e,t,n){const r=[];for(const{selectors:i,settings:o}of e)for(const l of i)if(DO(l,t,n)){r.push(o);break}return r}function WS(e,t,n,r=ZS){const i=Object.entries(n.themes).filter(f=>f[1]).map(f=>({color:f[0],theme:f[1]})),o=i.map(f=>{const m=r(e,t,{...n,theme:f.theme});return{tokens:m,state:Kl(m),theme:typeof f.theme=="string"?f.theme:f.theme.name}}),l=MO(...o.map(f=>f.tokens)),d=l[0].map((f,m)=>f.map((g,y)=>{const b={content:g.content,variants:{},offset:g.offset};return"includeExplanation"in n&&n.includeExplanation&&(b.explanation=g.explanation),l.forEach((w,k)=>{const{content:j,explanation:S,offset:E,...C}=w[m][y];b.variants[i[k].color]=C}),b})),p=o[0].state?new ef(Object.fromEntries(o.map(f=>[f.theme,f.state?.getInternalStack(f.theme)])),o[0].state.lang):void 0;return p&&Jd(d,p),d}function MO(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(p=>p[r]),o=t.map(()=>[]);t.forEach((p,f)=>p.push(o[f]));const l=i.map(()=>0),d=i.map(p=>p[0]);for(;d.every(p=>p);){const p=Math.min(...d.map(f=>f.content.length));for(let f=0;f<n;f++){const m=d[f];m.content.length===p?(o[f].push(m),l[f]+=1,d[f]=i[f][l[f]]):(o[f].push({...m,content:m.content.slice(0,p)}),d[f]={...m,content:m.content.slice(p),offset:m.offset+p})}}}return t}const zO=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],l_={}.hasOwnProperty;function IO(e,t){const n=t||{};function r(i,...o){let l=r.invalid;const d=r.handlers;if(i&&l_.call(i,e)){const p=String(i[e]);l=l_.call(d,p)?d[p]:r.unknown}if(l)return l.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const $O=/["&'<>`]/g,BO=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,PO=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,FO=/[|\\{}()[\]^$+*?.]/g,c_=new WeakMap;function UO(e,t){if(e=e.replace(t.subset?HO(t.subset):$O,r),t.subset||t.escapeOnly)return e;return e.replace(BO,n).replace(PO,r);function n(i,o,l){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,l.charCodeAt(o+2),t)}function r(i,o,l){return t.format(i.charCodeAt(0),l.charCodeAt(o+1),t)}}function HO(e){let t=c_.get(e);return t||(t=qO(e),c_.set(e,t)),t}function qO(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(FO,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const VO=/[\dA-Fa-f]/;function GO(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!VO.test(String.fromCharCode(t))?r:r+";"}const YO=/\d/;function KO(e,t,n){const r="&#"+String(e);return n&&t&&!YO.test(String.fromCharCode(t))?r:r+";"}const XO=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Qh={nbsp:"ย ",iexcl:"ยก",cent:"ยข",pound:"ยฃ",curren:"ยค",yen:"ยฅ",brvbar:"ยฆ",sect:"ยง",uml:"ยจ",copy:"ยฉ",ordf:"ยช",laquo:"ยซ",not:"ยฌ",shy:"ยญ",reg:"ยฎ",macr:"ยฏ",deg:"ยฐ",plusmn:"ยฑ",sup2:"ยฒ",sup3:"ยณ",acute:"ยด",micro:"ยต",para:"ยถ",middot:"ยท",cedil:"ยธ",sup1:"ยน",ordm:"ยบ",raquo:"ยป",frac14:"ยผ",frac12:"ยฝ",frac34:"ยพ",iquest:"ยฟ",Agrave:"ร€",Aacute:"ร",Acirc:"ร‚",Atilde:"รƒ",Auml:"ร„",Aring:"ร…",AElig:"ร†",Ccedil:"ร‡",Egrave:"รˆ",Eacute:"ร‰",Ecirc:"รŠ",Euml:"ร‹",Igrave:"รŒ",Iacute:"ร",Icirc:"รŽ",Iuml:"ร",ETH:"ร",Ntilde:"ร‘",Ograve:"ร’",Oacute:"ร“",Ocirc:"ร”",Otilde:"ร•",Ouml:"ร–",times:"ร—",Oslash:"ร˜",Ugrave:"ร™",Uacute:"รš",Ucirc:"ร›",Uuml:"รœ",Yacute:"ร",THORN:"รž",szlig:"รŸ",agrave:"ร ",aacute:"รก",acirc:"รข",atilde:"รฃ",auml:"รค",aring:"รฅ",aelig:"รฆ",ccedil:"รง",egrave:"รจ",eacute:"รฉ",ecirc:"รช",euml:"รซ",igrave:"รฌ",iacute:"รญ",icirc:"รฎ",iuml:"รฏ",eth:"รฐ",ntilde:"รฑ",ograve:"รฒ",oacute:"รณ",ocirc:"รด",otilde:"รต",ouml:"รถ",divide:"รท",oslash:"รธ",ugrave:"รน",uacute:"รบ",ucirc:"รป",uuml:"รผ",yacute:"รฝ",thorn:"รพ",yuml:"รฟ",fnof:"ฦ’",Alpha:"ฮ‘",Beta:"ฮ’",Gamma:"ฮ“",Delta:"ฮ”",Epsilon:"ฮ•",Zeta:"ฮ–",Eta:"ฮ—",Theta:"ฮ˜",Iota:"ฮ™",Kappa:"ฮš",Lambda:"ฮ›",Mu:"ฮœ",Nu:"ฮ",Xi:"ฮž",Omicron:"ฮŸ",Pi:"ฮ ",Rho:"ฮก",Sigma:"ฮฃ",Tau:"ฮค",Upsilon:"ฮฅ",Phi:"ฮฆ",Chi:"ฮง",Psi:"ฮจ",Omega:"ฮฉ",alpha:"ฮฑ",beta:"ฮฒ",gamma:"ฮณ",delta:"ฮด",epsilon:"ฮต",zeta:"ฮถ",eta:"ฮท",theta:"ฮธ",iota:"ฮน",kappa:"ฮบ",lambda:"ฮป",mu:"ฮผ",nu:"ฮฝ",xi:"ฮพ",omicron:"ฮฟ",pi:"ฯ€",rho:"ฯ",sigmaf:"ฯ‚",sigma:"ฯƒ",tau:"ฯ„",upsilon:"ฯ…",phi:"ฯ†",chi:"ฯ‡",psi:"ฯˆ",omega:"ฯ‰",thetasym:"ฯ‘",upsih:"ฯ’",piv:"ฯ–",bull:"โ€ข",hellip:"โ€ฆ",prime:"โ€ฒ",Prime:"โ€ณ",oline:"โ€พ",frasl:"โ„",weierp:"โ„˜",image:"โ„‘",real:"โ„œ",trade:"โ„ข",alefsym:"โ„ต",larr:"โ†",uarr:"โ†‘",rarr:"โ†’",darr:"โ†“",harr:"โ†”",crarr:"โ†ต",lArr:"โ‡",uArr:"โ‡‘",rArr:"โ‡’",dArr:"โ‡“",hArr:"โ‡”",forall:"โˆ€",part:"โˆ‚",exist:"โˆƒ",empty:"โˆ…",nabla:"โˆ‡",isin:"โˆˆ",notin:"โˆ‰",ni:"โˆ‹",prod:"โˆ",sum:"โˆ‘",minus:"โˆ’",lowast:"โˆ—",radic:"โˆš",prop:"โˆ",infin:"โˆž",ang:"โˆ ",and:"โˆง",or:"โˆจ",cap:"โˆฉ",cup:"โˆช",int:"โˆซ",there4:"โˆด",sim:"โˆผ",cong:"โ‰…",asymp:"โ‰ˆ",ne:"โ‰ ",equiv:"โ‰ก",le:"โ‰ค",ge:"โ‰ฅ",sub:"โŠ‚",sup:"โŠƒ",nsub:"โŠ„",sube:"โІ",supe:"โЇ",oplus:"โŠ•",otimes:"โŠ—",perp:"โŠฅ",sdot:"โ‹…",lceil:"โŒˆ",rceil:"โŒ‰",lfloor:"โŒŠ",rfloor:"โŒ‹",lang:"โŒฉ",rang:"โŒช",loz:"โ—Š",spades:"โ™ ",clubs:"โ™ฃ",hearts:"โ™ฅ",diams:"โ™ฆ",quot:'"',amp:"&",lt:"<",gt:">",OElig:"ล’",oelig:"ล“",Scaron:"ล ",scaron:"ลก",Yuml:"ลธ",circ:"ห†",tilde:"หœ",ensp:"โ€‚",emsp:"โ€ƒ",thinsp:"โ€‰",zwnj:"โ€Œ",zwj:"โ€",lrm:"โ€Ž",rlm:"โ€",ndash:"โ€“",mdash:"โ€”",lsquo:"โ€˜",rsquo:"โ€™",sbquo:"โ€š",ldquo:"โ€œ",rdquo:"โ€",bdquo:"โ€ž",dagger:"โ€ ",Dagger:"โ€ก",permil:"โ€ฐ",lsaquo:"โ€น",rsaquo:"โ€บ",euro:"โ‚ฌ"},QO=["cent","copy","divide","gt","lt","not","para","times"],JS={}.hasOwnProperty,tg={};let Bu;for(Bu in Qh)JS.call(Qh,Bu)&&(tg[Qh[Bu]]=Bu);const ZO=/[^\dA-Za-z]/;function WO(e,t,n,r){const i=String.fromCharCode(e);if(JS.call(tg,i)){const o=tg[i],l="&"+o;return n&&XO.includes(o)&&!QO.includes(o)&&(!r||t&&t!==61&&ZO.test(String.fromCharCode(t)))?l:l+";"}return""}function JO(e,t,n){let r=GO(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=WO(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=KO(e,t,n.omitOptionalSemicolons);o.length<r.length&&(r=o)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function no(e,t){return UO(e,Object.assign({format:JO},t))}const e6=/^>|^->|<!--|-->|--!>|<!-$/g,t6=[">"],n6=["<",">"];function r6(e,t,n,r){return r.settings.bogusComments?"<?"+no(e.value,Object.assign({},r.settings.characterReferences,{subset:t6}))+">":"<!--"+e.value.replace(e6,i)+"-->";function i(o){return no(o,Object.assign({},r.settings.characterReferences,{subset:n6}))}}function a6(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Cd(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const yn=t4(1),e4=t4(-1),i6=[];function t4(e){return t;function t(n,r,i){const o=n?n.children:i6;let l=(r||0)+e,d=o[l];if(!i)for(;d&&Xd(d);)l+=e,d=o[l];return d}}const s6={}.hasOwnProperty;function n4(e){return t;function t(n,r,i){return s6.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const Kg=n4({body:l6,caption:Zh,colgroup:Zh,dd:f6,dt:d6,head:Zh,html:o6,li:u6,optgroup:p6,option:h6,p:c6,rp:u_,rt:u_,tbody:g6,td:d_,tfoot:x6,th:d_,thead:m6,tr:y6});function Zh(e,t,n){const r=yn(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Xd(r.value.charAt(0)))}function o6(e,t,n){const r=yn(n,t);return!r||r.type!=="comment"}function l6(e,t,n){const r=yn(n,t);return!r||r.type!=="comment"}function c6(e,t,n){const r=yn(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function u6(e,t,n){const r=yn(n,t);return!r||r.type==="element"&&r.tagName==="li"}function d6(e,t,n){const r=yn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function f6(e,t,n){const r=yn(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function u_(e,t,n){const r=yn(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function p6(e,t,n){const r=yn(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function h6(e,t,n){const r=yn(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function m6(e,t,n){const r=yn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function g6(e,t,n){const r=yn(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function x6(e,t,n){return!yn(n,t)}function y6(e,t,n){const r=yn(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function d_(e,t,n){const r=yn(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const b6=n4({body:w6,colgroup:k6,head:_6,html:v6,tbody:S6});function v6(e){const t=yn(e,-1);return!t||t.type!=="comment"}function _6(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function w6(e){const t=yn(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Xd(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function k6(e,t,n){const r=e4(n,t),i=yn(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Kg(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function S6(e,t,n){const r=e4(n,t),i=yn(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Kg(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Pu={name:[[`
37
+ \f\r &/=>`.split(""),`
38
+ \f\r "&'/=>\``.split("")],[`\0
39
+ \f\r "&'/<=>`.split(""),`\0
40
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
41
+ \f\r &>`.split(""),`\0
42
+ \f\r "&'<=>\``.split("")],[`\0
43
+ \f\r "&'<=>\``.split(""),`\0
44
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function j6(e,t,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let l=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const d=[];let p;i.space==="html"&&e.tagName==="svg"&&(r.schema=fc);const f=N6(r,e.properties),m=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,m&&(l=!1),(f||!o||!b6(e,t,n))&&(d.push("<",e.tagName,f?" "+f:""),l&&(i.space==="svg"||r.settings.closeSelfClosing)&&(p=f.charAt(f.length-1),(!r.settings.tightSelfClosing||p==="/"||p&&p!=='"'&&p!=="'")&&d.push(" "),d.push("/")),d.push(">")),d.push(m),!l&&(!o||!Kg(e,t,n))&&d.push("</"+e.tagName+">"),d.join("")}function N6(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const o=C6(e,i,t[i]);o&&n.push(o)}}for(;++r<n.length;){const o=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&o!=='"'&&o!=="'"&&(n[r]+=" ")}return n.join("")}function C6(e,t,n){const r=bS(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,o=e.settings.allowDangerousCharacters?0:1;let l=e.quote,d;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const p=no(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Pu.name[i][o]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?dS:_S)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?p:(e.settings.preferUnquoted&&(d=no(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Pu.unquoted[i][o]}))),d!==n&&(e.settings.quoteSmart&&Cd(n,l)>Cd(n,e.alternative)&&(l=e.alternative),d=l+no(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?Pu.single:Pu.double)[i][o],attribute:!0}))+l),p+(d&&"="+d))}const E6=["<","&"];function r4(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:no(e.value,Object.assign({},r.settings.characterReferences,{subset:E6}))}function A6(e,t,n,r){return r.settings.allowDangerousHtml?e.value:r4(e,t,n,r)}function T6(e,t,n,r){return r.all(e)}const R6=IO("type",{invalid:L6,unknown:D6,handlers:{comment:r6,doctype:a6,element:j6,raw:A6,root:T6,text:r4}});function L6(e){throw new Error("Expected node, not `"+e+"`")}function D6(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const O6={},M6={},z6=[];function I6(e,t){const n=t||O6,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:$6,all:B6,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||zO,characterReferences:n.characterReferences||M6,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?fc:vS,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function $6(e,t,n){return R6(e,t,n,this)}function B6(e){const t=[],n=e&&e.children||z6;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function a4(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function P6(e){const t=Wd(e,!0).map(([i])=>i);function n(i){if(i===e.length)return{line:t.length-1,character:t[t.length-1].length};let o=i,l=0;for(const d of t){if(o<d.length)break;o-=d.length,l++}return{line:l,character:o}}function r(i,o){let l=0;for(let d=0;d<i;d++)l+=t[d].length;return l+=o,l}return{lines:t,indexToPos:n,posToIndex:r}}function i4(e,t,n){const r=new Set;for(const o of e.matchAll(/:?lang=["']([^"']+)["']/g)){const l=o[1].toLowerCase().trim();l&&r.add(l)}for(const o of e.matchAll(/(?:```|~~~)([\w-]+)/g)){const l=o[1].toLowerCase().trim();l&&r.add(l)}for(const o of e.matchAll(/\\begin\{([\w-]+)\}/g)){const l=o[1].toLowerCase().trim();l&&r.add(l)}for(const o of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){const l=o[1].toLowerCase().trim(),d=l.includes("/")?l.split("/").pop():l;d&&r.add(d)}if(!n)return Array.from(r);const i=n.getBundledLanguages();return Array.from(r).filter(o=>o&&i[o])}const Xg="light-dark()",F6=["color","background-color"];function U6(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function H6(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((r,i)=>r-i);return n.length?e.map(r=>r.flatMap(i=>{const o=n.filter(l=>i.offset<l&&l<i.offset+i.content.length).map(l=>l-i.offset).sort((l,d)=>l-d);return o.length?U6(i,o):i})):e}function q6(e,t,n,r,i="css-vars"){const o={content:e.content,explanation:e.explanation,offset:e.offset},l=t.map(m=>Ed(e.variants[m])),d=new Set(l.flatMap(m=>Object.keys(m))),p={},f=(m,g)=>{const y=g==="color"?"":g==="background-color"?"-bg":`-${g}`;return n+t[m]+(g==="color"?"":y)};return l.forEach((m,g)=>{for(const y of d){const b=m[y]||"inherit";if(g===0&&r&&F6.includes(y))if(r===Xg&&l.length>1){const w=t.findIndex(j=>j==="light"),k=t.findIndex(j=>j==="dark");if(w===-1||k===-1)throw new Bt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');p[y]=`light-dark(${l[w][y]||"inherit"}, ${l[k][y]||"inherit"})`,i==="css-vars"&&(p[f(g,y)]=b)}else p[y]=b;else i==="css-vars"&&(p[f(g,y)]=b)}}),o.htmlStyle=p,o}function Ed(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Mn.Italic&&(t["font-style"]="italic"),e.fontStyle&Mn.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Mn.Underline&&n.push("underline"),e.fontStyle&Mn.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function ng(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function V6(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let i=function(l){if(typeof l=="number"){if(l<0||l>n.source.length)throw new Bt(`Invalid decoration offset: ${l}. Code length: ${n.source.length}`);return{...r.indexToPos(l),offset:l}}else{const d=r.lines[l.line];if(d===void 0)throw new Bt(`Invalid decoration position ${JSON.stringify(l)}. Lines length: ${r.lines.length}`);let p=l.character;if(p<0&&(p=d.length+p),p<0||p>d.length)throw new Bt(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${d.length}`);return{...l,character:p,offset:r.posToIndex(l.line,p)}}};const r=P6(n.source),o=(n.options.decorations||[]).map(l=>({...l,start:i(l.start),end:i(l.end)}));G6(o),e.set(n.meta,{decorations:o,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return H6(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;const r=t(this),i=Array.from(n.children).filter(m=>m.type==="element"&&m.tagName==="span");if(i.length!==r.converter.lines.length)throw new Bt(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function o(m,g,y,b){const w=i[m];let k="",j=-1,S=-1;if(g===0&&(j=0),y===0&&(S=0),y===Number.POSITIVE_INFINITY&&(S=w.children.length),j===-1||S===-1)for(let C=0;C<w.children.length;C++)k+=s4(w.children[C]),j===-1&&k.length===g&&(j=C+1),S===-1&&k.length===y&&(S=C+1);if(j===-1)throw new Bt(`Failed to find start index for decoration ${JSON.stringify(b.start)}`);if(S===-1)throw new Bt(`Failed to find end index for decoration ${JSON.stringify(b.end)}`);const E=w.children.slice(j,S);if(!b.alwaysWrap&&E.length===w.children.length)d(w,b,"line");else if(!b.alwaysWrap&&E.length===1&&E[0].type==="element")d(E[0],b,"token");else{const C={type:"element",tagName:"span",properties:{},children:E};d(C,b,"wrapper"),w.children.splice(j,E.length,C)}}function l(m,g){i[m]=d(i[m],g,"line")}function d(m,g,y){const b=g.properties||{},w=g.transform||(k=>k);return m.tagName=g.tagName||"span",m.properties={...m.properties,...b,class:m.properties.class},g.properties?.class&&a4(m,g.properties.class),m=w(m,y)||m,m}const p=[],f=r.decorations.sort((m,g)=>g.start.offset-m.start.offset||m.end.offset-g.end.offset);for(const m of f){const{start:g,end:y}=m;if(g.line===y.line)o(g.line,g.character,y.character,m);else if(g.line<y.line){o(g.line,g.character,Number.POSITIVE_INFINITY,m);for(let b=g.line+1;b<y.line;b++)p.unshift(()=>l(b,m));o(y.line,0,y.character,m)}}p.forEach(m=>m())}}}function G6(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Bt(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],o=n.start.offset<=i.start.offset&&i.start.offset<n.end.offset,l=n.start.offset<i.end.offset&&i.end.offset<=n.end.offset,d=i.start.offset<=n.start.offset&&n.start.offset<i.end.offset,p=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(o||l||d||p){if(o&&l||d&&p||d&&n.start.offset===n.end.offset||l&&i.start.offset===i.end.offset)continue;throw new Bt(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function s4(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(s4).join(""):""}const Y6=[V6()];function Ad(e){const t=K6(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Y6]}function K6(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Zi=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Wh={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function X6(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function f_(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Q6(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)Wh[r]&&t.push({type:"setDecoration",value:Wh[r]});else if(r<=29){const i=Wh[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Zi[r-30]}});else if(r===38){const i=f_(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Zi[r-40]}});else if(r===48){const i=f_(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Zi[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Zi[r-100+8]}})}return t}function Z6(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let o=0;do{const l=X6(r,o),d=l.sequence?r.substring(o,l.startPosition):r.substring(o);if(d.length>0&&i.push({value:d,foreground:e,background:t,decorations:new Set(n)}),l.sequence){const p=Q6(l.sequence);for(const f of p)f.type==="resetAll"?(e=null,t=null,n.clear()):f.type==="resetForegroundColor"?e=null:f.type==="resetBackgroundColor"?t=null:f.type==="resetDecoration"&&n.delete(f.value);for(const f of p)f.type==="setForegroundColor"?e=f.value:f.type==="setBackgroundColor"?t=f.value:f.type==="setDecoration"&&n.add(f.value)}o=l.position}while(o<r.length);return i}}}var W6={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function J6(e=W6){function t(d){return e[d]}function n(d){return`#${d.map(p=>Math.max(0,Math.min(p,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let f=0;f<Zi.length;f++)r.push(t(Zi[f]));let d=[0,95,135,175,215,255];for(let f=0;f<6;f++)for(let m=0;m<6;m++)for(let g=0;g<6;g++)r.push(n([d[f],d[m],d[g]]));let p=8;for(let f=0;f<24;f++,p+=10)r.push(n([p,p,p]));return r}function o(d){return i()[d]}function l(d){switch(d.type){case"named":return t(d.name);case"rgb":return n(d.rgb);case"table":return o(d.index)}}return{value:l}}const eM={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function tM(e,t,n){const r=Nd(e,n),i=Wd(t),o=J6(Object.fromEntries(Zi.map(d=>{const p=`terminal.ansi${d[0].toUpperCase()}${d.substring(1)}`;return[d,e.colors?.[p]||eM[d]]}))),l=Z6();return i.map(d=>l.parse(d[0]).map(p=>{let f,m;p.decorations.has("reverse")?(f=p.background?o.value(p.background):e.bg,m=p.foreground?o.value(p.foreground):e.fg):(f=p.foreground?o.value(p.foreground):e.fg,m=p.background?o.value(p.background):void 0),f=Si(f,r),m=Si(m,r),p.decorations.has("dim")&&(f=nM(f));let g=Mn.None;return p.decorations.has("bold")&&(g|=Mn.Bold),p.decorations.has("italic")&&(g|=Mn.Italic),p.decorations.has("underline")&&(g|=Mn.Underline),p.decorations.has("strikethrough")&&(g|=Mn.Strikethrough),{content:p.value,offset:d[1],color:f,bgColor:m,fontStyle:g}}))}function nM(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],o=r[1],l=r[2],d=r[3];return`#${i}${i}${o}${o}${l}${l}${Math.round(Number.parseInt(`${d}${d}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const i=r[0],o=r[1],l=r[2];return`#${i}${i}${o}${o}${l}${l}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function rg(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:i=e.getLoadedThemes()[0]}=n;if(!Qd(r)&&!Zd(i)&&r==="ansi"){const{theme:o}=e.setTheme(i);return tM(o,t,n)}return ZS(e,t,n)}function Td(e,t,n){let r,i,o,l,d,p;if("themes"in n){const{defaultColor:f="light",cssVariablePrefix:m="--shiki-",colorsRendering:g="css-vars"}=n,y=Object.entries(n.themes).filter(S=>S[1]).map(S=>({color:S[0],theme:S[1]})).sort((S,E)=>S.color===f?-1:E.color===f?1:0);if(y.length===0)throw new Bt("`themes` option must not be empty");const b=WS(e,t,n,rg);if(p=Kl(b),f&&Xg!==f&&!y.find(S=>S.color===f))throw new Bt(`\`themes\` option must contain the defaultColor key \`${f}\``);const w=y.map(S=>e.getTheme(S.theme)),k=y.map(S=>S.color);o=b.map(S=>S.map(E=>q6(E,k,m,f,g))),p&&Jd(o,p);const j=y.map(S=>Nd(S.theme,n));i=p_(y,w,j,m,f,"fg",g),r=p_(y,w,j,m,f,"bg",g),l=`shiki-themes ${w.map(S=>S.name).join(" ")}`,d=f?void 0:[i,r].join(";")}else if("theme"in n){const f=Nd(n.theme,n);o=rg(e,t,n);const m=e.getTheme(n.theme);r=Si(m.bg,f),i=Si(m.fg,f),l=m.name,p=Kl(o)}else throw new Bt("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:i,bg:r,themeName:l,rootStyle:d,grammarState:p}}function p_(e,t,n,r,i,o,l){return e.map((d,p)=>{const f=Si(t[p][o],n[p])||"inherit",m=`${r+d.color}${o==="bg"?"-bg":""}:${f}`;if(p===0&&i){if(i===Xg&&e.length>1){const g=e.findIndex(b=>b.color==="light"),y=e.findIndex(b=>b.color==="dark");if(g===-1||y===-1)throw new Bt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Si(t[g][o],n[g])||"inherit"}, ${Si(t[y][o],n[y])||"inherit"});${m}`}return f}return l==="css-vars"?m:null}).filter(d=>!!d).join(";")}function Rd(e,t,n,r={meta:{},options:n,codeToHast:(i,o)=>Rd(e,i,o),codeToTokens:(i,o)=>Td(e,i,o)}){let i=t;for(const w of Ad(n))i=w.preprocess?.call(r,i,n)||i;let{tokens:o,fg:l,bg:d,themeName:p,rootStyle:f,grammarState:m}=Td(e,i,n);const{mergeWhitespaces:g=!0,mergeSameStyleTokens:y=!1}=n;g===!0?o=aM(o):g==="never"&&(o=iM(o)),y&&(o=sM(o));const b={...r,get source(){return i}};for(const w of Ad(n))o=w.tokens?.call(b,o)||o;return rM(o,{...n,fg:l,bg:d,themeName:p,rootStyle:n.rootStyle===!1?!1:n.rootStyle??f},b,m)}function rM(e,t,n,r=Kl(e)){const i=Ad(t),o=[],l={type:"root",children:[]},{structure:d="classic",tabindex:p="0"}=t,f={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?f.style=t.rootStyle:f.style=`background-color:${t.bg};color:${t.fg}`),p!==!1&&p!=null&&(f.tabindex=p.toString());for(const[k,j]of Object.entries(t.meta||{}))k.startsWith("_")||(f[k]=j);let m={type:"element",tagName:"pre",properties:f,children:[],data:t.data},g={type:"element",tagName:"code",properties:{},children:o};const y=[],b={...n,structure:d,addClassToHast:a4,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return l},get pre(){return m},get code(){return g},get lines(){return y}};if(e.forEach((k,j)=>{j&&(d==="inline"?l.children.push({type:"element",tagName:"br",properties:{},children:[]}):d==="classic"&&o.push({type:"text",value:`
45
+ `}));let S={type:"element",tagName:"span",properties:{class:"line"},children:[]},E=0;for(const C of k){let z={type:"element",tagName:"span",properties:{...C.htmlAttrs},children:[{type:"text",value:C.content}]};const D=ng(C.htmlStyle||Ed(C));D&&(z.properties.style=D);for(const A of i)z=A?.span?.call(b,z,j+1,E,S,C)||z;d==="inline"?l.children.push(z):d==="classic"&&S.children.push(z),E+=C.content.length}if(d==="classic"){for(const C of i)S=C?.line?.call(b,S,j+1)||S;y.push(S),o.push(S)}else d==="inline"&&y.push(S)}),d==="classic"){for(const k of i)g=k?.code?.call(b,g)||g;m.children.push(g);for(const k of i)m=k?.pre?.call(b,m)||m;l.children.push(m)}else if(d==="inline"){const k=[];let j={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const E of l.children)E.type==="element"&&E.tagName==="br"?(k.push(j),j={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(E.type==="element"||E.type==="text")&&j.children.push(E);k.push(j);let S={type:"element",tagName:"code",properties:{},children:k};for(const E of i)S=E?.code?.call(b,S)||S;l.children=[];for(let E=0;E<S.children.length;E++){E>0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]});const C=S.children[E];C.type==="element"&&l.children.push(...C.children)}}let w=l;for(const k of i)w=k?.root?.call(b,w)||w;return r&&Jd(w,r),w}function aM(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((o,l)=>{const d=!(o.fontStyle&&(o.fontStyle&Mn.Underline||o.fontStyle&Mn.Strikethrough));d&&o.content.match(/^\s+$/)&&t[l+1]?(i===void 0&&(i=o.offset),r+=o.content):r?(d?n.push({...o,offset:i,content:r+o.content}):n.push({content:r,offset:i},o),i=void 0,r=""):n.push(o)}),n})}function iM(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,o,l]=r;if(!i&&!l)return n;const d=[{...n,offset:n.offset+i.length,content:o}];return i&&d.unshift({content:i,offset:n.offset}),l&&d.push({content:l,offset:n.offset+i.length+o.length}),d}))}function sM(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n[n.length-1],o=ng(i.htmlStyle||Ed(i)),l=ng(r.htmlStyle||Ed(r)),d=i.fontStyle&&(i.fontStyle&Mn.Underline||i.fontStyle&Mn.Strikethrough),p=r.fontStyle&&(r.fontStyle&Mn.Underline||r.fontStyle&Mn.Strikethrough);!d&&!p&&o===l?i.content+=r.content:n.push({...r})}return n})}const oM=I6;function lM(e,t,n){const r={meta:{},options:n,codeToHast:(o,l)=>Rd(e,o,l),codeToTokens:(o,l)=>Td(e,o,l)};let i=oM(Rd(e,t,n,r));for(const o of Ad(n))i=o.postprocess?.call(r,i,n)||i;return i}async function cM(e){const t=await NO(e);return{getLastGrammarState:(...n)=>AO(t,...n),codeToTokensBase:(n,r)=>rg(t,n,r),codeToTokensWithThemes:(n,r)=>WS(t,n,r),codeToTokens:(n,r)=>Td(t,n,r),codeToHast:(n,r)=>Rd(t,n,r),codeToHtml:(n,r)=>lM(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function uM(e){const t=e.langs,n=e.themes,r=e.engine;async function i(o){function l(g){if(typeof g=="string"){if(g=o.langAlias?.[g]||g,Vg(g))return[];const y=t[g];if(!y)throw new Bt(`Language \`${g}\` is not included in this bundle. You may want to load it from external source.`);return y}return g}function d(g){if(VS(g))return"none";if(typeof g=="string"){const y=n[g];if(!y)throw new Bt(`Theme \`${g}\` is not included in this bundle. You may want to load it from external source.`);return y}return g}const p=(o.themes??[]).map(g=>d(g)),f=(o.langs??[]).map(g=>l(g)),m=await cM({engine:o.engine??r(),...o,themes:p,langs:f});return{...m,loadLanguage(...g){return m.loadLanguage(...g.map(l))},loadTheme(...g){return m.loadTheme(...g.map(d))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function dM(e){let t;async function n(r={}){if(t){const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}else{t=e({...r,themes:[],langs:[]});const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}}return n}function fM(e,t){const n=dM(e);async function r(i,o){const l=await n({langs:[o.lang],themes:"theme"in o?[o.theme]:Object.values(o.themes)}),d=await t?.guessEmbeddedLanguages?.(i,o.lang,l);return d&&await l.loadLanguage(...d),l}return{getSingletonHighlighter(i){return n(i)},async codeToHtml(i,o){return(await r(i,o)).codeToHtml(i,o)},async codeToHast(i,o){return(await r(i,o)).codeToHast(i,o)},async codeToTokens(i,o){return(await r(i,o)).codeToTokens(i,o)},async codeToTokensBase(i,o){return(await r(i,o)).codeToTokensBase(i,o)},async codeToTokensWithThemes(i,o){return(await r(i,o)).codeToTokensWithThemes(i,o)},async getLastGrammarState(i,o){return(await n({langs:[o.lang],themes:[o.theme]})).getLastGrammarState(i,o)}}}var h_=Object.prototype.hasOwnProperty;function m_(e,t,n){for(n of e.keys())if(Ml(n,t))return n}function Ml(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Ml(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i=="object"&&(i=m_(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i=="object"&&(i=m_(t,i),!i)||!Ml(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(h_.call(e,n)&&++r&&!h_.call(t,n)||!(n in t)||!Ml(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const tf=(function(e){if(e==null)return gM;if(typeof e=="function")return nf(e);if(typeof e=="object")return Array.isArray(e)?pM(e):hM(e);if(typeof e=="string")return mM(e);throw new Error("Expected function, string, or object as test")});function pM(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=tf(e[n]);return nf(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function hM(e){const t=e;return nf(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function mM(e){return nf(t);function t(n){return n&&n.type===e}}function nf(e){return t;function t(n,r,i){return!!(xM(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function gM(){return!0}function xM(e){return e!==null&&typeof e=="object"&&"type"in e}const o4=[],yM=!0,ag=!1,bM="skip";function l4(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=tf(i),l=r?-1:1;d(e,void 0,[])();function d(p,f,m){const g=p&&typeof p=="object"?p:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(p.type+(b?"<"+b+">":""))+")"})}return y;function y(){let b=o4,w,k,j;if((!t||o(p,f,m[m.length-1]||void 0))&&(b=vM(n(p,m)),b[0]===ag))return b;if("children"in p&&p.children){const S=p;if(S.children&&b[0]!==bM)for(k=(r?S.children.length:-1)+l,j=m.concat(S);k>-1&&k<S.children.length;){const E=S.children[k];if(w=d(E,k,j)(),w[0]===ag)return w;k=typeof w[1]=="number"?w[1]:k+l}}return b}}}function vM(e){return Array.isArray(e)?e:typeof e=="number"?[yM,e]:e==null?o4:[e]}function Qg(e,t,n,r){let i,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,i=n):(o=t,l=n,i=r),l4(e,o,d,i);function d(p,f){const m=f[f.length-1],g=m?m.children.indexOf(p):void 0;return l(p,g,m)}}function c4(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=c4(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function g_(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=c4(e))&&(r&&(r+=" "),r+=t);return r}var Jh=e=>{const t=_.useRef(e);return e!==t.current&&!Ml(e,t.current)&&(t.current=e),t.current},_M=(e,t,n)=>{const r=Date.now();clearTimeout(t.current.timeoutId);const i=Math.max(0,t.current.nextAllowedTime-r);t.current.timeoutId=setTimeout(()=>{e().catch(console.error),t.current.nextAllowedTime=r+n},i)},u4="plaintext",x_=e=>e==null?[]:Array.isArray(e)?e:[e],wM=e=>e==null?null:typeof e=="string"?`s:${e}`:`o:${e.name}::${e.scopeName}`,y_=e=>{const t=new Set,n=[];for(const r of e){const i=wM(r);i==null||t.has(i)||(t.add(i),n.push(r))}return n},kM=(e,t)=>e==null?!1:typeof e=="string"?e in t:typeof e.name=="string"&&typeof e.scopeName=="string",SM=(e,t)=>Vg(e)||t.includes(e)?e:u4,jM=(e,t,n,r)=>{const i=x_(t),o=x_(r),l=[...i,...o];let d=u4,p;if(e==null||typeof e=="string"&&!e.trim())return{languageId:d,langsToLoad:y_([...o,...i])};if(typeof e=="object")d=e.name,p=e;else{const f=e.toLowerCase(),m=y=>y?.toLowerCase()===f,g=l.find(y=>typeof y=="object"&&y!=null&&!!(m(y.name)||m(y.scopeName)||m(y.scopeName?.split(".").pop())||y.aliases?.some(m)||y.fileTypes?.some(m)));g?(d=g.name||e,p=g):n?.[e]?(d=n[e],p=n[e]):(d=e,p=e)}return{languageId:d,langsToLoad:y_([p,...o,...i])}},b_=e=>typeof e=="object"&&e!==null&&"tokenColors"in e&&Array.isArray(e.tokenColors);function NM(e){const t=b_(e),n=typeof e=="object"&&e!==null&&!t,r=typeof e=="object"&&e!==null&&!t&&Object.entries(e).some(([i,o])=>i.trim()!==""&&(typeof o=="string"&&o.trim()!==""||b_(o)));return n?{isMultiTheme:!0,themeId:r?`multi-${Object.values(e).map(o=>(typeof o=="string"?o:o?.name)||"custom").sort().join("-")}`:"multi-default",multiTheme:r?e:null,themesToLoad:r?Object.values(e):[]}:{isMultiTheme:!1,themeId:typeof e=="string"?e:e?.name||"custom",singleTheme:e,themesToLoad:[e]}}function CM(e=1){return{name:"react-shiki:line-numbers",code(t){if(this.addClassToHast(t,"has-line-numbers"),e!==1){const n=t.properties?.style||"",r=n?`${n}; --line-start: ${e}`:`--line-start: ${e}`;t.properties={...t.properties,style:r}}},line(t){return this.addClassToHast(t,"line-numbers"),t}}}var v_={light:"github-light",dark:"github-dark"},EM=(e,t)=>e.isMultiTheme?{themes:e.multiTheme??v_,defaultColor:t.defaultColor,cssVariablePrefix:t.cssVariablePrefix}:{theme:e.singleTheme??v_.dark},AM=e=>{const t=[...e.transformers||[]];return e.showLineNumbers&&t.push(CM(e.startingLineNumber)),t},TM=({languageId:e,resolvedTheme:t,options:n})=>{const{defaultColor:r,cssVariablePrefix:i,showLineNumbers:o,startingLineNumber:l,transformers:d,...p}=n;return{lang:e,...EM(t,n),...p,transformers:AM(n)}},RM=(e,t,n)=>{const r=n.getBundledLanguages();return i4(e).flatMap(i=>r[i]??[])},LM=(e,t,n,r={},i)=>{const[o,l]=_.useState(null),d=Jh(t),p=Jh(n),f=Jh(r),{languageId:m,langsToLoad:g}=_.useMemo(()=>jM(d,f.customLanguages,f.langAlias,f.preloadLanguages),[d,f.customLanguages,f.preloadLanguages,f.langAlias]),y=_.useMemo(()=>NM(p),[p]),{themesToLoad:b}=y,w=_.useRef({nextAllowedTime:0,timeoutId:void 0}),k=_.useMemo(()=>TM({languageId:m,resolvedTheme:y,options:f}),[m,y,f]);return _.useEffect(()=>{let j=!0;const S=async()=>{if(!m)return;const C=f.highlighter?f.highlighter:await i(g,b,f.engine);if(!f.highlighter){const A=RM(e,m,C);A.length>0&&await C.loadLanguage(...A)}const z=SM(m,C.getLoadedLanguages()),D={...k,lang:z};if(j){const A=f.outputFormat==="html"?C.codeToHtml(e,D):jS(C.codeToHast(e,D),{jsx:u.jsx,jsxs:u.jsxs,Fragment:u.Fragment});l(A)}},{delay:E}=f;return E?_M(S,w,E):S().catch(console.error),()=>{j=!1,clearTimeout(w.current.timeoutId)}},[e,k,f.delay,f.highlighter,g,b]),o};function DM(e,{insertAt:t}={}){if(typeof document>"u")return;const n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}DM(`.relative {
46
+ position: relative;
47
+ }
48
+ .defaultStyles pre {
49
+ overflow: auto;
50
+ border-radius: 0.5rem;
51
+ padding-left: 1.5rem;
52
+ padding-right: 1.5rem;
53
+ padding-top: 1.25rem;
54
+ padding-bottom: 1.25rem;
55
+ }
56
+ .languageLabel {
57
+ position: absolute;
58
+ right: 0.75rem;
59
+ top: 0.5rem;
60
+ font-family: monospace;
61
+ font-size: 0.75rem;
62
+ letter-spacing: -0.05em;
63
+ color: rgba(107, 114, 128, 0.85);
64
+ }
65
+ .line-numbers::before {
66
+ counter-increment: line-number;
67
+ content: counter(line-number);
68
+ display: inline-flex;
69
+ justify-content: flex-end;
70
+ align-items: flex-start;
71
+ box-sizing: content-box;
72
+ min-width: var(--line-numbers-width, 2ch);
73
+ padding-left: var(--line-numbers-padding-left, 2ch);
74
+ padding-right: var(--line-numbers-padding-right, 2ch);
75
+ color: var(--line-numbers-foreground, rgba(107, 114, 128, 0.6));
76
+ font-size: var(--line-numbers-font-size, inherit);
77
+ font-weight: var(--line-numbers-font-weight, inherit);
78
+ line-height: var(--line-numbers-line-height, inherit);
79
+ font-family: var(--line-numbers-font-family, inherit);
80
+ opacity: var(--line-numbers-opacity, 1);
81
+ user-select: none;
82
+ pointer-events: none;
83
+ }
84
+ .has-line-numbers {
85
+ counter-reset: line-number calc(var(--line-start, 1) - 1);
86
+ --line-numbers-foreground: rgba(107, 114, 128, 0.5);
87
+ --line-numbers-width: 2ch;
88
+ --line-numbers-padding-left: 0ch;
89
+ --line-numbers-padding-right: 2ch;
90
+ --line-numbers-font-size: inherit;
91
+ --line-numbers-font-weight: inherit;
92
+ --line-numbers-line-height: inherit;
93
+ --line-numbers-font-family: inherit;
94
+ --line-numbers-opacity: 1;
95
+ }
96
+ `);var OM=e=>_.forwardRef(({language:t,theme:n,delay:r,transformers:i,defaultColor:o,cssVariablePrefix:l,addDefaultStyles:d=!0,style:p,langStyle:f,className:m,langClassName:g,showLanguage:y=!0,showLineNumbers:b=!1,startingLineNumber:w=1,children:k,as:j="pre",customLanguages:S,preloadLanguages:E,...C},z)=>{const D={delay:r,transformers:i,customLanguages:S,preloadLanguages:E,showLineNumbers:b,defaultColor:o,cssVariablePrefix:l,startingLineNumber:w,...C},A=typeof t=="object"?t.name||null:t?.trim()||null,P=e(k,t,n,D),T=typeof P=="string";return u.jsxs(j,{ref:z,"data-testid":"shiki-container",className:g_("relative","not-prose",d&&"defaultStyles",m),style:p,id:"shiki-container",children:[y&&A?u.jsx("span",{className:g_("languageLabel",g),style:f,id:"language-label",children:A}):null,T?u.jsx("div",{dangerouslySetInnerHTML:{__html:P}}):P]})}),Zg=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function MM(){return 2147483648}function zM(){return typeof performance<"u"?performance.now():Date.now()}const IM=(e,t)=>e+(t-e%t)%t;async function $M(e){let t,n;const r={};function i(b){n=b,r.HEAPU8=new Uint8Array(b),r.HEAPU32=new Uint32Array(b)}function o(b,w,k){r.HEAPU8.copyWithin(b,w,w+k)}function l(b){try{return t.grow(b-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function d(b){const w=r.HEAPU8.length;b=b>>>0;const k=MM();if(b>k)return!1;for(let j=1;j<=4;j*=2){let S=w*(1+.2/j);S=Math.min(S,b+100663296);const E=Math.min(k,IM(Math.max(b,S),65536));if(l(E))return!0}return!1}const p=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function f(b,w,k=1024){const j=w+k;let S=w;for(;b[S]&&!(S>=j);)++S;if(S-w>16&&b.buffer&&p)return p.decode(b.subarray(w,S));let E="";for(;w<S;){let C=b[w++];if(!(C&128)){E+=String.fromCharCode(C);continue}const z=b[w++]&63;if((C&224)===192){E+=String.fromCharCode((C&31)<<6|z);continue}const D=b[w++]&63;if((C&240)===224?C=(C&15)<<12|z<<6|D:C=(C&7)<<18|z<<12|D<<6|b[w++]&63,C<65536)E+=String.fromCharCode(C);else{const A=C-65536;E+=String.fromCharCode(55296|A>>10,56320|A&1023)}}return E}function m(b,w){return b?f(r.HEAPU8,b,w):""}const g={emscripten_get_now:zM,emscripten_memcpy_big:o,emscripten_resize_heap:d,fd_write:()=>0};async function y(){const w=await e({env:g,wasi_snapshot_preview1:g});t=w.memory,i(t.buffer),Object.assign(r,w),r.UTF8ToString=m}return await y(),r}var BM=Object.defineProperty,PM=(e,t,n)=>t in e?BM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gn=(e,t,n)=>PM(e,typeof t!="symbol"?t+"":t,n);let wn=null;function FM(e){throw new Zg(e.UTF8ToString(e.getLastOnigError()))}class rf{constructor(t){gn(this,"utf16Length"),gn(this,"utf8Length"),gn(this,"utf16Value"),gn(this,"utf8Value"),gn(this,"utf16OffsetToUtf8"),gn(this,"utf8OffsetToUtf16");const n=t.length,r=rf._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const l=i?new Uint32Array(r+1):null;i&&(l[r]=n);const d=new Uint8Array(r);let p=0;for(let f=0;f<n;f++){const m=t.charCodeAt(f);let g=m,y=!1;if(m>=55296&&m<=56319&&f+1<n){const b=t.charCodeAt(f+1);b>=56320&&b<=57343&&(g=(m-55296<<10)+65536|b-56320,y=!0)}i&&(o[f]=p,y&&(o[f+1]=p),g<=127?l[p+0]=f:g<=2047?(l[p+0]=f,l[p+1]=f):g<=65535?(l[p+0]=f,l[p+1]=f,l[p+2]=f):(l[p+0]=f,l[p+1]=f,l[p+2]=f,l[p+3]=f)),g<=127?d[p++]=g:g<=2047?(d[p++]=192|(g&1984)>>>6,d[p++]=128|(g&63)>>>0):g<=65535?(d[p++]=224|(g&61440)>>>12,d[p++]=128|(g&4032)>>>6,d[p++]=128|(g&63)>>>0):(d[p++]=240|(g&1835008)>>>18,d[p++]=128|(g&258048)>>>12,d[p++]=128|(g&4032)>>>6,d[p++]=128|(g&63)>>>0),y&&f++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=d,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=l}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r<i;r++){const o=t.charCodeAt(r);let l=o,d=!1;if(o>=55296&&o<=56319&&r+1<i){const p=t.charCodeAt(r+1);p>=56320&&p<=57343&&(l=(o-55296<<10)+65536|p-56320,d=!0)}l<=127?n+=1:l<=2047?n+=2:l<=65535?n+=3:n+=4,d&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const af=class ta{constructor(t){if(gn(this,"id",++ta.LAST_ID),gn(this,"_onigBinding"),gn(this,"content"),gn(this,"utf16Length"),gn(this,"utf8Length"),gn(this,"utf16OffsetToUtf8"),gn(this,"utf8OffsetToUtf16"),gn(this,"ptr"),!wn)throw new Zg("Must invoke loadWasm first.");this._onigBinding=wn,this.content=t;const n=new rf(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!ta._sharedPtrInUse?(ta._sharedPtr||(ta._sharedPtr=wn.omalloc(1e4)),ta._sharedPtrInUse=!0,wn.HEAPU8.set(n.utf8Value,ta._sharedPtr),this.ptr=ta._sharedPtr):this.ptr=n.createString(wn)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===ta._sharedPtr?ta._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};gn(af,"LAST_ID",0);gn(af,"_sharedPtr",0);gn(af,"_sharedPtrInUse",!1);let d4=af;class UM{constructor(t){if(gn(this,"_onigBinding"),gn(this,"_ptr"),!wn)throw new Zg("Must invoke loadWasm first.");const n=[],r=[];for(let d=0,p=t.length;d<p;d++){const f=new rf(t[d]);n[d]=f.createString(wn),r[d]=f.utf8Length}const i=wn.omalloc(4*t.length);wn.HEAPU32.set(n,i/4);const o=wn.omalloc(4*t.length);wn.HEAPU32.set(r,o/4);const l=wn.createOnigScanner(i,o,t.length);for(let d=0,p=t.length;d<p;d++)wn.ofree(n[d]);wn.ofree(o),wn.ofree(i),l===0&&FM(wn),this._onigBinding=wn,this._ptr=l}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let i=0;if(typeof r=="number"&&(i=r),typeof t=="string"){t=new d4(t);const o=this._findNextMatchSync(t,n,!1,i);return t.dispose(),o}return this._findNextMatchSync(t,n,!1,i)}_findNextMatchSync(t,n,r,i){const o=this._onigBinding,l=o.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),i);if(l===0)return null;const d=o.HEAPU32;let p=l/4;const f=d[p++],m=d[p++],g=[];for(let y=0;y<m;y++){const b=t.convertUtf8OffsetToUtf16(d[p++]),w=t.convertUtf8OffsetToUtf16(d[p++]);g[y]={start:b,end:w,length:w-b}}return{index:f,captureIndices:g}}}function HM(e){return typeof e.instantiator=="function"}function qM(e){return typeof e.default=="function"}function VM(e){return typeof e.data<"u"}function GM(e){return typeof Response<"u"&&e instanceof Response}function YM(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Fu;function f4(e){if(Fu)return Fu;async function t(){wn=await $M(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),HM(r)?r=await r.instantiator(n):qM(r)?r=await r.default(n):(VM(r)&&(r=r.data),GM(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await KM(r)(n):r=await XM(r)(n):YM(r)?r=await em(r)(n):r instanceof WebAssembly.Module?r=await em(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await em(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Fu=t(),Fu}function em(e){return t=>WebAssembly.instantiate(e,t)}function KM(e){return t=>WebAssembly.instantiateStreaming(e,t)}function XM(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let p4;function QM(e){p4=e}function ZM(){return p4}async function h4(e){return e&&await f4(e),{createScanner(t){return new UM(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new d4(t)}}}const WM=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:h4,getDefaultWasmLoader:ZM,loadWasm:f4,setDefaultWasmLoader:QM},Symbol.toStringTag,{value:"Module"}));var m4=DD({});MD(m4,WM);const JM=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>ue(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>ue(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>ue(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>ue(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>ue(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappรฉ",type:"dark",import:(()=>ue(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>ue(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>ue(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>ue(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>ue(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>ue(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>ue(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>ue(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>ue(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>ue(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>ue(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>ue(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>ue(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>ue(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>ue(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>ue(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>ue(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>ue(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>ue(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>ue(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>ue(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>ue(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>ue(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>ue(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>ue(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>ue(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>ue(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>ue(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>ue(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>ue(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>ue(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>ue(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>ue(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>ue(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>ue(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>ue(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>ue(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>ue(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>ue(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>ue(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>ue(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>ue(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>ue(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>ue(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>ue(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>ue(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosรฉ Pine",type:"dark",import:(()=>ue(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosรฉ Pine Dawn",type:"light",import:(()=>ue(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosรฉ Pine Moon",type:"dark",import:(()=>ue(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>ue(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>ue(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>ue(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>ue(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>ue(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>ue(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>ue(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>ue(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>ue(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>ue(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>ue(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],ez=Object.fromEntries(JM.map(e=>[e.id,e.import])),g4=[{id:"angular-html",name:"Angular HTML",import:(()=>ue(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>ue(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"astro",name:"Astro",import:(()=>ue(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([6,7,2,8,3,9,10])))},{id:"blade",name:"Blade",import:(()=>ue(()=>import("./blade-BjGOyj-B.js"),__vite__mapDeps([11,12,1,2,3,13,14,15,7])))},{id:"c",name:"C",import:(()=>ue(()=>import("./c-BIGW1oBm.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>ue(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([16,2])))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>ue(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([17,18,19,20,15])))},{id:"css",name:"CSS",import:(()=>ue(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>ue(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"glsl",name:"GLSL",import:(()=>ue(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([19,20])))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>ue(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([21,2,8,22,10])))},{id:"haml",name:"Ruby Haml",import:(()=>ue(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([23,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>ue(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([24,1,2,3,25])))},{id:"html",name:"HTML",import:(()=>ue(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>ue(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([12,1,2,3])))},{id:"http",name:"HTTP",import:(()=>ue(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([26,27,7,13,14,21,2,8,22,10])))},{id:"hurl",name:"Hurl",import:(()=>ue(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([28,21,2,8,22,10,13,14,29])))},{id:"imba",name:"Imba",import:(()=>ue(()=>import("./imba-DGztddWO.js"),[]))},{id:"java",name:"Java",import:(()=>ue(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>ue(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>ue(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([30,1,2,3])))},{id:"jison",name:"Jison",import:(()=>ue(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([31,2])))},{id:"json",name:"JSON",import:(()=>ue(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>ue(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>ue(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>ue(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>ue(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>ue(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([32,17,18,19,20,15,33,2,34])))},{id:"less",name:"Less",import:(()=>ue(()=>import("./less-B1dDrJ26.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>ue(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>ue(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([35,3,36,5,8])))},{id:"mdc",name:"MDC",import:(()=>ue(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([37,38,25,12,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>ue(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"php",name:"PHP",import:(()=>ue(()=>import("./php-R6g_5hLQ.js"),__vite__mapDeps([39,1,2,3,13,14,15,7])))},{id:"postcss",name:"PostCSS",import:(()=>ue(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>ue(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([40,2,3,1])))},{id:"python",name:"Python",aliases:["py"],import:(()=>ue(()=>import("./python-B6aJPvgy.js"),[]))},{id:"r",name:"R",import:(()=>ue(()=>import("./r-Dspwwk_N.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>ue(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"sass",name:"Sass",import:(()=>ue(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scss",name:"SCSS",import:(()=>ue(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>ue(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"sql",name:"SQL",import:(()=>ue(()=>import("./sql-BLtJtn59.js"),[]))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>ue(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>ue(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([41,2,8,3,9])))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>ue(()=>import("./ts-tags-DQrlYJgV.js"),__vite__mapDeps([42,8,3,2,19,20,1,15,13,14])))},{id:"tsx",name:"TSX",import:(()=>ue(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>ue(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"vue",name:"Vue",import:(()=>ue(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([43,3,2,8,7,1,12])))},{id:"vue-html",name:"Vue HTML",import:(()=>ue(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([44,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>ue(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([45,3,5,36,46,9,2])))},{id:"wasm",name:"WebAssembly",import:(()=>ue(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>ue(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>ue(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"xml",name:"XML",import:(()=>ue(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([13,14])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>ue(()=>import("./yaml-Buea-lGh.js"),[]))}],tz=Object.fromEntries(g4.map(e=>[e.id,e.import])),nz=Object.fromEntries(g4.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),x4={...tz,...nz},rz=uM({langs:x4,themes:ez,engine:()=>(0,m4.createOnigurumaEngine)(ue(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{getSingletonHighlighter:az}=fM(rz,{guessEmbeddedLanguages:i4});async function iz(e,t,n){const r=e.filter(i=>kM(i,x4));return await az({langs:r,themes:t,engine:n??h4(ue(()=>import("./wasm-CG6Dc4jp.js"),[]))})}var sz=(e,t,n,r={})=>LM(e,t,n,r,iz),oz=OM(sz),y4=oz;const lz={"actionBar.toggledBackground":"#525761","activityBar.background":"#282c34","activityBar.foreground":"#d7dae0","activityBarBadge.background":"#4d78cc","activityBarBadge.foreground":"#f8fafd","badge.background":"#282c34","button.background":"#404754","button.secondaryBackground":"#30333d","button.secondaryForeground":"#c0bdbd","checkbox.border":"#404754","debugToolBar.background":"#21252b",descriptionForeground:"#abb2bf","diffEditor.insertedTextBackground":"#00809b33","dropdown.background":"#21252b","dropdown.border":"#21252b","editor.background":"#282c34","editor.findMatchBackground":"#d19a6644","editor.findMatchBorder":"#ffffff5a","editor.findMatchHighlightBackground":"#ffffff22","editor.foreground":"#abb2bf","editor.lineHighlightBackground":"#2c313c","editor.selectionBackground":"#67769660","editor.selectionHighlightBackground":"#ffd33d44","editor.selectionHighlightBorder":"#dddddd","editor.wordHighlightBackground":"#d2e0ff2f","editor.wordHighlightBorder":"#7f848e","editor.wordHighlightStrongBackground":"#abb2bf26","editor.wordHighlightStrongBorder":"#7f848e","editorBracketHighlight.foreground1":"#d19a66","editorBracketHighlight.foreground2":"#c678dd","editorBracketHighlight.foreground3":"#56b6c2","editorBracketMatch.background":"#515a6b","editorBracketMatch.border":"#515a6b","editorCursor.background":"#ffffffc9","editorCursor.foreground":"#528bff","editorError.foreground":"#c24038","editorGroup.background":"#181a1f","editorGroup.border":"#181a1f","editorGroupHeader.tabsBackground":"#21252b","editorGutter.addedBackground":"#109868","editorGutter.deletedBackground":"#9A353D","editorGutter.modifiedBackground":"#948B60","editorHoverWidget.background":"#21252b","editorHoverWidget.border":"#181a1f","editorHoverWidget.highlightForeground":"#61afef","editorIndentGuide.activeBackground1":"#c8c8c859","editorIndentGuide.background1":"#3b4048","editorInlayHint.background":"#2c313c","editorInlayHint.foreground":"#abb2bf","editorLineNumber.activeForeground":"#abb2bf","editorLineNumber.foreground":"#495162","editorMarkerNavigation.background":"#21252b","editorOverviewRuler.addedBackground":"#109868","editorOverviewRuler.deletedBackground":"#9A353D","editorOverviewRuler.modifiedBackground":"#948B60","editorRuler.foreground":"#abb2bf26","editorSuggestWidget.background":"#21252b","editorSuggestWidget.border":"#181a1f","editorSuggestWidget.selectedBackground":"#2c313a","editorWarning.foreground":"#d19a66","editorWhitespace.foreground":"#ffffff1d","editorWidget.background":"#21252b",focusBorder:"#3e4452","gitDecoration.ignoredResourceForeground":"#636b78","input.background":"#1d1f23","input.foreground":"#abb2bf","list.activeSelectionBackground":"#2c313a","list.activeSelectionForeground":"#d7dae0","list.focusBackground":"#323842","list.focusForeground":"#f0f0f0","list.highlightForeground":"#ecebeb","list.hoverBackground":"#2c313a","list.hoverForeground":"#abb2bf","list.inactiveSelectionBackground":"#323842","list.inactiveSelectionForeground":"#d7dae0","list.warningForeground":"#d19a66","menu.foreground":"#abb2bf","menu.separatorBackground":"#343a45","minimapGutter.addedBackground":"#109868","minimapGutter.deletedBackground":"#9A353D","minimapGutter.modifiedBackground":"#948B60","multiDiffEditor.headerBackground":"#21252b","panel.border":"#3e4452","panelSectionHeader.background":"#21252b","peekViewEditor.background":"#1b1d23","peekViewEditor.matchHighlightBackground":"#29244b","peekViewResult.background":"#22262b","scrollbar.shadow":"#23252c","scrollbarSlider.activeBackground":"#747d9180","scrollbarSlider.background":"#4e566660","scrollbarSlider.hoverBackground":"#5a637580","settings.focusedRowBackground":"#282c34","settings.headerForeground":"#fff","sideBar.background":"#21252b","sideBar.foreground":"#abb2bf","sideBarSectionHeader.background":"#282c34","sideBarSectionHeader.foreground":"#abb2bf","statusBar.background":"#21252b","statusBar.debuggingBackground":"#cc6633","statusBar.debuggingBorder":"#ff000000","statusBar.debuggingForeground":"#ffffff","statusBar.foreground":"#9da5b4","statusBar.noFolderBackground":"#21252b","statusBarItem.remoteBackground":"#4d78cc","statusBarItem.remoteForeground":"#f8fafd","tab.activeBackground":"#282c34","tab.activeBorder":"#b4b4b4","tab.activeForeground":"#dcdcdc","tab.border":"#181a1f","tab.hoverBackground":"#323842","tab.inactiveBackground":"#21252b","tab.unfocusedHoverBackground":"#323842","terminal.ansiBlack":"#3f4451","terminal.ansiBlue":"#4aa5f0","terminal.ansiBrightBlack":"#4f5666","terminal.ansiBrightBlue":"#4dc4ff","terminal.ansiBrightCyan":"#4cd1e0","terminal.ansiBrightGreen":"#a5e075","terminal.ansiBrightMagenta":"#de73ff","terminal.ansiBrightRed":"#ff616e","terminal.ansiBrightWhite":"#e6e6e6","terminal.ansiBrightYellow":"#f0a45d","terminal.ansiCyan":"#42b3c2","terminal.ansiGreen":"#8cc265","terminal.ansiMagenta":"#c162de","terminal.ansiRed":"#e05561","terminal.ansiWhite":"#d7dae0","terminal.ansiYellow":"#d18f52","terminal.background":"#282c34","terminal.border":"#3e4452","terminal.foreground":"#abb2bf","terminal.selectionBackground":"#abb2bf30","textBlockQuote.background":"#2e3440","textBlockQuote.border":"#4b5362","textLink.foreground":"#61afef","textPreformat.foreground":"#d19a66","titleBar.activeBackground":"#282c34","titleBar.activeForeground":"#9da5b4","titleBar.inactiveBackground":"#282c34","titleBar.inactiveForeground":"#6b717d","tree.indentGuidesStroke":"#ffffff1d","walkThrough.embeddedEditorBackground":"#2e3440","welcomePage.buttonHoverBackground":"#404754"},cz="C4A Dark",uz="c4a-dark",dz=!0,fz={"annotation:dart":{foreground:"#d19a66"},enumMember:{foreground:"#56b6c2"},macro:{foreground:"#d19a66"},memberOperatorOverload:{foreground:"#c678dd"},"parameter.label:dart":{foreground:"#abb2bf"},"property:dart":{foreground:"#d19a66"},tomlArrayKey:{foreground:"#e5c07b"},"variable.constant":{foreground:"#d19a66"},"variable.defaultLibrary":{foreground:"#e5c07b"},"variable:dart":{foreground:"#d19a66"}},pz=JSON.parse('[{"scope":"meta.embedded","settings":{"foreground":"#abb2bf"}},{"scope":"punctuation.definition.delayed.unison,punctuation.definition.list.begin.unison,punctuation.definition.list.end.unison,punctuation.definition.ability.begin.unison,punctuation.definition.ability.end.unison,punctuation.operator.assignment.as.unison,punctuation.separator.pipe.unison,punctuation.separator.delimiter.unison,punctuation.definition.hash.unison","settings":{"foreground":"#e06c75"}},{"scope":"variable.other.generic-type.haskell","settings":{"foreground":"#c678dd"}},{"scope":"storage.type.haskell","settings":{"foreground":"#d19a66"}},{"scope":"support.variable.magic.python","settings":{"foreground":"#e06c75"}},{"scope":"punctuation.separator.period.python,punctuation.separator.element.python,punctuation.parenthesis.begin.python,punctuation.parenthesis.end.python","settings":{"foreground":"#abb2bf"}},{"scope":"variable.parameter.function.language.special.self.python","settings":{"foreground":"#e5c07b"}},{"scope":"variable.parameter.function.language.special.cls.python","settings":{"foreground":"#e5c07b"}},{"scope":"storage.modifier.lifetime.rust","settings":{"foreground":"#abb2bf"}},{"scope":"support.function.std.rust","settings":{"foreground":"#61afef"}},{"scope":"entity.name.lifetime.rust","settings":{"foreground":"#e5c07b"}},{"scope":"variable.language.rust","settings":{"foreground":"#e06c75"}},{"scope":"support.constant.edge","settings":{"foreground":"#c678dd"}},{"scope":"constant.other.character-class.regexp","settings":{"foreground":"#e06c75"}},{"scope":["keyword.operator.word"],"settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.quantifier.regexp","settings":{"foreground":"#d19a66"}},{"scope":"variable.parameter.function","settings":{"foreground":"#abb2bf"}},{"scope":"comment markup.link","settings":{"foreground":"#5c6370"}},{"scope":"markup.changed.diff","settings":{"foreground":"#e5c07b"}},{"scope":"meta.diff.header.from-file,meta.diff.header.to-file,punctuation.definition.from-file.diff,punctuation.definition.to-file.diff","settings":{"foreground":"#61afef"}},{"scope":"markup.inserted.diff","settings":{"foreground":"#98c379"}},{"scope":"markup.deleted.diff","settings":{"foreground":"#e06c75"}},{"scope":"meta.function.c,meta.function.cpp","settings":{"foreground":"#e06c75"}},{"scope":"punctuation.section.block.begin.bracket.curly.cpp,punctuation.section.block.end.bracket.curly.cpp,punctuation.terminator.statement.c,punctuation.section.block.begin.bracket.curly.c,punctuation.section.block.end.bracket.curly.c,punctuation.section.parens.begin.bracket.round.c,punctuation.section.parens.end.bracket.round.c,punctuation.section.parameters.begin.bracket.round.c,punctuation.section.parameters.end.bracket.round.c","settings":{"foreground":"#abb2bf"}},{"scope":"punctuation.separator.key-value","settings":{"foreground":"#abb2bf"}},{"scope":"keyword.operator.expression.import","settings":{"foreground":"#61afef"}},{"scope":"support.constant.math","settings":{"foreground":"#e5c07b"}},{"scope":"support.constant.property.math","settings":{"foreground":"#d19a66"}},{"scope":"variable.other.constant","settings":{"foreground":"#e5c07b"}},{"scope":["storage.type.annotation.java","storage.type.object.array.java"],"settings":{"foreground":"#e5c07b"}},{"scope":"source.java","settings":{"foreground":"#e06c75"}},{"scope":"punctuation.section.block.begin.java,punctuation.section.block.end.java,punctuation.definition.method-parameters.begin.java,punctuation.definition.method-parameters.end.java,meta.method.identifier.java,punctuation.section.method.begin.java,punctuation.section.method.end.java,punctuation.terminator.java,punctuation.section.class.begin.java,punctuation.section.class.end.java,punctuation.section.inner-class.begin.java,punctuation.section.inner-class.end.java,meta.method-call.java,punctuation.section.class.begin.bracket.curly.java,punctuation.section.class.end.bracket.curly.java,punctuation.section.method.begin.bracket.curly.java,punctuation.section.method.end.bracket.curly.java,punctuation.separator.period.java,punctuation.bracket.angle.java,punctuation.definition.annotation.java,meta.method.body.java","settings":{"foreground":"#abb2bf"}},{"scope":"meta.method.java","settings":{"foreground":"#61afef"}},{"scope":"storage.modifier.import.java,storage.type.java,storage.type.generic.java","settings":{"foreground":"#e5c07b"}},{"scope":"keyword.operator.instanceof.java","settings":{"foreground":"#c678dd"}},{"scope":"meta.definition.variable.name.java","settings":{"foreground":"#e06c75"}},{"scope":"keyword.operator.logical","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.bitwise","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.channel","settings":{"foreground":"#56b6c2"}},{"scope":"support.constant.property-value.scss,support.constant.property-value.css","settings":{"foreground":"#d19a66"}},{"scope":"keyword.operator.css,keyword.operator.scss,keyword.operator.less","settings":{"foreground":"#56b6c2"}},{"scope":"support.constant.color.w3c-standard-color-name.css,support.constant.color.w3c-standard-color-name.scss","settings":{"foreground":"#d19a66"}},{"scope":"punctuation.separator.list.comma.css","settings":{"foreground":"#abb2bf"}},{"scope":"support.constant.color.w3c-standard-color-name.css","settings":{"foreground":"#d19a66"}},{"scope":"support.type.vendored.property-name.css","settings":{"foreground":"#56b6c2"}},{"scope":"support.module.node,support.type.object.module,support.module.node","settings":{"foreground":"#e5c07b"}},{"scope":"entity.name.type.module","settings":{"foreground":"#e5c07b"}},{"scope":"variable.other.readwrite,meta.object-literal.key,support.variable.property,support.variable.object.process,support.variable.object.node","settings":{"foreground":"#e06c75"}},{"scope":"support.constant.json","settings":{"foreground":"#d19a66"}},{"scope":["keyword.operator.expression.instanceof","keyword.operator.new","keyword.operator.ternary","keyword.operator.optional","keyword.operator.expression.keyof"],"settings":{"foreground":"#c678dd"}},{"scope":"support.type.object.console","settings":{"foreground":"#e06c75"}},{"scope":"support.variable.property.process","settings":{"foreground":"#d19a66"}},{"scope":"entity.name.function,support.function.console","settings":{"foreground":"#61afef"}},{"scope":"keyword.operator.misc.rust","settings":{"foreground":"#abb2bf"}},{"scope":"keyword.operator.sigil.rust","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.delete","settings":{"foreground":"#c678dd"}},{"scope":"support.type.object.dom","settings":{"foreground":"#56b6c2"}},{"scope":"support.variable.dom,support.variable.property.dom","settings":{"foreground":"#e06c75"}},{"scope":"keyword.operator.arithmetic,keyword.operator.comparison,keyword.operator.decrement,keyword.operator.increment,keyword.operator.relational","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.assignment.c,keyword.operator.comparison.c,keyword.operator.c,keyword.operator.increment.c,keyword.operator.decrement.c,keyword.operator.bitwise.shift.c,keyword.operator.assignment.cpp,keyword.operator.comparison.cpp,keyword.operator.cpp,keyword.operator.increment.cpp,keyword.operator.decrement.cpp,keyword.operator.bitwise.shift.cpp","settings":{"foreground":"#c678dd"}},{"scope":"punctuation.separator.delimiter","settings":{"foreground":"#abb2bf"}},{"scope":"punctuation.separator.c,punctuation.separator.cpp","settings":{"foreground":"#c678dd"}},{"scope":"support.type.posix-reserved.c,support.type.posix-reserved.cpp","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.sizeof.c,keyword.operator.sizeof.cpp","settings":{"foreground":"#c678dd"}},{"scope":"variable.parameter.function.language.python","settings":{"foreground":"#d19a66"}},{"scope":"support.type.python","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.logical.python","settings":{"foreground":"#c678dd"}},{"scope":"variable.parameter.function.python","settings":{"foreground":"#d19a66"}},{"scope":"punctuation.definition.arguments.begin.python,punctuation.definition.arguments.end.python,punctuation.separator.arguments.python,punctuation.definition.list.begin.python,punctuation.definition.list.end.python","settings":{"foreground":"#abb2bf"}},{"scope":"meta.function-call.generic.python","settings":{"foreground":"#61afef"}},{"scope":"constant.character.format.placeholder.other.python","settings":{"foreground":"#d19a66"}},{"scope":"keyword.operator","settings":{"foreground":"#abb2bf"}},{"scope":"keyword.operator.assignment.compound","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.assignment.compound.js,keyword.operator.assignment.compound.ts","settings":{"foreground":"#56b6c2"}},{"scope":"keyword","settings":{"foreground":"#c678dd"}},{"scope":"entity.name.namespace","settings":{"foreground":"#e5c07b"}},{"scope":"variable","settings":{"foreground":"#e06c75"}},{"scope":"variable.c","settings":{"foreground":"#abb2bf"}},{"scope":"variable.language","settings":{"foreground":"#e5c07b"}},{"scope":"token.variable.parameter.java","settings":{"foreground":"#abb2bf"}},{"scope":"import.storage.java","settings":{"foreground":"#e5c07b"}},{"scope":"token.package.keyword","settings":{"foreground":"#c678dd"}},{"scope":"token.package","settings":{"foreground":"#abb2bf"}},{"scope":["entity.name.function","meta.require","support.function.any-method","variable.function"],"settings":{"foreground":"#61afef"}},{"scope":"entity.name.type.namespace","settings":{"foreground":"#e5c07b"}},{"scope":"support.class, entity.name.type.class","settings":{"foreground":"#e5c07b"}},{"scope":"entity.name.class.identifier.namespace.type","settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.class","variable.other.class.js","variable.other.class.ts"],"settings":{"foreground":"#e5c07b"}},{"scope":"variable.other.class.php","settings":{"foreground":"#e06c75"}},{"scope":"entity.name.type","settings":{"foreground":"#e5c07b"}},{"scope":"keyword.control","settings":{"foreground":"#c678dd"}},{"scope":"control.elements, keyword.operator.less","settings":{"foreground":"#d19a66"}},{"scope":"keyword.other.special-method","settings":{"foreground":"#61afef"}},{"scope":"storage","settings":{"foreground":"#c678dd"}},{"scope":"token.storage","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.expression.delete,keyword.operator.expression.in,keyword.operator.expression.of,keyword.operator.expression.instanceof,keyword.operator.new,keyword.operator.expression.typeof,keyword.operator.expression.void","settings":{"foreground":"#c678dd"}},{"scope":"token.storage.type.java","settings":{"foreground":"#e5c07b"}},{"scope":"support.function","settings":{"foreground":"#56b6c2"}},{"scope":"support.type.property-name","settings":{"foreground":"#abb2bf"}},{"scope":"support.type.property-name.toml, support.type.property-name.table.toml, support.type.property-name.array.toml","settings":{"foreground":"#e06c75"}},{"scope":"support.constant.property-value","settings":{"foreground":"#abb2bf"}},{"scope":"support.constant.font-name","settings":{"foreground":"#d19a66"}},{"scope":"meta.tag","settings":{"foreground":"#abb2bf"}},{"scope":"string","settings":{"foreground":"#98c379"}},{"scope":"constant.other.symbol","settings":{"foreground":"#56b6c2"}},{"scope":"constant.numeric","settings":{"foreground":"#d19a66"}},{"scope":"constant","settings":{"foreground":"#d19a66"}},{"scope":"punctuation.definition.constant","settings":{"foreground":"#d19a66"}},{"scope":"entity.name.tag","settings":{"foreground":"#e06c75"}},{"scope":"entity.other.attribute-name","settings":{"foreground":"#d19a66"}},{"scope":"entity.other.attribute-name.id","settings":{"foreground":"#61afef"}},{"scope":"entity.other.attribute-name.class.css","settings":{"foreground":"#d19a66"}},{"scope":"meta.selector","settings":{"foreground":"#c678dd"}},{"scope":"markup.heading","settings":{"foreground":"#ef6f2e"}},{"scope":"markup.heading punctuation.definition.heading, entity.name.section","settings":{"foreground":"#ef6f2e"}},{"scope":"keyword.other.unit","settings":{"foreground":"#e06c75"}},{"scope":"markup.bold,todo.bold","settings":{"foreground":"#d19a66"}},{"scope":"punctuation.definition.bold","settings":{"foreground":"#e5c07b"}},{"scope":"markup.italic, punctuation.definition.italic,todo.emphasis","settings":{"foreground":"#c678dd"}},{"scope":"emphasis md","settings":{"foreground":"#c678dd"}},{"scope":"entity.name.section.markdown","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.heading.markdown","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#e5c07b"}},{"scope":"markup.heading.setext","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.bold.markdown","settings":{"foreground":"#d19a66"}},{"scope":"markup.inline.raw.markdown","settings":{"foreground":"#98c379"}},{"scope":"markup.inline.raw.string.markdown","settings":{"foreground":"#98c379"}},{"scope":"punctuation.definition.raw.markdown","settings":{"foreground":"#e5c07b"}},{"scope":"punctuation.definition.list.markdown","settings":{"foreground":"#e5c07b"}},{"scope":["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","punctuation.definition.metadata.markdown"],"settings":{"foreground":"#e06c75"}},{"scope":["beginning.punctuation.definition.list.markdown"],"settings":{"foreground":"#e06c75"}},{"scope":"punctuation.definition.metadata.markdown","settings":{"foreground":"#e06c75"}},{"scope":"markup.underline.link.markdown,markup.underline.link.image.markdown","settings":{"foreground":"#c678dd"}},{"scope":"string.other.link.title.markdown,string.other.link.description.markdown","settings":{"foreground":"#61afef"}},{"scope":"markup.raw.monospace.asciidoc","settings":{"foreground":"#98c379"}},{"scope":"punctuation.definition.asciidoc","settings":{"foreground":"#e5c07b"}},{"scope":"markup.list.asciidoc","settings":{"foreground":"#e5c07b"}},{"scope":"markup.link.asciidoc,markup.other.url.asciidoc","settings":{"foreground":"#c678dd"}},{"scope":"string.unquoted.asciidoc,markup.other.url.asciidoc","settings":{"foreground":"#61afef"}},{"scope":"string.regexp","settings":{"foreground":"#56b6c2"}},{"scope":"punctuation.section.embedded, variable.interpolation","settings":{"foreground":"#e06c75"}},{"scope":"punctuation.section.embedded.begin,punctuation.section.embedded.end","settings":{"foreground":"#c678dd"}},{"scope":"invalid.illegal","settings":{"foreground":"#ffffff"}},{"scope":"invalid.illegal.bad-ampersand.html","settings":{"foreground":"#abb2bf"}},{"scope":"invalid.illegal.unrecognized-tag.html","settings":{"foreground":"#e06c75"}},{"scope":"invalid.broken","settings":{"foreground":"#ffffff"}},{"scope":"invalid.deprecated","settings":{"foreground":"#ffffff"}},{"scope":"invalid.deprecated.entity.other.attribute-name.html","settings":{"foreground":"#d19a66"}},{"scope":"invalid.unimplemented","settings":{"foreground":"#ffffff"}},{"scope":"source.json meta.structure.dictionary.json > string.quoted.json","settings":{"foreground":"#e06c75"}},{"scope":"source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string","settings":{"foreground":"#e06c75"}},{"scope":"source.json meta.structure.dictionary.json > value.json > string.quoted.json,source.json meta.structure.array.json > value.json > string.quoted.json,source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation,source.json meta.structure.array.json > value.json > string.quoted.json > punctuation","settings":{"foreground":"#98c379"}},{"scope":"source.json meta.structure.dictionary.json > constant.language.json,source.json meta.structure.array.json > constant.language.json","settings":{"foreground":"#56b6c2"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#e06c75"}},{"scope":"support.type.property-name.json punctuation","settings":{"foreground":"#e06c75"}},{"scope":"text.html.laravel-blade source.php.embedded.line.html entity.name.tag.laravel-blade","settings":{"foreground":"#c678dd"}},{"scope":"text.html.laravel-blade source.php.embedded.line.html support.constant.laravel-blade","settings":{"foreground":"#c678dd"}},{"scope":"support.other.namespace.use.php,support.other.namespace.use-as.php,entity.other.alias.php,meta.interface.php","settings":{"foreground":"#e5c07b"}},{"scope":"keyword.operator.error-control.php","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.type.php","settings":{"foreground":"#c678dd"}},{"scope":"punctuation.section.array.begin.php","settings":{"foreground":"#abb2bf"}},{"scope":"punctuation.section.array.end.php","settings":{"foreground":"#abb2bf"}},{"scope":"invalid.illegal.non-null-typehinted.php","settings":{"foreground":"#f44747"}},{"scope":"storage.type.php,meta.other.type.phpdoc.php,keyword.other.type.php,keyword.other.array.phpdoc.php","settings":{"foreground":"#e5c07b"}},{"scope":"meta.function-call.php,meta.function-call.object.php,meta.function-call.static.php","settings":{"foreground":"#61afef"}},{"scope":"punctuation.definition.parameters.begin.bracket.round.php,punctuation.definition.parameters.end.bracket.round.php,punctuation.separator.delimiter.php,punctuation.section.scope.begin.php,punctuation.section.scope.end.php,punctuation.terminator.expression.php,punctuation.definition.arguments.begin.bracket.round.php,punctuation.definition.arguments.end.bracket.round.php,punctuation.definition.storage-type.begin.bracket.round.php,punctuation.definition.storage-type.end.bracket.round.php,punctuation.definition.array.begin.bracket.round.php,punctuation.definition.array.end.bracket.round.php,punctuation.definition.begin.bracket.round.php,punctuation.definition.end.bracket.round.php,punctuation.definition.begin.bracket.curly.php,punctuation.definition.end.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php,punctuation.definition.section.switch-block.start.bracket.curly.php,punctuation.definition.section.switch-block.begin.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php","settings":{"foreground":"#abb2bf"}},{"scope":"support.constant.core.rust","settings":{"foreground":"#d19a66"}},{"scope":"support.constant.ext.php,support.constant.std.php,support.constant.core.php,support.constant.parser-token.php","settings":{"foreground":"#d19a66"}},{"scope":"entity.name.goto-label.php,support.other.php","settings":{"foreground":"#61afef"}},{"scope":"keyword.operator.logical.php,keyword.operator.bitwise.php,keyword.operator.arithmetic.php","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.regexp.php","settings":{"foreground":"#c678dd"}},{"scope":"keyword.operator.comparison.php","settings":{"foreground":"#56b6c2"}},{"scope":"keyword.operator.heredoc.php,keyword.operator.nowdoc.php","settings":{"foreground":"#c678dd"}},{"scope":"meta.function.decorator.python","settings":{"foreground":"#61afef"}},{"scope":"support.token.decorator.python,meta.function.decorator.identifier.python","settings":{"foreground":"#56b6c2"}},{"scope":"function.parameter","settings":{"foreground":"#abb2bf"}},{"scope":"function.brace","settings":{"foreground":"#abb2bf"}},{"scope":"function.parameter.ruby, function.parameter.cs","settings":{"foreground":"#abb2bf"}},{"scope":"constant.language.symbol.ruby","settings":{"foreground":"#56b6c2"}},{"scope":"constant.language.symbol.hashkey.ruby","settings":{"foreground":"#56b6c2"}},{"scope":"rgb-value","settings":{"foreground":"#56b6c2"}},{"scope":"inline-color-decoration rgb-value","settings":{"foreground":"#d19a66"}},{"scope":"less rgb-value","settings":{"foreground":"#d19a66"}},{"scope":"selector.sass","settings":{"foreground":"#e06c75"}},{"scope":"support.type.primitive.ts,support.type.builtin.ts,support.type.primitive.tsx,support.type.builtin.tsx","settings":{"foreground":"#e5c07b"}},{"scope":"block.scope.end,block.scope.begin","settings":{"foreground":"#abb2bf"}},{"scope":"storage.type.cs","settings":{"foreground":"#e5c07b"}},{"scope":"entity.name.variable.local.cs","settings":{"foreground":"#e06c75"}},{"scope":"token.info-token","settings":{"foreground":"#61afef"}},{"scope":"token.warn-token","settings":{"foreground":"#d19a66"}},{"scope":"token.error-token","settings":{"foreground":"#f44747"}},{"scope":"token.debug-token","settings":{"foreground":"#c678dd"}},{"scope":["punctuation.definition.template-expression.begin","punctuation.definition.template-expression.end","punctuation.section.embedded"],"settings":{"foreground":"#c678dd"}},{"scope":["meta.template.expression"],"settings":{"foreground":"#abb2bf"}},{"scope":["keyword.operator.module"],"settings":{"foreground":"#c678dd"}},{"scope":["support.type.type.flowtype"],"settings":{"foreground":"#61afef"}},{"scope":["support.type.primitive"],"settings":{"foreground":"#e5c07b"}},{"scope":["meta.property.object"],"settings":{"foreground":"#e06c75"}},{"scope":["variable.parameter.function.js"],"settings":{"foreground":"#e06c75"}},{"scope":["keyword.other.template.begin"],"settings":{"foreground":"#98c379"}},{"scope":["keyword.other.template.end"],"settings":{"foreground":"#98c379"}},{"scope":["keyword.other.substitution.begin"],"settings":{"foreground":"#98c379"}},{"scope":["keyword.other.substitution.end"],"settings":{"foreground":"#98c379"}},{"scope":["keyword.operator.assignment"],"settings":{"foreground":"#56b6c2"}},{"scope":["keyword.operator.assignment.go"],"settings":{"foreground":"#e5c07b"}},{"scope":["keyword.operator.arithmetic.go","keyword.operator.address.go"],"settings":{"foreground":"#c678dd"}},{"scope":["keyword.operator.arithmetic.c","keyword.operator.arithmetic.cpp"],"settings":{"foreground":"#c678dd"}},{"scope":["entity.name.package.go"],"settings":{"foreground":"#e5c07b"}},{"scope":["support.type.prelude.elm"],"settings":{"foreground":"#56b6c2"}},{"scope":["support.constant.elm"],"settings":{"foreground":"#d19a66"}},{"scope":["punctuation.quasi.element"],"settings":{"foreground":"#c678dd"}},{"scope":["constant.character.entity"],"settings":{"foreground":"#e06c75"}},{"scope":["entity.other.attribute-name.pseudo-element","entity.other.attribute-name.pseudo-class"],"settings":{"foreground":"#56b6c2"}},{"scope":["entity.global.clojure"],"settings":{"foreground":"#e5c07b"}},{"scope":["meta.symbol.clojure"],"settings":{"foreground":"#e06c75"}},{"scope":["constant.keyword.clojure"],"settings":{"foreground":"#56b6c2"}},{"scope":["meta.arguments.coffee","variable.parameter.function.coffee"],"settings":{"foreground":"#e06c75"}},{"scope":["source.ini"],"settings":{"foreground":"#98c379"}},{"scope":["meta.scope.prerequisites.makefile"],"settings":{"foreground":"#e06c75"}},{"scope":["source.makefile"],"settings":{"foreground":"#e5c07b"}},{"scope":["storage.modifier.import.groovy"],"settings":{"foreground":"#e5c07b"}},{"scope":["meta.method.groovy"],"settings":{"foreground":"#61afef"}},{"scope":["meta.definition.variable.name.groovy"],"settings":{"foreground":"#e06c75"}},{"scope":["meta.definition.class.inherited.classes.groovy"],"settings":{"foreground":"#98c379"}},{"scope":["support.variable.semantic.hlsl"],"settings":{"foreground":"#e5c07b"}},{"scope":["support.type.texture.hlsl","support.type.sampler.hlsl","support.type.object.hlsl","support.type.object.rw.hlsl","support.type.fx.hlsl","support.type.object.hlsl"],"settings":{"foreground":"#c678dd"}},{"scope":["text.variable","text.bracketed"],"settings":{"foreground":"#e06c75"}},{"scope":["support.type.swift","support.type.vb.asp"],"settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.function.xi"],"settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.class.xi"],"settings":{"foreground":"#56b6c2"}},{"scope":["constant.character.character-class.regexp.xi"],"settings":{"foreground":"#e06c75"}},{"scope":["constant.regexp.xi"],"settings":{"foreground":"#c678dd"}},{"scope":["keyword.control.xi"],"settings":{"foreground":"#56b6c2"}},{"scope":["invalid.xi"],"settings":{"foreground":"#abb2bf"}},{"scope":["beginning.punctuation.definition.quote.markdown.xi"],"settings":{"foreground":"#98c379"}},{"scope":["beginning.punctuation.definition.list.markdown.xi"],"settings":{"foreground":"#7f848e"}},{"scope":["constant.character.xi"],"settings":{"foreground":"#61afef"}},{"scope":["accent.xi"],"settings":{"foreground":"#61afef"}},{"scope":["wikiword.xi"],"settings":{"foreground":"#d19a66"}},{"scope":["constant.other.color.rgb-value.xi"],"settings":{"foreground":"#ffffff"}},{"scope":["punctuation.definition.tag.xi"],"settings":{"foreground":"#5c6370"}},{"scope":["entity.name.label.cs","entity.name.scope-resolution.function.call","entity.name.scope-resolution.function.definition"],"settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.label.cs","markup.heading.setext.1.markdown","markup.heading.setext.2.markdown"],"settings":{"foreground":"#ef6f2e"}},{"scope":[" meta.brace.square"],"settings":{"foreground":"#abb2bf"}},{"scope":"comment, punctuation.definition.comment","settings":{"fontStyle":"italic","foreground":"#7f848e"}},{"scope":"markup.quote.markdown","settings":{"foreground":"#5c6370"}},{"scope":"punctuation.definition.block.sequence.item.yaml","settings":{"foreground":"#abb2bf"}},{"scope":["constant.language.symbol.elixir","constant.language.symbol.double-quoted.elixir"],"settings":{"foreground":"#56b6c2"}},{"scope":["entity.name.variable.parameter.cs"],"settings":{"foreground":"#e5c07b"}},{"scope":["entity.name.variable.field.cs"],"settings":{"foreground":"#e06c75"}},{"scope":"markup.deleted","settings":{"foreground":"#e06c75"}},{"scope":"markup.inserted","settings":{"foreground":"#98c379"}},{"scope":"markup.underline","settings":{"fontStyle":"underline"}},{"scope":["punctuation.section.embedded.begin.php","punctuation.section.embedded.end.php"],"settings":{"foreground":"#BE5046"}},{"scope":["support.other.namespace.php"],"settings":{"foreground":"#abb2bf"}},{"scope":["variable.parameter.function.latex"],"settings":{"foreground":"#e06c75"}},{"scope":["variable.other.object"],"settings":{"foreground":"#e5c07b"}},{"scope":["variable.other.constant.property"],"settings":{"foreground":"#e06c75"}},{"scope":["entity.other.inherited-class"],"settings":{"foreground":"#e5c07b"}},{"scope":"variable.other.readwrite.c","settings":{"foreground":"#e06c75"}},{"scope":"entity.name.variable.parameter.php,punctuation.separator.colon.php,constant.other.php","settings":{"foreground":"#abb2bf"}},{"scope":["constant.numeric.decimal.asm.x86_64"],"settings":{"foreground":"#c678dd"}},{"scope":["support.other.parenthesis.regexp"],"settings":{"foreground":"#d19a66"}},{"scope":["constant.character.escape"],"settings":{"foreground":"#56b6c2"}},{"scope":["string.regexp"],"settings":{"foreground":"#e06c75"}},{"scope":["log.info"],"settings":{"foreground":"#98c379"}},{"scope":["log.warning"],"settings":{"foreground":"#e5c07b"}},{"scope":["log.error"],"settings":{"foreground":"#e06c75"}},{"scope":"keyword.operator.expression.is","settings":{"foreground":"#c678dd"}},{"scope":"entity.name.label","settings":{"foreground":"#e06c75"}},{"scope":["support.class.math.block.environment.latex","constant.other.general.math.tex"],"settings":{"foreground":"#61afef"}},{"scope":["constant.character.math.tex"],"settings":{"foreground":"#98c379"}},{"scope":"entity.other.attribute-name.js,entity.other.attribute-name.ts,entity.other.attribute-name.jsx,entity.other.attribute-name.tsx,variable.parameter,variable.language.super","settings":{"fontStyle":"italic"}},{"scope":"comment.line.double-slash,comment.block.documentation","settings":{"fontStyle":"italic"}},{"scope":"markup.italic.markdown","settings":{"fontStyle":"italic"}}]'),hz="dark",b4={colors:lz,displayName:cz,name:uz,semanticHighlighting:dz,semanticTokenColors:fz,tokenColors:pz,type:hz},mz={"activityBar.background":"#FAFAFA","activityBar.foreground":"#121417","activityBarBadge.background":"#526FFF","activityBarBadge.foreground":"#FFFFFF","badge.background":"#526FFF","badge.foreground":"#FFFFFF","button.background":"#5871EF","button.foreground":"#FFFFFF","button.hoverBackground":"#6B83ED","diffEditor.insertedTextBackground":"#00809B33","dropdown.background":"#FFFFFF","dropdown.border":"#DBDBDC","editor.background":"#FAFAFA","editor.findMatchHighlightBackground":"#526FFF33","editor.foreground":"#383A42","editor.lineHighlightBackground":"#383A420C","editor.selectionBackground":"#E5E5E6","editorCursor.foreground":"#526FFF","editorGroup.background":"#EAEAEB","editorGroup.border":"#DBDBDC","editorGroupHeader.tabsBackground":"#EAEAEB","editorHoverWidget.background":"#EAEAEB","editorHoverWidget.border":"#DBDBDC","editorIndentGuide.activeBackground":"#626772","editorIndentGuide.background":"#383A4233","editorInlayHint.background":"#F5F5F5","editorInlayHint.foreground":"#AFB2BB","editorLineNumber.activeForeground":"#383A42","editorLineNumber.foreground":"#9D9D9F","editorRuler.foreground":"#383A4233","editorSuggestWidget.background":"#EAEAEB","editorSuggestWidget.border":"#DBDBDC","editorSuggestWidget.selectedBackground":"#FFFFFF","editorWhitespace.foreground":"#383A4233","editorWidget.background":"#EAEAEB","editorWidget.border":"#E5E5E6","extensionButton.prominentBackground":"#3BBA54","extensionButton.prominentHoverBackground":"#4CC263",focusBorder:"#526FFF","input.background":"#FFFFFF","input.border":"#DBDBDC","list.activeSelectionBackground":"#DBDBDC","list.activeSelectionForeground":"#232324","list.focusBackground":"#DBDBDC","list.highlightForeground":"#121417","list.hoverBackground":"#DBDBDC66","list.inactiveSelectionBackground":"#DBDBDC","list.inactiveSelectionForeground":"#232324","notebook.cellEditorBackground":"#F5F5F5","notification.background":"#333333","peekView.border":"#526FFF","peekViewEditor.background":"#FFFFFF","peekViewResult.background":"#EAEAEB","peekViewResult.selectionBackground":"#DBDBDC","peekViewTitle.background":"#FFFFFF","pickerGroup.border":"#526FFF","scrollbarSlider.activeBackground":"#747D9180","scrollbarSlider.background":"#4E566680","scrollbarSlider.hoverBackground":"#5A637580","sideBar.background":"#EAEAEB","sideBarSectionHeader.background":"#FAFAFA","statusBar.background":"#EAEAEB","statusBar.debuggingForeground":"#FFFFFF","statusBar.foreground":"#424243","statusBar.noFolderBackground":"#EAEAEB","statusBarItem.hoverBackground":"#DBDBDC","tab.activeBackground":"#FAFAFA","tab.activeForeground":"#121417","tab.border":"#DBDBDC","tab.inactiveBackground":"#EAEAEB","titleBar.activeBackground":"#EAEAEB","titleBar.activeForeground":"#424243","titleBar.inactiveBackground":"#EAEAEB","titleBar.inactiveForeground":"#424243"},gz="C4A Light",xz="c4a-light",yz=JSON.parse('[{"scope":["comment"],"settings":{"fontStyle":"italic","foreground":"#A0A1A7"}},{"scope":["comment markup.link"],"settings":{"foreground":"#A0A1A7"}},{"scope":["entity.name.type"],"settings":{"foreground":"#C18401"}},{"scope":["entity.other.inherited-class"],"settings":{"foreground":"#C18401"}},{"scope":["keyword"],"settings":{"foreground":"#A626A4"}},{"scope":["keyword.control"],"settings":{"foreground":"#A626A4"}},{"scope":["keyword.operator"],"settings":{"foreground":"#383A42"}},{"scope":["keyword.other.special-method"],"settings":{"foreground":"#4078F2"}},{"scope":["keyword.other.unit"],"settings":{"foreground":"#986801"}},{"scope":["storage"],"settings":{"foreground":"#A626A4"}},{"scope":["storage.type.annotation","storage.type.primitive"],"settings":{"foreground":"#A626A4"}},{"scope":["storage.modifier.package","storage.modifier.import"],"settings":{"foreground":"#383A42"}},{"scope":["constant"],"settings":{"foreground":"#986801"}},{"scope":["constant.variable"],"settings":{"foreground":"#986801"}},{"scope":["constant.character.escape"],"settings":{"foreground":"#0184BC"}},{"scope":["constant.numeric"],"settings":{"foreground":"#986801"}},{"scope":["constant.other.color"],"settings":{"foreground":"#0184BC"}},{"scope":["constant.other.symbol"],"settings":{"foreground":"#0184BC"}},{"scope":["variable"],"settings":{"foreground":"#E45649"}},{"scope":["variable.interpolation"],"settings":{"foreground":"#CA1243"}},{"scope":["variable.parameter"],"settings":{"foreground":"#383A42"}},{"scope":["string"],"settings":{"foreground":"#50A14F"}},{"scope":["string > source","string embedded"],"settings":{"foreground":"#383A42"}},{"scope":["string.regexp"],"settings":{"foreground":"#0184BC"}},{"scope":["string.regexp source.ruby.embedded"],"settings":{"foreground":"#C18401"}},{"scope":["string.other.link"],"settings":{"foreground":"#E45649"}},{"scope":["punctuation.definition.comment"],"settings":{"foreground":"#A0A1A7"}},{"scope":["punctuation.definition.method-parameters","punctuation.definition.function-parameters","punctuation.definition.parameters","punctuation.definition.separator","punctuation.definition.seperator","punctuation.definition.array"],"settings":{"foreground":"#383A42"}},{"scope":["punctuation.definition.heading","punctuation.definition.identity"],"settings":{"foreground":"#4078F2"}},{"scope":["punctuation.definition.bold"],"settings":{"fontStyle":"bold","foreground":"#C18401"}},{"scope":["punctuation.definition.italic"],"settings":{"fontStyle":"italic","foreground":"#A626A4"}},{"scope":["punctuation.section.embedded"],"settings":{"foreground":"#CA1243"}},{"scope":["punctuation.section.method","punctuation.section.class","punctuation.section.inner-class"],"settings":{"foreground":"#383A42"}},{"scope":["support.class"],"settings":{"foreground":"#C18401"}},{"scope":["support.type"],"settings":{"foreground":"#0184BC"}},{"scope":["support.function"],"settings":{"foreground":"#0184BC"}},{"scope":["support.function.any-method"],"settings":{"foreground":"#4078F2"}},{"scope":["entity.name.function"],"settings":{"foreground":"#4078F2"}},{"scope":["entity.name.class","entity.name.type.class"],"settings":{"foreground":"#C18401"}},{"scope":["entity.name.section"],"settings":{"foreground":"#4078F2"}},{"scope":["entity.name.tag"],"settings":{"foreground":"#E45649"}},{"scope":["entity.other.attribute-name"],"settings":{"foreground":"#986801"}},{"scope":["entity.other.attribute-name.id"],"settings":{"foreground":"#4078F2"}},{"scope":["meta.class"],"settings":{"foreground":"#C18401"}},{"scope":["meta.class.body"],"settings":{"foreground":"#383A42"}},{"scope":["meta.method-call","meta.method"],"settings":{"foreground":"#383A42"}},{"scope":["meta.definition.variable"],"settings":{"foreground":"#E45649"}},{"scope":["meta.link"],"settings":{"foreground":"#986801"}},{"scope":["meta.require"],"settings":{"foreground":"#4078F2"}},{"scope":["meta.selector"],"settings":{"foreground":"#A626A4"}},{"scope":["meta.separator"],"settings":{"foreground":"#383A42"}},{"scope":["meta.tag"],"settings":{"foreground":"#383A42"}},{"scope":["underline"],"settings":{"text-decoration":"underline"}},{"scope":["none"],"settings":{"foreground":"#383A42"}},{"scope":["invalid.deprecated"],"settings":{"background":"#F2A60D","foreground":"#000000"}},{"scope":["invalid.illegal"],"settings":{"background":"#FF1414","foreground":"#50A14F"}},{"scope":["markup.bold"],"settings":{"fontStyle":"bold","foreground":"#986801"}},{"scope":["markup.changed"],"settings":{"foreground":"#A626A4"}},{"scope":["markup.deleted"],"settings":{"foreground":"#E45649"}},{"scope":["markup.italic"],"settings":{"fontStyle":"italic","foreground":"#A626A4"}},{"scope":["markup.heading"],"settings":{"foreground":"#ef6f2e"}},{"scope":["markup.heading punctuation.definition.heading"],"settings":{"foreground":"#ef6f2e"}},{"scope":["markup.link"],"settings":{"foreground":"#0184BC"}},{"scope":["markup.inserted"],"settings":{"foreground":"#50A14F"}},{"scope":["markup.quote"],"settings":{"foreground":"#986801"}},{"scope":["markup.raw"],"settings":{"foreground":"#50A14F"}},{"scope":["source.c keyword.operator"],"settings":{"foreground":"#A626A4"}},{"scope":["source.cpp keyword.operator"],"settings":{"foreground":"#A626A4"}},{"scope":["source.cs keyword.operator"],"settings":{"foreground":"#A626A4"}},{"scope":["source.css property-name","source.css property-value"],"settings":{"foreground":"#696C77"}},{"scope":["source.css property-name.support","source.css property-value.support"],"settings":{"foreground":"#383A42"}},{"scope":["source.elixir source.embedded.source"],"settings":{"foreground":"#383A42"}},{"scope":["source.elixir constant.language","source.elixir constant.numeric","source.elixir constant.definition"],"settings":{"foreground":"#4078F2"}},{"scope":["source.elixir variable.definition","source.elixir variable.anonymous"],"settings":{"foreground":"#A626A4"}},{"scope":["source.elixir parameter.variable.function"],"settings":{"fontStyle":"italic","foreground":"#986801"}},{"scope":["source.elixir quoted"],"settings":{"foreground":"#50A14F"}},{"scope":["source.elixir keyword.special-method","source.elixir embedded.section","source.elixir embedded.source.empty"],"settings":{"foreground":"#E45649"}},{"scope":["source.elixir readwrite.module punctuation"],"settings":{"foreground":"#E45649"}},{"scope":["source.elixir regexp.section","source.elixir regexp.string"],"settings":{"foreground":"#CA1243"}},{"scope":["source.elixir separator","source.elixir keyword.operator"],"settings":{"foreground":"#986801"}},{"scope":["source.elixir variable.constant"],"settings":{"foreground":"#C18401"}},{"scope":["source.elixir array","source.elixir scope","source.elixir section"],"settings":{"foreground":"#696C77"}},{"scope":["source.gfm markup"],"settings":{"-webkit-font-smoothing":"auto"}},{"scope":["source.gfm link entity"],"settings":{"foreground":"#4078F2"}},{"scope":["source.go storage.type.string"],"settings":{"foreground":"#A626A4"}},{"scope":["source.ini keyword.other.definition.ini"],"settings":{"foreground":"#E45649"}},{"scope":["source.java storage.modifier.import"],"settings":{"foreground":"#C18401"}},{"scope":["source.java storage.type"],"settings":{"foreground":"#C18401"}},{"scope":["source.java keyword.operator.instanceof"],"settings":{"foreground":"#A626A4"}},{"scope":["source.java-properties meta.key-pair"],"settings":{"foreground":"#E45649"}},{"scope":["source.java-properties meta.key-pair > punctuation"],"settings":{"foreground":"#383A42"}},{"scope":["source.js keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["source.js keyword.operator.delete","source.js keyword.operator.in","source.js keyword.operator.of","source.js keyword.operator.instanceof","source.js keyword.operator.new","source.js keyword.operator.typeof","source.js keyword.operator.void"],"settings":{"foreground":"#A626A4"}},{"scope":["source.ts keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["source.flow keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["source.json meta.structure.dictionary.json > string.quoted.json"],"settings":{"foreground":"#E45649"}},{"scope":["source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string"],"settings":{"foreground":"#E45649"}},{"scope":["source.json meta.structure.dictionary.json > value.json > string.quoted.json","source.json meta.structure.array.json > value.json > string.quoted.json","source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation","source.json meta.structure.array.json > value.json > string.quoted.json > punctuation"],"settings":{"foreground":"#50A14F"}},{"scope":["source.json meta.structure.dictionary.json > constant.language.json","source.json meta.structure.array.json > constant.language.json"],"settings":{"foreground":"#0184BC"}},{"scope":["ng.interpolation"],"settings":{"foreground":"#E45649"}},{"scope":["ng.interpolation.begin","ng.interpolation.end"],"settings":{"foreground":"#4078F2"}},{"scope":["ng.interpolation function"],"settings":{"foreground":"#E45649"}},{"scope":["ng.interpolation function.begin","ng.interpolation function.end"],"settings":{"foreground":"#4078F2"}},{"scope":["ng.interpolation bool"],"settings":{"foreground":"#986801"}},{"scope":["ng.interpolation bracket"],"settings":{"foreground":"#383A42"}},{"scope":["ng.pipe","ng.operator"],"settings":{"foreground":"#383A42"}},{"scope":["ng.tag"],"settings":{"foreground":"#0184BC"}},{"scope":["ng.attribute-with-value attribute-name"],"settings":{"foreground":"#C18401"}},{"scope":["ng.attribute-with-value string"],"settings":{"foreground":"#A626A4"}},{"scope":["ng.attribute-with-value string.begin","ng.attribute-with-value string.end"],"settings":{"foreground":"#383A42"}},{"scope":["source.ruby constant.other.symbol > punctuation"],"settings":{"foreground":"inherit"}},{"scope":["source.php class.bracket"],"settings":{"foreground":"#383A42"}},{"scope":["source.python keyword.operator.logical.python"],"settings":{"foreground":"#A626A4"}},{"scope":["source.python variable.parameter"],"settings":{"foreground":"#986801"}},{"scope":"customrule","settings":{"foreground":"#383A42"}},{"scope":"support.type.property-name","settings":{"foreground":"#383A42"}},{"scope":"string.quoted.double punctuation","settings":{"foreground":"#50A14F"}},{"scope":"support.constant","settings":{"foreground":"#986801"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#E45649"}},{"scope":"support.type.property-name.json punctuation","settings":{"foreground":"#E45649"}},{"scope":["punctuation.separator.key-value.ts","punctuation.separator.key-value.js","punctuation.separator.key-value.tsx"],"settings":{"foreground":"#0184BC"}},{"scope":["source.js.embedded.html keyword.operator","source.ts.embedded.html keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["variable.other.readwrite.js","variable.other.readwrite.ts","variable.other.readwrite.tsx"],"settings":{"foreground":"#383A42"}},{"scope":["support.variable.dom.js","support.variable.dom.ts"],"settings":{"foreground":"#E45649"}},{"scope":["support.variable.property.dom.js","support.variable.property.dom.ts"],"settings":{"foreground":"#E45649"}},{"scope":["meta.template.expression.js punctuation.definition","meta.template.expression.ts punctuation.definition"],"settings":{"foreground":"#CA1243"}},{"scope":["source.ts punctuation.definition.typeparameters","source.js punctuation.definition.typeparameters","source.tsx punctuation.definition.typeparameters"],"settings":{"foreground":"#383A42"}},{"scope":["source.ts punctuation.definition.block","source.js punctuation.definition.block","source.tsx punctuation.definition.block"],"settings":{"foreground":"#383A42"}},{"scope":["source.ts punctuation.separator.comma","source.js punctuation.separator.comma","source.tsx punctuation.separator.comma"],"settings":{"foreground":"#383A42"}},{"scope":["support.variable.property.js","support.variable.property.ts","support.variable.property.tsx"],"settings":{"foreground":"#E45649"}},{"scope":["keyword.control.default.js","keyword.control.default.ts","keyword.control.default.tsx"],"settings":{"foreground":"#E45649"}},{"scope":["keyword.operator.expression.instanceof.js","keyword.operator.expression.instanceof.ts","keyword.operator.expression.instanceof.tsx"],"settings":{"foreground":"#A626A4"}},{"scope":["keyword.operator.expression.of.js","keyword.operator.expression.of.ts","keyword.operator.expression.of.tsx"],"settings":{"foreground":"#A626A4"}},{"scope":["meta.brace.round.js","meta.array-binding-pattern-variable.js","meta.brace.square.js","meta.brace.round.ts","meta.array-binding-pattern-variable.ts","meta.brace.square.ts","meta.brace.round.tsx","meta.array-binding-pattern-variable.tsx","meta.brace.square.tsx"],"settings":{"foreground":"#383A42"}},{"scope":["source.js punctuation.accessor","source.ts punctuation.accessor","source.tsx punctuation.accessor"],"settings":{"foreground":"#383A42"}},{"scope":["punctuation.terminator.statement.js","punctuation.terminator.statement.ts","punctuation.terminator.statement.tsx"],"settings":{"foreground":"#383A42"}},{"scope":["meta.array-binding-pattern-variable.js variable.other.readwrite.js","meta.array-binding-pattern-variable.ts variable.other.readwrite.ts","meta.array-binding-pattern-variable.tsx variable.other.readwrite.tsx"],"settings":{"foreground":"#986801"}},{"scope":["source.js support.variable","source.ts support.variable","source.tsx support.variable"],"settings":{"foreground":"#E45649"}},{"scope":["variable.other.constant.property.js","variable.other.constant.property.ts","variable.other.constant.property.tsx"],"settings":{"foreground":"#986801"}},{"scope":["keyword.operator.new.ts","keyword.operator.new.j","keyword.operator.new.tsx"],"settings":{"foreground":"#A626A4"}},{"scope":["source.ts keyword.operator","source.tsx keyword.operator"],"settings":{"foreground":"#0184BC"}},{"scope":["punctuation.separator.parameter.js","punctuation.separator.parameter.ts","punctuation.separator.parameter.tsx "],"settings":{"foreground":"#383A42"}},{"scope":["constant.language.import-export-all.js","constant.language.import-export-all.ts"],"settings":{"foreground":"#E45649"}},{"scope":["constant.language.import-export-all.jsx","constant.language.import-export-all.tsx"],"settings":{"foreground":"#0184BC"}},{"scope":["keyword.control.as.js","keyword.control.as.ts","keyword.control.as.jsx","keyword.control.as.tsx"],"settings":{"foreground":"#383A42"}},{"scope":["variable.other.readwrite.alias.js","variable.other.readwrite.alias.ts","variable.other.readwrite.alias.jsx","variable.other.readwrite.alias.tsx"],"settings":{"foreground":"#E45649"}},{"scope":["variable.other.constant.js","variable.other.constant.ts","variable.other.constant.jsx","variable.other.constant.tsx"],"settings":{"foreground":"#986801"}},{"scope":["meta.export.default.js variable.other.readwrite.js","meta.export.default.ts variable.other.readwrite.ts"],"settings":{"foreground":"#E45649"}},{"scope":["source.js meta.template.expression.js punctuation.accessor","source.ts meta.template.expression.ts punctuation.accessor","source.tsx meta.template.expression.tsx punctuation.accessor"],"settings":{"foreground":"#50A14F"}},{"scope":["source.js meta.import-equals.external.js keyword.operator","source.jsx meta.import-equals.external.jsx keyword.operator","source.ts meta.import-equals.external.ts keyword.operator","source.tsx meta.import-equals.external.tsx keyword.operator"],"settings":{"foreground":"#383A42"}},{"scope":"entity.name.type.module.js,entity.name.type.module.ts,entity.name.type.module.jsx,entity.name.type.module.tsx","settings":{"foreground":"#50A14F"}},{"scope":"meta.class.js,meta.class.ts,meta.class.jsx,meta.class.tsx","settings":{"foreground":"#383A42"}},{"scope":["meta.definition.property.js variable","meta.definition.property.ts variable","meta.definition.property.jsx variable","meta.definition.property.tsx variable"],"settings":{"foreground":"#383A42"}},{"scope":["meta.type.parameters.js support.type","meta.type.parameters.jsx support.type","meta.type.parameters.ts support.type","meta.type.parameters.tsx support.type"],"settings":{"foreground":"#383A42"}},{"scope":["source.js meta.tag.js keyword.operator","source.jsx meta.tag.jsx keyword.operator","source.ts meta.tag.ts keyword.operator","source.tsx meta.tag.tsx keyword.operator"],"settings":{"foreground":"#383A42"}},{"scope":["meta.tag.js punctuation.section.embedded","meta.tag.jsx punctuation.section.embedded","meta.tag.ts punctuation.section.embedded","meta.tag.tsx punctuation.section.embedded"],"settings":{"foreground":"#383A42"}},{"scope":["meta.array.literal.js variable","meta.array.literal.jsx variable","meta.array.literal.ts variable","meta.array.literal.tsx variable"],"settings":{"foreground":"#C18401"}},{"scope":["support.type.object.module.js","support.type.object.module.jsx","support.type.object.module.ts","support.type.object.module.tsx"],"settings":{"foreground":"#E45649"}},{"scope":["constant.language.json"],"settings":{"foreground":"#0184BC"}},{"scope":["variable.other.constant.object.js","variable.other.constant.object.jsx","variable.other.constant.object.ts","variable.other.constant.object.tsx"],"settings":{"foreground":"#986801"}},{"scope":["storage.type.property.js","storage.type.property.jsx","storage.type.property.ts","storage.type.property.tsx"],"settings":{"foreground":"#0184BC"}},{"scope":["meta.template.expression.js string.quoted punctuation.definition","meta.template.expression.jsx string.quoted punctuation.definition","meta.template.expression.ts string.quoted punctuation.definition","meta.template.expression.tsx string.quoted punctuation.definition"],"settings":{"foreground":"#50A14F"}},{"scope":["meta.template.expression.js string.template punctuation.definition.string.template","meta.template.expression.jsx string.template punctuation.definition.string.template","meta.template.expression.ts string.template punctuation.definition.string.template","meta.template.expression.tsx string.template punctuation.definition.string.template"],"settings":{"foreground":"#50A14F"}},{"scope":["keyword.operator.expression.in.js","keyword.operator.expression.in.jsx","keyword.operator.expression.in.ts","keyword.operator.expression.in.tsx"],"settings":{"foreground":"#A626A4"}},{"scope":["variable.other.object.js","variable.other.object.ts"],"settings":{"foreground":"#383A42"}},{"scope":["meta.object-literal.key.js","meta.object-literal.key.ts"],"settings":{"foreground":"#E45649"}},{"scope":"source.python constant.other","settings":{"foreground":"#383A42"}},{"scope":"source.python constant","settings":{"foreground":"#986801"}},{"scope":"constant.character.format.placeholder.other.python storage","settings":{"foreground":"#986801"}},{"scope":"support.variable.magic.python","settings":{"foreground":"#E45649"}},{"scope":"meta.function.parameters.python","settings":{"foreground":"#986801"}},{"scope":"punctuation.separator.annotation.python","settings":{"foreground":"#383A42"}},{"scope":"punctuation.separator.parameters.python","settings":{"foreground":"#383A42"}},{"scope":"entity.name.variable.field.cs","settings":{"foreground":"#E45649"}},{"scope":"source.cs keyword.operator","settings":{"foreground":"#383A42"}},{"scope":"variable.other.readwrite.cs","settings":{"foreground":"#383A42"}},{"scope":"variable.other.object.cs","settings":{"foreground":"#383A42"}},{"scope":"variable.other.object.property.cs","settings":{"foreground":"#383A42"}},{"scope":"entity.name.variable.property.cs","settings":{"foreground":"#4078F2"}},{"scope":"storage.type.cs","settings":{"foreground":"#C18401"}},{"scope":"keyword.other.unsafe.rust","settings":{"foreground":"#A626A4"}},{"scope":"entity.name.type.rust","settings":{"foreground":"#0184BC"}},{"scope":"storage.modifier.lifetime.rust","settings":{"foreground":"#383A42"}},{"scope":"entity.name.lifetime.rust","settings":{"foreground":"#986801"}},{"scope":"storage.type.core.rust","settings":{"foreground":"#0184BC"}},{"scope":"meta.attribute.rust","settings":{"foreground":"#986801"}},{"scope":"storage.class.std.rust","settings":{"foreground":"#0184BC"}},{"scope":"markup.raw.block.markdown","settings":{"foreground":"#383A42"}},{"scope":"punctuation.definition.variable.shell","settings":{"foreground":"#E45649"}},{"scope":"support.constant.property-value.css","settings":{"foreground":"#383A42"}},{"scope":"punctuation.definition.constant.css","settings":{"foreground":"#986801"}},{"scope":"punctuation.separator.key-value.scss","settings":{"foreground":"#E45649"}},{"scope":"punctuation.definition.constant.scss","settings":{"foreground":"#986801"}},{"scope":"meta.property-list.scss punctuation.separator.key-value.scss","settings":{"foreground":"#383A42"}},{"scope":"storage.type.primitive.array.java","settings":{"foreground":"#C18401"}},{"scope":"entity.name.section.markdown","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.heading.markdown","settings":{"foreground":"#ef6f2e"}},{"scope":"markup.heading.setext","settings":{"foreground":"#ef6f2e"}},{"scope":"punctuation.definition.bold.markdown","settings":{"foreground":"#986801"}},{"scope":"markup.inline.raw.markdown","settings":{"foreground":"#50A14F"}},{"scope":"beginning.punctuation.definition.list.markdown","settings":{"foreground":"#E45649"}},{"scope":"markup.quote.markdown","settings":{"fontStyle":"italic","foreground":"#A0A1A7"}},{"scope":["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","punctuation.definition.metadata.markdown"],"settings":{"foreground":"#383A42"}},{"scope":"punctuation.definition.metadata.markdown","settings":{"foreground":"#A626A4"}},{"scope":["markup.underline.link.markdown","markup.underline.link.image.markdown"],"settings":{"foreground":"#A626A4"}},{"scope":["string.other.link.title.markdown","string.other.link.description.markdown"],"settings":{"foreground":"#4078F2"}},{"scope":"punctuation.separator.variable.ruby","settings":{"foreground":"#E45649"}},{"scope":"variable.other.constant.ruby","settings":{"foreground":"#986801"}},{"scope":"keyword.operator.other.ruby","settings":{"foreground":"#50A14F"}},{"scope":"punctuation.definition.variable.php","settings":{"foreground":"#E45649"}},{"scope":"meta.class.php","settings":{"foreground":"#383A42"}}]'),bz="light",v4={colors:mz,displayName:gz,name:xz,tokenColors:yz,type:bz},vz={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",go:"go",rs:"rust",java:"java",kt:"kotlin",rb:"ruby",php:"php",cs:"csharp",cpp:"cpp",c:"c",h:"c",swift:"swift",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",html:"html",css:"css",scss:"scss",sql:"sql",sh:"bash",bash:"bash",zsh:"bash",dockerfile:"dockerfile"};function _z(e){if(!e)return"plaintext";const t=e.split(".").pop()?.toLowerCase();return t?vz[t]??"plaintext":"plaintext"}function __({code:e,language:t,sourcePath:n}){const r=Kd(d=>d.theme),o=(r==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":r)==="dark"?b4:v4,l=t??_z(n);return u.jsx("div",{className:"flex min-w-0 flex-1 flex-col rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface text-xs leading-relaxed overflow-auto c4a-scrollbar [&>*]:flex-1 [&_pre]:min-h-full [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:!bg-transparent [&_code]:!bg-transparent",children:u.jsx(y4,{language:l,theme:o,children:e})})}let Uu=null,Hu=[];const qu=da((e,t)=>({cache:new Map,pending:new Set,resolve:n=>{const{cache:r,pending:i}=t(),o=n.filter(l=>!r.has(l)&&!i.has(l)&&!Hu.includes(l));o.length!==0&&(Hu.push(...o),e({pending:new Set([...i,...o])}),Uu&&clearTimeout(Uu),Uu=setTimeout(()=>{const l=[...Hu];Hu=[],Uu=null,l.length!==0&&Pe.post("/resolve",{refs:l}).then(d=>{const{cache:p,pending:f}=t(),m=new Map(p),g=new Set(f);for(const y of l){const b=d[y];b?m.set(y,b):m.set(y,{exists:!1}),g.delete(y)}e({cache:m,pending:g})}).catch(()=>{const{cache:d,pending:p}=t(),f=new Map(d),m=new Set(p);for(const g of l)f.set(g,{error:!0,exists:!1}),m.delete(g);e({cache:f,pending:m})})},50))},retry:n=>{const{cache:r}=t(),i=new Map(r);i.delete(n),e({cache:i}),t().resolve([n])}})),tm="/studio",mr={entity:e=>`${tm}/entities/${e}`,relation:e=>`${tm}/relations/${e}`,content:e=>`${tm}/contents/${e}`},_4=/^ref:(entity|relation|content):(.+)$/;function wz(e){const t=_4.exec(e);return!t||!t[2]?null:{type:t[1],id:t[2]}}function Wg(e){return typeof e=="string"&&_4.test(e)}const w_={Component:"๐Ÿ—",SoR:"๐Ÿ“‹",Product:"๐Ÿ“ฆ",Container:"๐Ÿ“‚",Contract:"๐Ÿ“",Epic:"๐ŸŽฏ"};function kz(e,t){if(e.type==="content")return"๐Ÿ“„";if(e.type==="relation")return"๐Ÿ”—";const n=t?.entity_type;return n&&w_[n]?w_[n]:"๐Ÿ”น"}function Sz(e){switch(e.type){case"entity":return mr.entity(e.id);case"relation":return mr.relation(e.id);case"content":return mr.content(e.id);default:return"#"}}function Jg({pointer:e}){const t=Pt(),{t:n}=_e(),r=ho(),i=qu(b=>b.cache),o=qu(b=>b.pending);_.useEffect(()=>{qu.getState().resolve([e])},[e]);const l=wz(e);if(!l)return u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:e});const d=i.get(e);if(o.has(e)||!d&&!i.has(e))return u.jsx("span",{className:"inline-block animate-pulse bg-c4a-bg-hover rounded px-2 py-0.5 text-xs font-mono w-24 h-4"});if(d?.error)return u.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted cursor-pointer",title:n("ref.retry"),onClick:()=>qu.getState().retry(e),children:["<",n("ref.unknown"),": ",l.id.slice(0,12),">"]});if(d&&!d.exists)return u.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted line-through",title:e,children:["<",n("ref.stale"),": ",l.id.slice(0,12),">"]});const f=kz(l,d),m=l.type==="relation"?d?.relation_type||l.id.slice(0,12):d?.name||l.id.slice(0,12),g=Sz(l),y=()=>{r?.active?r.navigate(l.type,l.id,m,f):t(g)};return u.jsxs("span",{className:"inline-flex items-center gap-1 text-c4a-accent hover:underline cursor-pointer text-xs font-mono",onClick:y,title:e,children:[u.jsx("span",{children:f}),u.jsx("span",{children:m})]})}function hc({data:e,defaultExpanded:t=2}){return u.jsx("div",{className:"font-mono text-xs",children:u.jsx(ig,{value:e,depth:0,defaultExpanded:t})})}function ig({keyName:e,value:t,depth:n,defaultExpanded:r}){const[i,o]=_.useState(n<r);if(typeof t=="string"&&Wg(t))return u.jsxs("div",{className:"flex items-baseline gap-1",style:{paddingLeft:n*16},children:[e!==void 0&&u.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),u.jsx(Jg,{pointer:t})]});if(t==null)return u.jsxs("div",{style:{paddingLeft:n*16},children:[e!==void 0&&u.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),u.jsx("span",{className:"text-c4a-text-muted",children:"null"})]});if(typeof t=="string")return u.jsxs("div",{style:{paddingLeft:n*16},children:[e!==void 0&&u.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),u.jsxs("span",{className:"text-c4a-accent",children:['"',t,'"']})]});if(typeof t=="number")return u.jsxs("div",{style:{paddingLeft:n*16},children:[e!==void 0&&u.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),u.jsx("span",{className:"text-c4a-success",children:t})]});if(typeof t=="boolean")return u.jsxs("div",{style:{paddingLeft:n*16},children:[e!==void 0&&u.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),u.jsx("span",{className:"text-c4a-warning",children:String(t)})]});if(Array.isArray(t))return t.length===0?u.jsxs("div",{style:{paddingLeft:n*16},children:[e!==void 0&&u.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),u.jsx("span",{className:"text-c4a-text-muted",children:"[]"})]}):u.jsxs("div",{children:[u.jsxs("div",{style:{paddingLeft:n*16},className:"cursor-pointer hover:bg-c4a-bg-hover rounded px-1 -mx-1",onClick:()=>o(!i),children:[u.jsx("span",{className:"text-c4a-text-muted mr-1",children:i?"โ–ผ":"โ–ถ"}),e!==void 0&&u.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),!i&&u.jsxs("span",{className:"text-c4a-text-muted",children:["[",t.length," items]"]})]}),i&&t.map((l,d)=>u.jsx(ig,{keyName:String(d),value:l,depth:n+1,defaultExpanded:r},d))]});if(typeof t=="object"){const l=Object.entries(t);return l.length===0?u.jsxs("div",{style:{paddingLeft:n*16},children:[e!==void 0&&u.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),u.jsx("span",{className:"text-c4a-text-muted",children:"{}"})]}):u.jsxs("div",{children:[u.jsxs("div",{style:{paddingLeft:n*16},className:"cursor-pointer hover:bg-c4a-bg-hover rounded px-1 -mx-1",onClick:()=>o(!i),children:[u.jsx("span",{className:"text-c4a-text-muted mr-1",children:i?"โ–ผ":"โ–ถ"}),e!==void 0&&u.jsxs("span",{className:"text-c4a-text-secondary",children:[e,": "]}),!i&&u.jsx("span",{className:"text-c4a-text-muted",children:"{ ... }"})]}),i&&l.map(([d,p])=>u.jsx(ig,{keyName:d,value:p,depth:n+1,defaultExpanded:r},d))]})}return null}const jz={Component:"๐Ÿ—",SoR:"๐Ÿ“‹",Product:"๐Ÿ“ฆ",Container:"๐Ÿ“‚",Contract:"๐Ÿ“",Epic:"๐ŸŽฏ"};function k_({entity:e}){const t=Pt(),n=ho(),r=jz[e.type]??"๐Ÿ”น",i=()=>{n?.active?n.navigate("entity",e.id,e.name,r):t(mr.entity(e.id))};return u.jsx("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-3 cursor-pointer hover:border-c4a-accent transition-colors",onClick:i,children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"shrink-0",children:r}),u.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:e.name}),e.kind&&u.jsx(Yt,{variant:"muted",children:e.kind})]})})}const Nz=new Set(["ts","tsx","js","jsx","mts","mjs","cts","cjs","py","pyi","go","rs","java","kt","c","cpp","h","hpp","cs","rb","php","swift","scala","zig","lua","sh","bash","vue","svelte"]),Cz=new Set(["md","txt","rst","adoc"]);function S_(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}function j_({data:e}){const{t}=_e(),n=Pt(),r=ho(),i=e.manifest??{},o=i.name??e.name??t("package.unknown"),l=i.version,d=i.license,p=i.description,f=i.dependencies,m=i.devDependencies,g=f?Object.entries(f):[],y=m?Object.entries(m):[],[b,w]=_.useState(!1),[k,j]=_.useState(null),S=e.files??[],E=S.filter(D=>Nz.has(S_(D.path))),C=S.filter(D=>Cz.has(S_(D.path)));_.useEffect(()=>{const D=S.find(A=>{const P=A.path.toLowerCase();return(P==="readme.md"||P.endsWith("/readme.md"))&&A.hash_id});if(!D?.hash_id){j(null);return}Pe.get(`/contents/${D.hash_id}/raw`).then(A=>j(A.content)).catch(()=>j(null))},[S]);const z=(D,A)=>{r?.active?r.navigate("content",D,A,"๐Ÿ“„"):n(mr.content(D))};return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:t("raw.basic_info")}),u.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 font-mono text-xs",children:[u.jsx("span",{className:"text-c4a-text-muted uppercase",children:t("raw.field.name")}),u.jsx("span",{className:"text-c4a-text-primary font-bold",children:o}),l&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-c4a-text-muted uppercase",children:t("raw.field.version")}),u.jsx("span",{className:"text-c4a-text-primary",children:l})]}),d&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-c4a-text-muted uppercase",children:t("raw.field.license")}),u.jsx("span",{className:"text-c4a-text-primary",children:d})]}),p&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-c4a-text-muted uppercase",children:t("raw.field.description")}),u.jsx("span",{className:"text-c4a-text-secondary",children:p})]})]}),e.manifest_type&&u.jsx("div",{className:"mt-2",children:u.jsx("span",{className:"rounded bg-c4a-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase text-c4a-accent/60",children:e.manifest_type})})]}),S.length>0&&u.jsxs("div",{className:"flex flex-wrap gap-3",children:[u.jsx(xn,{icon:u.jsx(Mg,{size:14}),label:t("raw.code_files"),value:E.length,size:"sm"}),u.jsx(xn,{icon:u.jsx(Vn,{size:14}),label:t("raw.doc_files"),value:C.length,size:"sm"}),u.jsx(xn,{icon:u.jsx(Hr,{size:14}),label:t("raw.total_files"),value:S.length,size:"sm"})]}),u.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:[t("raw.dependencies")," (",g.length,")"]}),g.length===0?u.jsx("p",{className:"font-mono text-xs text-c4a-text-muted",children:t("raw.no_dependencies")}):u.jsx("div",{className:"space-y-1",children:g.map(([D,A])=>u.jsxs("div",{className:"flex justify-between font-mono text-xs",children:[u.jsx("span",{className:"text-c4a-text-primary",children:D}),u.jsx("span",{className:"text-c4a-text-muted",children:A})]},D))})]}),y.length>0&&u.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5",onClick:()=>w(D=>!D),children:[u.jsx(Gt,{size:12,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${b?"rotate-90":""}`}),u.jsxs("h4",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:[t("raw.dev_dependencies")," (",y.length,")"]})]}),b&&u.jsx("div",{className:"mt-2 space-y-1",children:y.map(([D,A])=>u.jsxs("div",{className:"flex justify-between font-mono text-xs",children:[u.jsx("span",{className:"text-c4a-text-primary",children:D}),u.jsx("span",{className:"text-c4a-text-muted",children:A})]},D))})]}),k&&u.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:t("raw.readme")}),u.jsx("div",{className:"max-h-64 overflow-y-auto c4a-scrollbar prose prose-invert prose-sm max-w-none text-c4a-text-secondary",children:u.jsx("pre",{className:"whitespace-pre-wrap font-sans text-sm leading-relaxed",children:k})})]}),S.length>0&&u.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:[t("package.files")," (",S.length,")"]}),u.jsx("div",{className:"space-y-1",children:S.map(D=>u.jsxs("div",{className:"flex items-center justify-between font-mono text-xs",children:[u.jsxs("span",{className:"flex items-center gap-1 text-c4a-text-secondary",children:[u.jsx("span",{children:"๐Ÿ“„"}),u.jsx("span",{children:D.path})]}),D.hash_id&&u.jsx("span",{className:"font-mono text-[10px] text-c4a-accent hover:underline cursor-pointer",onClick:()=>z(D.hash_id,D.path),children:D.hash_id.slice(0,12)})]},D.path))})]})]})}const Vu=["daemon_starting","cloning","preparing"],Ez=["scanning","parsing","analyzing","uploading"],ml=["chunking","annotating","post-processing","embedding","storing"],sg={daemon_starting:"index.stage.daemon_starting",cloning:"index.stage.cloning",preparing:"index.stage.preparing",scanning:"index.stage.scanning",parsing:"index.stage.parsing",analyzing:"index.stage.analyzing",uploading:"index.stage.uploading",skipping:"index.stage.skipping",chunking:"index.stage.chunking",annotating:"index.stage.annotating","post-processing":"index.stage.post_processing",embedding:"index.stage.embedding",storing:"index.stage.storing"},N_={daemon_starting:5,cloning:10,preparing:5,scanning:15,parsing:55,analyzing:20,uploading:10},Az={chunking:10,annotating:75,"post-processing":85,embedding:95,storing:100};function Tz(e){const t=e.reduce((i,o)=>i+(N_[o]??10),0),n={};let r=0;for(const i of e)r+=(N_[i]??10)/t*100,n[i]=Math.round(r);return n[e[e.length-1]]=100,n}const Rz={COMMIT_NOT_AVAILABLE:"index.error.commit_not_available",DAEMON_AUTO_START_FAILED:"index.error.daemon_start_failed",GIT_ARCHIVE_FAILED:"index.error.git_archive_failed"};function Lz(e,t){if(e){const n=Rz[e];return n?t(n):e}return t("index.code.error")}function gl(){const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`}function Gu(e,t,n,r){switch(e){case"daemon_starting":return t("index.log.daemon_ready");case"cloning":return t("index.log.clone_done");case"preparing":return t("index.log.prepare_done");case"scanning":return t("index.log.scan_done");case"parsing":return n!=null?t("index.log.parse_done",{count:n}):`${t(sg.parsing)} ${t("index.log.done_suffix")}`;case"analyzing":return t("index.log.analyze_done");case"uploading":return r?t("index.log.upload_done",{name:r}):t("index.log.done_suffix");default:return`${t(sg[e])} ${t("index.log.done_suffix")}`}}function Dz({sourceId:e,onComplete:t,retryModules:n}){const{t:r}=_e(),i=Ot(ie=>ie.indexingTasks.get(e)),[o,l]=_.useState([]),[d,p]=_.useState(!1),[f,m]=_.useState(!1),g=_.useRef(null),y=_.useRef(!1),b=_.useRef(null),w=_.useRef(null),[k,j]=_.useState(null),S=_.useRef(null),[E,C]=_.useState([]),[z,D]=_.useState(null),[A,P]=_.useState(new Set),[T,F]=_.useState(!0);_.useEffect(()=>{if(!i)return;const ie=i.stage;k!=="doc"&&Vu.includes(ie)&&!A.has(ie)&&P(pe=>new Set(pe).add(ie))},[i?.stage,k]),_.useEffect(()=>{if(i?.stage){if(ml.includes(i.stage)){k!=="doc"&&(j("doc"),g.current=null);return}!k&&i.stage!=="pending"&&i.stage!=="skipping"&&j("code")}},[i?.stage,k]),_.useEffect(()=>{i?.stage&&i.stage!=="skipping"&&i.stage!=="pending"&&(w.current=i.stage)},[i?.stage]);const M=k==="doc"||i?.stage&&ml.includes(i.stage)?"doc":k??"code",G=M==="doc"?ml:[...Vu.filter(ie=>A.has(ie)),...Ez],Q=G.map(ie=>({key:ie,label:r(sg[ie])})),re=M==="doc"?Az:Tz(G),$=_.useRef(0);_.useEffect(()=>{const ie=i?.pendingSkips;if(!ie||ie.length===0)return;const pe=ie.length;if(pe<=$.current)return;const Ee=ie.slice($.current);$.current=pe;const Ie=gl();l(Ue=>[...Ue,...Ee.map(be=>`[${Ie}] โญ ${be}`)].slice(-500))},[i?.pendingSkips]);const U=_.useRef(null),I=_.useRef(null);_.useEffect(()=>{if(!i||i.terminalState)return;const{stage:ie,currentFile:pe,totalFiles:Ee,processedFiles:Ie,moduleName:Ue}=i;if(M==="doc"){const ge=gl(),we=[],Xe=ml.indexOf(ie);if(ie!==g.current&&(g.current!==null&&(ie==="chunking"&&we.push(`[${ge}] ${r("index.doc.log.chunking")}`),ie==="annotating"&&we.push(`[${ge}] ${r("index.doc.log.annotating_start")}`),ie==="post-processing"&&we.push(`[${ge}] ${r("index.doc.log.post_processing")}`),ie==="embedding"&&we.push(`[${ge}] ${r("index.doc.log.embedding")}`),ie==="storing"&&we.push(`[${ge}] ${r("index.doc.log.storing")}`)),Xe>=0&&C(Me=>{const Je=new Set(Me);for(const zt of ml.slice(0,Xe))Je.add(zt);return Je.size===Me.length?Me:[...Je]}),D(ie),g.current=ie),i.message){const Me=typeof i.message=="string"?i.message:r(i.message.key,i.message.params);Me!==S.current&&(we.push(`[${ge}] ${Me}`),S.current=Me)}we.length>0&&l(Me=>[...Me,...we].slice(-500));return}if(ie==="skipping")return;const be=gl(),de=[],ke=Ue!=null&&Ue!==U.current;if(ie!==g.current){if(g.current==="pending"||g.current===null){D(ie),g.current=ie;const we=G.indexOf(ie);we>0&&C(Xe=>{const Me=new Set(Xe);for(const Je of G.slice(0,we))Me.add(Je);return Me.size===Xe.length?Xe:[...Me]}),Vu.includes(ie)&&de.push(`[${be}] ${r(`index.log.${ie}`)}`),de.length>0&&l(Xe=>[...Xe,...de].slice(-500));return}const ge=G.indexOf(ie);if(ge>=0){const we=G.slice(0,ge);if(C(Xe=>{const Me=new Set(Xe);for(const Je of we)Me.add(Je);return Me.size===Xe.length?Xe:[...Me]}),g.current&&g.current!=="skipping"){const Xe=G.indexOf(g.current);if(Xe<=ge){for(let Me=Xe;Me<ge;Me++){const Je=G[Me];de.push(`[${be}] ${Gu(Je,r,I.current,U.current)}`)}Vu.includes(ie)&&de.push(`[${be}] ${r(`index.log.${ie}`)}`)}else{for(let Me=Xe;Me<G.length;Me++){const Je=G[Me];de.push(`[${be}] ${Gu(Je,r,I.current,U.current)}`)}ke&&(de.push(`[${be}] โ”€โ”€ ${Ue} โ”€โ”€`),U.current=Ue,I.current=null);for(let Me=0;Me<ge;Me++){const Je=G[Me];de.push(`[${be}] ${Gu(Je,r,null,null)}`)}}}}D(ie),g.current=ie}ke&&U.current!==Ue&&(de.push(`[${be}] โ”€โ”€ ${Ue} โ”€โ”€`),U.current=Ue,I.current=null),Ee!=null&&(I.current=Ee),pe&&Ie!=null&&Ee!=null&&de.push(`[${be}] ${pe} (${Ie}/${Ee})`),de.length>0&&l(ge=>[...ge,...de].slice(-500))},[i,r,M,G]),_.useEffect(()=>{if(!i?.terminalState){y.current=!1;return}if(y.current)return;y.current=!0;const ie=gl();if(i.terminalState==="done"){const pe=[];g.current==="uploading"&&U.current&&pe.push(`[${ie}] ${Gu("uploading",r,I.current,U.current)}`),pe.push(`[${ie}] ${r("index.code.complete")}`),i.unchangedCount&&pe.push(`[${ie}] ${r("index.code.unchanged_count",{count:i.unchangedCount})}`),l(Ee=>[...Ee,...pe].slice(-500)),C(G.slice()),D(null);return}if(i.terminalState==="error"){const pe=i.errorMessage??r("index.code.error");l(Ee=>[...Ee,`[${ie}] ERROR: ${pe}`].slice(-500)),p(!0),D(null);return}if(i.terminalState==="timeout"){l(pe=>[...pe,`[${ie}] ${r("index.code.timeout")}`].slice(-500)),m(!0),D(null);return}},[i?.terminalState,e,r,t]),_.useEffect(()=>{b.current?.scrollIntoView({behavior:"smooth"})},[o]),_.useEffect(()=>{if(i?.terminalState!=="done"||!T)return;const ie=setTimeout(()=>{Ot.getState().clearIndexTask(e),t?.()},2e3);return()=>{clearTimeout(ie)}},[i?.terminalState,T,e,t]);const V=i&&!i.terminalState?{percent:i.progress,label:i.currentFile??""}:null,[te,oe]=_.useState(!1),R=_.useCallback(async()=>{oe(!0);try{(await Ot.getState().triggerIndex(e,n)).status==="skipped"?(Ot.getState().clearIndexTask(e),t?.()):(m(!1),p(!1),l([]),C([]),D(null),j(null),g.current=null,w.current=null,P(new Set))}catch{p(!0);const ie=gl();l(pe=>[...pe,`[${ie}] ${r("index.code.error")}`].slice(-500))}finally{oe(!1)}},[e,n,r,t]),B=_.useCallback(()=>{Ot.getState().clearIndexTask(e),t?.()},[e,t]),K=_.useCallback(()=>{Ot.getState().clearIndexTask(e),t?.()},[e,t]),O=i?.terminalState==="done",se=!!i&&!i?.terminalState;return u.jsxs("div",{className:"flex flex-col gap-4 pb-8",children:[u.jsx(Jk,{stages:Q,currentStage:z,completedStages:E,failedStage:d?w.current:null,progress:V,breakpoints:re,headerRight:O&&!T?u.jsx("button",{type:"button",className:"rounded-sm bg-c4a-accent px-2 py-0.5 font-mono text-[11px] text-white hover:bg-c4a-accent/90",onClick:K,children:r("index.code.done_continue")}):O&&T?u.jsx("span",{className:"animate-pulse font-mono text-[11px] text-c4a-text-muted",children:r("index.code.auto_continue_pending")}):se||O?u.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 select-none",children:[u.jsx("span",{className:`flex h-3.5 w-3.5 items-center justify-center rounded-sm border transition-colors ${T?"border-c4a-accent bg-c4a-accent":"border-c4a-border-default bg-transparent"}`,onClick:()=>F(ie=>!ie),children:T&&u.jsx(ua,{size:10,className:"text-white"})}),u.jsx("span",{className:"font-mono text-[11px] text-c4a-text-muted",onClick:()=>F(ie=>!ie),children:r("index.code.auto_continue")})]}):void 0}),f&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-c4a-warning",children:r("index.code.timeout")}),u.jsx("button",{type:"button",className:`shrink-0 rounded bg-c4a-accent px-3 py-1 font-mono text-xs text-white hover:bg-c4a-accent/90 ${te?"opacity-50 cursor-not-allowed":""}`,onClick:R,disabled:te,children:r("sources.import.retry")}),u.jsx("button",{type:"button",className:`shrink-0 rounded border border-c4a-border-default px-3 py-1 font-mono text-xs text-c4a-text-muted hover:text-c4a-text-primary ${te?"opacity-50 cursor-not-allowed":""}`,onClick:B,disabled:te,children:r("index.code.dismiss")})]}),d&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-c4a-error",children:Lz(i?.errorMessage,r)}),u.jsx("button",{type:"button",className:`shrink-0 rounded bg-c4a-accent px-3 py-1 font-mono text-xs text-white hover:bg-c4a-accent/90 ${te?"opacity-50 cursor-not-allowed":""}`,onClick:R,disabled:te,children:r("sources.import.retry")}),u.jsx("button",{type:"button",className:`shrink-0 rounded border border-c4a-border-default px-3 py-1 font-mono text-xs text-c4a-text-muted hover:text-c4a-text-primary ${te?"opacity-50 cursor-not-allowed":""}`,onClick:B,disabled:te,children:r("index.code.dismiss")})]}),u.jsxs("div",{className:"mt-4 min-h-[200px] max-h-[50vh] overflow-y-auto rounded bg-c4a-bg-base p-3 c4a-scrollbar",children:[o.map((ie,pe)=>u.jsx("div",{className:`font-mono text-xs leading-relaxed ${ie.includes("ERROR")?"text-red-400/80":"text-c4a-text-muted"}`,children:ie},pe)),u.jsx("div",{ref:b})]})]})}const nm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Oz={};function ex(e,t){const n=Oz,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return w4(e,r,i)}function w4(e,t,n){if(Mz(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return C_(e.children,t,n)}return Array.isArray(e)?C_(e,t,n):""}function C_(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=w4(e[i],t,n);return r.join("")}function Mz(e){return!!(e&&typeof e=="object")}const E_=document.createElement("i");function tx(e){const t="&"+e+";";E_.innerHTML=t;const n=E_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function gr(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function Lr(e,t){return e.length>0?(gr(e,e.length,0,t),e):t}const A_={}.hasOwnProperty;function k4(e){const t={};let n=-1;for(;++n<e.length;)zz(t,e[n]);return t}function zz(e,t){let n;for(n in t){const i=(A_.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){A_.call(i,l)||(i[l]=[]);const d=o[l];Iz(i[l],Array.isArray(d)?d:d?[d]:[])}}}function Iz(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);gr(e,0,0,r)}function S4(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"๏ฟฝ":String.fromCodePoint(n)}function qr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Hn=Ni(/[A-Za-z]/),zn=Ni(/[\dA-Za-z]/),$z=Ni(/[#-'*+\--9=?A-Z^-~]/);function Ld(e){return e!==null&&(e<32||e===127)}const og=Ni(/\d/),Bz=Ni(/[\dA-Fa-f]/),Pz=Ni(/[!-/:-@[-`{-~]/);function Ze(e){return e!==null&&e<-2}function Mt(e){return e!==null&&(e<0||e===32)}function dt(e){return e===-2||e===-1||e===32}const sf=Ni(new RegExp("\\p{P}|\\p{S}","u")),rs=Ni(/\s/);function Ni(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function go(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&zn(e.charCodeAt(n+1))&&zn(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const d=e.charCodeAt(n+1);o<56320&&d>56319&&d<57344?(l=String.fromCharCode(o,d),i=1):l="๏ฟฝ"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function xt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(p){return dt(p)?(e.enter(n),d(p)):t(p)}function d(p){return dt(p)&&o++<i?(e.consume(p),d):(e.exit(n),t(p))}}const Fz={tokenize:Uz};function Uz(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),xt(e,t,"linePrefix")}function i(d){return e.enter("paragraph"),o(d)}function o(d){const p=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=p),n=p,l(d)}function l(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Ze(d)?(e.consume(d),e.exit("chunkText"),o):(e.consume(d),l)}}const Hz={tokenize:qz},T_={tokenize:Vz};function qz(e){const t=this,n=[];let r=0,i,o,l;return d;function d(C){if(r<n.length){const z=n[r];return t.containerState=z[1],e.attempt(z[0].continuation,p,f)(C)}return f(C)}function p(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const z=t.events.length;let D=z,A;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){A=t.events[D][1].end;break}S(r);let P=z;for(;P<t.events.length;)t.events[P][1].end={...A},P++;return gr(t.events,D+1,0,t.events.slice(z)),t.events.length=P,f(C)}return d(C)}function f(C){if(r===n.length){if(!i)return y(C);if(i.currentConstruct&&i.currentConstruct.concrete)return w(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(T_,m,g)(C)}function m(C){return i&&E(),S(r),y(C)}function g(C){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,w(C)}function y(C){return t.containerState={},e.attempt(T_,b,w)(C)}function b(C){return r++,n.push([t.currentConstruct,t.containerState]),y(C)}function w(C){if(C===null){i&&E(),S(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),k(C)}function k(C){if(C===null){j(e.exit("chunkFlow"),!0),S(0),e.consume(C);return}return Ze(C)?(e.consume(C),j(e.exit("chunkFlow")),r=0,t.interrupt=void 0,d):(e.consume(C),k)}function j(C,z){const D=t.sliceStream(C);if(z&&D.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(D),t.parser.lazy[C.start.line]){let A=i.events.length;for(;A--;)if(i.events[A][1].start.offset<l&&(!i.events[A][1].end||i.events[A][1].end.offset>l))return;const P=t.events.length;let T=P,F,M;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(F){M=t.events[T][1].end;break}F=!0}for(S(r),A=P;A<t.events.length;)t.events[A][1].end={...M},A++;gr(t.events,T+1,0,t.events.slice(P)),t.events.length=A}}function S(C){let z=n.length;for(;z-- >C;){const D=n[z];t.containerState=D[1],D[0].exit.call(t,e)}n.length=C}function E(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Vz(e,t,n){return xt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function oo(e){if(e===null||Mt(e)||rs(e))return 1;if(sf(e))return 2}function of(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const lg={name:"attention",resolveAll:Gz,tokenize:Yz};function Gz(e,t){let n=-1,r,i,o,l,d,p,f,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;p=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},y={...e[n][1].start};R_(g,-p),R_(y,p),l={type:p>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},d={type:p>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},o={type:p>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:p>1?"strong":"emphasis",start:{...l.start},end:{...d.end}},e[r][1].end={...l.start},e[n][1].start={...d.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Lr(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Lr(f,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),f=Lr(f,of(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Lr(f,[["exit",o,t],["enter",d,t],["exit",d,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,f=Lr(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,gr(e,r-1,n-r+3,f),n=r+f.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Yz(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=oo(r);let o;return l;function l(p){return o=p,e.enter("attentionSequence"),d(p)}function d(p){if(p===o)return e.consume(p),d;const f=e.exit("attentionSequence"),m=oo(p),g=!m||m===2&&i||n.includes(p),y=!i||i===2&&m||n.includes(r);return f._open=!!(o===42?g:g&&(i||!y)),f._close=!!(o===42?y:y&&(m||!g)),t(p)}}function R_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Kz={name:"autolink",tokenize:Xz};function Xz(e,t,n){let r=0;return i;function i(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return Hn(b)?(e.consume(b),l):b===64?n(b):f(b)}function l(b){return b===43||b===45||b===46||zn(b)?(r=1,d(b)):f(b)}function d(b){return b===58?(e.consume(b),r=0,p):(b===43||b===45||b===46||zn(b))&&r++<32?(e.consume(b),d):(r=0,f(b))}function p(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Ld(b)?n(b):(e.consume(b),p)}function f(b){return b===64?(e.consume(b),m):$z(b)?(e.consume(b),f):n(b)}function m(b){return zn(b)?g(b):n(b)}function g(b){return b===46?(e.consume(b),r=0,m):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):y(b)}function y(b){if((b===45||zn(b))&&r++<63){const w=b===45?y:g;return e.consume(b),w}return n(b)}}const mc={partial:!0,tokenize:Qz};function Qz(e,t,n){return r;function r(o){return dt(o)?xt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Ze(o)?t(o):n(o)}}const j4={continuation:{tokenize:Wz},exit:Jz,name:"blockQuote",tokenize:Zz};function Zz(e,t,n){const r=this;return i;function i(l){if(l===62){const d=r.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return dt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Wz(e,t,n){const r=this;return i;function i(l){return dt(l)?xt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(j4,t,n)(l)}}function Jz(e){e.exit("blockQuote")}const N4={name:"characterEscape",tokenize:e8};function e8(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Pz(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const C4={name:"characterReference",tokenize:t8};function t8(e,t,n){const r=this;let i=0,o,l;return d;function d(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),p}function p(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,l=zn,m(g))}function f(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=Bz,m):(e.enter("characterReferenceValue"),o=7,l=og,m(g))}function m(g){if(g===59&&i){const y=e.exit("characterReferenceValue");return l===zn&&!tx(r.sliceSerialize(y))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(g)&&i++<o?(e.consume(g),m):n(g)}}const L_={partial:!0,tokenize:r8},D_={concrete:!0,name:"codeFenced",tokenize:n8};function n8(e,t,n){const r=this,i={partial:!0,tokenize:D};let o=0,l=0,d;return p;function p(A){return f(A)}function f(A){const P=r.events[r.events.length-1];return o=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,d=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(A)}function m(A){return A===d?(l++,e.consume(A),m):l<3?n(A):(e.exit("codeFencedFenceSequence"),dt(A)?xt(e,g,"whitespace")(A):g(A))}function g(A){return A===null||Ze(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(L_,k,z)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(A))}function y(A){return A===null||Ze(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(A)):dt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xt(e,b,"whitespace")(A)):A===96&&A===d?n(A):(e.consume(A),y)}function b(A){return A===null||Ze(A)?g(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||Ze(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(A)):A===96&&A===d?n(A):(e.consume(A),w)}function k(A){return e.attempt(i,z,j)(A)}function j(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),S}function S(A){return o>0&&dt(A)?xt(e,E,"linePrefix",o+1)(A):E(A)}function E(A){return A===null||Ze(A)?e.check(L_,k,z)(A):(e.enter("codeFlowValue"),C(A))}function C(A){return A===null||Ze(A)?(e.exit("codeFlowValue"),E(A)):(e.consume(A),C)}function z(A){return e.exit("codeFenced"),t(A)}function D(A,P,T){let F=0;return M;function M(U){return A.enter("lineEnding"),A.consume(U),A.exit("lineEnding"),G}function G(U){return A.enter("codeFencedFence"),dt(U)?xt(A,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):Q(U)}function Q(U){return U===d?(A.enter("codeFencedFenceSequence"),re(U)):T(U)}function re(U){return U===d?(F++,A.consume(U),re):F>=l?(A.exit("codeFencedFenceSequence"),dt(U)?xt(A,$,"whitespace")(U):$(U)):T(U)}function $(U){return U===null||Ze(U)?(A.exit("codeFencedFence"),P(U)):T(U)}}}function r8(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const rm={name:"codeIndented",tokenize:i8},a8={partial:!0,tokenize:s8};function i8(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),xt(e,o,"linePrefix",5)(f)}function o(f){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?p(f):Ze(f)?e.attempt(a8,l,p)(f):(e.enter("codeFlowValue"),d(f))}function d(f){return f===null||Ze(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),d)}function p(f){return e.exit("codeIndented"),t(f)}}function s8(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):Ze(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):xt(e,o,"linePrefix",5)(l)}function o(l){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):Ze(l)?i(l):n(l)}}const o8={name:"codeText",previous:c8,resolve:l8,tokenize:u8};function l8(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function c8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function u8(e,t,n){let r=0,i,o;return l;function l(g){return e.enter("codeText"),e.enter("codeTextSequence"),d(g)}function d(g){return g===96?(e.consume(g),r++,d):(e.exit("codeTextSequence"),p(g))}function p(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),p):g===96?(o=e.enter("codeTextSequence"),i=0,m(g)):Ze(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("codeTextData"),f(g))}function f(g){return g===null||g===32||g===96||Ze(g)?(e.exit("codeTextData"),p(g)):(e.consume(g),f)}function m(g){return g===96?(e.consume(g),i++,m):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",f(g))}}class d8{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&xl(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),xl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),xl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);xl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);xl(this.left,n.reverse())}}}function xl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function E4(e){const t={};let n=-1,r,i,o,l,d,p,f;const m=new d8(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(p=r[1]._tokenizer.events,o=0,o<p.length&&p[o][1].type==="lineEndingBlank"&&(o+=2),o<p.length&&p[o][1].type==="content"))for(;++o<p.length&&p[o][1].type!=="content";)p[o][1].type==="chunkText"&&(p[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,f8(m,n)),n=t[n],f=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=m.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(m.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...m.get(i)[1].start},d=m.slice(i,n),d.unshift(r),m.splice(i,n-i+1,d))}}return gr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function f8(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const d=l.events,p=[],f={};let m,g,y=-1,b=n,w=0,k=0;const j=[k];for(;b;){for(;e.get(++i)[1]!==b;);o.push(i),b._tokenizer||(m=r.sliceStream(b),b.next||m.push(null),g&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=n;++y<d.length;)d[y][0]==="exit"&&d[y-1][0]==="enter"&&d[y][1].type===d[y-1][1].type&&d[y][1].start.line!==d[y][1].end.line&&(k=y+1,j.push(k),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):j.pop(),y=j.length;y--;){const S=d.slice(j[y],j[y+1]),E=o.pop();p.push([E,E+S.length-1]),e.splice(E,2,S)}for(p.reverse(),y=-1;++y<p.length;)f[w+p[y][0]]=w+p[y][1],w+=p[y][1]-p[y][0]-1;return f}const p8={resolve:m8,tokenize:g8},h8={partial:!0,tokenize:x8};function m8(e){return E4(e),e}function g8(e,t){let n;return r;function r(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(d)}function i(d){return d===null?o(d):Ze(d)?e.check(h8,l,o)(d):(e.consume(d),i)}function o(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function l(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function x8(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),xt(e,o,"linePrefix")}function o(l){if(l===null||Ze(l))return n(l);const d=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function A4(e,t,n,r,i,o,l,d,p){const f=p||Number.POSITIVE_INFINITY;let m=0;return g;function g(S){return S===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(S),e.exit(o),y):S===null||S===32||S===41||Ld(S)?n(S):(e.enter(r),e.enter(l),e.enter(d),e.enter("chunkString",{contentType:"string"}),k(S))}function y(S){return S===62?(e.enter(o),e.consume(S),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===62?(e.exit("chunkString"),e.exit(d),y(S)):S===null||S===60||Ze(S)?n(S):(e.consume(S),S===92?w:b)}function w(S){return S===60||S===62||S===92?(e.consume(S),b):b(S)}function k(S){return!m&&(S===null||S===41||Mt(S))?(e.exit("chunkString"),e.exit(d),e.exit(l),e.exit(r),t(S)):m<f&&S===40?(e.consume(S),m++,k):S===41?(e.consume(S),m--,k):S===null||S===32||S===40||Ld(S)?n(S):(e.consume(S),S===92?j:k)}function j(S){return S===40||S===41||S===92?(e.consume(S),k):k(S)}}function T4(e,t,n,r,i,o){const l=this;let d=0,p;return f;function f(b){return e.enter(r),e.enter(i),e.consume(b),e.exit(i),e.enter(o),m}function m(b){return d>999||b===null||b===91||b===93&&!p||b===94&&!d&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(o),e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):Ze(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||Ze(b)||d++>999?(e.exit("chunkString"),m(b)):(e.consume(b),p||(p=!dt(b)),b===92?y:g)}function y(b){return b===91||b===92||b===93?(e.consume(b),d++,g):g(b)}}function R4(e,t,n,r,i,o){let l;return d;function d(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),l=y===40?41:y,p):n(y)}function p(y){return y===l?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(o),f(y))}function f(y){return y===l?(e.exit(o),p(l)):y===null?n(y):Ze(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),xt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===l||y===null||Ze(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?g:m)}function g(y){return y===l||y===92?(e.consume(y),m):m(y)}}function zl(e,t){let n;return r;function r(i){return Ze(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):dt(i)?xt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const y8={name:"definition",tokenize:v8},b8={partial:!0,tokenize:_8};function v8(e,t,n){const r=this;let i;return o;function o(b){return e.enter("definition"),l(b)}function l(b){return T4.call(r,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return i=qr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),p):n(b)}function p(b){return Mt(b)?zl(e,f)(b):f(b)}function f(b){return A4(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(b8,g,g)(b)}function g(b){return dt(b)?xt(e,y,"whitespace")(b):y(b)}function y(b){return b===null||Ze(b)?(e.exit("definition"),r.parser.defined.push(i),t(b)):n(b)}}function _8(e,t,n){return r;function r(d){return Mt(d)?zl(e,i)(d):n(d)}function i(d){return R4(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return dt(d)?xt(e,l,"whitespace")(d):l(d)}function l(d){return d===null||Ze(d)?t(d):n(d)}}const w8={name:"hardBreakEscape",tokenize:k8};function k8(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ze(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const S8={name:"headingAtx",resolve:j8,tokenize:N8};function j8(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},gr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function N8(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),o(m)}function o(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||Mt(m)?(e.exit("atxHeadingSequence"),d(m)):n(m)}function d(m){return m===35?(e.enter("atxHeadingSequence"),p(m)):m===null||Ze(m)?(e.exit("atxHeading"),t(m)):dt(m)?xt(e,d,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function p(m){return m===35?(e.consume(m),p):(e.exit("atxHeadingSequence"),d(m))}function f(m){return m===null||m===35||Mt(m)?(e.exit("atxHeadingText"),d(m)):(e.consume(m),f)}}const C8=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],O_=["pre","script","style","textarea"],E8={concrete:!0,name:"htmlFlow",resolveTo:R8,tokenize:L8},A8={partial:!0,tokenize:O8},T8={partial:!0,tokenize:D8};function R8(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function L8(e,t,n){const r=this;let i,o,l,d,p;return f;function f(O){return m(O)}function m(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),y):O===47?(e.consume(O),o=!0,k):O===63?(e.consume(O),i=3,r.interrupt?t:R):Hn(O)?(e.consume(O),l=String.fromCharCode(O),j):n(O)}function y(O){return O===45?(e.consume(O),i=2,b):O===91?(e.consume(O),i=5,d=0,w):Hn(O)?(e.consume(O),i=4,r.interrupt?t:R):n(O)}function b(O){return O===45?(e.consume(O),r.interrupt?t:R):n(O)}function w(O){const se="CDATA[";return O===se.charCodeAt(d++)?(e.consume(O),d===se.length?r.interrupt?t:Q:w):n(O)}function k(O){return Hn(O)?(e.consume(O),l=String.fromCharCode(O),j):n(O)}function j(O){if(O===null||O===47||O===62||Mt(O)){const se=O===47,ie=l.toLowerCase();return!se&&!o&&O_.includes(ie)?(i=1,r.interrupt?t(O):Q(O)):C8.includes(l.toLowerCase())?(i=6,se?(e.consume(O),S):r.interrupt?t(O):Q(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?E(O):C(O))}return O===45||zn(O)?(e.consume(O),l+=String.fromCharCode(O),j):n(O)}function S(O){return O===62?(e.consume(O),r.interrupt?t:Q):n(O)}function E(O){return dt(O)?(e.consume(O),E):M(O)}function C(O){return O===47?(e.consume(O),M):O===58||O===95||Hn(O)?(e.consume(O),z):dt(O)?(e.consume(O),C):M(O)}function z(O){return O===45||O===46||O===58||O===95||zn(O)?(e.consume(O),z):D(O)}function D(O){return O===61?(e.consume(O),A):dt(O)?(e.consume(O),D):C(O)}function A(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),p=O,P):dt(O)?(e.consume(O),A):T(O)}function P(O){return O===p?(e.consume(O),p=null,F):O===null||Ze(O)?n(O):(e.consume(O),P)}function T(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Mt(O)?D(O):(e.consume(O),T)}function F(O){return O===47||O===62||dt(O)?C(O):n(O)}function M(O){return O===62?(e.consume(O),G):n(O)}function G(O){return O===null||Ze(O)?Q(O):dt(O)?(e.consume(O),G):n(O)}function Q(O){return O===45&&i===2?(e.consume(O),I):O===60&&i===1?(e.consume(O),V):O===62&&i===4?(e.consume(O),B):O===63&&i===3?(e.consume(O),R):O===93&&i===5?(e.consume(O),oe):Ze(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(A8,K,re)(O)):O===null||Ze(O)?(e.exit("htmlFlowData"),re(O)):(e.consume(O),Q)}function re(O){return e.check(T8,$,K)(O)}function $(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),U}function U(O){return O===null||Ze(O)?re(O):(e.enter("htmlFlowData"),Q(O))}function I(O){return O===45?(e.consume(O),R):Q(O)}function V(O){return O===47?(e.consume(O),l="",te):Q(O)}function te(O){if(O===62){const se=l.toLowerCase();return O_.includes(se)?(e.consume(O),B):Q(O)}return Hn(O)&&l.length<8?(e.consume(O),l+=String.fromCharCode(O),te):Q(O)}function oe(O){return O===93?(e.consume(O),R):Q(O)}function R(O){return O===62?(e.consume(O),B):O===45&&i===2?(e.consume(O),R):Q(O)}function B(O){return O===null||Ze(O)?(e.exit("htmlFlowData"),K(O)):(e.consume(O),B)}function K(O){return e.exit("htmlFlow"),t(O)}}function D8(e,t,n){const r=this;return i;function i(l){return Ze(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function O8(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(mc,t,n)}}const M8={name:"htmlText",tokenize:z8};function z8(e,t,n){const r=this;let i,o,l;return d;function d(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),p}function p(R){return R===33?(e.consume(R),f):R===47?(e.consume(R),D):R===63?(e.consume(R),C):Hn(R)?(e.consume(R),T):n(R)}function f(R){return R===45?(e.consume(R),m):R===91?(e.consume(R),o=0,w):Hn(R)?(e.consume(R),E):n(R)}function m(R){return R===45?(e.consume(R),b):n(R)}function g(R){return R===null?n(R):R===45?(e.consume(R),y):Ze(R)?(l=g,V(R)):(e.consume(R),g)}function y(R){return R===45?(e.consume(R),b):g(R)}function b(R){return R===62?I(R):R===45?y(R):g(R)}function w(R){const B="CDATA[";return R===B.charCodeAt(o++)?(e.consume(R),o===B.length?k:w):n(R)}function k(R){return R===null?n(R):R===93?(e.consume(R),j):Ze(R)?(l=k,V(R)):(e.consume(R),k)}function j(R){return R===93?(e.consume(R),S):k(R)}function S(R){return R===62?I(R):R===93?(e.consume(R),S):k(R)}function E(R){return R===null||R===62?I(R):Ze(R)?(l=E,V(R)):(e.consume(R),E)}function C(R){return R===null?n(R):R===63?(e.consume(R),z):Ze(R)?(l=C,V(R)):(e.consume(R),C)}function z(R){return R===62?I(R):C(R)}function D(R){return Hn(R)?(e.consume(R),A):n(R)}function A(R){return R===45||zn(R)?(e.consume(R),A):P(R)}function P(R){return Ze(R)?(l=P,V(R)):dt(R)?(e.consume(R),P):I(R)}function T(R){return R===45||zn(R)?(e.consume(R),T):R===47||R===62||Mt(R)?F(R):n(R)}function F(R){return R===47?(e.consume(R),I):R===58||R===95||Hn(R)?(e.consume(R),M):Ze(R)?(l=F,V(R)):dt(R)?(e.consume(R),F):I(R)}function M(R){return R===45||R===46||R===58||R===95||zn(R)?(e.consume(R),M):G(R)}function G(R){return R===61?(e.consume(R),Q):Ze(R)?(l=G,V(R)):dt(R)?(e.consume(R),G):F(R)}function Q(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,re):Ze(R)?(l=Q,V(R)):dt(R)?(e.consume(R),Q):(e.consume(R),$)}function re(R){return R===i?(e.consume(R),i=void 0,U):R===null?n(R):Ze(R)?(l=re,V(R)):(e.consume(R),re)}function $(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||Mt(R)?F(R):(e.consume(R),$)}function U(R){return R===47||R===62||Mt(R)?F(R):n(R)}function I(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function V(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),te}function te(R){return dt(R)?xt(e,oe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):oe(R)}function oe(R){return e.enter("htmlTextData"),l(R)}}const nx={name:"labelEnd",resolveAll:P8,resolveTo:F8,tokenize:U8},I8={tokenize:H8},$8={tokenize:q8},B8={tokenize:V8};function P8(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&gr(e,0,e.length,n),e}function F8(e,t){let n=e.length,r=0,i,o,l,d;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const p={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return d=[["enter",p,t],["enter",f,t]],d=Lr(d,e.slice(o+1,o+r+3)),d=Lr(d,[["enter",m,t]]),d=Lr(d,of(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),d=Lr(d,[["exit",m,t],e[l-2],e[l-1],["exit",f,t]]),d=Lr(d,e.slice(l+1)),d=Lr(d,[["exit",p,t]]),gr(e,o,e.length,d),e}function U8(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return d;function d(y){return o?o._inactive?g(y):(l=r.parser.defined.includes(qr(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),p):n(y)}function p(y){return y===40?e.attempt(I8,m,l?m:g)(y):y===91?e.attempt($8,m,l?f:g)(y):l?m(y):g(y)}function f(y){return e.attempt(B8,m,g)(y)}function m(y){return t(y)}function g(y){return o._balanced=!0,n(y)}}function H8(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),i}function i(g){return Mt(g)?zl(e,o)(g):o(g)}function o(g){return g===41?m(g):A4(e,l,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return Mt(g)?zl(e,p)(g):m(g)}function d(g){return n(g)}function p(g){return g===34||g===39||g===40?R4(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function f(g){return Mt(g)?zl(e,m)(g):m(g)}function m(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function q8(e,t,n){const r=this;return i;function i(d){return T4.call(r,e,o,l,"reference","referenceMarker","referenceString")(d)}function o(d){return r.parser.defined.includes(qr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function l(d){return n(d)}}function V8(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const G8={name:"labelStartImage",resolveAll:nx.resolveAll,tokenize:Y8};function Y8(e,t,n){const r=this;return i;function i(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),o}function o(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),l):n(d)}function l(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(d):t(d)}}const K8={name:"labelStartLink",resolveAll:nx.resolveAll,tokenize:X8};function X8(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const am={name:"lineEnding",tokenize:Q8};function Q8(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),xt(e,t,"linePrefix")}}const cd={name:"thematicBreak",tokenize:Z8};function Z8(e,t,n){let r=0,i;return o;function o(f){return e.enter("thematicBreak"),l(f)}function l(f){return i=f,d(f)}function d(f){return f===i?(e.enter("thematicBreakSequence"),p(f)):r>=3&&(f===null||Ze(f))?(e.exit("thematicBreak"),t(f)):n(f)}function p(f){return f===i?(e.consume(f),r++,p):(e.exit("thematicBreakSequence"),dt(f)?xt(e,d,"whitespace")(f):d(f))}}const tr={continuation:{tokenize:tI},exit:rI,name:"list",tokenize:eI},W8={partial:!0,tokenize:aI},J8={partial:!0,tokenize:nI};function eI(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return d;function d(b){const w=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:og(b)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(cd,n,f)(b):f(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(b)}return n(b)}function p(b){return og(b)&&++l<10?(e.consume(b),p):(!r.interrupt||l<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),f(b)):n(b)}function f(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(mc,r.interrupt?n:m,e.attempt(W8,y,g))}function m(b){return r.containerState.initialBlankLine=!0,o++,y(b)}function g(b){return dt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function tI(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(mc,i,o);function i(d){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xt(e,t,"listItemIndent",r.containerState.size+1)(d)}function o(d){return r.containerState.furtherBlankLines||!dt(d)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(d)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(J8,t,l)(d))}function l(d){return r.containerState._closeFlow=!0,r.interrupt=void 0,xt(e,e.attempt(tr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function nI(e,t,n){const r=this;return xt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function rI(e){e.exit(this.containerState.type)}function aI(e,t,n){const r=this;return xt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!dt(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const M_={name:"setextUnderline",resolveTo:iI,tokenize:sI};function iI(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function sI(e,t,n){const r=this;let i;return o;function o(f){let m=r.events.length,g;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){g=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),i=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),d(f)}function d(f){return f===i?(e.consume(f),d):(e.exit("setextHeadingLineSequence"),dt(f)?xt(e,p,"lineSuffix")(f):p(f))}function p(f){return f===null||Ze(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const oI={tokenize:lI};function lI(e){const t=this,n=e.attempt(mc,r,e.attempt(this.parser.constructs.flowInitial,i,xt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(p8,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cI={resolveAll:D4()},uI=L4("string"),dI=L4("text");function L4(e){return{resolveAll:D4(e==="text"?fI:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,d);return l;function l(m){return f(m)?o(m):d(m)}function d(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),p}function p(m){return f(m)?(n.exit("data"),o(m)):(n.consume(m),p)}function f(m){if(m===null)return!0;const g=i[m];let y=-1;if(g)for(;++y<g.length;){const b=g[y];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function D4(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function fI(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,l=-1,d=0,p;for(;o--;){const f=i[o];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)d++,l--;if(l)break;l=-1}else if(f===-2)p=!0,d++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const f={type:n===e.length||p||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-d,offset:r.end.offset-d},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const pI={42:tr,43:tr,45:tr,48:tr,49:tr,50:tr,51:tr,52:tr,53:tr,54:tr,55:tr,56:tr,57:tr,62:j4},hI={91:y8},mI={[-2]:rm,[-1]:rm,32:rm},gI={35:S8,42:cd,45:[M_,cd],60:E8,61:M_,95:cd,96:D_,126:D_},xI={38:C4,92:N4},yI={[-5]:am,[-4]:am,[-3]:am,33:G8,38:C4,42:lg,60:[Kz,M8],91:K8,92:[w8,N4],93:nx,95:lg,96:o8},bI={null:[lg,cI]},vI={null:[42,95]},_I={null:[]},wI=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:vI,contentInitial:hI,disable:_I,document:pI,flow:gI,flowInitial:mI,insideSpan:bI,string:xI,text:yI},Symbol.toStringTag,{value:"Module"}));function kI(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let l=[],d=[];const p={attempt:P(D),check:P(A),consume:E,enter:C,exit:z,interrupt:P(A,{interrupt:!0})},f={code:null,containerState:{},defineSkip:k,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:g};let m=t.tokenize.call(f,p);return t.resolveAll&&o.push(t),f;function g(G){return l=Lr(l,G),j(),l[l.length-1]!==null?[]:(T(t,0),f.events=of(o,f.events,f),f.events)}function y(G,Q){return jI(b(G),Q)}function b(G){return SI(l,G)}function w(){const{_bufferIndex:G,_index:Q,line:re,column:$,offset:U}=r;return{_bufferIndex:G,_index:Q,line:re,column:$,offset:U}}function k(G){i[G.line]=G.column,M()}function j(){let G;for(;r._index<l.length;){const Q=l[r._index];if(typeof Q=="string")for(G=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===G&&r._bufferIndex<Q.length;)S(Q.charCodeAt(r._bufferIndex));else S(Q)}}function S(G){m=m(G)}function E(G){Ze(G)?(r.line++,r.column=1,r.offset+=G===-3?2:1,M()):G!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=G}function C(G,Q){const re=Q||{};return re.type=G,re.start=w(),f.events.push(["enter",re,f]),d.push(re),re}function z(G){const Q=d.pop();return Q.end=w(),f.events.push(["exit",Q,f]),Q}function D(G,Q){T(G,Q.from)}function A(G,Q){Q.restore()}function P(G,Q){return re;function re($,U,I){let V,te,oe,R;return Array.isArray($)?K($):"tokenize"in $?K([$]):B($);function B(pe){return Ee;function Ee(Ie){const Ue=Ie!==null&&pe[Ie],be=Ie!==null&&pe.null,de=[...Array.isArray(Ue)?Ue:Ue?[Ue]:[],...Array.isArray(be)?be:be?[be]:[]];return K(de)(Ie)}}function K(pe){return V=pe,te=0,pe.length===0?I:O(pe[te])}function O(pe){return Ee;function Ee(Ie){return R=F(),oe=pe,pe.partial||(f.currentConstruct=pe),pe.name&&f.parser.constructs.disable.null.includes(pe.name)?ie():pe.tokenize.call(Q?Object.assign(Object.create(f),Q):f,p,se,ie)(Ie)}}function se(pe){return G(oe,R),U}function ie(pe){return R.restore(),++te<V.length?O(V[te]):I}}}function T(G,Q){G.resolveAll&&!o.includes(G)&&o.push(G),G.resolve&&gr(f.events,Q,f.events.length-Q,G.resolve(f.events.slice(Q),f)),G.resolveTo&&(f.events=G.resolveTo(f.events,f))}function F(){const G=w(),Q=f.previous,re=f.currentConstruct,$=f.events.length,U=Array.from(d);return{from:$,restore:I};function I(){r=G,f.previous=Q,f.currentConstruct=re,f.events.length=$,d=U,M()}}function M(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function SI(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const d=l[0];typeof d=="string"?l[0]=d.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function jI(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
97
+ `;break}case-3:{l=`\r
98
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function NI(e){const r={constructs:k4([wI,...(e||{}).extensions||[]]),content:i(Fz),defined:[],document:i(Hz),flow:i(oI),lazy:{},string:i(uI),text:i(dI)};return r;function i(o){return l;function l(d){return kI(r,o,d)}}}function CI(e){for(;!E4(e););return e}const z_=/[\0\t\n\r]/g;function EI(){let e=1,t="",n=!0,r;return i;function i(o,l,d){const p=[];let f,m,g,y,b;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(z_.lastIndex=g,f=z_.exec(o),y=f&&f.index!==void 0?f.index:o.length,b=o.charCodeAt(y),!f){t=o.slice(g);break}if(b===10&&g===y&&r)p.push(-3),r=void 0;else switch(r&&(p.push(-5),r=void 0),g<y&&(p.push(o.slice(g,y)),e+=y-g),b){case 0:{p.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,p.push(-2);e++<m;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:r=!0,e=1}g=y+1}return d&&(r&&p.push(-5),t&&p.push(t),p.push(null)),p}}const AI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function TI(e){return e.replace(AI,RI)}function RI(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return S4(n.slice(o?2:1),o?16:10)}return tx(n)||e}const O4={}.hasOwnProperty;function LI(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),DI(n)(CI(NI(n).document().write(EI()(e,t,!0))))}function DI(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(en),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(Xe),blockQuote:o(be),characterEscape:F,characterReference:F,codeFenced:o(de),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(de,l),codeText:o(ke,l),codeTextData:F,data:F,codeFlowValue:F,definition:o(ge),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(we),hardBreakEscape:o(Me),hardBreakTrailing:o(Me),htmlFlow:o(Je,l),htmlFlowData:F,htmlText:o(Je,l),htmlTextData:F,image:o(zt),label:l,link:o(en),listItem:o(An),listItemValue:y,listOrdered:o(Kt,g),listUnordered:o(Kt),paragraph:o(Kn),reference:O,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Xe),strong:o(Pn),thematicBreak:o(Sn)},exit:{atxHeading:p(),atxHeadingSequence:D,autolink:p(),autolinkEmail:Ue,autolinkProtocol:Ie,blockQuote:p(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:pe,characterReference:Ee,codeFenced:p(j),codeFencedFence:k,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:M,codeIndented:p(S),codeText:p(U),codeTextData:M,data:M,definition:p(),definitionDestinationString:z,definitionLabelString:E,definitionTitleString:C,emphasis:p(),hardBreakEscape:p(Q),hardBreakTrailing:p(Q),htmlFlow:p(re),htmlFlowData:M,htmlText:p($),htmlTextData:M,image:p(V),label:oe,labelText:te,lineEnding:G,link:p(I),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:se,resourceDestinationString:R,resourceTitleString:B,resource:K,setextHeading:p(T),setextHeadingLineSequence:P,setextHeadingText:A,strong:p(),thematicBreak:p()}};M4(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Z){let fe={type:"root",children:[]};const Ne={stack:[fe],tokenStack:[],config:t,enter:d,exit:f,buffer:l,resume:m,data:n},ze=[];let He=-1;for(;++He<Z.length;)if(Z[He][1].type==="listOrdered"||Z[He][1].type==="listUnordered")if(Z[He][0]==="enter")ze.push(He);else{const Tt=ze.pop();He=i(Z,Tt,He)}for(He=-1;++He<Z.length;){const Tt=t[Z[He][0]];O4.call(Tt,Z[He][1].type)&&Tt[Z[He][1].type].call(Object.assign({sliceSerialize:Z[He][2].sliceSerialize},Ne),Z[He][1])}if(Ne.tokenStack.length>0){const Tt=Ne.tokenStack[Ne.tokenStack.length-1];(Tt[1]||I_).call(Ne,void 0,Tt[0])}for(fe.position={start:yi(Z.length>0?Z[0][1].start:{line:1,column:1,offset:0}),end:yi(Z.length>0?Z[Z.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<t.transforms.length;)fe=t.transforms[He](fe)||fe;return fe}function i(Z,fe,Ne){let ze=fe-1,He=-1,Tt=!1,Ft,Rt,_t,yt;for(;++ze<=Ne;){const lt=Z[ze];switch(lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{lt[0]==="enter"?He++:He--,yt=void 0;break}case"lineEndingBlank":{lt[0]==="enter"&&(Ft&&!yt&&!He&&!_t&&(_t=ze),yt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:yt=void 0}if(!He&&lt[0]==="enter"&&lt[1].type==="listItemPrefix"||He===-1&&lt[0]==="exit"&&(lt[1].type==="listUnordered"||lt[1].type==="listOrdered")){if(Ft){let bn=ze;for(Rt=void 0;bn--;){const on=Z[bn];if(on[1].type==="lineEnding"||on[1].type==="lineEndingBlank"){if(on[0]==="exit")continue;Rt&&(Z[Rt][1].type="lineEndingBlank",Tt=!0),on[1].type="lineEnding",Rt=bn}else if(!(on[1].type==="linePrefix"||on[1].type==="blockQuotePrefix"||on[1].type==="blockQuotePrefixWhitespace"||on[1].type==="blockQuoteMarker"||on[1].type==="listItemIndent"))break}_t&&(!Rt||_t<Rt)&&(Ft._spread=!0),Ft.end=Object.assign({},Rt?Z[Rt][1].start:lt[1].end),Z.splice(Rt||ze,0,["exit",Ft,lt[2]]),ze++,Ne++}if(lt[1].type==="listItemPrefix"){const bn={type:"listItem",_spread:!1,start:Object.assign({},lt[1].start),end:void 0};Ft=bn,Z.splice(ze,0,["enter",bn,lt[2]]),ze++,Ne++,_t=void 0,yt=!0}}}return Z[fe][1]._spread=Tt,Ne}function o(Z,fe){return Ne;function Ne(ze){d.call(this,Z(ze),ze),fe&&fe.call(this,ze)}}function l(){this.stack.push({type:"fragment",children:[]})}function d(Z,fe,Ne){this.stack[this.stack.length-1].children.push(Z),this.stack.push(Z),this.tokenStack.push([fe,Ne||void 0]),Z.position={start:yi(fe.start),end:void 0}}function p(Z){return fe;function fe(Ne){Z&&Z.call(this,Ne),f.call(this,Ne)}}function f(Z,fe){const Ne=this.stack.pop(),ze=this.tokenStack.pop();if(ze)ze[0].type!==Z.type&&(fe?fe.call(this,Z,ze[0]):(ze[1]||I_).call(this,Z,ze[0]));else throw new Error("Cannot close `"+Z.type+"` ("+Dl({start:Z.start,end:Z.end})+"): itโ€™s not open");Ne.position.end=yi(Z.end)}function m(){return ex(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(Z){if(this.data.expectingFirstListItemValue){const fe=this.stack[this.stack.length-2];fe.start=Number.parseInt(this.sliceSerialize(Z),10),this.data.expectingFirstListItemValue=void 0}}function b(){const Z=this.resume(),fe=this.stack[this.stack.length-1];fe.lang=Z}function w(){const Z=this.resume(),fe=this.stack[this.stack.length-1];fe.meta=Z}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const Z=this.resume(),fe=this.stack[this.stack.length-1];fe.value=Z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const Z=this.resume(),fe=this.stack[this.stack.length-1];fe.value=Z.replace(/(\r?\n|\r)$/g,"")}function E(Z){const fe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=fe,Ne.identifier=qr(this.sliceSerialize(Z)).toLowerCase()}function C(){const Z=this.resume(),fe=this.stack[this.stack.length-1];fe.title=Z}function z(){const Z=this.resume(),fe=this.stack[this.stack.length-1];fe.url=Z}function D(Z){const fe=this.stack[this.stack.length-1];if(!fe.depth){const Ne=this.sliceSerialize(Z).length;fe.depth=Ne}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function P(Z){const fe=this.stack[this.stack.length-1];fe.depth=this.sliceSerialize(Z).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function F(Z){const Ne=this.stack[this.stack.length-1].children;let ze=Ne[Ne.length-1];(!ze||ze.type!=="text")&&(ze=Xt(),ze.position={start:yi(Z.start),end:void 0},Ne.push(ze)),this.stack.push(ze)}function M(Z){const fe=this.stack.pop();fe.value+=this.sliceSerialize(Z),fe.position.end=yi(Z.end)}function G(Z){const fe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=fe.children[fe.children.length-1];Ne.position.end=yi(Z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(fe.type)&&(F.call(this,Z),M.call(this,Z))}function Q(){this.data.atHardBreak=!0}function re(){const Z=this.resume(),fe=this.stack[this.stack.length-1];fe.value=Z}function $(){const Z=this.resume(),fe=this.stack[this.stack.length-1];fe.value=Z}function U(){const Z=this.resume(),fe=this.stack[this.stack.length-1];fe.value=Z}function I(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=fe,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function V(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=fe,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function te(Z){const fe=this.sliceSerialize(Z),Ne=this.stack[this.stack.length-2];Ne.label=TI(fe),Ne.identifier=qr(fe).toLowerCase()}function oe(){const Z=this.stack[this.stack.length-1],fe=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const ze=Z.children;Ne.children=ze}else Ne.alt=fe}function R(){const Z=this.resume(),fe=this.stack[this.stack.length-1];fe.url=Z}function B(){const Z=this.resume(),fe=this.stack[this.stack.length-1];fe.title=Z}function K(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function se(Z){const fe=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=fe,Ne.identifier=qr(this.sliceSerialize(Z)).toLowerCase(),this.data.referenceType="full"}function ie(Z){this.data.characterReferenceType=Z.type}function pe(Z){const fe=this.sliceSerialize(Z),Ne=this.data.characterReferenceType;let ze;Ne?(ze=S4(fe,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ze=tx(fe);const He=this.stack[this.stack.length-1];He.value+=ze}function Ee(Z){const fe=this.stack.pop();fe.position.end=yi(Z.end)}function Ie(Z){M.call(this,Z);const fe=this.stack[this.stack.length-1];fe.url=this.sliceSerialize(Z)}function Ue(Z){M.call(this,Z);const fe=this.stack[this.stack.length-1];fe.url="mailto:"+this.sliceSerialize(Z)}function be(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function ke(){return{type:"inlineCode",value:""}}function ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function we(){return{type:"emphasis",children:[]}}function Xe(){return{type:"heading",depth:0,children:[]}}function Me(){return{type:"break"}}function Je(){return{type:"html",value:""}}function zt(){return{type:"image",title:null,url:"",alt:null}}function en(){return{type:"link",title:null,url:"",children:[]}}function Kt(Z){return{type:"list",ordered:Z.type==="listOrdered",start:null,spread:Z._spread,children:[]}}function An(Z){return{type:"listItem",spread:Z._spread,checked:null,children:[]}}function Kn(){return{type:"paragraph",children:[]}}function Pn(){return{type:"strong",children:[]}}function Xt(){return{type:"text",value:""}}function Sn(){return{type:"thematicBreak"}}}function yi(e){return{line:e.line,column:e.column,offset:e.offset}}function M4(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?M4(e,r):OI(e,r)}}function OI(e,t){let n;for(n in t)if(O4.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function I_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Dl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Dl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Dl({start:t.start,end:t.end})+") is still open")}function MI(e){const t=this;t.parser=n;function n(r){return LI(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function zI(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function II(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
99
+ `}]}function $I(e,t){const n=t.value?t.value+`
100
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function BI(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PI(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FI(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=go(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,d=e.footnoteCounts.get(r);d===void 0?(d=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,d+=1,e.footnoteCounts.set(r,d);const p={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,p);const f={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,f),e.applyData(t,f)}function UI(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function HI(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function z4(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function qI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return z4(e,t);const i={src:go(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function VI(e,t){const n={src:go(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function GI(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function YI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return z4(e,t);const i={href:go(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function KI(e,t){const n={href:go(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function XI(e,t,n){const r=e.all(t),i=n?QI(n):I4(t),o={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let d=-1;for(;++d<r.length;){const m=r[d];(i||d!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
101
+ `}),m.type==="element"&&m.tagName==="p"&&!i?l.push(...m.children):l.push(m)}const p=r[r.length-1];p&&(i||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
102
+ `});const f={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,f),e.applyData(t,f)}function QI(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=I4(n[r])}return t}function I4(e){const t=e.spread;return t??e.children.length>1}function ZI(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function WI(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JI(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function e$(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function t$(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=Pg(t.children[1]),p=wS(t.children[t.children.length-1]);d&&p&&(l.position={start:d,end:p}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function n$(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,d=l?l.length:t.children.length;let p=-1;const f=[];for(;++p<d;){const g=t.children[p],y={},b=l?l[p]:void 0;b&&(y.align=b);let w={type:"element",tagName:o,properties:y,children:[]};g&&(w.children=e.all(g),e.patch(g,w),w=e.applyData(g,w)),f.push(w)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,m),e.applyData(t,m)}function r$(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const $_=9,B_=32;function a$(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(P_(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(P_(t.slice(i),i>0,!1)),o.join("")}function P_(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===$_||o===B_;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===$_||o===B_;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function i$(e,t){const n={type:"text",value:a$(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function s$(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const o$={blockquote:zI,break:II,code:$I,delete:BI,emphasis:PI,footnoteReference:FI,heading:UI,html:HI,imageReference:qI,image:VI,inlineCode:GI,linkReference:YI,link:KI,listItem:XI,list:ZI,paragraph:WI,root:JI,strong:e$,table:t$,tableCell:r$,tableRow:n$,text:i$,thematicBreak:s$,toml:Yu,yaml:Yu,definition:Yu,footnoteDefinition:Yu};function Yu(){}const $4=-1,lf=0,Il=1,Dd=2,rx=3,ax=4,ix=5,sx=6,B4=7,P4=8,F_=typeof self=="object"?self:globalThis,l$=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case lf:case $4:return n(l,i);case Il:{const d=n([],i);for(const p of l)d.push(r(p));return d}case Dd:{const d=n({},i);for(const[p,f]of l)d[r(p)]=r(f);return d}case rx:return n(new Date(l),i);case ax:{const{source:d,flags:p}=l;return n(new RegExp(d,p),i)}case ix:{const d=n(new Map,i);for(const[p,f]of l)d.set(r(p),r(f));return d}case sx:{const d=n(new Set,i);for(const p of l)d.add(r(p));return d}case B4:{const{name:d,message:p}=l;return n(new F_[d](p),i)}case P4:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:d}=new Uint8Array(l);return n(new DataView(d),l)}}return n(new F_[o](l),i)};return r},U_=e=>l$(new Map,e)(0),Ks="",{toString:c$}={},{keys:u$}=Object,yl=e=>{const t=typeof e;if(t!=="object"||!e)return[lf,t];const n=c$.call(e).slice(8,-1);switch(n){case"Array":return[Il,Ks];case"Object":return[Dd,Ks];case"Date":return[rx,Ks];case"RegExp":return[ax,Ks];case"Map":return[ix,Ks];case"Set":return[sx,Ks];case"DataView":return[Il,n]}return n.includes("Array")?[Il,n]:n.includes("Error")?[B4,n]:[Dd,n]},Ku=([e,t])=>e===lf&&(t==="function"||t==="symbol"),d$=(e,t,n,r)=>{const i=(l,d)=>{const p=r.push(l)-1;return n.set(d,p),p},o=l=>{if(n.has(l))return n.get(l);let[d,p]=yl(l);switch(d){case lf:{let m=l;switch(p){case"bigint":d=P4,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);m=null;break;case"undefined":return i([$4],l)}return i([d,m],l)}case Il:{if(p){let y=l;return p==="DataView"?y=new Uint8Array(l.buffer):p==="ArrayBuffer"&&(y=new Uint8Array(l)),i([p,[...y]],l)}const m=[],g=i([d,m],l);for(const y of l)m.push(o(y));return g}case Dd:{if(p)switch(p){case"BigInt":return i([p,l.toString()],l);case"Boolean":case"Number":case"String":return i([p,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const m=[],g=i([d,m],l);for(const y of u$(l))(e||!Ku(yl(l[y])))&&m.push([o(y),o(l[y])]);return g}case rx:return i([d,l.toISOString()],l);case ax:{const{source:m,flags:g}=l;return i([d,{source:m,flags:g}],l)}case ix:{const m=[],g=i([d,m],l);for(const[y,b]of l)(e||!(Ku(yl(y))||Ku(yl(b))))&&m.push([o(y),o(b)]);return g}case sx:{const m=[],g=i([d,m],l);for(const y of l)(e||!Ku(yl(y)))&&m.push(o(y));return g}}const{message:f}=l;return i([d,{name:p,message:f}],l)};return o},H_=(e,{json:t,lossy:n}={})=>{const r=[];return d$(!(t||n),!!t,new Map,r)(e),r},Od=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?U_(H_(e,t)):structuredClone(e):(e,t)=>U_(H_(e,t));function f$(e,t){const n=[{type:"text",value:"โ†ฉ"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function p$(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function h$(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||f$,r=e.options.footnoteBackLabel||p$,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let p=-1;for(;++p<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[p]);if(!f)continue;const m=e.all(f),g=String(f.identifier).toUpperCase(),y=go(g.toLowerCase());let b=0;const w=[],k=e.footnoteCounts.get(g);for(;k!==void 0&&++b<=k;){w.length>0&&w.push({type:"text",value:" "});let E=typeof n=="string"?n:n(p,b);typeof E=="string"&&(E={type:"text",value:E}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(p,b),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const j=m[m.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const E=j.children[j.children.length-1];E&&E.type==="text"?E.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...w)}else m.push(...w);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(m,!0)};e.patch(f,S),d.push(S)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Od(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
103
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
104
+ `}]}}const cg={}.hasOwnProperty,m$={};function g$(e,t){const n=t||m$,r=new Map,i=new Map,o=new Map,l={...o$,...n.handlers},d={all:f,applyData:y$,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:p,options:n,patch:x$,wrap:v$};return Qg(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?r:i,y=String(m.identifier).toUpperCase();g.has(y)||g.set(y,m)}}),d;function p(m,g){const y=m.type,b=d.handlers[y];if(cg.call(d.handlers,y)&&b)return b(d,m,g);if(d.options.passThrough&&d.options.passThrough.includes(y)){if("children"in m){const{children:k,...j}=m,S=Od(j);return S.children=d.all(m),S}return Od(m)}return(d.options.unknownHandler||b$)(d,m,g)}function f(m){const g=[];if("children"in m){const y=m.children;let b=-1;for(;++b<y.length;){const w=d.one(y[b],m);if(w){if(b&&y[b-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=q_(w.value)),!Array.isArray(w)&&w.type==="element")){const k=w.children[0];k&&k.type==="text"&&(k.value=q_(k.value))}Array.isArray(w)?g.push(...w):g.push(w)}}}return g}}function x$(e,t){e.position&&(t.position=uD(e))}function y$(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,Od(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function b$(e,t){const n=t.data||{},r="value"in t&&!(cg.call(n,"hProperties")||cg.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function v$(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
105
+ `});++r<e.length;)r&&n.push({type:"text",value:`
106
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
107
+ `}),n}function q_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function V_(e,t){const n=g$(e,t),r=n.one(e,void 0),i=h$(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
108
+ `},i),o}function _$(e,t){return e&&"run"in e?async function(n,r){const i=V_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return V_(n,{file:r,...e||t})}}function G_(e){if(e)throw e}var im,Y_;function w$(){if(Y_)return im;Y_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},o=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var m=e.call(f,"constructor"),g=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!g)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},l=function(f,m){n&&m.name==="__proto__"?n(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},d=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(r)return r(f,m).value}else return;return f[m]};return im=function p(){var f,m,g,y,b,w,k=arguments[0],j=1,S=arguments.length,E=!1;for(typeof k=="boolean"&&(E=k,k=arguments[1]||{},j=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});j<S;++j)if(f=arguments[j],f!=null)for(m in f)g=d(k,m),y=d(f,m),k!==y&&(E&&y&&(o(y)||(b=i(y)))?(b?(b=!1,w=g&&i(g)?g:[]):w=g&&o(g)?g:{},l(k,{name:m,newValue:p(E,w,y)})):typeof y<"u"&&l(k,{name:m,newValue:y}));return k},im}var k$=w$();const sm=kg(k$);function ug(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function S$(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);d(null,...i);function d(p,...f){const m=e[++o];let g=-1;if(p){l(p);return}for(;++g<i.length;)(f[g]===null||f[g]===void 0)&&(f[g]=i[g]);i=f,m?j$(m,d)(...f):l(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function j$(e,t){let n;return r;function r(...l){const d=e.length>l.length;let p;d&&l.push(i);try{p=e.apply(this,l)}catch(f){const m=f;if(d&&n)throw m;return i(m)}d||(p&&p.then&&typeof p.then=="function"?p.then(o,i):p instanceof Error?i(p):o(p))}function i(l,...d){n||(n=!0,t(l,...d))}function o(l){i(null,l)}}const na={basename:N$,dirname:C$,extname:E$,join:A$,sep:"/"};function N$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');gc(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,d=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),d>-1&&(e.codePointAt(i)===t.codePointAt(d--)?d<0&&(r=i):(d=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function C$(e){if(gc(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function E$(e){gc(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const d=e.codePointAt(t);if(d===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),d===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function A$(...e){let t=-1,n;for(;++t<e.length;)gc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":T$(n)}function T$(e){gc(e);const t=e.codePointAt(0)===47;let n=R$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function R$(e,t){let n="",r=0,i=-1,o=0,l=-1,d,p;for(;++l<=e.length;){if(l<e.length)d=e.codePointAt(l);else{if(d===47)break;d=47}if(d===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(p=n.lastIndexOf("/"),p!==n.length-1){p<0?(n="",r=0):(n=n.slice(0,p),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else d===46&&o>-1?o++:o=-1}return n}function gc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const L$={cwd:D$};function D$(){return"/"}function dg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function O$(e){if(typeof e=="string")e=new URL(e);else if(!dg(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return M$(e)}function M$(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const om=["history","path","basename","stem","extname","dirname"];class F4{constructor(t){let n;t?dg(t)?n={path:t}:typeof t=="string"||z$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":L$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<om.length;){const o=om[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)om.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?na.basename(this.path):void 0}set basename(t){cm(t,"basename"),lm(t,"basename"),this.path=na.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?na.dirname(this.path):void 0}set dirname(t){K_(this.basename,"dirname"),this.path=na.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?na.extname(this.path):void 0}set extname(t){if(lm(t,"extname"),K_(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=na.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){dg(t)&&(t=O$(t)),cm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?na.basename(this.path,this.extname):void 0}set stem(t){cm(t,"stem"),lm(t,"stem"),this.path=na.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Bn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function lm(e,t){if(e&&e.includes(na.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+na.sep+"`")}function cm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function K_(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function z$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const I$=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),$$={}.hasOwnProperty;class ox extends I${constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=S$()}copy(){const t=new ox;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(sm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(fm("data",this.frozen),this.namespace[t]=n,this):$$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Xu(t),r=this.parser||this.Parser;return um("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),um("process",this.parser||this.Parser),dm("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,l){const d=Xu(t),p=r.parse(d);r.run(p,d,function(m,g,y){if(m||!g||!y)return f(m);const b=g,w=r.stringify(b,y);F$(w)?y.value=w:y.result=w,f(m,y)});function f(m,g){m||!g?l(m):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),um("processSync",this.parser||this.Parser),dm("processSync",this.compiler||this.Compiler),this.process(t,i),Q_("processSync","process",n),r;function i(o,l){n=!0,G_(o),r=l}}run(t,n,r){X_(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,d){const p=Xu(n);i.run(t,p,f);function f(m,g,y){const b=g||t;m?d(m):l?l(b):r(void 0,b,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Q_("runSync","run",r),i;function o(l,d){G_(l),i=d,r=!0}}stringify(t,n){this.freeze();const r=Xu(n),i=this.compiler||this.Compiler;return dm("stringify",i),X_(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(fm("use",this.frozen),t!=null)if(typeof t=="function")p(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(f){if(typeof f=="function")p(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[m,...g]=f;p(m,g)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(f.plugins),f.settings&&(i.settings=sm(!0,i.settings,f.settings))}function d(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const g=f[m];o(g)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function p(f,m){let g=-1,y=-1;for(;++g<r.length;)if(r[g][0]===f){y=g;break}if(y===-1)r.push([f,...m]);else if(m.length>0){let[b,...w]=m;const k=r[y][1];ug(k)&&ug(b)&&(b=sm(!0,k,b)),r[y]=[f,b,...w]}}}}const B$=new ox().freeze();function um(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function X_(e){if(!ug(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Q_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Xu(e){return P$(e)?e:new F4(e)}function P$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function F$(e){return typeof e=="string"||U$(e)}function U$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const H$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Z_=[],W_={allowDangerousHtml:!0},q$=/^(https?|ircs?|mailto|xmpp)$/i,V$=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function G$(e){const t=Y$(e),n=K$(e);return X$(t.runSync(t.parse(n),n),e)}function Y$(e){const t=e.rehypePlugins||Z_,n=e.remarkPlugins||Z_,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...W_}:W_;return B$().use(MI).use(n).use(_$,r).use(t)}function K$(e){const t=e.children||"",n=new F4;return typeof t=="string"&&(n.value=t),n}function X$(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,d=t.unwrapDisallowed,p=t.urlTransform||Q$;for(const m of V$)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+H$+m.id,void 0);return Qg(e,f),jS(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function f(m,g,y){if(m.type==="raw"&&y&&typeof g=="number")return l?y.children.splice(g,1):y.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let b;for(b in nm)if(Object.hasOwn(nm,b)&&Object.hasOwn(m.properties,b)){const w=m.properties[b],k=nm[b];(k===null||k.includes(m.tagName))&&(m.properties[b]=p(String(w||""),b,m))}}if(m.type==="element"){let b=n?!n.includes(m.tagName):o?o.includes(m.tagName):!1;if(!b&&r&&typeof g=="number"&&(b=!r(m,g,y)),b&&y&&typeof g=="number")return d&&m.children?y.children.splice(g,1,...m.children):y.children.splice(g,1),g}}}function Q$(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||q$.test(e.slice(0,t))?e:""}function Z$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function U4(e,t,n){const i=tf((n||{}).ignore||[]),o=W$(t);let l=-1;for(;++l<o.length;)l4(e,"text",d);function d(f,m){let g=-1,y;for(;++g<m.length;){const b=m[g],w=y?y.children:void 0;if(i(b,w?w.indexOf(b):void 0,y))return;y=b}if(y)return p(f,m)}function p(f,m){const g=m[m.length-1],y=o[l][0],b=o[l][1];let w=0;const j=g.children.indexOf(f);let S=!1,E=[];y.lastIndex=0;let C=y.exec(f.value);for(;C;){const z=C.index,D={index:C.index,input:C.input,stack:[...m,f]};let A=b(...C,D);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?y.lastIndex=z+1:(w!==z&&E.push({type:"text",value:f.value.slice(w,z)}),Array.isArray(A)?E.push(...A):A&&E.push(A),w=z+C[0].length,S=!0),!y.global)break;C=y.exec(f.value)}return S?(w<f.value.length&&E.push({type:"text",value:f.value.slice(w)}),g.children.splice(j,1,...E)):E=[f],j+E.length}}function W$(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([J$(i[0]),e9(i[1])])}return t}function J$(e){return typeof e=="string"?new RegExp(Z$(e),"g"):e}function e9(e){return typeof e=="function"?e:function(){return e}}const pm="phrasing",hm=["autolink","link","image","label"];function t9(){return{transforms:[l9],enter:{literalAutolink:r9,literalAutolinkEmail:mm,literalAutolinkHttp:mm,literalAutolinkWww:mm},exit:{literalAutolink:o9,literalAutolinkEmail:s9,literalAutolinkHttp:a9,literalAutolinkWww:i9}}}function n9(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:pm,notInConstruct:hm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:pm,notInConstruct:hm},{character:":",before:"[ps]",after:"\\/",inConstruct:pm,notInConstruct:hm}]}}function r9(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mm(e){this.config.enter.autolinkProtocol.call(this,e)}function a9(e){this.config.exit.autolinkProtocol.call(this,e)}function i9(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function s9(e){this.config.exit.autolinkEmail.call(this,e)}function o9(e){this.exit(e)}function l9(e){U4(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,c9],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),u9]],{ignore:["link","linkReference"]})}function c9(e,t,n,r,i){let o="";if(!H4(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!d9(n)))return!1;const l=f9(n+r);if(!l[0])return!1;const d={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[d,{type:"text",value:l[1]}]:d}function u9(e,t,n,r){return!H4(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function d9(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function f9(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Cd(e,"(");let o=Cd(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function H4(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||rs(n)||sf(n))&&(!t||n!==47)}q4.peek=_9;function p9(){this.buffer()}function h9(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function m9(){this.buffer()}function g9(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function x9(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function y9(e){this.exit(e)}function b9(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function v9(e){this.exit(e)}function _9(){return"["}function q4(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const l=n.enter("footnoteReference"),d=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),d(),l(),o+=i.move("]"),o}function w9(){return{enter:{gfmFootnoteCallString:p9,gfmFootnoteCall:h9,gfmFootnoteDefinitionLabelString:m9,gfmFootnoteDefinition:g9},exit:{gfmFootnoteCallString:x9,gfmFootnoteCall:y9,gfmFootnoteDefinitionLabelString:b9,gfmFootnoteDefinition:v9}}}function k9(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:q4},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,l){const d=o.createTracker(l);let p=d.move("[^");const f=o.enter("footnoteDefinition"),m=o.enter("label");return p+=d.move(o.safe(o.associationId(r),{before:p,after:"]"})),m(),p+=d.move("]:"),r.children&&r.children.length>0&&(d.shift(4),p+=d.move((t?`
109
+ `:" ")+o.indentLines(o.containerFlow(r,d.current()),t?V4:S9))),f(),p}}function S9(e,t,n){return t===0?e:V4(e,t,n)}function V4(e,t,n){return(n?"":" ")+e}const j9=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];G4.peek=T9;function N9(){return{canContainEols:["delete"],enter:{strikethrough:E9},exit:{strikethrough:A9}}}function C9(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:j9}],handlers:{delete:G4}}}function E9(e){this.enter({type:"delete",children:[]},e)}function A9(e){this.exit(e)}function G4(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function T9(){return"~"}function R9(e){return e.length}function L9(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||R9,o=[],l=[],d=[],p=[];let f=0,m=-1;for(;++m<e.length;){const k=[],j=[];let S=-1;for(e[m].length>f&&(f=e[m].length);++S<e[m].length;){const E=D9(e[m][S]);if(n.alignDelimiters!==!1){const C=i(E);j[S]=C,(p[S]===void 0||C>p[S])&&(p[S]=C)}k.push(E)}l[m]=k,d[m]=j}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<f;)o[g]=J_(r[g]);else{const k=J_(r);for(;++g<f;)o[g]=k}g=-1;const y=[],b=[];for(;++g<f;){const k=o[g];let j="",S="";k===99?(j=":",S=":"):k===108?j=":":k===114&&(S=":");let E=n.alignDelimiters===!1?1:Math.max(1,p[g]-j.length-S.length);const C=j+"-".repeat(E)+S;n.alignDelimiters!==!1&&(E=j.length+E+S.length,E>p[g]&&(p[g]=E),b[g]=E),y[g]=C}l.splice(1,0,y),d.splice(1,0,b),m=-1;const w=[];for(;++m<l.length;){const k=l[m],j=d[m];g=-1;const S=[];for(;++g<f;){const E=k[g]||"";let C="",z="";if(n.alignDelimiters!==!1){const D=p[g]-(j[g]||0),A=o[g];A===114?C=" ".repeat(D):A===99?D%2?(C=" ".repeat(D/2+.5),z=" ".repeat(D/2-.5)):(C=" ".repeat(D/2),z=C):z=" ".repeat(D)}n.delimiterStart!==!1&&!g&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||g)&&S.push(" "),n.alignDelimiters!==!1&&S.push(C),S.push(E),n.alignDelimiters!==!1&&S.push(z),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||g!==f-1)&&S.push("|")}w.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return w.join(`
110
+ `)}function D9(e){return e==null?"":String(e)}function J_(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function O9(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),M9);return i(),l}function M9(e,t,n){return">"+(n?"":" ")+e}function z9(e,t){return ew(e,t.inConstruct,!0)&&!ew(e,t.notInConstruct,!1)}function ew(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function tw(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
111
+ `&&z9(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
112
+ `}function I9(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+t.length,r=n.indexOf(t,i);return l}function $9(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function B9(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function P9(e,t,n,r){const i=B9(n),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if($9(e,n)){const g=n.enter("codeIndented"),y=n.indentLines(o,F9);return g(),y}const d=n.createTracker(r),p=i.repeat(Math.max(I9(o,i)+1,3)),f=n.enter("codeFenced");let m=d.move(p);if(e.lang){const g=n.enter(`codeFencedLang${l}`);m+=d.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...d.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${l}`);m+=d.move(" "),m+=d.move(n.safe(e.meta,{before:m,after:`
113
+ `,encode:["`"],...d.current()})),g()}return m+=d.move(`
114
+ `),o&&(m+=d.move(o+`
115
+ `)),m+=d.move(p),f(),m}function F9(e,t,n){return(n?"":" ")+e}function lx(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function U9(e,t,n,r){const i=lx(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let d=n.enter("label");const p=n.createTracker(r);let f=p.move("[");return f+=p.move(n.safe(n.associationId(e),{before:f,after:"]",...p.current()})),f+=p.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=p.move("<"),f+=p.move(n.safe(e.url,{before:f,after:">",...p.current()})),f+=p.move(">")):(d=n.enter("destinationRaw"),f+=p.move(n.safe(e.url,{before:f,after:e.title?" ":`
116
+ `,...p.current()}))),d(),e.title&&(d=n.enter(`title${o}`),f+=p.move(" "+i),f+=p.move(n.safe(e.title,{before:f,after:i,...p.current()})),f+=p.move(i),d()),l(),f}function H9(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Md(e,t,n){const r=oo(e),i=oo(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Y4.peek=q9;function Y4(e,t,n,r){const i=H9(n),o=n.enter("emphasis"),l=n.createTracker(r),d=l.move(i);let p=l.move(n.containerPhrasing(e,{after:i,before:d,...l.current()}));const f=p.charCodeAt(0),m=Md(r.before.charCodeAt(r.before.length-1),f,i);m.inside&&(p=Xl(f)+p.slice(1));const g=p.charCodeAt(p.length-1),y=Md(r.after.charCodeAt(0),g,i);y.inside&&(p=p.slice(0,-1)+Xl(g));const b=l.move(i);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},d+p+b}function q9(e,t,n){return n.options.emphasis||"*"}function V9(e,t){let n=!1;return Qg(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ag}),!!((!e.depth||e.depth<3)&&ex(e)&&(t.options.setext||n))}function G9(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(V9(e,n)){const m=n.enter("headingSetext"),g=n.enter("phrasing"),y=n.containerPhrasing(e,{...o.current(),before:`
117
+ `,after:`
118
+ `});return g(),m(),y+`
119
+ `+(i===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
120
+ `))+1))}const l="#".repeat(i),d=n.enter("headingAtx"),p=n.enter("phrasing");o.move(l+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
121
+ `,...o.current()});return/^[\t ]/.test(f)&&(f=Xl(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),p(),d(),f}K4.peek=Y9;function K4(e){return e.value||""}function Y9(){return"<"}X4.peek=K9;function X4(e,t,n,r){const i=lx(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let d=n.enter("label");const p=n.createTracker(r);let f=p.move("![");return f+=p.move(n.safe(e.alt,{before:f,after:"]",...p.current()})),f+=p.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=p.move("<"),f+=p.move(n.safe(e.url,{before:f,after:">",...p.current()})),f+=p.move(">")):(d=n.enter("destinationRaw"),f+=p.move(n.safe(e.url,{before:f,after:e.title?" ":")",...p.current()}))),d(),e.title&&(d=n.enter(`title${o}`),f+=p.move(" "+i),f+=p.move(n.safe(e.title,{before:f,after:i,...p.current()})),f+=p.move(i),d()),f+=p.move(")"),l(),f}function K9(){return"!"}Q4.peek=X9;function Q4(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const d=n.createTracker(r);let p=d.move("![");const f=n.safe(e.alt,{before:p,after:"]",...d.current()});p+=d.move(f+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:p,after:"]",...d.current()});return l(),n.stack=m,o(),i==="full"||!f||f!==g?p+=d.move(g+"]"):i==="shortcut"?p=p.slice(0,-1):p+=d.move("]"),p}function X9(){return"!"}Z4.peek=Q9;function Z4(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],d=n.compilePattern(l);let p;if(l.atBreak)for(;p=d.exec(r);){let f=p.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(p.index+1)}}return i+r+i}function Q9(){return"`"}function W4(e,t){const n=ex(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}J4.peek=Z9;function J4(e,t,n,r){const i=lx(n),o=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let d,p;if(W4(e,n)){const m=n.stack;n.stack=[],d=n.enter("autolink");let g=l.move("<");return g+=l.move(n.containerPhrasing(e,{before:g,after:">",...l.current()})),g+=l.move(">"),d(),n.stack=m,g}d=n.enter("link"),p=n.enter("label");let f=l.move("[");return f+=l.move(n.containerPhrasing(e,{before:f,after:"](",...l.current()})),f+=l.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=n.enter("destinationLiteral"),f+=l.move("<"),f+=l.move(n.safe(e.url,{before:f,after:">",...l.current()})),f+=l.move(">")):(p=n.enter("destinationRaw"),f+=l.move(n.safe(e.url,{before:f,after:e.title?" ":")",...l.current()}))),p(),e.title&&(p=n.enter(`title${o}`),f+=l.move(" "+i),f+=l.move(n.safe(e.title,{before:f,after:i,...l.current()})),f+=l.move(i),p()),f+=l.move(")"),d(),f}function Z9(e,t,n){return W4(e,n)?"<":"["}e2.peek=W9;function e2(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const d=n.createTracker(r);let p=d.move("[");const f=n.containerPhrasing(e,{before:p,after:"]",...d.current()});p+=d.move(f+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:p,after:"]",...d.current()});return l(),n.stack=m,o(),i==="full"||!f||f!==g?p+=d.move(g+"]"):i==="shortcut"?p=p.slice(0,-1):p+=d.move("]"),p}function W9(){return"["}function cx(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function J9(e){const t=cx(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function eB(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function t2(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function tB(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?eB(n):cx(n);const d=e.ordered?l==="."?")":".":J9(n);let p=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(p=!0),t2(n)===l&&m){let g=-1;for(;++g<e.children.length;){const y=e.children[g];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(l=d),n.bulletCurrent=l;const f=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,i(),f}function nB(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function rB(e,t,n,r){const i=nB(n);let o=n.bulletCurrent||cx(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const d=n.createTracker(r);d.move(o+" ".repeat(l-o.length)),d.shift(l);const p=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,d.current()),m);return p(),f;function m(g,y,b){return y?(b?"":" ".repeat(l))+g:(b?o:o+" ".repeat(l-o.length))+g}}function aB(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),i(),l}const iB=tf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function sB(e,t,n,r){return(e.children.some(function(l){return iB(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function oB(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}n2.peek=lB;function n2(e,t,n,r){const i=oB(n),o=n.enter("strong"),l=n.createTracker(r),d=l.move(i+i);let p=l.move(n.containerPhrasing(e,{after:i,before:d,...l.current()}));const f=p.charCodeAt(0),m=Md(r.before.charCodeAt(r.before.length-1),f,i);m.inside&&(p=Xl(f)+p.slice(1));const g=p.charCodeAt(p.length-1),y=Md(r.after.charCodeAt(0),g,i);y.inside&&(p=p.slice(0,-1)+Xl(g));const b=l.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},d+p+b}function lB(e,t,n){return n.options.strong||"*"}function cB(e,t,n,r){return n.safe(e.value,r)}function uB(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function dB(e,t,n){const r=(t2(n)+(n.options.ruleSpaces?" ":"")).repeat(uB(n));return n.options.ruleSpaces?r.slice(0,-1):r}const r2={blockquote:O9,break:tw,code:P9,definition:U9,emphasis:Y4,hardBreak:tw,heading:G9,html:K4,image:X4,imageReference:Q4,inlineCode:Z4,link:J4,linkReference:e2,list:tB,listItem:rB,paragraph:aB,root:sB,strong:n2,text:cB,thematicBreak:dB};function fB(){return{enter:{table:pB,tableData:nw,tableHeader:nw,tableRow:mB},exit:{codeText:gB,table:hB,tableData:gm,tableHeader:gm,tableRow:gm}}}function pB(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function hB(e){this.exit(e),this.data.inTable=void 0}function mB(e){this.enter({type:"tableRow",children:[]},e)}function gm(e){this.exit(e)}function nw(e){this.enter({type:"tableCell",children:[]},e)}function gB(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,xB));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function xB(e,t){return t==="|"?t:e}function yB(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
122
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:l,tableCell:p,tableRow:d}};function l(b,w,k,j){return f(m(b,k,j),b.align)}function d(b,w,k,j){const S=g(b,k,j),E=f([S]);return E.slice(0,E.indexOf(`
123
+ `))}function p(b,w,k,j){const S=k.enter("tableCell"),E=k.enter("phrasing"),C=k.containerPhrasing(b,{...j,before:o,after:o});return E(),S(),C}function f(b,w){return L9(b,{align:w,alignDelimiters:r,padding:n,stringLength:i})}function m(b,w,k){const j=b.children;let S=-1;const E=[],C=w.enter("table");for(;++S<j.length;)E[S]=g(j[S],w,k);return C(),E}function g(b,w,k){const j=b.children;let S=-1;const E=[],C=w.enter("tableRow");for(;++S<j.length;)E[S]=p(j[S],b,w,k);return C(),E}function y(b,w,k){let j=r2.inlineCode(b,w,k);return k.stack.includes("tableCell")&&(j=j.replace(/\|/g,"\\$&")),j}}function bB(){return{exit:{taskListCheckValueChecked:rw,taskListCheckValueUnchecked:rw,paragraph:_B}}}function vB(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:wB}}}function rw(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function _B(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,l;for(;++o<i.length;){const d=i[o];if(d.type==="paragraph"){l=d;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function wB(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",d=n.createTracker(r);o&&d.move(l);let p=r2.listItem(e,t,n,{...r,...d.current()});return o&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),p;function f(m){return m+l}}function kB(){return[t9(),w9(),N9(),fB(),bB()]}function SB(e){return{extensions:[n9(),k9(e),C9(),yB(e),vB()]}}const jB={tokenize:RB,partial:!0},a2={tokenize:LB,partial:!0},i2={tokenize:DB,partial:!0},s2={tokenize:OB,partial:!0},NB={tokenize:MB,partial:!0},o2={name:"wwwAutolink",tokenize:AB,previous:c2},l2={name:"protocolAutolink",tokenize:TB,previous:u2},Ga={name:"emailAutolink",tokenize:EB,previous:d2},ha={};function CB(){return{text:ha}}let Gi=48;for(;Gi<123;)ha[Gi]=Ga,Gi++,Gi===58?Gi=65:Gi===91&&(Gi=97);ha[43]=Ga;ha[45]=Ga;ha[46]=Ga;ha[95]=Ga;ha[72]=[Ga,l2];ha[104]=[Ga,l2];ha[87]=[Ga,o2];ha[119]=[Ga,o2];function EB(e,t,n){const r=this;let i,o;return l;function l(g){return!fg(g)||!d2.call(r,r.previous)||ux(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(g))}function d(g){return fg(g)?(e.consume(g),d):g===64?(e.consume(g),p):n(g)}function p(g){return g===46?e.check(NB,m,f)(g):g===45||g===95||zn(g)?(o=!0,e.consume(g),p):m(g)}function f(g){return e.consume(g),i=!0,p}function m(g){return o&&i&&Hn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function AB(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!c2.call(r,r.previous)||ux(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(jB,e.attempt(a2,e.attempt(i2,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function TB(e,t,n){const r=this;let i="",o=!1;return l;function l(g){return(g===72||g===104)&&u2.call(r,r.previous)&&!ux(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(g),e.consume(g),d):n(g)}function d(g){if(Hn(g)&&i.length<5)return i+=String.fromCodePoint(g),e.consume(g),d;if(g===58){const y=i.toLowerCase();if(y==="http"||y==="https")return e.consume(g),p}return n(g)}function p(g){return g===47?(e.consume(g),o?f:(o=!0,p)):n(g)}function f(g){return g===null||Ld(g)||Mt(g)||rs(g)||sf(g)?n(g):e.attempt(a2,e.attempt(i2,m),n)(g)}function m(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function RB(e,t,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function LB(e,t,n){let r,i,o;return l;function l(f){return f===46||f===95?e.check(s2,p,d)(f):f===null||Mt(f)||rs(f)||f!==45&&sf(f)?p(f):(o=!0,e.consume(f),l)}function d(f){return f===95?r=!0:(i=r,r=void 0),e.consume(f),l}function p(f){return i||r||!o?n(f):t(f)}}function DB(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(s2,t,o)(l):l===null||Mt(l)||rs(l)?t(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function OB(e,t,n){return r;function r(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),r):d===38?(e.consume(d),o):d===93?(e.consume(d),i):d===60||d===null||Mt(d)||rs(d)?t(d):n(d)}function i(d){return d===null||d===40||d===91||Mt(d)||rs(d)?t(d):r(d)}function o(d){return Hn(d)?l(d):n(d)}function l(d){return d===59?(e.consume(d),r):Hn(d)?(e.consume(d),l):n(d)}}function MB(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return zn(o)?n(o):t(o)}}function c2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Mt(e)}function u2(e){return!Hn(e)}function d2(e){return!(e===47||fg(e))}function fg(e){return e===43||e===45||e===46||e===95||zn(e)}function ux(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const zB={tokenize:qB,partial:!0};function IB(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:FB,continuation:{tokenize:UB},exit:HB}},text:{91:{name:"gfmFootnoteCall",tokenize:PB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:$B,resolveTo:BB}}}}function $B(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const p=r.events[i][1];if(p.type==="labelImage"){l=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return d;function d(p){if(!l||!l._balanced)return n(p);const f=qr(r.sliceSerialize({start:l.end,end:r.now()}));return f.codePointAt(0)!==94||!o.includes(f.slice(1))?n(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),t(p))}}function BB(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...d),e}function PB(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return d;function d(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(g){if(o>999||g===93&&!l||g===null||g===91||Mt(g))return n(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return i.includes(qr(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return Mt(g)||(l=!0),o++,e.consume(g),g===92?m:f}function m(g){return g===91||g===92||g===93?(e.consume(g),o++,f):f(g)}}function FB(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,d;return p;function p(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(w)}function m(w){if(l>999||w===93&&!d||w===null||w===91||Mt(w))return n(w);if(w===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return o=qr(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Mt(w)||(d=!0),l++,e.consume(w),w===92?g:m}function g(w){return w===91||w===92||w===93?(e.consume(w),l++,m):m(w)}function y(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),i.includes(o)||i.push(o),xt(e,b,"gfmFootnoteDefinitionWhitespace")):n(w)}function b(w){return t(w)}}function UB(e,t,n){return e.check(mc,t,e.attempt(zB,t,n))}function HB(e){e.exit("gfmFootnoteDefinition")}function qB(e,t,n){const r=this;return xt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function VB(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,d){let p=-1;for(;++p<l.length;)if(l[p][0]==="enter"&&l[p][1].type==="strikethroughSequenceTemporary"&&l[p][1]._close){let f=p;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[p][1].end.offset-l[p][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[p][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[p][1].end)},g={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[p][1].start)},y=[["enter",m,d],["enter",l[f][1],d],["exit",l[f][1],d],["enter",g,d]],b=d.parser.constructs.insideSpan.null;b&&gr(y,y.length,0,of(b,l.slice(f+1,p),d)),gr(y,y.length,0,[["exit",g,d],["enter",l[p][1],d],["exit",l[p][1],d],["exit",m,d]]),gr(l,f-1,p-f+3,y),p=f+y.length-2;break}}for(p=-1;++p<l.length;)l[p][1].type==="strikethroughSequenceTemporary"&&(l[p][1].type="data");return l}function o(l,d,p){const f=this.previous,m=this.events;let g=0;return y;function y(w){return f===126&&m[m.length-1][1].type!=="characterEscape"?p(w):(l.enter("strikethroughSequenceTemporary"),b(w))}function b(w){const k=oo(f);if(w===126)return g>1?p(w):(l.consume(w),g++,b);if(g<2&&!n)return p(w);const j=l.exit("strikethroughSequenceTemporary"),S=oo(w);return j._open=!S||S===2&&!!k,j._close=!k||k===2&&!!S,d(w)}}}class GB{constructor(){this.map=[]}add(t,n,r){YB(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function YB(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function KB(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function XB(){return{flow:{null:{name:"table",tokenize:QB,resolveAll:ZB}}}}function QB(e,t,n){const r=this;let i=0,o=0,l;return d;function d(M){let G=r.events.length-1;for(;G>-1;){const $=r.events[G][1].type;if($==="lineEnding"||$==="linePrefix")G--;else break}const Q=G>-1?r.events[G][1].type:null,re=Q==="tableHead"||Q==="tableRow"?A:p;return re===A&&r.parser.lazy[r.now().line]?n(M):re(M)}function p(M){return e.enter("tableHead"),e.enter("tableRow"),f(M)}function f(M){return M===124||(l=!0,o+=1),m(M)}function m(M){return M===null?n(M):Ze(M)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),b):n(M):dt(M)?xt(e,m,"whitespace")(M):(o+=1,l&&(l=!1,i+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),g(M)))}function g(M){return M===null||M===124||Mt(M)?(e.exit("data"),m(M)):(e.consume(M),M===92?y:g)}function y(M){return M===92||M===124?(e.consume(M),g):g(M)}function b(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),l=!1,dt(M)?xt(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):w(M))}function w(M){return M===45||M===58?j(M):M===124?(l=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),k):D(M)}function k(M){return dt(M)?xt(e,j,"whitespace")(M):j(M)}function j(M){return M===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),S):M===45?(o+=1,S(M)):M===null||Ze(M)?z(M):D(M)}function S(M){return M===45?(e.enter("tableDelimiterFiller"),E(M)):D(M)}function E(M){return M===45?(e.consume(M),E):M===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(M))}function C(M){return dt(M)?xt(e,z,"whitespace")(M):z(M)}function z(M){return M===124?w(M):M===null||Ze(M)?!l||i!==o?D(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):D(M)}function D(M){return n(M)}function A(M){return e.enter("tableRow"),P(M)}function P(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),P):M===null||Ze(M)?(e.exit("tableRow"),t(M)):dt(M)?xt(e,P,"whitespace")(M):(e.enter("data"),T(M))}function T(M){return M===null||M===124||Mt(M)?(e.exit("data"),P(M)):(e.consume(M),M===92?F:T)}function F(M){return M===92||M===124?(e.consume(M),T):T(M)}}function ZB(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],d=!1,p=0,f,m,g;const y=new GB;for(;++n<e.length;){const b=e[n],w=b[1];b[0]==="enter"?w.type==="tableHead"?(d=!1,p!==0&&(aw(y,t,p,f,m),m=void 0,p=0),f={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",f,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,g=void 0,o=[0,0,0,0],l=[0,n+1,0,0],d&&(d=!1,m={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",m,t]])),i=w.type==="tableDelimiterRow"?2:m?3:1):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],g=Qu(y,t,o,i,void 0,g),o=[0,0,0,0]),l[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],g=Qu(y,t,o,i,void 0,g)),o=l,l=[o[1],n,0,0])):w.type==="tableHead"?(d=!0,p=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(p=n,o[1]!==0?(l[0]=l[1],g=Qu(y,t,o,i,n,g)):l[1]!==0&&(g=Qu(y,t,l,i,n,g)),i=0):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(p!==0&&aw(y,t,p,f,m),y.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=KB(t.events,n))}return e}function Qu(e,t,n,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(o.end=Object.assign({},Qs(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const p=Qs(t.events,n[1]);if(o={type:l,start:Object.assign({},p),end:Object.assign({},p)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const f=Qs(t.events,n[2]),m=Qs(t.events,n[3]),g={type:d,start:Object.assign({},f),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",g,t]]),r!==2){const y=t.events[n[2]],b=t.events[n[3]];if(y[1].end=Object.assign({},b[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,k=n[3]-n[2]-1;e.add(w,k,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return i!==void 0&&(o.end=Object.assign({},Qs(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function aw(e,t,n,r,i){const o=[],l=Qs(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function Qs(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const WB={name:"tasklistCheck",tokenize:eP};function JB(){return{text:{91:WB}}}function eP(e,t,n){const r=this;return i;function i(p){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),o)}function o(p){return Mt(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),l):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),l):n(p)}function l(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(p)}function d(p){return Ze(p)?t(p):dt(p)?e.check({tokenize:tP},t,n)(p):n(p)}}function tP(e,t,n){return xt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function nP(e){return k4([CB(),IB(),VB(e),XB(),JB()])}const rP={};function aP(e){const t=this,n=e||rP,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(nP(n)),o.push(kB()),l.push(SB(n))}function iP(e){U4(e,[/\r?\n|\r/g,sP])}function sP(){return{type:"break"}}function oP(){return function(e){iP(e)}}function lP({children:e,className:t}){const n=Kd(o=>o.theme),i=(n==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n)==="dark"?b4:v4;return u.jsx("div",{className:`c4a-markdown ${t??""}`,children:u.jsx(G$,{remarkPlugins:[aP,oP],components:{pre({children:o}){return u.jsx(u.Fragment,{children:o})},code({className:o,children:l,node:d,...p}){const f=/language-(\w+)/.exec(o??""),m=String(l).replace(/\n$/,"");if(!(d?.position&&m.includes(`
124
+ `)||f))return u.jsx("code",{className:"rounded bg-c4a-bg-elevated px-1.5 py-0.5 font-mono text-c4a-text-secondary",...p,children:l});const y=f?.[1]??"plaintext";return u.jsx("div",{"data-theme":"dark",className:"my-2 rounded-lg border border-c4a-border-subtle overflow-hidden text-xs leading-relaxed [&_pre]:!bg-transparent [&_code]:!bg-transparent",children:u.jsx(y4,{language:y,theme:i,children:m})})}},children:e})})}const cP=["entities","relations","behaviors","attributes","states","rules","transitions","events","decisions","metrics","roles","constraints","comparisons","boundaries"],uP={critical:{label:"CRITICAL",className:"text-red-400 bg-red-500/10"},major:{label:"MAJOR",className:"text-amber-400 bg-amber-500/10"},minor:{label:"MINOR",className:"text-c4a-text-muted bg-c4a-bg-elevated"},must:{label:"MUST",className:"text-red-400 bg-red-500/10"},should:{label:"SHOULD",className:"text-amber-400 bg-amber-500/10"},may:{label:"MAY",className:"text-c4a-text-muted bg-c4a-bg-elevated"}};function f2(e){return e==null?"":typeof e=="object"?JSON.stringify(e):String(e)}function dP(e){if(e==null)return"";if(Array.isArray(e)){const t=e.map(n=>f2(n));return t.length<=5?t.join(", "):`${t.slice(0,5).join(", ")} โ€ฆ (${t.length})`}return typeof e=="object"?JSON.stringify(e):String(e)}function fP(e){return cP.map(t=>({type:t,atoms:Array.isArray(e[t])?e[t]:[]}))}function pP(e){return e.every(t=>t.atoms.length===0)}function hP({severity:e}){if(!e)return null;const t=uP[e];return t?u.jsxs("span",{className:"relative inline-block group cursor-default ml-2",children:[u.jsx("span",{className:`inline-flex rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${t.className}`,children:t.label}),u.jsx("span",{className:"pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-1.5 px-2 py-1 rounded bg-c4a-bg-elevated text-c4a-text-primary text-[11px] font-sans normal-case whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity duration-150 shadow-lg border border-c4a-border-subtle z-50",children:e})]}):u.jsxs("span",{className:"relative inline-block group cursor-default ml-2",children:[u.jsx("span",{className:"inline-flex rounded-sm bg-c4a-bg-active border border-c4a-border-subtle px-1.5 py-0.5 font-mono text-[10px] uppercase text-c4a-text-muted",children:e}),u.jsx("span",{className:"pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-1.5 px-2 py-1 rounded bg-c4a-bg-elevated text-c4a-text-primary text-[11px] font-sans normal-case whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity duration-150 shadow-lg border border-c4a-border-subtle z-50",children:e})]})}function Zu({name:e,clickable:t}){if(!t)return u.jsx("span",{className:"text-c4a-text-secondary font-mono font-medium group-hover/atom:text-c4a-accent transition-colors",children:e});const n=()=>{const r=document.querySelector(`[data-entity-name="${CSS.escape(e)}"]`);r&&r.scrollIntoView({behavior:"smooth",block:"nearest"})};return u.jsx("span",{className:"text-c4a-text-secondary font-mono font-medium cursor-pointer hover:underline group-hover/atom:text-c4a-accent transition-colors",onClick:n,children:e})}function iw(e){return Object.entries(e).map(([t,n])=>`${t}: ${f2(n)}`).join(", ")}function mP({rows:e,label:t}){const[n,r]=_.useState(!1),i=_.useRef(null);return _.useEffect(()=>{if(!n)return;const o=l=>{i.current&&!i.current.contains(l.target)&&r(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[n]),u.jsxs("span",{className:"relative inline-block",ref:i,children:[u.jsx("span",{className:"text-c4a-text-muted cursor-pointer hover:underline",onClick:()=>r(o=>!o),children:t}),n&&u.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 w-max max-w-[26.25rem] rounded-lg border border-c4a-border-subtle bg-c4a-bg-elevated px-3 py-2 shadow-lg",children:u.jsx("div",{className:"max-h-48 overflow-y-auto c4a-scrollbar space-y-1",children:e.map((o,l)=>u.jsx("div",{className:"font-mono text-[11px] text-c4a-text-secondary whitespace-pre-wrap break-words",children:o},l))})})]})}function Wu({label:e}){return u.jsx("span",{className:"font-mono text-[10px] uppercase text-c4a-text-muted",children:e})}function gP({atom:e,t}){const n=typeof e.severity=="string"?e.severity:void 0,r=typeof e.confidence=="number"?e.confidence:void 0,i=po(r);return u.jsxs(u.Fragment,{children:[i?u.jsx("span",{className:"ml-2 inline-flex",children:u.jsx(Yt,{variant:i.variant,tooltip:`${i.value.toFixed(2)} โ€” ${t(i.tipKey)}`,children:t(i.labelKey)})}):null,u.jsx(hP,{severity:n})]})}function xP(e,t){const n=[];switch(e){case"relations":typeof t.description=="string"&&n.push(t.description);break;case"attributes":if(t.value!==void 0)if(Array.isArray(t.value)&&t.value.length>0&&typeof t.value[0]=="object"&&t.value[0]!==null){const r=t.value,i=3,o=r.slice(0,i);for(const l of o)n.push(u.jsx("span",{className:"font-mono",children:iw(l)}));if(r.length>i){const l=r.map(p=>iw(p)),d=r.length-i;n.push(u.jsx(mP,{rows:l,label:`... ${d} More`}))}}else n.push(dP(t.value));break;case"states":Array.isArray(t.values)&&n.push(u.jsxs(u.Fragment,{children:["[",t.values.join(", "),"]"]})),typeof t.ref_sor=="string"&&n.push(t.ref_sor);break;case"rules":typeof t.expression=="string"&&n.push(u.jsx("span",{className:"font-mono",children:t.expression})),Array.isArray(t.depends_on)&&t.depends_on.length>0&&n.push(u.jsxs(u.Fragment,{children:["depends: ",t.depends_on.join(", ")]}));break;case"behaviors":typeof t.description=="string"&&n.push(t.description),typeof t.signature=="string"&&n.push(u.jsx("span",{className:"font-mono",children:t.signature}));break;case"metrics":typeof t.target=="string"&&n.push(u.jsxs(u.Fragment,{children:["target: ",t.target]})),typeof t.threshold=="string"&&n.push(u.jsxs(u.Fragment,{children:["threshold: ",t.threshold]}));break;case"roles":typeof t.description=="string"&&n.push(t.description),Array.isArray(t.performs)&&t.performs.length>0&&n.push(u.jsxs(u.Fragment,{children:["performs: ",t.performs.join(", ")]}));break;case"boundaries":Array.isArray(t.contains)&&t.contains.length>0&&n.push(u.jsxs(u.Fragment,{children:["โŠƒ ",t.contains.join(", ")]})),Array.isArray(t.excludes)&&t.excludes.length>0&&n.push(u.jsxs(u.Fragment,{children:["โŠ… ",t.excludes.join(", ")]}));break;case"decisions":typeof t.rationale=="string"&&n.push(t.rationale),Array.isArray(t.alternatives)&&t.alternatives.length>0&&n.push(u.jsxs(u.Fragment,{children:["alternatives: ",t.alternatives.join(", ")]}));break;case"comparisons":Array.isArray(t.subjects)&&n.push(t.subjects.join(" vs ")),typeof t.conclusion=="string"&&n.push(t.conclusion);break;case"transitions":typeof t.guard=="string"&&n.push(u.jsxs(u.Fragment,{children:["guard: ",u.jsx("span",{className:"font-mono",children:t.guard})]}));break;case"events":Array.isArray(t.trigger_for)&&t.trigger_for.length>0&&n.push(u.jsxs(u.Fragment,{children:["triggers: ",t.trigger_for.join(", ")]}));break;case"constraints":typeof t.metric_ref=="string"&&n.push(u.jsxs(u.Fragment,{children:["metric: ",t.metric_ref]}));break}return n}function yP(e,t){switch(e){case"relations":return{main:u.jsxs(u.Fragment,{children:[u.jsx(Zu,{name:String(t.from??""),clickable:!0}),typeof t.type=="string"?u.jsxs("span",{className:"mx-1.5 text-c4a-text-muted font-mono text-[10px] uppercase",children:["โ€• ",t.type," โ†’"]}):u.jsx("span",{className:"mx-1 text-c4a-text-muted",children:"โ†’"}),u.jsx(Zu,{name:String(t.to??""),clickable:!0})]}),chip:null};case"transitions":return{main:u.jsxs(u.Fragment,{children:[u.jsx(Zu,{name:String(t.from??""),clickable:!0}),u.jsx("span",{className:"mx-1 text-c4a-text-muted",children:"โ†’"}),u.jsx(Zu,{name:String(t.to??""),clickable:!0})]}),chip:typeof t.trigger=="string"?u.jsx("span",{className:"ml-2",children:u.jsx(Wu,{label:t.trigger})}):null};case"entities":return{main:u.jsx("span",{className:"c4a-entity-name font-medium text-c4a-text-secondary group-hover/atom:text-c4a-accent transition-colors",children:String(t.name??"")}),chip:typeof t.kind=="string"?u.jsx("span",{className:"c4a-entity-name ml-2",children:u.jsx(Wu,{label:t.kind})}):null};case"attributes":return{main:u.jsx("span",{className:"font-medium",children:String(t.name??"")}),chip:typeof t.type=="string"?u.jsx("span",{className:"ml-2",children:u.jsx(Wu,{label:t.type})}):null};case"roles":return{main:u.jsx("span",{className:"font-medium",children:String(t.name??"")}),chip:typeof t.kind=="string"?u.jsx("span",{className:"ml-2",children:u.jsx(Wu,{label:t.kind})}):null};case"metrics":return{main:u.jsx("span",{className:"font-medium",children:String(t.name??"")}),chip:null};case"states":return{main:u.jsx("span",{className:"font-medium",children:String(t.name??"")}),chip:null};case"boundaries":return{main:u.jsx("span",{className:"font-medium",children:String(t.name??"")}),chip:null};case"comparisons":return{main:u.jsx("span",{className:"font-medium",children:String(t.name??"")}),chip:null};case"behaviors":return{main:u.jsx("span",{className:"font-medium",children:String(t.name??"")}),chip:null};case"events":return{main:u.jsx("span",{className:"font-medium",children:String(t.name??"")}),chip:null};default:return{main:u.jsx("span",{children:String(t.description??t.name??JSON.stringify(t))}),chip:null}}}function bP({type:e,atom:t,t:n}){const{main:r,chip:i}=yP(e,t),o=xP(e,t),l=e==="entities"&&typeof t.name=="string"?{"data-entity-name":t.name}:void 0,d=e==="relations"||e==="transitions"?[t.from,t.to].filter(m=>typeof m=="string"):[],p=d.length>0?()=>d.forEach(m=>{const g=document.querySelector(`[data-entity-name="${CSS.escape(m)}"]`);g&&g.classList.add("c4a-entity-highlight")}):void 0,f=d.length>0?()=>d.forEach(m=>{const g=document.querySelector(`[data-entity-name="${CSS.escape(m)}"]`);g&&g.classList.remove("c4a-entity-highlight")}):void 0;return u.jsxs("div",{className:`group/atom relative pl-3 py-1 rounded hover:bg-c4a-bg-hover cursor-default transition-colors text-xs text-c4a-text-secondary leading-relaxed break-words${e==="entities"?" c4a-entity-target":""}`,...l,onMouseEnter:p,onMouseLeave:f,children:[u.jsxs("div",{children:[u.jsxs("span",{className:"group-hover/atom:text-c4a-accent transition-colors",children:[r,i]}),u.jsx(gP,{atom:t,t:n})]}),o.length>0?u.jsx("div",{className:"pl-3 text-c4a-text-muted",children:o.map((m,g)=>u.jsx("div",{children:m},g))}):null]})}const sw=100;function vP({paragraph:e,t}){const n=_.useRef(null),r=_.useRef(null),[i,o]=_.useState(void 0),[l,d]=_.useState(!1),[p,f]=_.useState(!1),m=fP(e.atoms),g=pP(m);return _.useEffect(()=>{if(l)return;const y=n.current,b=r.current;if(!y||!b)return;const w=requestAnimationFrame(()=>{const k=y.scrollHeight,j=b.offsetHeight;if(k>j+sw&&j>0){const S=j+sw;o(S),f(!0)}else o(void 0),f(!1)});return()=>cancelAnimationFrame(w)},[e.text,e.atoms,l]),u.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 mt-5 pt-5 border-t border-c4a-border-subtle first:border-t-0 first:mt-0 first:pt-0",children:[u.jsxs("div",{className:"lg:w-1/2 min-w-0",children:[u.jsx("div",{ref:n,className:"text-xs text-c4a-text-secondary leading-relaxed break-words overflow-hidden",style:!l&&i!==void 0?{maxHeight:i}:void 0,children:u.jsx(lP,{children:e.text})}),p&&!l&&u.jsx("span",{className:"text-c4a-text-muted text-xs cursor-pointer hover:underline mt-0.5 inline-block",onClick:()=>d(!0),children:"...More"}),l&&p&&u.jsx("span",{className:"text-c4a-text-muted text-xs cursor-pointer hover:underline mt-0.5 inline-block",onClick:()=>d(!1),children:t("common.collapse")})]}),u.jsx("div",{ref:r,className:"lg:w-1/2 min-w-0 self-start",children:g?u.jsx("span",{className:"text-xs text-c4a-text-muted italic",children:t("digest.noAtoms","โ€”")}):u.jsx("div",{className:"space-y-4",children:m.filter(y=>y.atoms.length>0).map(y=>u.jsxs("div",{className:"rounded-lg bg-c4a-bg-elevated p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.jsx("span",{className:"w-0.5 h-3 bg-c4a-accent rounded-full"}),u.jsx("span",{className:"font-mono text-xs uppercase tracking-widest text-c4a-accent",children:y.type})]}),u.jsx("div",{className:"space-y-0.5",children:y.atoms.map((b,w)=>u.jsx(bP,{type:y.type,atom:b,t},w))})]},y.type))})})]})}function _P({digest:e}){const{t}=_e(),n=_.useMemo(()=>e.sections.map((r,i)=>({section:r,sectionIndex:i})),[e.sections]);return u.jsx("div",{className:"w-full rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-5 overflow-hidden",children:n.map(({section:r,sectionIndex:i})=>u.jsx("div",{className:"border-t border-c4a-border-subtle pt-4 mt-4 first:border-t-0 first:mt-0 first:pt-0",children:r.paragraphs.map((o,l)=>u.jsx(vP,{paragraph:o,t},`${i}-${l}`))},`section-${i}`))})}function Ia(){return{data:null,loading:!1,error:null,warnings:[],pagination:null}}function xm(){return{data:null,loading:!1,error:null,warnings:[]}}function bl(e){const t={};for(const[n,r]of Object.entries(e))r!=null&&(Array.isArray(r)?t[n]=r.join(","):t[n]=String(r));return t}const ow=new Map;function vl(e){const t=ow.get(e);t&&t.abort();const n=new AbortController;return ow.set(e,n),n.signal}const Gn=da((e,t)=>({symbols:{...Ia()},callGraph:{...Ia()},imports:{...Ia()},inheritance:{...Ia()},paragraphs:{...xm()},fetchSymbols:async(n,r)=>{const i=vl("symbols");e(o=>({symbols:{...o.symbols,loading:!0,error:null}}));try{const o=await Pe.get("/query/symbols",bl({sourceIds:n.sourceIds,exportedOnly:n.exportedOnly,kind:n.kind,namePattern:n.namePattern,filePath:n.filePath,limit:n.limit,offset:n.offset}),{signal:i,skipDedup:!0});if(i.aborted)return;const l=r?.append?t().symbols.data??[]:[];e({symbols:{data:[...l,...o.symbols],pagination:o.pagination,loading:!1,error:null,warnings:o.warnings??[]}})}catch(o){if(i.aborted||o instanceof DOMException&&o.name==="AbortError")return;e(l=>({symbols:{...l.symbols,loading:!1,error:String(o)}}))}},fetchCallGraph:async n=>{const r=vl("callGraph");e({callGraph:{data:null,loading:!0,error:null,warnings:[],pagination:null}});try{const i=await Pe.get("/query/call-graph",bl({sourceIds:n.sourceIds,functionName:n.functionName,direction:n.direction,maxDepth:n.maxDepth,limit:n.limit,offset:n.offset}),{signal:r,skipDedup:!0});if(r.aborted)return;e({callGraph:{data:i.entries,pagination:i.pagination,loading:!1,error:null,warnings:i.warnings??[]}})}catch(i){if(r.aborted||i instanceof DOMException&&i.name==="AbortError")return;e({callGraph:{data:null,loading:!1,error:String(i),warnings:[],pagination:null}})}},fetchImports:async n=>{const r=vl("imports");e({imports:{data:null,loading:!0,error:null,warnings:[],pagination:null}});try{const i=await Pe.get("/query/imports",bl({sourceIds:n.sourceIds,filePath:n.filePath,direction:n.direction,limit:n.limit,offset:n.offset}),{signal:r,skipDedup:!0});if(r.aborted)return;e({imports:{data:i.imports,pagination:i.pagination,loading:!1,error:null,warnings:i.warnings??[]}})}catch(i){if(r.aborted||i instanceof DOMException&&i.name==="AbortError")return;e({imports:{data:null,loading:!1,error:String(i),warnings:[],pagination:null}})}},fetchInheritance:async n=>{const r=vl("inheritance");e({inheritance:{data:null,loading:!0,error:null,warnings:[],pagination:null}});try{const i=await Pe.get("/query/inheritance",bl({sourceIds:n.sourceIds,className:n.className,direction:n.direction,limit:n.limit,offset:n.offset}),{signal:r,skipDedup:!0});if(r.aborted)return;e({inheritance:{data:i.relations,pagination:i.pagination,loading:!1,error:null,warnings:i.warnings??[]}})}catch(i){if(r.aborted||i instanceof DOMException&&i.name==="AbortError")return;e({inheritance:{data:null,loading:!1,error:String(i),warnings:[],pagination:null}})}},fetchParagraphs:async n=>{const r=vl("paragraphs");e({paragraphs:{data:null,loading:!0,error:null,warnings:[]}});try{const i=await Pe.get("/query/paragraphs",bl({sourceIds:n.sourceIds,text:n.text,topK:n.topK,scoreLow:n.scoreLow}),{signal:r,skipDedup:!0});if(r.aborted)return;e({paragraphs:{data:i.results,loading:!1,error:null,warnings:[]}})}catch(i){if(r.aborted||i instanceof DOMException&&i.name==="AbortError")return;e({paragraphs:{data:null,loading:!1,error:String(i),warnings:[]}})}},resetQuery:n=>{e(n?n==="paragraphs"?{[n]:xm()}:{[n]:Ia()}:{symbols:Ia(),callGraph:Ia(),imports:Ia(),inheritance:Ia(),paragraphs:xm()})}}));function cf({warnings:e}){const{t}=_e(),[n,r]=_.useState(!1);return e.length===0?null:u.jsxs("div",{className:"rounded-lg bg-c4a-warning/10 border border-c4a-warning/20 px-3 py-2 mb-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(C3,{size:14,className:"text-c4a-warning shrink-0"}),u.jsx("span",{className:"font-mono text-xs text-c4a-warning",children:e[0]}),e.length>1&&u.jsx("button",{type:"button",className:"font-mono text-[10px] text-c4a-warning/70 underline cursor-pointer",onClick:()=>r(!n),children:t("query.warning.more",{count:e.length-1})})]}),n&&e.slice(1).map((i,o)=>u.jsx("div",{className:"mt-1 pl-6 font-mono text-xs text-c4a-warning/80",children:i},o))]})}function wP(e){const t={children:[]},n=new Map,r=new Map;for(const o of e)r.set(o.filePath,(r.get(o.filePath)??0)+1);for(const[o,l]of r){const d=o.split("/").filter(Boolean);let p="",f=t;for(let m=0;m<d.length;m++){const g=d[m];p=p?`${p}/${g}`:g;const y=m===d.length-1;let b=n.get(p);b||(b={name:g,fullPath:p,isFile:y,children:[],symbolCount:0},n.set(p,b),f.children.push(b)),y&&(b.symbolCount=l,b.isFile=!0),f=b}}const i=o=>{o.sort((l,d)=>l.isFile!==d.isFile?l.isFile?1:-1:l.name.localeCompare(d.name));for(const l of o)l.children.length>0&&i(l.children)};return i(t.children),t.children}function kP({symbols:e,selectedFilePath:t,onSelectFile:n,sourceId:r}){const i=_.useMemo(()=>wP(e),[e]);return u.jsx("div",{className:"overflow-y-auto c4a-scrollbar",children:u.jsx(p2,{nodes:i,depth:0,selectedFilePath:t,onSelectFile:n,sourceId:r})})}function p2({nodes:e,depth:t,selectedFilePath:n,onSelectFile:r,sourceId:i}){return u.jsx(u.Fragment,{children:e.map(o=>u.jsx(SP,{node:o,depth:t,selectedFilePath:n,onSelectFile:r,sourceId:i},o.fullPath))})}function SP({node:e,depth:t,selectedFilePath:n,onSelectFile:r,sourceId:i}){const{t:o}=_e(),l=Fa(b=>b.openTab),[d,p]=_.useState(t<2),f=e.isFile&&e.fullPath===n,m=t*16,g=_.useCallback(()=>{e.isFile?r(f?null:e.fullPath):p(b=>!b)},[e.isFile,e.fullPath,f,r]),y=_.useCallback(b=>{b.stopPropagation(),l({id:`import-deps:${e.fullPath}`,type:"import-deps",resourceId:e.fullPath,label:e.name,meta:{sourceIds:[i]}})},[e.fullPath,e.name,i,l]);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:`group/node flex h-7 items-center cursor-pointer font-mono text-xs ${f?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-secondary hover:bg-c4a-bg-hover/50"}`,style:{paddingLeft:m},onClick:g,children:[e.isFile?u.jsx("span",{className:"w-4 shrink-0"}):u.jsx(Gt,{size:12,className:`shrink-0 transition-transform duration-200 text-c4a-text-muted ${d?"rotate-90":""}`}),e.isFile?u.jsx(Mg,{size:13,className:"mx-1 shrink-0 text-c4a-text-muted"}):u.jsx(nr,{size:13,className:"mx-1 shrink-0 text-c4a-text-muted"}),u.jsx("span",{className:"truncate flex-1",children:e.name}),e.isFile&&u.jsx("button",{type:"button",className:"opacity-0 group-hover/node:opacity-100 p-0.5 rounded hover:bg-c4a-bg-active shrink-0 mr-1",title:o("query.import_deps.open"),onClick:y,children:u.jsx(GT,{size:12,className:"text-c4a-text-muted"})})]}),!e.isFile&&d&&e.children.length>0&&u.jsx(p2,{nodes:e.children,depth:t+1,selectedFilePath:n,onSelectFile:r,sourceId:i})]})}function jP({symbol:e}){return e.kind==="class"||e.kind==="interface"?u.jsx(NP,{symbol:e}):e.kind==="function"?u.jsx(CP,{symbol:e}):u.jsxs("div",{className:dx,children:[u.jsxs(Ql,{children:[e.kind.toUpperCase(),": ",e.name]}),e.signature&&u.jsx("p",{className:"font-mono text-xs text-c4a-text-secondary",children:e.signature})]})}function NP({symbol:e}){const{t}=_e();return u.jsxs("div",{className:dx,children:[e.methods&&e.methods.length>0&&u.jsxs("div",{className:"mb-2",children:[u.jsxs(Ql,{children:[t("query.symbol.methods")," (",e.methods.length,")"]}),u.jsx("table",{className:"w-full font-mono text-xs",children:u.jsx("tbody",{children:e.methods.map((n,r)=>u.jsxs("tr",{className:"even:bg-c4a-bg-base",children:[u.jsx("td",{className:"py-0.5 pr-3 text-c4a-text-primary",children:n.name}),u.jsxs("td",{className:"py-0.5 pr-3 text-c4a-text-muted",children:["(",n.params.map(i=>`${i.name}: ${i.type??"unknown"}`).join(", "),")"]}),u.jsx("td",{className:"py-0.5 text-c4a-text-secondary",children:n.returnType??"void"})]},r))})})]}),e.properties&&e.properties.length>0&&u.jsxs("div",{className:"mb-2",children:[u.jsxs(Ql,{children:[t("query.symbol.properties")," (",e.properties.length,")"]}),u.jsx("table",{className:"w-full font-mono text-xs",children:u.jsx("tbody",{children:e.properties.map((n,r)=>u.jsxs("tr",{className:"even:bg-c4a-bg-base",children:[u.jsx("td",{className:"py-0.5 pr-3 text-c4a-text-primary",children:n.name}),u.jsx("td",{className:"py-0.5 text-c4a-text-secondary",children:n.type??"unknown"})]},r))})})]}),e.baseClass&&u.jsxs("div",{className:"font-mono text-xs text-c4a-text-secondary",children:[u.jsxs("span",{className:"text-c4a-text-muted",children:[t("query.symbol.extends"),":"]})," ",e.baseClass]}),e.interfaces&&e.interfaces.length>0&&u.jsxs("div",{className:"font-mono text-xs text-c4a-text-secondary",children:[u.jsxs("span",{className:"text-c4a-text-muted",children:[t("query.symbol.implements"),":"]})," ",e.interfaces.join(", ")]})]})}function CP({symbol:e}){const{t}=_e();return u.jsxs("div",{className:dx,children:[e.signature&&u.jsxs("div",{className:"mb-1",children:[u.jsx(Ql,{children:t("query.symbol.signature")}),u.jsx("p",{className:"font-mono text-xs text-c4a-text-primary",children:e.signature})]}),e.params&&e.params.length>0&&u.jsxs("div",{className:"mb-1",children:[u.jsx(Ql,{children:t("query.symbol.parameters")}),u.jsx("div",{className:"font-mono text-xs",children:e.params.map((n,r)=>u.jsxs("div",{className:"text-c4a-text-secondary",children:[u.jsx("span",{className:"text-c4a-text-primary",children:n.name}),": ",n.type??"unknown"]},r))})]}),e.returnType&&u.jsxs("div",{className:"font-mono text-xs text-c4a-text-secondary",children:[u.jsxs("span",{className:"text-c4a-text-muted",children:[t("query.symbol.returns"),":"]})," ",e.returnType]}),e.isAsync&&u.jsxs("div",{className:"font-mono text-xs text-c4a-text-muted",children:[t("query.symbol.async"),": โœ“"]})]})}const dx="ml-6 mt-1 mb-2 rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-3";function Ql({children:e}){return u.jsx("div",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted mb-1",children:e})}const EP={class:"โ– ",interface:"โ—‡",function:"ฦ’",enum:"โ–ฃ",type_alias:"โ—ˆ"};function AP(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?e:u.jsxs(u.Fragment,{children:[e.slice(0,n),u.jsx("mark",{className:"bg-c4a-accent/20 text-c4a-accent",children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function TP({symbols:e,searchQuery:t,sourceId:n}){const{t:r}=_e(),[i,o]=_.useState(null),l=Fa(m=>m.openTab),d=_.useCallback(m=>{o(g=>g===m?null:m)},[]),p=_.useCallback((m,g)=>{m.stopPropagation(),l({id:`call-graph:${g.filePath}:${g.name}`,type:"call-graph",resourceId:`${g.filePath}#${g.name}`,label:`Calls: ${g.name}`,icon:"๐Ÿ”—",meta:{sourceIds:[n]}})},[n,l]),f=_.useCallback((m,g)=>{m.stopPropagation(),l({id:`inheritance:${g.filePath}:${g.name}`,type:"inheritance",resourceId:`${g.filePath}#${g.name}`,label:`Inherit: ${g.name}`,icon:"๐Ÿ“",meta:{sourceIds:[n]}})},[n,l]);return e.length===0?u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"font-mono text-xs text-c4a-text-muted",children:r("query.symbol.empty")})}):u.jsx("div",{className:"overflow-y-auto c4a-scrollbar",children:e.map(m=>{const g=`${m.filePath}:${m.name}:${m.line}`,y=i===g;return u.jsxs("div",{children:[u.jsxs("div",{className:"group flex h-8 items-center gap-2 px-3 cursor-pointer border-b border-c4a-border-subtle last:border-b-0 hover:bg-c4a-bg-hover/50",onClick:()=>d(g),children:[u.jsx("span",{className:"shrink-0 w-4 text-center font-mono text-xs text-c4a-text-muted",children:EP[m.kind]??"ยท"}),u.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate flex-1",children:AP(m.name,t)}),u.jsx(Yt,{variant:"muted",children:m.kind.replace("_"," ")}),m.isExported&&u.jsx(Yt,{variant:"accent",children:"Export"}),m.kind==="function"&&u.jsx("button",{type:"button",className:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-c4a-bg-active shrink-0",title:r("query.call_graph.open"),onClick:b=>p(b,m),children:u.jsx(vd,{size:13,className:"text-c4a-text-muted"})}),(m.kind==="class"||m.kind==="interface")&&u.jsx("button",{type:"button",className:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-c4a-bg-active shrink-0",title:r("query.inheritance.open"),onClick:b=>f(b,m),children:u.jsx(a3,{size:13,className:"text-c4a-text-muted"})})]}),y&&u.jsx(jP,{symbol:m})]},g)})})}const lw=200,RP=200;function LP({sourceId:e}){const{t}=_e(),{data:n,loading:r,error:i,warnings:o,pagination:l}=Gn(P=>P.symbols),d=Gn(P=>P.fetchSymbols),p=Gn(P=>P.resetQuery),[f,m]=_.useState(!0),[g,y]=_.useState(""),[b,w]=_.useState(null),k=_.useRef(null),[j,S]=_.useState("");_.useEffect(()=>(d({sourceIds:[e],exportedOnly:!0,limit:lw}),()=>p("symbols")),[e]);const E=_.useCallback(()=>{const P=!f;m(P),w(null),d({sourceIds:[e],exportedOnly:P,limit:lw})},[f,e,d]),C=_.useCallback(P=>{const T=P.target.value;y(T),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>S(T),300)},[]),z=_.useCallback(()=>{!n||!l||d({sourceIds:[e],exportedOnly:f,limit:RP,offset:n.length},{append:!0})},[n,l,e,f,d]),D=_.useMemo(()=>{if(!n)return[];let P=n;if(b&&(P=P.filter(T=>T.filePath===b)),j){const T=j.toLowerCase();P=P.filter(F=>F.name.toLowerCase().includes(T))}return P},[n,b,j]),A=l&&n&&l.total>n.length;return r&&!n?u.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[Array.from({length:5}).map((P,T)=>u.jsx("div",{className:"h-7 bg-c4a-bg-hover animate-pulse rounded"},T)),u.jsx("div",{className:"mt-2 text-center",children:u.jsx(fa,{labelKey:"query.symbol.loading"})})]}):i&&!n?u.jsx(At,{title:t("query.symbol.empty"),description:i}):!r&&n&&n.length===0?u.jsx(At,{title:t("query.symbol.empty"),description:t("query.symbol.empty_desc")}):u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.length>0&&u.jsx("div",{className:"px-4 pt-3",children:u.jsx(cf,{warnings:o})}),u.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-c4a-border-subtle",children:[u.jsxs("div",{className:"relative flex-1",children:[u.jsx(Fl,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-c4a-text-muted"}),u.jsx("input",{className:"w-full rounded-lg border border-c4a-border-default bg-c4a-bg-surface pl-8 pr-3 py-1.5 text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none focus:ring-2 focus:ring-c4a-accent/30",placeholder:t("query.symbol.search_placeholder"),value:g,onChange:C})]}),u.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer shrink-0",children:[u.jsx("input",{type:"checkbox",checked:f,onChange:E,className:"accent-c4a-accent"}),u.jsx("span",{className:"font-mono text-[11px] uppercase tracking-tight text-c4a-text-secondary",children:t("query.symbol.exported_only")})]})]}),u.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[u.jsx("div",{className:"w-1/3 min-w-[200px] max-w-[300px] border-r border-c4a-border-subtle overflow-y-auto c4a-scrollbar",children:n&&u.jsx(kP,{symbols:n,selectedFilePath:b,onSelectFile:w,sourceId:e})}),u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsx("div",{className:"flex-1 overflow-y-auto c4a-scrollbar",children:u.jsx(TP,{symbols:D,searchQuery:j,sourceId:e})}),A&&u.jsx("div",{className:"flex items-center justify-center border-t border-c4a-border-subtle py-2",children:u.jsx("button",{type:"button",className:"rounded-lg border border-c4a-border-default bg-c4a-bg-surface px-4 py-1.5 font-mono text-xs uppercase tracking-tight text-c4a-text-secondary hover:bg-c4a-bg-hover cursor-pointer",onClick:z,disabled:r,children:r?u.jsx("span",{className:"animate-pulse",children:t("query.symbol.loading")}):t("query.symbol.load_more",{count:l.total-n.length})})})]})]})]})}function DP(e){return e>=.7?{stars:3,label:"โญโญโญ",key:"query.doc.relevance.high"}:e>=.5?{stars:2,label:"โญโญ",key:"query.doc.relevance.medium"}:{stars:1,label:"โญ",key:"query.doc.relevance.low"}}function OP(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?e:u.jsxs(u.Fragment,{children:[e.slice(0,n),u.jsx("mark",{className:"bg-c4a-accent/20 text-c4a-accent",children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function MP({result:e,searchQuery:t}){const{t:n}=_e(),r=Fa(d=>d.openTab),i=DP(e.score),o=()=>{r({id:`content:${e.hashId}:s${e.sectionIndex}p${e.paragraphIndex}`,type:"content",resourceId:e.hashId,label:e.sourceName,meta:{sectionIndex:e.sectionIndex,paragraphIndex:e.paragraphIndex,sourcePath:e.sourcePath}})},l=e.sectionHeading?e.sectionHeading.split(" > ").filter(Boolean):[];return u.jsxs("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-surface p-4 hover:border-c4a-accent/30 cursor-pointer transition-colors",onClick:o,children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm",children:i.label}),u.jsx("span",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:n(i.key)})]}),u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted truncate ml-2",children:e.sourceName})]}),u.jsx("p",{className:"text-sm text-c4a-text-primary leading-relaxed line-clamp-4",children:OP(e.paragraphText,t)}),l.length>0&&u.jsxs("div",{className:"flex items-center gap-1 mt-3 font-mono text-[11px] text-c4a-text-muted",children:[u.jsx(Vn,{size:12,className:"shrink-0"}),l.map((d,p)=>u.jsxs("span",{className:"flex items-center gap-1",children:[p>0&&u.jsx("span",{className:"text-c4a-text-muted/50",children:">"}),u.jsx("span",{children:d})]},p))]})]})}function zP({sourceId:e}){const{t}=_e(),[n,r]=_.useState(""),[i,o]=_.useState(""),[l,d]=_.useState(null),{data:p,loading:f,error:m}=Gn(k=>k.paragraphs),g=Gn(k=>k.fetchParagraphs),y=Gn(k=>k.resetQuery);_.useEffect(()=>{r(""),o(""),y("paragraphs")},[e,y]),_.useEffect(()=>{m&&!f&&(console.error("[DocSearchBox] search failed:",m),d({title:t("query.doc.error.title"),detail:m}))},[m,f,t]);const b=_.useCallback(()=>{const k=n.trim();k&&(o(k),g({sourceIds:[e],text:k,topK:10}))},[n,e,g]),w=k=>{k.key==="Enter"&&b()};return u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-c4a-border-subtle",children:[u.jsxs("div",{className:"relative flex-1",children:[u.jsx(Fl,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-c4a-text-muted"}),u.jsx("input",{className:"w-full rounded-lg border border-c4a-border-default bg-c4a-bg-surface pl-8 pr-3 py-1.5 text-sm text-c4a-text-primary placeholder:text-c4a-text-muted focus:border-c4a-accent focus:outline-none focus:ring-2 focus:ring-c4a-accent/30",placeholder:t("query.doc.search_placeholder"),value:n,onChange:k=>r(k.target.value),onKeyDown:w})]}),u.jsx("button",{type:"button",className:"rounded px-4 py-1.5 bg-c4a-accent text-white font-mono text-xs uppercase tracking-tight hover:bg-c4a-accent/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",onClick:b,disabled:!n.trim()||f,children:t("query.doc.search_button")})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto c4a-scrollbar p-4",children:[f&&u.jsx("div",{className:"flex items-center justify-center py-12",children:u.jsx(fa,{labelKey:"query.doc.searching"})}),l&&u.jsx(uc,{error:l,onClose:()=>d(null)}),!f&&!m&&p&&p.length===0&&u.jsx(At,{title:t("query.doc.empty.title"),description:t("query.doc.empty.desc")}),!f&&!m&&p&&p.length>0&&u.jsx("div",{className:"flex flex-col gap-3",children:p.map(k=>u.jsx(MP,{result:k,searchQuery:i},`${k.hashId}-${k.paragraphIndex}`))})]})]})}function IP({sourceType:e,sourceId:t,indexStatus:n}){const{t:r}=_e();return n==="indexing"?u.jsx(At,{title:r("query.indexing.title"),description:r("query.indexing.desc")}):e==="code"&&t?u.jsx(LP,{sourceId:t}):e&&e!=="code"&&t?u.jsx(zP,{sourceId:t}):u.jsx(At,{title:r("query.doc.empty.title"),description:r("query.doc.empty.desc")})}const $P=new Set(["raw","digest","extraction","entities","query"]);function ym(){const e=window.location.hash.replace("#","");return $P.has(e)?e:null}function cw(e){try{const t=JSON.parse(e);return t&&typeof t=="object"&&"manifest_type"in t}catch{return!1}}function uw({sourceId:e,isDaemonOnline:t,indexModules:n}){const{t:r}=_e(),i=Ot(p=>p.triggerIndex),[o,l]=_.useState(null),d=async()=>{if(e){l(null);try{(await i(e,n)).status==="skipped"&&(l(r("index.code.skipped")),setTimeout(()=>l(null),3e3))}catch{l(r("index.code.error")),setTimeout(()=>l(null),3e3)}}};return u.jsx(At,{title:r("common.empty.content_raw.title"),description:r("common.empty.content_raw.description"),action:e?u.jsxs("div",{className:"flex flex-col items-center gap-2",children:[u.jsx("button",{type:"button",className:`rounded bg-c4a-accent px-4 py-2 text-sm font-medium text-white hover:bg-c4a-accent/90 ${t?"":"opacity-40 cursor-not-allowed"}`,onClick:t?d:void 0,title:t?void 0:r("daemon.offline_tooltip"),children:r("common.empty.content_raw.cta")}),o&&u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:o})]}):void 0})}function h2({hashId:e,sourcePath:t,sourceId:n,isCodeIndexing:r,isDaemonOnline:i,indexModules:o,sourceType:l,indexStatus:d,paragraphMeta:p}){const{t:f}=_e(),[m,g]=_.useState(null),[y,b]=_.useState(null),w=p!=null&&typeof p.sectionIndex=="number",[k,j]=_.useState(()=>w?"digest":ym()??"raw"),[S,E]=_.useState(!1);_.useEffect(()=>{const D=()=>{const A=ym();A&&j(A)};return window.addEventListener("hashchange",D),()=>window.removeEventListener("hashchange",D)},[]),_.useEffect(()=>{w&&j("digest")},[w,p?.sectionIndex,p?.paragraphIndex]),_.useEffect(()=>{if(!e){g(null),b(null);return}b(null),Pe.get(`/contents/${e}`).then(D=>{g(D),!w&&!ym()&&j("raw")}).catch(D=>{D instanceof kn&&D.status===404?b("not_found"):b("load_failed")})},[e]);const C=_.useCallback(()=>{E(!0),e&&Pe.get(`/contents/${e}`).then(D=>g(D)).catch(()=>{})},[e]);_.useEffect(()=>{r&&E(!1)},[r]);const z=r&&!S&&n;return u.jsx("div",{className:"flex flex-1 flex-col",children:u.jsxs(cS,{value:k,onChange:D=>{const A=D;j(A),window.location.hash=A},children:[u.jsxs(uS,{children:[u.jsx(ra,{value:"raw",children:f("content.detail.tab.raw")}),u.jsx(ra,{value:"digest",children:f("content.detail.tab.digest")}),u.jsx(ra,{value:"extraction",children:f("content.detail.tab.extraction")}),u.jsx(ra,{value:"entities",children:f("content.detail.tab.entities")}),d&&d!=="none"&&u.jsx(ra,{value:"query",children:f("query.tab.label")})]}),u.jsx("div",{className:"mt-4 flex flex-1 flex-col",children:z?u.jsx(Dz,{sourceId:n,onComplete:C,retryModules:o}):y?e?u.jsx(At,{title:f(`common.error.${y}`),description:f(`common.error.${y}_description`)}):u.jsx(uw,{sourceId:n,isDaemonOnline:i,indexModules:o}):e?m?u.jsxs(u.Fragment,{children:[u.jsx(aa,{value:"raw",children:u.jsx(BP,{hashId:m.hash_id,sourcePath:t})}),u.jsx(aa,{value:"digest",children:u.jsx(PP,{hashId:m.hash_id,sourceId:n,sourcePath:t,isDaemonOnline:i,available:m.stages?.digest?.available,indexModules:o})}),u.jsx(aa,{value:"extraction",children:u.jsx(FP,{hashId:m.hash_id,available:m.stages?.extraction?.available})}),u.jsx(aa,{value:"entities",children:u.jsx(UP,{hashId:m.hash_id,available:m.stages?.extraction?.available})}),d&&d!=="none"&&u.jsx(aa,{value:"query",children:u.jsx(IP,{sourceType:l,sourceId:n,indexStatus:d})})]}):u.jsx(xc,{}):u.jsx(uw,{sourceId:n,isDaemonOnline:i,indexModules:o})})]})})}function xc(){return u.jsx("div",{className:"flex flex-1 items-center justify-center pb-15",children:u.jsx(sn,{size:24,className:"animate-spin text-c4a-text-muted"})})}function BP({hashId:e,sourcePath:t}){const{t:n}=_e(),[r,i]=_.useState(null),[o,l]=_.useState(!1),[d,p]=_.useState(!1);if(_.useEffect(()=>{l(!1),i(null),Pe.get(`/contents/${e}/raw`).then(f=>{i(f),l(!0),p(!1)}).catch(f=>{f instanceof kn&&f.status===404&&p(!0),l(!0)})},[e]),!o){if(r){if(cw(r.content))try{return u.jsx(j_,{data:JSON.parse(r.content)})}catch{}return u.jsx(__,{code:r.content,sourcePath:t})}return u.jsx(xc,{})}if(d||!r||r.source==="unavailable")return u.jsx(At,{title:n("common.empty.content_raw.title"),description:n("common.empty.content_raw.description")});if(cw(r.content))try{const f=JSON.parse(r.content);return u.jsx(j_,{data:f})}catch{}return u.jsx(__,{code:r.content,sourcePath:t})}function PP({hashId:e,sourceId:t,sourcePath:n,isDaemonOnline:r,available:i,indexModules:o}){const{t:l}=_e(),[d,p]=_.useState(null),[f,m]=_.useState(!1),[g,y]=_.useState(!1),[b,w]=_.useState(null),k=Ot(z=>z.triggerIndex),j=Ot(z=>z.currentRoot),E=(j&&n?lc(j.tree,n):null)?.source_type==="doc",C=E?!0:!!r;return _.useEffect(()=>{if(i===!1){y(!0),m(!0),p(null);return}m(!1),y(!1),p(null);const z=E?"?digestType=doc_llm":"";Pe.get(`/contents/${e}/digest${z}`).then(D=>{const A="digest"in D?D.digest:D.digests?.[0];A?p(A):y(!0),m(!0)}).catch(D=>{D instanceof kn&&D.status===404&&y(!0),m(!0)})},[e,i,E]),f?g||!d?u.jsx(At,{title:l(E?"digest.doc.empty.title":"digest.empty.title"),description:l(E?"digest.doc.empty.description":"digest.empty.description"),action:t?u.jsxs("div",{className:"flex flex-col items-center gap-2",children:[u.jsx("button",{type:"button",className:`rounded bg-c4a-accent px-4 py-2 text-sm font-medium text-white hover:bg-c4a-accent/90 ${C?"":"opacity-40 cursor-not-allowed"}`,onClick:C?async()=>{w(null);try{(await k(t,o)).status==="skipped"&&(w(l("index.code.skipped")),setTimeout(()=>w(null),3e3))}catch{w(l("index.code.error")),setTimeout(()=>w(null),3e3)}}:void 0,title:!C&&!E?l("daemon.offline_tooltip"):void 0,children:l(E?"digest.doc.empty.cta":"digest.empty.cta")}),b&&u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:b})]}):void 0}):u.jsx(dw,{data:d}):d?u.jsx(dw,{data:d}):u.jsx(xc,{})}function dw({data:e}){const{t}=_e(),n=e.digest_data,r=n.classes||n.functions||n.relations;if(e.digest_type==="doc_llm")return u.jsx(_P,{digest:n});if(!r)return u.jsxs("div",{className:"flex flex-1 flex-col gap-3",children:[n.language&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:"text-xs text-c4a-text-muted",children:[t("content.detail.language"),":"]}),u.jsx(Yt,{children:n.language})]}),u.jsx("div",{className:"flex flex-1 flex-col overflow-auto rounded border border-c4a-border-subtle p-3",children:u.jsx(hc,{data:n,defaultExpanded:2})})]});const i=Array.isArray(n.files)?n.files.length:0,o=Array.isArray(n.classes)?n.classes.length:0,l=Array.isArray(n.functions)?n.functions.length:0,d=(Array.isArray(n.relations?.imports)?n.relations.imports.length:0)+(Array.isArray(n.relations?.calls)?n.relations.calls.length:0)+(Array.isArray(n.relations?.inheritance)?n.relations.inheritance.length:0),p=Array.isArray(n.techStack)?n.techStack:[],f=Array.isArray(n.modules)?n.modules:[];return u.jsxs("div",{className:"flex flex-1 flex-col gap-6 overflow-auto c4a-scrollbar",children:[u.jsxs("div",{className:"flex flex-wrap gap-3",children:[u.jsx(xn,{icon:u.jsx(Vn,{size:14}),label:t("digest.stats.files"),value:i,size:"sm"}),u.jsx(xn,{icon:u.jsx(Ok,{size:14}),label:t("digest.stats.classes"),value:o,size:"sm"}),u.jsx(xn,{icon:u.jsx(D3,{size:14}),label:t("digest.stats.functions"),value:l,size:"sm"}),u.jsx(xn,{icon:u.jsx(VR,{size:14}),label:t("digest.stats.relations"),value:d,size:"sm"})]}),p.length>0&&u.jsxs("div",{children:[u.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:t("digest.tech_stack")}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(m=>u.jsx(Yt,{children:m},m))})]}),f.length>0&&u.jsxs("div",{children:[u.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:t("digest.modules")}),u.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface",children:f.map(m=>u.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 font-mono text-xs border-b border-c4a-border-subtle last:border-b-0",children:[u.jsx("span",{className:"text-c4a-text-primary",children:m.path||m.name}),u.jsxs("span",{className:"text-c4a-text-muted",children:[m.fileCount," files ยท ",m.totalLines>=1e3?`${(m.totalLines/1e3).toFixed(1)}k`:m.totalLines," lines"]})]},m.path))})]})]})}function FP({hashId:e,available:t}){const{t:n}=_e(),[r,i]=_.useState(null),[o,l]=_.useState(!1),[d,p]=_.useState(!1);return _.useEffect(()=>{if(t===!1){p(!0),l(!0),i(null);return}l(!1),i(null),p(!1),Pe.get(`/contents/${e}/extractions`).then(f=>{!f.extractions||f.extractions.length===0?p(!0):i(f),l(!0)}).catch(f=>{f instanceof kn&&f.status===404&&p(!0),l(!0)})},[e,t]),o?d||!r?u.jsx(At,{title:n("common.empty.content_extraction.title"),description:n("common.empty.content_extraction.description")}):u.jsx(fw,{extractions:r.extractions}):r?u.jsx(fw,{extractions:r.extractions}):u.jsx(xc,{})}function fw({extractions:e}){const{t}=_e();return u.jsx("div",{className:"flex flex-1 flex-col gap-4 overflow-auto c4a-scrollbar",children:e.map(n=>{const r=po(n.extraction_confidence);return u.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.model&&u.jsx(Yt,{variant:"muted",children:n.model}),r&&u.jsx(Yt,{variant:r.variant,tooltip:`${r.value.toFixed(2)} โ€” ${t(r.tipKey)}`,children:t(r.labelKey)})]}),u.jsx(hc,{data:{atoms:n.atoms,candidate_entities:n.candidate_entities},defaultExpanded:2})]},n.id)})})}function UP({hashId:e,available:t}){const{t:n}=_e(),[r,i]=_.useState([]),[o,l]=_.useState(!1),[d,p]=_.useState(!1);return _.useEffect(()=>{if(t===!1){p(!0),l(!0),i([]);return}l(!1),i([]),p(!1),Pe.get(`/contents/${e}/entities`).then(f=>{!f.entities||f.entities.length===0?p(!0):i(f.entities),l(!0)}).catch(f=>{f instanceof kn&&f.status===404&&p(!0),l(!0)})},[e,t]),o?d||r.length===0?u.jsx(At,{title:n("common.empty.content_entities.title"),description:n("common.empty.content_entities.description")}):u.jsx("div",{className:"flex flex-1 flex-col overflow-auto c4a-scrollbar",children:u.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:r.map(f=>u.jsx(k_,{entity:f},f.id))})}):r.length>0?u.jsx("div",{className:"flex flex-1 flex-col overflow-auto c4a-scrollbar",children:u.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:r.map(f=>u.jsx(k_,{entity:f},f.id))})}):u.jsx(xc,{})}const pw={entities:"Entities",behaviors:"Behaviors",roles:"Roles",attributes:"Attributes",states:"States",transitions:"Transitions",events:"Events",rules:"Rules",constraints:"Constraints",decisions:"Decisions",metrics:"Metrics",claims:"Claims",relations:"Relations",comparisons:"Comparisons",boundaries:"Boundaries"};function HP({data:e,atoms:t}){return u.jsxs("div",{className:"space-y-4",children:[e&&Object.keys(e).length>0&&u.jsx("div",{children:u.jsx(hc,{data:e,defaultExpanded:2})}),t&&u.jsx(qP,{atoms:t})]})}function qP({atoms:e}){const t=Object.keys(pw);return u.jsx("div",{className:"space-y-2",children:t.map(n=>{const r=e[n];return!r||r.length===0?null:u.jsx(VP,{type:n,label:pw[n]??n,items:r},n)})})}function VP({type:e,label:t,items:n}){const[r,i]=_.useState(!0);return u.jsxs("details",{open:r,onToggle:o=>i(o.target.open),children:[u.jsxs("summary",{className:"cursor-pointer font-mono text-xs uppercase text-c4a-text-secondary hover:text-c4a-text-primary py-1.5",children:[t," (",n.length,")"]}),u.jsx("div",{className:"pl-4 pb-2",children:u.jsx(GP,{type:e,items:n})})]})}function GP({type:e,items:t}){switch(e){case"entities":case"behaviors":case"events":case"relations":return u.jsx(hw,{items:t});case"roles":return u.jsx(YP,{items:t});case"attributes":return u.jsx(KP,{items:t});case"states":return u.jsx(XP,{items:t});case"transitions":return u.jsx(QP,{items:t});case"rules":case"constraints":return u.jsx(ZP,{items:t});case"decisions":return u.jsx(WP,{items:t});case"metrics":return u.jsx(JP,{items:t});case"claims":return u.jsx(e7,{items:t});case"comparisons":return u.jsx(t7,{items:t});case"boundaries":return u.jsx(n7,{items:t});default:return u.jsx(hw,{items:t})}}function ma({value:e}){const{t}=_e(),n=po(e);return n?u.jsx(Yt,{variant:n.variant,tooltip:`${n.value.toFixed(2)} โ€” ${t(n.tipKey)}`,children:t(n.labelKey)}):null}function hw({items:e}){return u.jsx("div",{className:"space-y-1",children:e.map((t,n)=>u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[t.ref&&Wg(t.ref)?u.jsx(Jg,{pointer:t.ref}):u.jsx("span",{className:"text-c4a-text-primary",children:t.name??String(t)}),u.jsx(ma,{value:t.confidence})]},n))})}function YP({items:e}){return u.jsx("div",{className:"space-y-1.5",children:e.map((t,n)=>u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsx(Yt,{variant:"accent",children:t.name??"role"}),!!t.performs&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-c4a-text-muted",children:"performs"}),Wg(String(t.performs))?u.jsx(Jg,{pointer:String(t.performs)}):u.jsx("span",{className:"text-c4a-text-primary",children:String(t.performs)})]}),u.jsx(ma,{value:t.confidence})]},n))})}function KP({items:e}){return u.jsx("div",{className:"space-y-1",children:e.map((t,n)=>u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsxs("span",{className:"text-c4a-text-secondary font-mono",children:[t.name,":"]}),u.jsx("span",{className:"text-c4a-text-primary",children:String(t.value??"")}),u.jsx(ma,{value:t.confidence})]},n))})}function XP({items:e}){return u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map((t,n)=>u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(Yt,{children:t.name??String(t)}),u.jsx(ma,{value:t.confidence})]},n))})}function QP({items:e}){return u.jsx("div",{className:"space-y-1.5",children:e.map((t,n)=>{const r=t;return u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsx(Yt,{variant:"muted",children:String(r.from_state??"?")}),u.jsx("span",{className:"text-c4a-text-muted",children:"โ†’"}),u.jsx(Yt,{variant:"muted",children:String(r.to_state??"?")}),!!r.trigger&&u.jsx("span",{className:"text-c4a-text-muted italic",children:String(r.trigger)}),u.jsx(ma,{value:t.confidence})]},n)})})}function ZP({items:e}){return u.jsx("div",{className:"space-y-1.5",children:e.map((t,n)=>{const r=t;return u.jsx("div",{className:"text-xs",children:u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"text-c4a-warning font-mono font-bold",children:"IF"}),u.jsx("span",{className:"text-c4a-text-primary",children:String(r.condition??r.name??"")}),u.jsx("span",{className:"text-c4a-accent font-mono font-bold",children:"THEN"}),u.jsx("span",{className:"text-c4a-text-primary",children:String(r.conclusion??r.description??"")}),u.jsx(ma,{value:t.confidence})]})},n)})})}function WP({items:e}){return u.jsx("div",{className:"space-y-1.5",children:e.map((t,n)=>u.jsxs("div",{className:"text-xs",children:[u.jsx("span",{className:"text-c4a-text-primary font-mono",children:t.name}),t.description&&u.jsx("span",{className:"text-c4a-text-muted ml-2",children:t.description}),u.jsx(ma,{value:t.confidence})]},n))})}function JP({items:e}){return u.jsx("div",{className:"space-y-1",children:e.map((t,n)=>{const r=t;return u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsx("span",{className:"text-c4a-text-primary font-mono",children:t.name}),!!r.unit&&u.jsx("span",{className:"text-c4a-text-muted",children:String(r.unit)}),!!r.threshold&&u.jsxs("span",{className:"text-c4a-text-secondary",children:["< ",String(r.threshold)]}),u.jsx(ma,{value:t.confidence})]},n)})})}function e7({items:e}){return u.jsx("div",{className:"space-y-1.5",children:e.map((t,n)=>{const r=t;return u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[!!r.claim_type&&u.jsx(Yt,{variant:"warning",children:String(r.claim_type)}),u.jsx("span",{className:"text-c4a-text-primary",children:t.description??t.name}),!!r.valid_from&&u.jsxs("span",{className:"text-c4a-text-muted",children:[String(r.valid_from)," ่ตท"]}),u.jsx(ma,{value:t.confidence})]},n)})})}function t7({items:e}){return u.jsx("div",{className:"space-y-3",children:e.map((t,n)=>{const r=t,i=r.criteria,o=r.options;return!i||!o?u.jsx("div",{className:"text-xs text-c4a-text-muted",children:u.jsx(hc,{data:t,defaultExpanded:1})},n):u.jsx("div",{className:"rounded border border-c4a-border-subtle overflow-auto",children:u.jsxs("table",{className:"w-full text-xs font-mono",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-c4a-border-subtle bg-c4a-bg-surface text-c4a-text-muted",children:[u.jsx("th",{className:"px-2 py-1 text-left",children:"Criteria"}),o.map((l,d)=>u.jsx("th",{className:"px-2 py-1 text-left",children:String(l.name??`Option ${d+1}`)},d))]})}),u.jsx("tbody",{children:i.map((l,d)=>u.jsxs("tr",{className:"border-b border-c4a-border-subtle",children:[u.jsx("td",{className:"px-2 py-1 text-c4a-text-secondary",children:l}),o.map((p,f)=>{const m=p.values;return u.jsx("td",{className:"px-2 py-1 text-c4a-text-primary",children:m?.[d]??"โ€”"},f)})]},d))})]})},n)})})}function n7({items:e}){return u.jsx("div",{className:"space-y-1",children:e.map((t,n)=>{const r=t,i=r.included!==!1&&r.type!=="exclude";return u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsx("span",{className:i?"text-c4a-success":"text-c4a-error",children:i?"โœ“ ๅŒ…ๅซ":"โœ— ๆŽ’้™ค"}),u.jsx("span",{className:"text-c4a-text-primary",children:t.name??t.description}),u.jsx(ma,{value:t.confidence})]},n)})})}function r7({relation:e}){const t=Pt(),{t:n}=_e(),r=ho(),i=po(e.confidence),o=e.direction==="incoming"?"โ†":"โ†’",l=()=>{r?.active?r.navigate("relation",e.id,e.type,"โ†”"):t(mr.relation(e.id))},d=(p,f)=>{p.stopPropagation(),r?.active?r.navigate("entity",f.id,f.name,"๐Ÿ”น"):t(mr.entity(f.id))};return u.jsxs("div",{className:"flex items-center gap-3 py-2 px-3 rounded hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:l,children:[u.jsx(Yt,{variant:"accent",children:e.type}),u.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline cursor-pointer truncate",onClick:p=>d(p,e.from),children:e.from.name}),u.jsx("span",{className:"text-c4a-text-muted text-xs shrink-0",children:o}),u.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline cursor-pointer truncate",onClick:p=>d(p,e.to),children:e.to.name}),e.weight!==void 0&&u.jsxs("span",{className:"text-xs text-c4a-text-muted ml-auto shrink-0",children:["w: ",e.weight]}),i&&u.jsx(Yt,{variant:i.variant,tooltip:`${i.value.toFixed(2)} โ€” ${n(i.tipKey)}`,children:n(i.labelKey)})]})}function a7({entityId:e}){const{t}=_e(),[n,r]=_.useState([]),[i,o]=_.useState(!1),[l,d]=_.useState("both"),[p,f]=_.useState(""),[m,g]=_.useState([]);return _.useEffect(()=>{const y={};l!=="both"&&(y.direction=l),p&&(y.type=p),Pe.get(`/entities/${e}/relations`,y).then(b=>{if(r(b.relations),m.length===0){const w=[...new Set(b.relations.map(k=>k.type))];g(w)}o(!0)}).catch(()=>{o(!0)})},[e,l,p]),i?n.length===0?u.jsx(At,{title:t("common.empty.entity_relations.title"),description:t("common.empty.entity_relations.description")}):u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[u.jsxs("select",{value:l,onChange:y=>d(y.target.value),className:"bg-c4a-bg-surface border border-c4a-border-subtle rounded px-2 py-1 text-xs font-mono text-c4a-text-secondary",children:[u.jsx("option",{value:"both",children:t("relation.filter.direction.all")}),u.jsx("option",{value:"outgoing",children:t("relation.filter.direction.outgoing")}),u.jsx("option",{value:"incoming",children:t("relation.filter.direction.incoming")})]}),m.length>1&&u.jsxs("select",{value:p,onChange:y=>f(y.target.value),className:"bg-c4a-bg-surface border border-c4a-border-subtle rounded px-2 py-1 text-xs font-mono text-c4a-text-secondary",children:[u.jsx("option",{value:"",children:t("relation.filter.type.all")}),m.map(y=>u.jsx("option",{value:y,children:y},y))]})]}),u.jsx("div",{className:"space-y-1",children:n.map(y=>u.jsx(r7,{relation:y},y.id))})]}):u.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function i7(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function m2({content:e}){const{t}=_e(),n=Pt(),r=ho(),i=e.hash_id.slice(0,12),o=()=>{const l=e.source_path??i;r?.active?r.navigate("content",e.hash_id,l,"๐Ÿ“„"):n(mr.content(e.hash_id))};return u.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3 cursor-pointer hover:border-c4a-accent transition-colors",onClick:o,children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"shrink-0",children:"๐Ÿ“„"}),u.jsx("span",{className:"font-mono text-xs text-c4a-accent hover:underline truncate",children:i}),e.byte_size!=null&&u.jsx("span",{className:"text-xs text-c4a-text-muted shrink-0",children:i7(e.byte_size)})]}),e.source_path&&u.jsx("p",{className:"mt-1 text-xs text-c4a-text-muted truncate",children:e.source_path}),e.span&&u.jsx("p",{className:"mt-0.5 text-xs text-c4a-text-muted",children:t("content.card.lines",{start:e.span.start,end:e.span.end})})]})}function s7({entityId:e}){const{t}=_e(),[n,r]=_.useState([]),[i,o]=_.useState(!1);return _.useEffect(()=>{Pe.get(`/entities/${e}/contents`).then(l=>{r(l.contents??[]),o(!0)}).catch(()=>o(!0))},[e]),i?n.length===0?u.jsx(At,{title:t("common.empty.entity_contents.title"),description:t("common.empty.entity_contents.description")}):u.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:n.map(l=>u.jsx(m2,{content:l},l.hash_id))}):u.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function o7({entityId:e}){const{t}=_e(),n=Pt(),[r,i]=_.useState([]),[o,l]=_.useState(!1);return _.useEffect(()=>{Pe.get(`/entities/${e}/referrers`).then(d=>{i(d.referrers??[]),l(!0)}).catch(()=>l(!0))},[e]),o?r.length===0?u.jsx(At,{title:t("common.empty.entity_referrers.title"),description:t("common.empty.entity_referrers.description")}):u.jsx("div",{className:"space-y-1",children:r.map(d=>u.jsxs("div",{className:"flex items-center gap-3 py-2 px-3 rounded hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:()=>n(mr.entity(d.id)),children:[u.jsx("span",{className:"text-xs font-mono text-c4a-accent hover:underline truncate",children:d.name}),u.jsx("span",{className:"text-xs text-c4a-text-muted shrink-0",children:d.type}),u.jsx("span",{className:"text-xs text-c4a-text-muted font-mono ml-auto shrink-0",children:d.ref_field}),u.jsxs("span",{className:"text-xs text-c4a-text-muted shrink-0",children:["(",d.ref_type,")"]})]},`${d.id}-${d.ref_field}`))}):u.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})}function l7(e,t){var n,r=1;e==null&&(e=0),t==null&&(t=0);function i(){var o,l=n.length,d,p=0,f=0;for(o=0;o<l;++o)d=n[o],p+=d.x,f+=d.y;for(p=(p/l-e)*r,f=(f/l-t)*r,o=0;o<l;++o)d=n[o],d.x-=p,d.y-=f}return i.initialize=function(o){n=o},i.x=function(o){return arguments.length?(e=+o,i):e},i.y=function(o){return arguments.length?(t=+o,i):t},i.strength=function(o){return arguments.length?(r=+o,i):r},i}function c7(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return g2(this.cover(t,n),t,n,e)}function g2(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o=e._root,l={data:r},d=e._x0,p=e._y0,f=e._x1,m=e._y1,g,y,b,w,k,j,S,E;if(!o)return e._root=l,e;for(;o.length;)if((k=t>=(g=(d+f)/2))?d=g:f=g,(j=n>=(y=(p+m)/2))?p=y:m=y,i=o,!(o=o[S=j<<1|k]))return i[S]=l,e;if(b=+e._x.call(null,o.data),w=+e._y.call(null,o.data),t===b&&n===w)return l.next=o,i?i[S]=l:e._root=l,e;do i=i?i[S]=new Array(4):e._root=new Array(4),(k=t>=(g=(d+f)/2))?d=g:f=g,(j=n>=(y=(p+m)/2))?p=y:m=y;while((S=j<<1|k)===(E=(w>=y)<<1|b>=g));return i[E]=o,i[S]=l,e}function u7(e){var t,n,r=e.length,i,o,l=new Array(r),d=new Array(r),p=1/0,f=1/0,m=-1/0,g=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(l[n]=i,d[n]=o,i<p&&(p=i),i>m&&(m=i),o<f&&(f=o),o>g&&(g=o));if(p>m||f>g)return this;for(this.cover(p,f).cover(m,g),n=0;n<r;++n)g2(this,l[n],d[n],e[n]);return this}function d7(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,o=(r=Math.floor(t))+1;else{for(var l=i-n||1,d=this._root,p,f;n>e||e>=i||r>t||t>=o;)switch(f=(t<r)<<1|e<n,p=new Array(4),p[f]=d,d=p,l*=2,f){case 0:i=n+l,o=r+l;break;case 1:n=i-l,o=r+l;break;case 2:i=n+l,r=o-l;break;case 3:n=i-l,r=o-l;break}this._root&&this._root.length&&(this._root=d)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this}function f7(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function p7(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function qn(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function h7(e,t,n){var r,i=this._x0,o=this._y0,l,d,p,f,m=this._x1,g=this._y1,y=[],b=this._root,w,k;for(b&&y.push(new qn(b,i,o,m,g)),n==null?n=1/0:(i=e-n,o=t-n,m=e+n,g=t+n,n*=n);w=y.pop();)if(!(!(b=w.node)||(l=w.x0)>m||(d=w.y0)>g||(p=w.x1)<i||(f=w.y1)<o))if(b.length){var j=(l+p)/2,S=(d+f)/2;y.push(new qn(b[3],j,S,p,f),new qn(b[2],l,S,j,f),new qn(b[1],j,d,p,S),new qn(b[0],l,d,j,S)),(k=(t>=S)<<1|e>=j)&&(w=y[y.length-1],y[y.length-1]=y[y.length-1-k],y[y.length-1-k]=w)}else{var E=e-+this._x.call(null,b.data),C=t-+this._y.call(null,b.data),z=E*E+C*C;if(z<n){var D=Math.sqrt(n=z);i=e-D,o=t-D,m=e+D,g=t+D,r=b.data}}return r}function m7(e){if(isNaN(m=+this._x.call(null,e))||isNaN(g=+this._y.call(null,e)))return this;var t,n=this._root,r,i,o,l=this._x0,d=this._y0,p=this._x1,f=this._y1,m,g,y,b,w,k,j,S;if(!n)return this;if(n.length)for(;;){if((w=m>=(y=(l+p)/2))?l=y:p=y,(k=g>=(b=(d+f)/2))?d=b:f=b,t=n,!(n=n[j=k<<1|w]))return this;if(!n.length)break;(t[j+1&3]||t[j+2&3]||t[j+3&3])&&(r=t,S=j)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):t?(o?t[j]=o:delete t[j],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[S]=n:this._root=n),this):(this._root=o,this)}function g7(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function x7(){return this._root}function y7(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function b7(e){var t=[],n,r=this._root,i,o,l,d,p;for(r&&t.push(new qn(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,o=n.x0,l=n.y0,d=n.x1,p=n.y1)&&r.length){var f=(o+d)/2,m=(l+p)/2;(i=r[3])&&t.push(new qn(i,f,m,d,p)),(i=r[2])&&t.push(new qn(i,o,m,f,p)),(i=r[1])&&t.push(new qn(i,f,l,d,m)),(i=r[0])&&t.push(new qn(i,o,l,f,m))}return this}function v7(e){var t=[],n=[],r;for(this._root&&t.push(new qn(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var o,l=r.x0,d=r.y0,p=r.x1,f=r.y1,m=(l+p)/2,g=(d+f)/2;(o=i[0])&&t.push(new qn(o,l,d,m,g)),(o=i[1])&&t.push(new qn(o,m,d,p,g)),(o=i[2])&&t.push(new qn(o,l,g,m,f)),(o=i[3])&&t.push(new qn(o,m,g,p,f))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function _7(e){return e[0]}function w7(e){return arguments.length?(this._x=e,this):this._x}function k7(e){return e[1]}function S7(e){return arguments.length?(this._y=e,this):this._y}function fx(e,t,n){var r=new px(t??_7,n??k7,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function px(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function mw(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var Yn=fx.prototype=px.prototype;Yn.copy=function(){var e=new px(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=mw(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=new Array(4)}):t.target[i]=mw(r));return e};Yn.add=c7;Yn.addAll=u7;Yn.cover=d7;Yn.data=f7;Yn.extent=p7;Yn.find=h7;Yn.remove=m7;Yn.removeAll=g7;Yn.root=x7;Yn.size=y7;Yn.visit=b7;Yn.visitAfter=v7;Yn.x=w7;Yn.y=S7;function es(e){return function(){return e}}function ki(e){return(e()-.5)*1e-6}function j7(e){return e.x+e.vx}function N7(e){return e.y+e.vy}function C7(e){var t,n,r,i=1,o=1;typeof e!="function"&&(e=es(e==null?1:+e));function l(){for(var f,m=t.length,g,y,b,w,k,j,S=0;S<o;++S)for(g=fx(t,j7,N7).visitAfter(d),f=0;f<m;++f)y=t[f],k=n[y.index],j=k*k,b=y.x+y.vx,w=y.y+y.vy,g.visit(E);function E(C,z,D,A,P){var T=C.data,F=C.r,M=k+F;if(T){if(T.index>y.index){var G=b-T.x-T.vx,Q=w-T.y-T.vy,re=G*G+Q*Q;re<M*M&&(G===0&&(G=ki(r),re+=G*G),Q===0&&(Q=ki(r),re+=Q*Q),re=(M-(re=Math.sqrt(re)))/re*i,y.vx+=(G*=re)*(M=(F*=F)/(j+F)),y.vy+=(Q*=re)*M,T.vx-=G*(M=1-M),T.vy-=Q*M)}return}return z>b+M||A<b-M||D>w+M||P<w-M}}function d(f){if(f.data)return f.r=n[f.data.index];for(var m=f.r=0;m<4;++m)f[m]&&f[m].r>f.r&&(f.r=f[m].r)}function p(){if(t){var f,m=t.length,g;for(n=new Array(m),f=0;f<m;++f)g=t[f],n[g.index]=+e(g,f,t)}}return l.initialize=function(f,m){t=f,r=m,p()},l.iterations=function(f){return arguments.length?(o=+f,l):o},l.strength=function(f){return arguments.length?(i=+f,l):i},l.radius=function(f){return arguments.length?(e=typeof f=="function"?f:es(+f),p(),l):e},l}function E7(e){return e.index}function gw(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function A7(e){var t=E7,n=g,r,i=es(30),o,l,d,p,f,m=1;e==null&&(e=[]);function g(j){return 1/Math.min(d[j.source.index],d[j.target.index])}function y(j){for(var S=0,E=e.length;S<m;++S)for(var C=0,z,D,A,P,T,F,M;C<E;++C)z=e[C],D=z.source,A=z.target,P=A.x+A.vx-D.x-D.vx||ki(f),T=A.y+A.vy-D.y-D.vy||ki(f),F=Math.sqrt(P*P+T*T),F=(F-o[C])/F*j*r[C],P*=F,T*=F,A.vx-=P*(M=p[C]),A.vy-=T*M,D.vx+=P*(M=1-M),D.vy+=T*M}function b(){if(l){var j,S=l.length,E=e.length,C=new Map(l.map((D,A)=>[t(D,A,l),D])),z;for(j=0,d=new Array(S);j<E;++j)z=e[j],z.index=j,typeof z.source!="object"&&(z.source=gw(C,z.source)),typeof z.target!="object"&&(z.target=gw(C,z.target)),d[z.source.index]=(d[z.source.index]||0)+1,d[z.target.index]=(d[z.target.index]||0)+1;for(j=0,p=new Array(E);j<E;++j)z=e[j],p[j]=d[z.source.index]/(d[z.source.index]+d[z.target.index]);r=new Array(E),w(),o=new Array(E),k()}}function w(){if(l)for(var j=0,S=e.length;j<S;++j)r[j]=+n(e[j],j,e)}function k(){if(l)for(var j=0,S=e.length;j<S;++j)o[j]=+i(e[j],j,e)}return y.initialize=function(j,S){l=j,f=S,b()},y.links=function(j){return arguments.length?(e=j,b(),y):e},y.id=function(j){return arguments.length?(t=j,y):t},y.iterations=function(j){return arguments.length?(m=+j,y):m},y.strength=function(j){return arguments.length?(n=typeof j=="function"?j:es(+j),w(),y):n},y.distance=function(j){return arguments.length?(i=typeof j=="function"?j:es(+j),k(),y):i},y}var T7={value:()=>{}};function uf(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ud(n)}function ud(e){this._=e}function R7(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ud.prototype=uf.prototype={constructor:ud,on:function(e,t){var n=this._,r=R7(e+"",n),i,o=-1,l=r.length;if(arguments.length<2){for(;++o<l;)if((i=(e=r[o]).type)&&(i=L7(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<l;)if(i=(e=r[o]).type)n[i]=xw(n[i],e.name,t);else if(t==null)for(i in n)n[i]=xw(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ud(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function L7(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function xw(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=T7,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var lo=0,El=0,_l=0,x2=1e3,zd,Al,Id=0,as=0,df=0,Zl=typeof performance=="object"&&performance.now?performance:Date,y2=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function hx(){return as||(y2(D7),as=Zl.now()+df)}function D7(){as=0}function $d(){this._call=this._time=this._next=null}$d.prototype=mx.prototype={constructor:$d,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?hx():+n)+(t==null?0:+t),!this._next&&Al!==this&&(Al?Al._next=this:zd=this,Al=this),this._call=e,this._time=n,pg()},stop:function(){this._call&&(this._call=null,this._time=1/0,pg())}};function mx(e,t,n){var r=new $d;return r.restart(e,t,n),r}function O7(){hx(),++lo;for(var e=zd,t;e;)(t=as-e._time)>=0&&e._call.call(void 0,t),e=e._next;--lo}function yw(){as=(Id=Zl.now())+df,lo=El=0;try{O7()}finally{lo=0,z7(),as=0}}function M7(){var e=Zl.now(),t=e-Id;t>x2&&(df-=t,Id=e)}function z7(){for(var e,t=zd,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:zd=n);Al=e,pg(r)}function pg(e){if(!lo){El&&(El=clearTimeout(El));var t=e-as;t>24?(e<1/0&&(El=setTimeout(yw,e-Zl.now()-df)),_l&&(_l=clearInterval(_l))):(_l||(Id=Zl.now(),_l=setInterval(M7,x2)),lo=1,y2(yw))}}function bw(e,t,n){var r=new $d;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}const I7=1664525,$7=1013904223,vw=4294967296;function B7(){let e=1;return()=>(e=(I7*e+$7)%vw)/vw}function P7(e){return e.x}function F7(e){return e.y}var U7=10,H7=Math.PI*(3-Math.sqrt(5));function q7(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,l=.6,d=new Map,p=mx(g),f=uf("tick","end"),m=B7();e==null&&(e=[]);function g(){y(),f.call("tick",t),n<r&&(p.stop(),f.call("end",t))}function y(k){var j,S=e.length,E;k===void 0&&(k=1);for(var C=0;C<k;++C)for(n+=(o-n)*i,d.forEach(function(z){z(n)}),j=0;j<S;++j)E=e[j],E.fx==null?E.x+=E.vx*=l:(E.x=E.fx,E.vx=0),E.fy==null?E.y+=E.vy*=l:(E.y=E.fy,E.vy=0);return t}function b(){for(var k=0,j=e.length,S;k<j;++k){if(S=e[k],S.index=k,S.fx!=null&&(S.x=S.fx),S.fy!=null&&(S.y=S.fy),isNaN(S.x)||isNaN(S.y)){var E=U7*Math.sqrt(.5+k),C=k*H7;S.x=E*Math.cos(C),S.y=E*Math.sin(C)}(isNaN(S.vx)||isNaN(S.vy))&&(S.vx=S.vy=0)}}function w(k){return k.initialize&&k.initialize(e,m),k}return b(),t={tick:y,restart:function(){return p.restart(g),t},stop:function(){return p.stop(),t},nodes:function(k){return arguments.length?(e=k,b(),d.forEach(w),t):e},alpha:function(k){return arguments.length?(n=+k,t):n},alphaMin:function(k){return arguments.length?(r=+k,t):r},alphaDecay:function(k){return arguments.length?(i=+k,t):+i},alphaTarget:function(k){return arguments.length?(o=+k,t):o},velocityDecay:function(k){return arguments.length?(l=1-k,t):1-l},randomSource:function(k){return arguments.length?(m=k,d.forEach(w),t):m},force:function(k,j){return arguments.length>1?(j==null?d.delete(k):d.set(k,w(j)),t):d.get(k)},find:function(k,j,S){var E=0,C=e.length,z,D,A,P,T;for(S==null?S=1/0:S*=S,E=0;E<C;++E)P=e[E],z=k-P.x,D=j-P.y,A=z*z+D*D,A<S&&(T=P,S=A);return T},on:function(k,j){return arguments.length>1?(f.on(k,j),t):f.on(k)}}}function V7(){var e,t,n,r,i=es(-30),o,l=1,d=1/0,p=.81;function f(b){var w,k=e.length,j=fx(e,P7,F7).visitAfter(g);for(r=b,w=0;w<k;++w)t=e[w],j.visit(y)}function m(){if(e){var b,w=e.length,k;for(o=new Array(w),b=0;b<w;++b)k=e[b],o[k.index]=+i(k,b,e)}}function g(b){var w=0,k,j,S=0,E,C,z;if(b.length){for(E=C=z=0;z<4;++z)(k=b[z])&&(j=Math.abs(k.value))&&(w+=k.value,S+=j,E+=j*k.x,C+=j*k.y);b.x=E/S,b.y=C/S}else{k=b,k.x=k.data.x,k.y=k.data.y;do w+=o[k.data.index];while(k=k.next)}b.value=w}function y(b,w,k,j){if(!b.value)return!0;var S=b.x-t.x,E=b.y-t.y,C=j-w,z=S*S+E*E;if(C*C/p<z)return z<d&&(S===0&&(S=ki(n),z+=S*S),E===0&&(E=ki(n),z+=E*E),z<l&&(z=Math.sqrt(l*z)),t.vx+=S*b.value*r/z,t.vy+=E*b.value*r/z),!0;if(b.length||z>=d)return;(b.data!==t||b.next)&&(S===0&&(S=ki(n),z+=S*S),E===0&&(E=ki(n),z+=E*E),z<l&&(z=Math.sqrt(l*z)));do b.data!==t&&(C=o[b.data.index]*r/z,t.vx+=S*C,t.vy+=E*C);while(b=b.next)}return f.initialize=function(b,w){e=b,n=w,m()},f.strength=function(b){return arguments.length?(i=typeof b=="function"?b:es(+b),m(),f):i},f.distanceMin=function(b){return arguments.length?(l=b*b,f):Math.sqrt(l)},f.distanceMax=function(b){return arguments.length?(d=b*b,f):Math.sqrt(d)},f.theta=function(b){return arguments.length?(p=b*b,f):Math.sqrt(p)},f}var hg="http://www.w3.org/1999/xhtml";const _w={svg:"http://www.w3.org/2000/svg",xhtml:hg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ff(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),_w.hasOwnProperty(t)?{space:_w[t],local:e}:e}function G7(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===hg&&t.documentElement.namespaceURI===hg?t.createElement(e):t.createElementNS(n,e)}}function Y7(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function b2(e){var t=ff(e);return(t.local?Y7:G7)(t)}function K7(){}function gx(e){return e==null?K7:function(){return this.querySelector(e)}}function X7(e){typeof e!="function"&&(e=gx(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],l=o.length,d=r[i]=new Array(l),p,f,m=0;m<l;++m)(p=o[m])&&(f=e.call(p,p.__data__,m,o))&&("__data__"in p&&(f.__data__=p.__data__),d[m]=f);return new xr(r,this._parents)}function Q7(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Z7(){return[]}function v2(e){return e==null?Z7:function(){return this.querySelectorAll(e)}}function W7(e){return function(){return Q7(e.apply(this,arguments))}}function J7(e){typeof e=="function"?e=W7(e):e=v2(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var l=t[o],d=l.length,p,f=0;f<d;++f)(p=l[f])&&(r.push(e.call(p,p.__data__,f,l)),i.push(p));return new xr(r,i)}function _2(e){return function(){return this.matches(e)}}function w2(e){return function(t){return t.matches(e)}}var eF=Array.prototype.find;function tF(e){return function(){return eF.call(this.children,e)}}function nF(){return this.firstElementChild}function rF(e){return this.select(e==null?nF:tF(typeof e=="function"?e:w2(e)))}var aF=Array.prototype.filter;function iF(){return Array.from(this.children)}function sF(e){return function(){return aF.call(this.children,e)}}function oF(e){return this.selectAll(e==null?iF:sF(typeof e=="function"?e:w2(e)))}function lF(e){typeof e!="function"&&(e=_2(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],l=o.length,d=r[i]=[],p,f=0;f<l;++f)(p=o[f])&&e.call(p,p.__data__,f,o)&&d.push(p);return new xr(r,this._parents)}function k2(e){return new Array(e.length)}function cF(){return new xr(this._enter||this._groups.map(k2),this._parents)}function Bd(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Bd.prototype={constructor:Bd,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function uF(e){return function(){return e}}function dF(e,t,n,r,i,o){for(var l=0,d,p=t.length,f=o.length;l<f;++l)(d=t[l])?(d.__data__=o[l],r[l]=d):n[l]=new Bd(e,o[l]);for(;l<p;++l)(d=t[l])&&(i[l]=d)}function fF(e,t,n,r,i,o,l){var d,p,f=new Map,m=t.length,g=o.length,y=new Array(m),b;for(d=0;d<m;++d)(p=t[d])&&(y[d]=b=l.call(p,p.__data__,d,t)+"",f.has(b)?i[d]=p:f.set(b,p));for(d=0;d<g;++d)b=l.call(e,o[d],d,o)+"",(p=f.get(b))?(r[d]=p,p.__data__=o[d],f.delete(b)):n[d]=new Bd(e,o[d]);for(d=0;d<m;++d)(p=t[d])&&f.get(y[d])===p&&(i[d]=p)}function pF(e){return e.__data__}function hF(e,t){if(!arguments.length)return Array.from(this,pF);var n=t?fF:dF,r=this._parents,i=this._groups;typeof e!="function"&&(e=uF(e));for(var o=i.length,l=new Array(o),d=new Array(o),p=new Array(o),f=0;f<o;++f){var m=r[f],g=i[f],y=g.length,b=mF(e.call(m,m&&m.__data__,f,r)),w=b.length,k=d[f]=new Array(w),j=l[f]=new Array(w),S=p[f]=new Array(y);n(m,g,k,j,S,b,t);for(var E=0,C=0,z,D;E<w;++E)if(z=k[E]){for(E>=C&&(C=E+1);!(D=j[C])&&++C<w;);z._next=D||null}}return l=new xr(l,r),l._enter=d,l._exit=p,l}function mF(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gF(){return new xr(this._exit||this._groups.map(k2),this._parents)}function xF(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function yF(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,l=Math.min(i,o),d=new Array(i),p=0;p<l;++p)for(var f=n[p],m=r[p],g=f.length,y=d[p]=new Array(g),b,w=0;w<g;++w)(b=f[w]||m[w])&&(y[w]=b);for(;p<i;++p)d[p]=n[p];return new xr(d,this._parents)}function bF(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],l;--i>=0;)(l=r[i])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function vF(e){e||(e=_F);function t(g,y){return g&&y?e(g.__data__,y.__data__):!g-!y}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var l=n[o],d=l.length,p=i[o]=new Array(d),f,m=0;m<d;++m)(f=l[m])&&(p[m]=f);p.sort(t)}return new xr(i,this._parents).order()}function _F(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function wF(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function kF(){return Array.from(this)}function SF(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var l=r[i];if(l)return l}return null}function jF(){let e=0;for(const t of this)++e;return e}function NF(){return!this.node()}function CF(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,l=i.length,d;o<l;++o)(d=i[o])&&e.call(d,d.__data__,o,i);return this}function EF(e){return function(){this.removeAttribute(e)}}function AF(e){return function(){this.removeAttributeNS(e.space,e.local)}}function TF(e,t){return function(){this.setAttribute(e,t)}}function RF(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function LF(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function DF(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function OF(e,t){var n=ff(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?AF:EF:typeof t=="function"?n.local?DF:LF:n.local?RF:TF)(n,t))}function S2(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function MF(e){return function(){this.style.removeProperty(e)}}function zF(e,t,n){return function(){this.style.setProperty(e,t,n)}}function IF(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function $F(e,t,n){return arguments.length>1?this.each((t==null?MF:typeof t=="function"?IF:zF)(e,t,n??"")):co(this.node(),e)}function co(e,t){return e.style.getPropertyValue(t)||S2(e).getComputedStyle(e,null).getPropertyValue(t)}function BF(e){return function(){delete this[e]}}function PF(e,t){return function(){this[e]=t}}function FF(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function UF(e,t){return arguments.length>1?this.each((t==null?BF:typeof t=="function"?FF:PF)(e,t)):this.node()[e]}function j2(e){return e.trim().split(/^|\s+/)}function xx(e){return e.classList||new N2(e)}function N2(e){this._node=e,this._names=j2(e.getAttribute("class")||"")}N2.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function C2(e,t){for(var n=xx(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function E2(e,t){for(var n=xx(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function HF(e){return function(){C2(this,e)}}function qF(e){return function(){E2(this,e)}}function VF(e,t){return function(){(t.apply(this,arguments)?C2:E2)(this,e)}}function GF(e,t){var n=j2(e+"");if(arguments.length<2){for(var r=xx(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?VF:t?HF:qF)(n,t))}function YF(){this.textContent=""}function KF(e){return function(){this.textContent=e}}function XF(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function QF(e){return arguments.length?this.each(e==null?YF:(typeof e=="function"?XF:KF)(e)):this.node().textContent}function ZF(){this.innerHTML=""}function WF(e){return function(){this.innerHTML=e}}function JF(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function eU(e){return arguments.length?this.each(e==null?ZF:(typeof e=="function"?JF:WF)(e)):this.node().innerHTML}function tU(){this.nextSibling&&this.parentNode.appendChild(this)}function nU(){return this.each(tU)}function rU(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function aU(){return this.each(rU)}function iU(e){var t=typeof e=="function"?e:b2(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function sU(){return null}function oU(e,t){var n=typeof e=="function"?e:b2(e),r=t==null?sU:typeof t=="function"?t:gx(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function lU(){var e=this.parentNode;e&&e.removeChild(this)}function cU(){return this.each(lU)}function uU(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function dU(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fU(e){return this.select(e?dU:uU)}function pU(e){return arguments.length?this.property("__data__",e):this.node().__data__}function hU(e){return function(t){e.call(this,t,this.__data__)}}function mU(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function gU(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function xU(e,t,n){return function(){var r=this.__on,i,o=hU(t);if(r){for(var l=0,d=r.length;l<d;++l)if((i=r[l]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function yU(e,t,n){var r=mU(e+""),i,o=r.length,l;if(arguments.length<2){var d=this.node().__on;if(d){for(var p=0,f=d.length,m;p<f;++p)for(i=0,m=d[p];i<o;++i)if((l=r[i]).type===m.type&&l.name===m.name)return m.value}return}for(d=t?xU:gU,i=0;i<o;++i)this.each(d(r[i],t,n));return this}function A2(e,t,n){var r=S2(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function bU(e,t){return function(){return A2(this,e,t)}}function vU(e,t){return function(){return A2(this,e,t.apply(this,arguments))}}function _U(e,t){return this.each((typeof t=="function"?vU:bU)(e,t))}function*wU(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,l;i<o;++i)(l=r[i])&&(yield l)}var T2=[null];function xr(e,t){this._groups=e,this._parents=t}function yc(){return new xr([[document.documentElement]],T2)}function kU(){return this}xr.prototype=yc.prototype={constructor:xr,select:X7,selectAll:J7,selectChild:rF,selectChildren:oF,filter:lF,data:hF,enter:cF,exit:gF,join:xF,merge:yF,selection:kU,order:bF,sort:vF,call:wF,nodes:kF,node:SF,size:jF,empty:NF,each:CF,attr:OF,style:$F,property:UF,classed:GF,text:QF,html:eU,raise:nU,lower:aU,append:iU,insert:oU,remove:cU,clone:fU,datum:pU,on:yU,dispatch:_U,[Symbol.iterator]:wU};function Dr(e){return typeof e=="string"?new xr([[document.querySelector(e)]],[document.documentElement]):new xr([[e]],T2)}function SU(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Yi(e,t){if(e=SU(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const mg={capture:!0,passive:!1};function gg(e){e.preventDefault(),e.stopImmediatePropagation()}function jU(e){var t=e.document.documentElement,n=Dr(e).on("dragstart.drag",gg,mg);"onselectstart"in t?n.on("selectstart.drag",gg,mg):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function NU(e,t){var n=e.document.documentElement,r=Dr(e).on("dragstart.drag",null);t&&(r.on("click.drag",gg,mg),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function yx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function R2(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function bc(){}var Wl=.7,Pd=1/Wl,ro="\\s*([+-]?\\d+)\\s*",Jl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",la="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",CU=/^#([0-9a-f]{3,8})$/,EU=new RegExp(`^rgb\\(${ro},${ro},${ro}\\)$`),AU=new RegExp(`^rgb\\(${la},${la},${la}\\)$`),TU=new RegExp(`^rgba\\(${ro},${ro},${ro},${Jl}\\)$`),RU=new RegExp(`^rgba\\(${la},${la},${la},${Jl}\\)$`),LU=new RegExp(`^hsl\\(${Jl},${la},${la}\\)$`),DU=new RegExp(`^hsla\\(${Jl},${la},${la},${Jl}\\)$`),ww={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};yx(bc,ec,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:kw,formatHex:kw,formatHex8:OU,formatHsl:MU,formatRgb:Sw,toString:Sw});function kw(){return this.rgb().formatHex()}function OU(){return this.rgb().formatHex8()}function MU(){return L2(this).formatHsl()}function Sw(){return this.rgb().formatRgb()}function ec(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=CU.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?jw(t):n===3?new rr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ju(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ju(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=EU.exec(e))?new rr(t[1],t[2],t[3],1):(t=AU.exec(e))?new rr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=TU.exec(e))?Ju(t[1],t[2],t[3],t[4]):(t=RU.exec(e))?Ju(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=LU.exec(e))?Ew(t[1],t[2]/100,t[3]/100,1):(t=DU.exec(e))?Ew(t[1],t[2]/100,t[3]/100,t[4]):ww.hasOwnProperty(e)?jw(ww[e]):e==="transparent"?new rr(NaN,NaN,NaN,0):null}function jw(e){return new rr(e>>16&255,e>>8&255,e&255,1)}function Ju(e,t,n,r){return r<=0&&(e=t=n=NaN),new rr(e,t,n,r)}function zU(e){return e instanceof bc||(e=ec(e)),e?(e=e.rgb(),new rr(e.r,e.g,e.b,e.opacity)):new rr}function xg(e,t,n,r){return arguments.length===1?zU(e):new rr(e,t,n,r??1)}function rr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}yx(rr,xg,R2(bc,{brighter(e){return e=e==null?Pd:Math.pow(Pd,e),new rr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wl:Math.pow(Wl,e),new rr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new rr(ts(this.r),ts(this.g),ts(this.b),Fd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Nw,formatHex:Nw,formatHex8:IU,formatRgb:Cw,toString:Cw}));function Nw(){return`#${Wi(this.r)}${Wi(this.g)}${Wi(this.b)}`}function IU(){return`#${Wi(this.r)}${Wi(this.g)}${Wi(this.b)}${Wi((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cw(){const e=Fd(this.opacity);return`${e===1?"rgb(":"rgba("}${ts(this.r)}, ${ts(this.g)}, ${ts(this.b)}${e===1?")":`, ${e})`}`}function Fd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ts(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wi(e){return e=ts(e),(e<16?"0":"")+e.toString(16)}function Ew(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Fr(e,t,n,r)}function L2(e){if(e instanceof Fr)return new Fr(e.h,e.s,e.l,e.opacity);if(e instanceof bc||(e=ec(e)),!e)return new Fr;if(e instanceof Fr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,d=o-i,p=(o+i)/2;return d?(t===o?l=(n-r)/d+(n<r)*6:n===o?l=(r-t)/d+2:l=(t-n)/d+4,d/=p<.5?o+i:2-o-i,l*=60):d=p>0&&p<1?0:l,new Fr(l,d,p,e.opacity)}function $U(e,t,n,r){return arguments.length===1?L2(e):new Fr(e,t,n,r??1)}function Fr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}yx(Fr,$U,R2(bc,{brighter(e){return e=e==null?Pd:Math.pow(Pd,e),new Fr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wl:Math.pow(Wl,e),new Fr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new rr(bm(e>=240?e-240:e+120,i,r),bm(e,i,r),bm(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Fr(Aw(this.h),ed(this.s),ed(this.l),Fd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Fd(this.opacity);return`${e===1?"hsl(":"hsla("}${Aw(this.h)}, ${ed(this.s)*100}%, ${ed(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Aw(e){return e=(e||0)%360,e<0?e+360:e}function ed(e){return Math.max(0,Math.min(1,e||0))}function bm(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const D2=e=>()=>e;function BU(e,t){return function(n){return e+n*t}}function PU(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function FU(e){return(e=+e)==1?O2:function(t,n){return n-t?PU(t,n,e):D2(isNaN(t)?n:t)}}function O2(e,t){var n=t-e;return n?BU(e,n):D2(isNaN(e)?t:e)}const Tw=(function e(t){var n=FU(t);function r(i,o){var l=n((i=xg(i)).r,(o=xg(o)).r),d=n(i.g,o.g),p=n(i.b,o.b),f=O2(i.opacity,o.opacity);return function(m){return i.r=l(m),i.g=d(m),i.b=p(m),i.opacity=f(m),i+""}}return r.gamma=e,r})(1);function bi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var yg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vm=new RegExp(yg.source,"g");function UU(e){return function(){return e}}function HU(e){return function(t){return e(t)+""}}function qU(e,t){var n=yg.lastIndex=vm.lastIndex=0,r,i,o,l=-1,d=[],p=[];for(e=e+"",t=t+"";(r=yg.exec(e))&&(i=vm.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),d[l]?d[l]+=o:d[++l]=o),(r=r[0])===(i=i[0])?d[l]?d[l]+=i:d[++l]=i:(d[++l]=null,p.push({i:l,x:bi(r,i)})),n=vm.lastIndex;return n<t.length&&(o=t.slice(n),d[l]?d[l]+=o:d[++l]=o),d.length<2?p[0]?HU(p[0].x):UU(t):(t=p.length,function(f){for(var m=0,g;m<t;++m)d[(g=p[m]).i]=g.x(f);return d.join("")})}var Rw=180/Math.PI,bg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function M2(e,t,n,r,i,o){var l,d,p;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(p=e*n+t*r)&&(n-=e*p,r-=t*p),(d=Math.sqrt(n*n+r*r))&&(n/=d,r/=d,p/=d),e*r<t*n&&(e=-e,t=-t,p=-p,l=-l),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*Rw,skewX:Math.atan(p)*Rw,scaleX:l,scaleY:d}}var td;function VU(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?bg:M2(t.a,t.b,t.c,t.d,t.e,t.f)}function GU(e){return e==null||(td||(td=document.createElementNS("http://www.w3.org/2000/svg","g")),td.setAttribute("transform",e),!(e=td.transform.baseVal.consolidate()))?bg:(e=e.matrix,M2(e.a,e.b,e.c,e.d,e.e,e.f))}function z2(e,t,n,r){function i(f){return f.length?f.pop()+" ":""}function o(f,m,g,y,b,w){if(f!==g||m!==y){var k=b.push("translate(",null,t,null,n);w.push({i:k-4,x:bi(f,g)},{i:k-2,x:bi(m,y)})}else(g||y)&&b.push("translate("+g+t+y+n)}function l(f,m,g,y){f!==m?(f-m>180?m+=360:m-f>180&&(f+=360),y.push({i:g.push(i(g)+"rotate(",null,r)-2,x:bi(f,m)})):m&&g.push(i(g)+"rotate("+m+r)}function d(f,m,g,y){f!==m?y.push({i:g.push(i(g)+"skewX(",null,r)-2,x:bi(f,m)}):m&&g.push(i(g)+"skewX("+m+r)}function p(f,m,g,y,b,w){if(f!==g||m!==y){var k=b.push(i(b)+"scale(",null,",",null,")");w.push({i:k-4,x:bi(f,g)},{i:k-2,x:bi(m,y)})}else(g!==1||y!==1)&&b.push(i(b)+"scale("+g+","+y+")")}return function(f,m){var g=[],y=[];return f=e(f),m=e(m),o(f.translateX,f.translateY,m.translateX,m.translateY,g,y),l(f.rotate,m.rotate,g,y),d(f.skewX,m.skewX,g,y),p(f.scaleX,f.scaleY,m.scaleX,m.scaleY,g,y),f=m=null,function(b){for(var w=-1,k=y.length,j;++w<k;)g[(j=y[w]).i]=j.x(b);return g.join("")}}}var YU=z2(VU,"px, ","px)","deg)"),KU=z2(GU,", ",")",")"),XU=1e-12;function Lw(e){return((e=Math.exp(e))+1/e)/2}function QU(e){return((e=Math.exp(e))-1/e)/2}function ZU(e){return((e=Math.exp(2*e))-1)/(e+1)}const WU=(function e(t,n,r){function i(o,l){var d=o[0],p=o[1],f=o[2],m=l[0],g=l[1],y=l[2],b=m-d,w=g-p,k=b*b+w*w,j,S;if(k<XU)S=Math.log(y/f)/t,j=function(P){return[d+P*b,p+P*w,f*Math.exp(t*P*S)]};else{var E=Math.sqrt(k),C=(y*y-f*f+r*k)/(2*f*n*E),z=(y*y-f*f-r*k)/(2*y*n*E),D=Math.log(Math.sqrt(C*C+1)-C),A=Math.log(Math.sqrt(z*z+1)-z);S=(A-D)/t,j=function(P){var T=P*S,F=Lw(D),M=f/(n*E)*(F*ZU(t*T+D)-QU(D));return[d+M*b,p+M*w,f*F/Lw(t*T+D)]}}return j.duration=S*1e3*t/Math.SQRT2,j}return i.rho=function(o){var l=Math.max(.001,+o),d=l*l,p=d*d;return e(l,d,p)},i})(Math.SQRT2,2,4);var JU=uf("start","end","cancel","interrupt"),eH=[],I2=0,Dw=1,vg=2,dd=3,Ow=4,_g=5,fd=6;function pf(e,t,n,r,i,o){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;tH(e,n,{name:t,index:r,group:i,on:JU,tween:eH,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:I2})}function bx(e,t){var n=Gr(e,t);if(n.state>I2)throw new Error("too late; already scheduled");return n}function ga(e,t){var n=Gr(e,t);if(n.state>dd)throw new Error("too late; already running");return n}function Gr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function tH(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=mx(o,0,n.time);function o(f){n.state=Dw,n.timer.restart(l,n.delay,n.time),n.delay<=f&&l(f-n.delay)}function l(f){var m,g,y,b;if(n.state!==Dw)return p();for(m in r)if(b=r[m],b.name===n.name){if(b.state===dd)return bw(l);b.state===Ow?(b.state=fd,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[m]):+m<t&&(b.state=fd,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete r[m])}if(bw(function(){n.state===dd&&(n.state=Ow,n.timer.restart(d,n.delay,n.time),d(f))}),n.state=vg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===vg){for(n.state=dd,i=new Array(y=n.tween.length),m=0,g=-1;m<y;++m)(b=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(i[++g]=b);i.length=g+1}}function d(f){for(var m=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(p),n.state=_g,1),g=-1,y=i.length;++g<y;)i[g].call(e,m);n.state===_g&&(n.on.call("end",e,e.__data__,n.index,n.group),p())}function p(){n.state=fd,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function pd(e,t){var n=e.__transition,r,i,o=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((r=n[l]).name!==t){o=!1;continue}i=r.state>vg&&r.state<_g,r.state=fd,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[l]}o&&delete e.__transition}}function nH(e){return this.each(function(){pd(this,e)})}function rH(e,t){var n,r;return function(){var i=ga(this,e),o=i.tween;if(o!==n){r=n=o;for(var l=0,d=r.length;l<d;++l)if(r[l].name===t){r=r.slice(),r.splice(l,1);break}}i.tween=r}}function aH(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=ga(this,e),l=o.tween;if(l!==r){i=(r=l).slice();for(var d={name:t,value:n},p=0,f=i.length;p<f;++p)if(i[p].name===t){i[p]=d;break}p===f&&i.push(d)}o.tween=i}}function iH(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Gr(this.node(),n).tween,i=0,o=r.length,l;i<o;++i)if((l=r[i]).name===e)return l.value;return null}return this.each((t==null?rH:aH)(n,e,t))}function vx(e,t,n){var r=e._id;return e.each(function(){var i=ga(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Gr(i,r).value[t]}}function $2(e,t){var n;return(typeof t=="number"?bi:t instanceof ec?Tw:(n=ec(t))?(t=n,Tw):qU)(e,t)}function sH(e){return function(){this.removeAttribute(e)}}function oH(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lH(e,t,n){var r,i=n+"",o;return function(){var l=this.getAttribute(e);return l===i?null:l===r?o:o=t(r=l,n)}}function cH(e,t,n){var r,i=n+"",o;return function(){var l=this.getAttributeNS(e.space,e.local);return l===i?null:l===r?o:o=t(r=l,n)}}function uH(e,t,n){var r,i,o;return function(){var l,d=n(this),p;return d==null?void this.removeAttribute(e):(l=this.getAttribute(e),p=d+"",l===p?null:l===r&&p===i?o:(i=p,o=t(r=l,d)))}}function dH(e,t,n){var r,i,o;return function(){var l,d=n(this),p;return d==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),p=d+"",l===p?null:l===r&&p===i?o:(i=p,o=t(r=l,d)))}}function fH(e,t){var n=ff(e),r=n==="transform"?KU:$2;return this.attrTween(e,typeof t=="function"?(n.local?dH:uH)(n,r,vx(this,"attr."+e,t)):t==null?(n.local?oH:sH)(n):(n.local?cH:lH)(n,r,t))}function pH(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function hH(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function mH(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&hH(e,o)),n}return i._value=t,i}function gH(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&pH(e,o)),n}return i._value=t,i}function xH(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ff(e);return this.tween(n,(r.local?mH:gH)(r,t))}function yH(e,t){return function(){bx(this,e).delay=+t.apply(this,arguments)}}function bH(e,t){return t=+t,function(){bx(this,e).delay=t}}function vH(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yH:bH)(t,e)):Gr(this.node(),t).delay}function _H(e,t){return function(){ga(this,e).duration=+t.apply(this,arguments)}}function wH(e,t){return t=+t,function(){ga(this,e).duration=t}}function kH(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_H:wH)(t,e)):Gr(this.node(),t).duration}function SH(e,t){if(typeof t!="function")throw new Error;return function(){ga(this,e).ease=t}}function jH(e){var t=this._id;return arguments.length?this.each(SH(t,e)):Gr(this.node(),t).ease}function NH(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ga(this,e).ease=n}}function CH(e){if(typeof e!="function")throw new Error;return this.each(NH(this._id,e))}function EH(e){typeof e!="function"&&(e=_2(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],l=o.length,d=r[i]=[],p,f=0;f<l;++f)(p=o[f])&&e.call(p,p.__data__,f,o)&&d.push(p);return new qa(r,this._parents,this._name,this._id)}function AH(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),l=new Array(r),d=0;d<o;++d)for(var p=t[d],f=n[d],m=p.length,g=l[d]=new Array(m),y,b=0;b<m;++b)(y=p[b]||f[b])&&(g[b]=y);for(;d<r;++d)l[d]=t[d];return new qa(l,this._parents,this._name,this._id)}function TH(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function RH(e,t,n){var r,i,o=TH(t)?bx:ga;return function(){var l=o(this,e),d=l.on;d!==r&&(i=(r=d).copy()).on(t,n),l.on=i}}function LH(e,t){var n=this._id;return arguments.length<2?Gr(this.node(),n).on.on(e):this.each(RH(n,e,t))}function DH(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function OH(){return this.on("end.remove",DH(this._id))}function MH(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gx(e));for(var r=this._groups,i=r.length,o=new Array(i),l=0;l<i;++l)for(var d=r[l],p=d.length,f=o[l]=new Array(p),m,g,y=0;y<p;++y)(m=d[y])&&(g=e.call(m,m.__data__,y,d))&&("__data__"in m&&(g.__data__=m.__data__),f[y]=g,pf(f[y],t,n,y,f,Gr(m,n)));return new qa(o,this._parents,t,n)}function zH(e){var t=this._name,n=this._id;typeof e!="function"&&(e=v2(e));for(var r=this._groups,i=r.length,o=[],l=[],d=0;d<i;++d)for(var p=r[d],f=p.length,m,g=0;g<f;++g)if(m=p[g]){for(var y=e.call(m,m.__data__,g,p),b,w=Gr(m,n),k=0,j=y.length;k<j;++k)(b=y[k])&&pf(b,t,n,k,y,w);o.push(y),l.push(m)}return new qa(o,l,t,n)}var IH=yc.prototype.constructor;function $H(){return new IH(this._groups,this._parents)}function BH(e,t){var n,r,i;return function(){var o=co(this,e),l=(this.style.removeProperty(e),co(this,e));return o===l?null:o===n&&l===r?i:i=t(n=o,r=l)}}function B2(e){return function(){this.style.removeProperty(e)}}function PH(e,t,n){var r,i=n+"",o;return function(){var l=co(this,e);return l===i?null:l===r?o:o=t(r=l,n)}}function FH(e,t,n){var r,i,o;return function(){var l=co(this,e),d=n(this),p=d+"";return d==null&&(p=d=(this.style.removeProperty(e),co(this,e))),l===p?null:l===r&&p===i?o:(i=p,o=t(r=l,d))}}function UH(e,t){var n,r,i,o="style."+t,l="end."+o,d;return function(){var p=ga(this,e),f=p.on,m=p.value[o]==null?d||(d=B2(t)):void 0;(f!==n||i!==m)&&(r=(n=f).copy()).on(l,i=m),p.on=r}}function HH(e,t,n){var r=(e+="")=="transform"?YU:$2;return t==null?this.styleTween(e,BH(e,r)).on("end.style."+e,B2(e)):typeof t=="function"?this.styleTween(e,FH(e,r,vx(this,"style."+e,t))).each(UH(this._id,e)):this.styleTween(e,PH(e,r,t),n).on("end.style."+e,null)}function qH(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function VH(e,t,n){var r,i;function o(){var l=t.apply(this,arguments);return l!==i&&(r=(i=l)&&qH(e,l,n)),r}return o._value=t,o}function GH(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,VH(e,t,n??""))}function YH(e){return function(){this.textContent=e}}function KH(e){return function(){var t=e(this);this.textContent=t??""}}function XH(e){return this.tween("text",typeof e=="function"?KH(vx(this,"text",e)):YH(e==null?"":e+""))}function QH(e){return function(t){this.textContent=e.call(this,t)}}function ZH(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&QH(i)),t}return r._value=e,r}function WH(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,ZH(e))}function JH(){for(var e=this._name,t=this._id,n=P2(),r=this._groups,i=r.length,o=0;o<i;++o)for(var l=r[o],d=l.length,p,f=0;f<d;++f)if(p=l[f]){var m=Gr(p,t);pf(p,e,n,f,l,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new qa(r,this._parents,e,n)}function eq(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,l){var d={value:l},p={value:function(){--i===0&&o()}};n.each(function(){var f=ga(this,r),m=f.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(d),t._.interrupt.push(d),t._.end.push(p)),f.on=t}),i===0&&o()})}var tq=0;function qa(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function P2(){return++tq}var $a=yc.prototype;qa.prototype={constructor:qa,select:MH,selectAll:zH,selectChild:$a.selectChild,selectChildren:$a.selectChildren,filter:EH,merge:AH,selection:$H,transition:JH,call:$a.call,nodes:$a.nodes,node:$a.node,size:$a.size,empty:$a.empty,each:$a.each,on:LH,attr:fH,attrTween:xH,style:HH,styleTween:GH,text:XH,textTween:WH,remove:OH,tween:iH,delay:vH,duration:kH,ease:jH,easeVarying:CH,end:eq,[Symbol.iterator]:$a[Symbol.iterator]};function nq(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var rq={time:null,delay:0,duration:250,ease:nq};function aq(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function iq(e){var t,n;e instanceof qa?(t=e._id,e=e._name):(t=P2(),(n=rq).time=hx(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var l=r[o],d=l.length,p,f=0;f<d;++f)(p=l[f])&&pf(p,e,t,f,l,n||aq(p,t));return new qa(r,this._parents,e,t)}yc.prototype.interrupt=nH;yc.prototype.transition=iq;const nd=e=>()=>e;function sq(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Ua(e,t,n){this.k=e,this.x=t,this.y=n}Ua.prototype={constructor:Ua,scale:function(e){return e===1?this:new Ua(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ua(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var _x=new Ua(1,0,0);Ua.prototype;function _m(e){e.stopImmediatePropagation()}function wl(e){e.preventDefault(),e.stopImmediatePropagation()}function oq(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function lq(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Mw(){return this.__zoom||_x}function cq(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function uq(){return navigator.maxTouchPoints||"ontouchstart"in this}function dq(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),l>o?(o+l)/2:Math.min(0,o)||Math.max(0,l))}function fq(){var e=oq,t=lq,n=dq,r=cq,i=uq,o=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],d=250,p=WU,f=uf("start","zoom","end"),m,g,y,b=500,w=150,k=0,j=10;function S($){$.property("__zoom",Mw).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",F).on("dblclick.zoom",M).filter(i).on("touchstart.zoom",G).on("touchmove.zoom",Q).on("touchend.zoom touchcancel.zoom",re).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function($,U,I,V){var te=$.selection?$.selection():$;te.property("__zoom",Mw),$!==te?D($,U,I,V):te.interrupt().each(function(){A(this,arguments).event(V).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},S.scaleBy=function($,U,I,V){S.scaleTo($,function(){var te=this.__zoom.k,oe=typeof U=="function"?U.apply(this,arguments):U;return te*oe},I,V)},S.scaleTo=function($,U,I,V){S.transform($,function(){var te=t.apply(this,arguments),oe=this.__zoom,R=I==null?z(te):typeof I=="function"?I.apply(this,arguments):I,B=oe.invert(R),K=typeof U=="function"?U.apply(this,arguments):U;return n(C(E(oe,K),R,B),te,l)},I,V)},S.translateBy=function($,U,I,V){S.transform($,function(){return n(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof I=="function"?I.apply(this,arguments):I),t.apply(this,arguments),l)},null,V)},S.translateTo=function($,U,I,V,te){S.transform($,function(){var oe=t.apply(this,arguments),R=this.__zoom,B=V==null?z(oe):typeof V=="function"?V.apply(this,arguments):V;return n(_x.translate(B[0],B[1]).scale(R.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof I=="function"?-I.apply(this,arguments):-I),oe,l)},V,te)};function E($,U){return U=Math.max(o[0],Math.min(o[1],U)),U===$.k?$:new Ua(U,$.x,$.y)}function C($,U,I){var V=U[0]-I[0]*$.k,te=U[1]-I[1]*$.k;return V===$.x&&te===$.y?$:new Ua($.k,V,te)}function z($){return[(+$[0][0]+ +$[1][0])/2,(+$[0][1]+ +$[1][1])/2]}function D($,U,I,V){$.on("start.zoom",function(){A(this,arguments).event(V).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(V).end()}).tween("zoom",function(){var te=this,oe=arguments,R=A(te,oe).event(V),B=t.apply(te,oe),K=I==null?z(B):typeof I=="function"?I.apply(te,oe):I,O=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),se=te.__zoom,ie=typeof U=="function"?U.apply(te,oe):U,pe=p(se.invert(K).concat(O/se.k),ie.invert(K).concat(O/ie.k));return function(Ee){if(Ee===1)Ee=ie;else{var Ie=pe(Ee),Ue=O/Ie[2];Ee=new Ua(Ue,K[0]-Ie[0]*Ue,K[1]-Ie[1]*Ue)}R.zoom(null,Ee)}})}function A($,U,I){return!I&&$.__zooming||new P($,U)}function P($,U){this.that=$,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply($,U),this.taps=0}P.prototype={event:function($){return $&&(this.sourceEvent=$),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function($,U){return this.mouse&&$!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&$!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&$!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function($){var U=Dr(this.that).datum();f.call($,this.that,new sq($,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:f}),U)}};function T($,...U){if(!e.apply(this,arguments))return;var I=A(this,U).event($),V=this.__zoom,te=Math.max(o[0],Math.min(o[1],V.k*Math.pow(2,r.apply(this,arguments)))),oe=Yi($);if(I.wheel)(I.mouse[0][0]!==oe[0]||I.mouse[0][1]!==oe[1])&&(I.mouse[1]=V.invert(I.mouse[0]=oe)),clearTimeout(I.wheel);else{if(V.k===te)return;I.mouse=[oe,V.invert(oe)],pd(this),I.start()}wl($),I.wheel=setTimeout(R,w),I.zoom("mouse",n(C(E(V,te),I.mouse[0],I.mouse[1]),I.extent,l));function R(){I.wheel=null,I.end()}}function F($,...U){if(y||!e.apply(this,arguments))return;var I=$.currentTarget,V=A(this,U,!0).event($),te=Dr($.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",O,!0),oe=Yi($,I),R=$.clientX,B=$.clientY;jU($.view),_m($),V.mouse=[oe,this.__zoom.invert(oe)],pd(this),V.start();function K(se){if(wl(se),!V.moved){var ie=se.clientX-R,pe=se.clientY-B;V.moved=ie*ie+pe*pe>k}V.event(se).zoom("mouse",n(C(V.that.__zoom,V.mouse[0]=Yi(se,I),V.mouse[1]),V.extent,l))}function O(se){te.on("mousemove.zoom mouseup.zoom",null),NU(se.view,V.moved),wl(se),V.event(se).end()}}function M($,...U){if(e.apply(this,arguments)){var I=this.__zoom,V=Yi($.changedTouches?$.changedTouches[0]:$,this),te=I.invert(V),oe=I.k*($.shiftKey?.5:2),R=n(C(E(I,oe),V,te),t.apply(this,U),l);wl($),d>0?Dr(this).transition().duration(d).call(D,R,V,$):Dr(this).call(S.transform,R,V,$)}}function G($,...U){if(e.apply(this,arguments)){var I=$.touches,V=I.length,te=A(this,U,$.changedTouches.length===V).event($),oe,R,B,K;for(_m($),R=0;R<V;++R)B=I[R],K=Yi(B,this),K=[K,this.__zoom.invert(K),B.identifier],te.touch0?!te.touch1&&te.touch0[2]!==K[2]&&(te.touch1=K,te.taps=0):(te.touch0=K,oe=!0,te.taps=1+!!m);m&&(m=clearTimeout(m)),oe&&(te.taps<2&&(g=K[0],m=setTimeout(function(){m=null},b)),pd(this),te.start())}}function Q($,...U){if(this.__zooming){var I=A(this,U).event($),V=$.changedTouches,te=V.length,oe,R,B,K;for(wl($),oe=0;oe<te;++oe)R=V[oe],B=Yi(R,this),I.touch0&&I.touch0[2]===R.identifier?I.touch0[0]=B:I.touch1&&I.touch1[2]===R.identifier&&(I.touch1[0]=B);if(R=I.that.__zoom,I.touch1){var O=I.touch0[0],se=I.touch0[1],ie=I.touch1[0],pe=I.touch1[1],Ee=(Ee=ie[0]-O[0])*Ee+(Ee=ie[1]-O[1])*Ee,Ie=(Ie=pe[0]-se[0])*Ie+(Ie=pe[1]-se[1])*Ie;R=E(R,Math.sqrt(Ee/Ie)),B=[(O[0]+ie[0])/2,(O[1]+ie[1])/2],K=[(se[0]+pe[0])/2,(se[1]+pe[1])/2]}else if(I.touch0)B=I.touch0[0],K=I.touch0[1];else return;I.zoom("touch",n(C(R,B,K),I.extent,l))}}function re($,...U){if(this.__zooming){var I=A(this,U).event($),V=$.changedTouches,te=V.length,oe,R;for(_m($),y&&clearTimeout(y),y=setTimeout(function(){y=null},b),oe=0;oe<te;++oe)R=V[oe],I.touch0&&I.touch0[2]===R.identifier?delete I.touch0:I.touch1&&I.touch1[2]===R.identifier&&delete I.touch1;if(I.touch1&&!I.touch0&&(I.touch0=I.touch1,delete I.touch1),I.touch0)I.touch0[1]=this.__zoom.invert(I.touch0[0]);else if(I.end(),I.taps===2&&(R=Yi(R,this),Math.hypot(g[0]-R[0],g[1]-R[1])<j)){var B=Dr(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return S.wheelDelta=function($){return arguments.length?(r=typeof $=="function"?$:nd(+$),S):r},S.filter=function($){return arguments.length?(e=typeof $=="function"?$:nd(!!$),S):e},S.touchable=function($){return arguments.length?(i=typeof $=="function"?$:nd(!!$),S):i},S.extent=function($){return arguments.length?(t=typeof $=="function"?$:nd([[+$[0][0],+$[0][1]],[+$[1][0],+$[1][1]]]),S):t},S.scaleExtent=function($){return arguments.length?(o[0]=+$[0],o[1]=+$[1],S):[o[0],o[1]]},S.translateExtent=function($){return arguments.length?(l[0][0]=+$[0][0],l[1][0]=+$[1][0],l[0][1]=+$[0][1],l[1][1]=+$[1][1],S):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},S.constrain=function($){return arguments.length?(n=$,S):n},S.duration=function($){return arguments.length?(d=+$,S):d},S.interpolate=function($){return arguments.length?(p=$,S):p},S.on=function(){var $=f.on.apply(f,arguments);return $===f?S:$},S.clickDistance=function($){return arguments.length?(k=($=+$)*$,S):Math.sqrt(k)},S.tapDistance=function($){return arguments.length?(j=+$,S):j},S}const pq=new Set(["CONTAINS","IMPLEMENTS","CORRESPONDS"]),hq=new Set(["REFERENCES","MENTIONS"]);function mq(e){return pq.has(e)?"skeleton":hq.has(e)?"weak":"standard"}const gq=30,rd=800,kl=500;function xq({centerNode:e,neighbors:t}){const[n,r]=_.useState(t.length>gq?"table":"graph");return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-end gap-1 mb-3",children:[u.jsx("button",{onClick:()=>r("graph"),className:`p-1.5 rounded transition-colors ${n==="graph"?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,title:"ๅŠ›ๅฏผๅ‘ๅ›พ",children:u.jsx(TR,{size:16})}),u.jsx("button",{onClick:()=>r("table"),className:`p-1.5 rounded transition-colors ${n==="table"?"bg-c4a-bg-hover text-c4a-text-primary":"text-c4a-text-muted hover:text-c4a-text-secondary"}`,title:"่กจๆ ผๆจกๅผ",children:u.jsx(MR,{size:16})})]}),n==="graph"?u.jsx(yq,{centerNode:e,neighbors:t}):u.jsx(bq,{neighbors:t})]})}function yq({centerNode:e,neighbors:t}){const n=_.useRef(null),r=Pt(),{t:i}=_e(),o=_.useCallback(d=>r(mr.entity(d)),[r]),l=_.useCallback(d=>r(mr.relation(d)),[r]);return _.useEffect(()=>{const d=n.current;if(!d)return;const p=Dr(d);p.selectAll("*").remove();const f=new Map;f.set(e.id,{id:e.id,name:e.name,type:e.type,kind:e.kind,isCenter:!0,x:rd/2,y:kl/2});for(const C of t)f.has(C.neighbor.id)||f.set(C.neighbor.id,{id:C.neighbor.id,name:C.neighbor.name,type:C.neighbor.type,kind:C.neighbor.kind,isCenter:!1});const m=Array.from(f.values()),g=t.map(C=>{const z={id:C.id,type:C.type,edgeClass:mq(C.type),source:C.direction==="outgoing"?e.id:C.neighbor.id,target:C.direction==="outgoing"?C.neighbor.id:e.id};return C.confidence!==void 0&&(z.confidence=C.confidence),z});p.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 6").attr("refX",28).attr("refY",3).attr("markerWidth",10).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M0,0L10,3L0,6").attr("fill","var(--c4a-border-subtle)");const b=p.append("g"),w=fq().scaleExtent([.3,3]).on("zoom",C=>{b.attr("transform",C.transform)});p.call(w).call(w.transform,_x);const k=b.selectAll("line.link").data(g).join("line").attr("class","link").attr("stroke",C=>C.edgeClass==="skeleton"?"var(--c4a-text-secondary)":"var(--c4a-border-subtle)").attr("stroke-width",C=>C.edgeClass==="skeleton"?2:1).attr("stroke-dasharray",C=>C.edgeClass==="weak"?"4 3":null).attr("opacity",C=>C.edgeClass==="weak"?.6:1).attr("marker-end","url(#arrow)").style("cursor","pointer").on("click",(C,z)=>l(z.id)).on("mouseenter",function(){Dr(this).attr("stroke","var(--c4a-accent)").attr("stroke-width",function(){return Number(Dr(this).attr("stroke-width"))+1})}).on("mouseleave",function(C,z){Dr(this).attr("stroke",z.edgeClass==="skeleton"?"var(--c4a-text-secondary)":"var(--c4a-border-subtle)").attr("stroke-width",z.edgeClass==="skeleton"?2:1)});k.append("title").text(C=>{const z=po(C.confidence);return z?`${C.type} ยท ${i(z.labelKey)}`:C.type});const j=b.selectAll("text.link-label").data(g).join("text").attr("class","link-label").text(C=>C.type).attr("font-family","var(--font-mono)").attr("font-size",9).attr("fill","var(--c4a-text-muted)").attr("text-anchor","middle").attr("dy",-4),S=b.selectAll("g.node").data(m,C=>C.id).join("g").attr("class","node").style("cursor","pointer").on("click",(C,z)=>o(z.id));S.append("circle").attr("r",C=>C.isCenter?24:18).attr("fill",C=>C.isCenter?"var(--c4a-accent)":"var(--c4a-bg-elevated)").attr("stroke",C=>C.isCenter?"#fff":"var(--c4a-border-default)").attr("stroke-width",C=>C.isCenter?2:1),S.append("text").text(C=>C.name.length>12?C.name.slice(0,12)+"โ€ฆ":C.name).attr("font-family","var(--font-mono)").attr("font-size",10).attr("fill","var(--c4a-text-primary)").attr("text-anchor","middle").attr("dy",C=>C.isCenter?36:30),S.append("title").text(C=>{let z=`${C.name}
125
+ type: ${C.type}`;return C.kind&&(z+=`
126
+ kind: ${C.kind}`),z});const E=q7(m).force("link",A7(g).id(C=>C.id).distance(120)).force("charge",V7().strength(-300)).force("center",l7(rd/2,kl/2)).force("collide",C7(30)).on("tick",()=>{k.attr("x1",C=>C.source.x??0).attr("y1",C=>C.source.y??0).attr("x2",C=>C.target.x??0).attr("y2",C=>C.target.y??0),j.attr("x",C=>{const z=C.source.x??0,D=C.target.x??0;return(z+D)/2}).attr("y",C=>{const z=C.source.y??0,D=C.target.y??0;return(z+D)/2}),S.attr("transform",C=>`translate(${C.x??0},${C.y??0})`)});return S.each(function(C,z){const D=Dr(this);let A=!1;D.on("mousedown.drag",P=>{P.stopPropagation(),A=!0;const T=m[z],F=d.getBoundingClientRect(),M=Q=>{if(!A)return;const re=b.attr("transform");let $=0,U=0,I=1;if(re){const oe=re.match(/translate\(([-\d.e+]+)[, ]([-\d.e+]+)\)\s*scale\(([-\d.e+]+)\)/);oe&&($=parseFloat(oe[1]),U=parseFloat(oe[2]),I=parseFloat(oe[3]))}const V=(Q.clientX-F.left)/F.width*rd,te=(Q.clientY-F.top)/F.height*kl;T.fx=(V-$)/I,T.fy=(te-U)/I,E.alpha(.3).restart()},G=()=>{A=!1,T.fx=null,T.fy=null,document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",G)};document.addEventListener("mousemove",M),document.addEventListener("mouseup",G)})}),()=>{E.stop()}},[e,t,o,l]),u.jsx("svg",{ref:n,width:"100%",height:kl,viewBox:`0 0 ${rd} ${kl}`,className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface"})}function bq({neighbors:e}){const t=Pt();return u.jsx("div",{className:"rounded border border-c4a-border-subtle overflow-auto",children:u.jsxs("table",{className:"w-full text-xs font-mono",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-c4a-border-subtle bg-c4a-bg-surface text-c4a-text-muted text-left",children:[u.jsx("th",{className:"px-3 py-2",children:"NAME"}),u.jsx("th",{className:"px-3 py-2",children:"TYPE"}),u.jsx("th",{className:"px-3 py-2",children:"KIND"}),u.jsx("th",{className:"px-3 py-2",children:"EDGE"}),u.jsx("th",{className:"px-3 py-2",children:"DIRECTION"})]})}),u.jsx("tbody",{children:e.map(n=>u.jsxs("tr",{className:"border-b border-c4a-border-subtle hover:bg-c4a-bg-hover cursor-pointer transition-colors",onClick:()=>t(mr.entity(n.neighbor.id)),children:[u.jsx("td",{className:"px-3 py-2 text-c4a-accent",children:n.neighbor.name}),u.jsx("td",{className:"px-3 py-2 text-c4a-text-secondary",children:n.neighbor.type}),u.jsx("td",{className:"px-3 py-2 text-c4a-text-muted",children:n.neighbor.kind??"โ€”"}),u.jsx("td",{className:"px-3 py-2",children:u.jsx(Yt,{variant:"accent",children:n.type})}),u.jsx("td",{className:"px-3 py-2 text-c4a-text-muted",children:n.direction==="outgoing"?"โ†’":"โ†"})]},n.id))})]})})}function vq({entityId:e,centerNode:t}){const{t:n}=_e(),[r,i]=_.useState([]),[o,l]=_.useState(!1);return _.useEffect(()=>{Pe.get(`/entities/${e}/neighbors`).then(d=>{const p=[];for(const f of d.neighbors)for(const m of f.via)p.push({id:m.relation_id,type:m.type,direction:m.direction,neighbor:{id:f.id,name:f.name,type:f.type,...f.kind?{kind:f.kind}:{}},...m.weight!==void 0?{weight:m.weight}:{},...m.confidence!==void 0?{confidence:m.confidence}:{}});i(p),l(!0)}).catch(()=>l(!0))},[e]),o?r.length===0?u.jsx(At,{title:n("common.empty.entity_neighbors.title"),description:n("common.empty.entity_neighbors.description")}):u.jsx(xq,{centerNode:t,neighbors:r}):u.jsx("p",{className:"text-sm text-c4a-text-muted",children:n("common.loading")})}const _q={Component:"๐Ÿ—",SoR:"๐Ÿ“‹",Product:"๐Ÿ“ฆ",Container:"๐Ÿ“‚",Contract:"๐Ÿ“",Epic:"๐ŸŽฏ"};function wq({entityId:e}){const{t}=_e(),[n,r]=_.useState(null),[i,o]=_.useState(null),[l,d]=_.useState("overview");if(_.useEffect(()=>{e&&(o(null),r(null),d("overview"),Pe.get(`/entities/${e}`).then(r).catch(k=>{k instanceof kn&&k.status===404?o("not_found"):o("load_failed")}))},[e]),i)return u.jsx(At,{title:t(`common.error.${i}`),description:t(`common.error.${i}_description`)});if(!n)return u.jsx("div",{className:"flex items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})});const p=_q[n.type]??"๐Ÿ”น",f=n._links,m=f?.relations?.count,g=f?.contents?.count,y=f?.referrers?.count,{atoms:b,...w}=n.data;return u.jsxs("div",{className:"flex flex-1 flex-col",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-xl",children:p}),u.jsx("h2",{className:"font-mono text-xl font-bold text-c4a-text-primary",children:n.name})]}),u.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[u.jsx(Yt,{children:n.type}),n.kind&&u.jsx(Yt,{variant:"muted",children:n.kind})]}),(n.perspective||n.scope)&&u.jsxs("div",{className:"mt-1 flex flex-wrap items-baseline gap-4 text-xs text-c4a-text-muted",children:[n.perspective&&u.jsxs("span",{children:[t("entity.detail.perspective"),":"," ",u.jsx("span",{className:"text-c4a-text-secondary",children:n.perspective})]}),n.scope&&u.jsxs("span",{children:[t("entity.detail.scope"),":"," ",u.jsx("span",{className:"text-c4a-text-secondary",children:n.scope})]})]}),u.jsxs(cS,{value:l,onChange:k=>d(k),children:[u.jsx("div",{className:"mt-3",children:u.jsxs(uS,{children:[u.jsx(ra,{value:"overview",children:t("entity.detail.tab.overview")}),u.jsxs(ra,{value:"relations",children:[t("entity.detail.tab.relations"),m!==void 0&&` (${m})`]}),u.jsxs(ra,{value:"contents",children:[t("entity.detail.tab.contents"),g!==void 0&&` (${g})`]}),u.jsxs(ra,{value:"referrers",children:[t("entity.detail.tab.referrers"),y!==void 0&&` (${y})`]}),u.jsx(ra,{value:"neighbors",children:t("entity.detail.tab.neighbors")})]})}),u.jsxs("div",{className:"mt-4 flex-1",children:[u.jsx(aa,{value:"overview",children:u.jsx(HP,{data:w,atoms:b})}),u.jsx(aa,{value:"relations",children:u.jsx(a7,{entityId:n.id})}),u.jsx(aa,{value:"contents",children:u.jsx(s7,{entityId:n.id})}),u.jsx(aa,{value:"referrers",children:u.jsx(o7,{entityId:n.id})}),u.jsx(aa,{value:"neighbors",children:u.jsx(vq,{entityId:n.id,centerNode:{id:n.id,name:n.name,type:n.type,...n.kind?{kind:n.kind}:{}}})})]})]})]})}const F2={Component:"๐Ÿ—",SoR:"๐Ÿ“‹",Product:"๐Ÿ“ฆ",Container:"๐Ÿ“‚",Contract:"๐Ÿ“",Epic:"๐ŸŽฏ"};function kq(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return e}}function Sq({relationId:e}){const{t}=_e(),n=Pt(),r=ho(),[i,o]=_.useState(null),[l,d]=_.useState(null),[p,f]=_.useState([]),[m,g]=_.useState(!1);_.useEffect(()=>{e&&(d(null),o(null),f([]),g(!1),Pe.get(`/relations/${e}`).then(k=>{o(k),Pe.get(`/relations/${e}/contents`).then(j=>{f(j.contents??[]),g(!0)}).catch(()=>g(!0))}).catch(k=>{k instanceof kn&&k.status===404?d("not_found"):d("load_failed")}))},[e]);const y=k=>{const j=F2[k.type]??"๐Ÿ”น";r?.active?r.navigate("entity",k.id,k.name,j):n(mr.entity(k.id))};if(l)return u.jsx(At,{title:t(`common.error.${l}`),description:t(`common.error.${l}_description`)});if(!i)return u.jsx("div",{className:"flex items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:t("common.loading")})});const b=po(i.confidence),w=i.metadata?._source==="field_sync"?t("relation.detail.source_field_sync"):t("relation.detail.source_explicit");return u.jsxs("div",{className:"flex flex-1 flex-col",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h2",{className:"font-mono text-xl font-bold text-c4a-text-primary",children:i.type}),b&&u.jsx(Yt,{variant:b.variant,tooltip:`${b.value.toFixed(2)} โ€” ${t(b.tipKey)}`,children:t(b.labelKey)})]}),u.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-4",children:[u.jsx(zw,{label:t("relation.detail.from"),entity:i.from,onClick:()=>y(i.from)}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-c4a-text-muted text-lg",children:"โ†’"}),u.jsx(Yt,{variant:"accent",children:i.type}),u.jsx("span",{className:"text-c4a-text-muted text-lg",children:"โ†’"})]}),u.jsx(zw,{label:t("relation.detail.to"),entity:i.to,onClick:()=>y(i.to)})]}),!!i.data.description&&u.jsxs("div",{className:"mt-4",children:[u.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.description")}),u.jsx("p",{className:"text-sm text-c4a-text-secondary",children:String(i.data.description)})]}),Object.keys(i.data).filter(k=>k!=="description").length>0&&u.jsxs("div",{className:"mt-4",children:[u.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.data")}),u.jsx("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3",children:u.jsx(hc,{data:Object.fromEntries(Object.entries(i.data).filter(([k])=>k!=="description")),defaultExpanded:2})})]}),m&&p.length>0&&u.jsxs("div",{className:"mt-4",children:[u.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.source_refs")}),u.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:p.map(k=>u.jsx(m2,{content:{hash_id:k.hash_id,...k.source_path?{source_path:k.source_path}:{},...k.span?{span:k.span}:{}}},k.hash_id))})]}),u.jsxs("div",{className:"mt-4",children:[u.jsx("h3",{className:"font-mono text-xs uppercase text-c4a-text-muted mb-1.5",children:t("relation.detail.meta")}),u.jsxs("div",{className:"flex flex-wrap gap-4 text-xs",children:[u.jsxs("span",{className:"text-c4a-text-muted",children:[t("relation.detail.source_label"),":",u.jsx("span",{className:"text-c4a-text-secondary ml-1",children:w})]}),i.metadata?.created_at&&u.jsxs("span",{className:"text-c4a-text-muted",children:[t("content.detail.created_at"),":",u.jsx("span",{className:"text-c4a-text-secondary ml-1",children:kq(String(i.metadata.created_at))})]})]})]})]})}function zw({label:e,entity:t,onClick:n}){const r=F2[t.type]??"๐Ÿ”น";return u.jsxs("div",{className:"rounded border border-c4a-border-subtle bg-c4a-bg-surface p-3 cursor-pointer hover:border-c4a-accent transition-colors min-w-[160px]",onClick:n,children:[u.jsx("p",{className:"text-[10px] font-mono uppercase text-c4a-text-muted mb-1",children:e}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{children:r}),u.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:t.name})]}),u.jsxs("div",{className:"mt-1 flex items-center gap-1",children:[u.jsx(Yt,{children:t.type}),t.kind&&u.jsx(Yt,{variant:"muted",children:t.kind})]})]})}const jq=[1,2,3];function Nq({functionName:e,sourceIds:t}){const{t:n}=_e(),[r,i]=_.useState("callers"),[o,l]=_.useState(1),{data:d,loading:p,error:f,warnings:m}=Gn(k=>k.callGraph),g=Gn(k=>k.fetchCallGraph),y=Gn(k=>k.resetQuery);_.useEffect(()=>{if(t?.length)return g({sourceIds:t,functionName:e,direction:r,maxDepth:o}),()=>y("callGraph")},[e,r,o,t?.join(",")]);const b=_.useCallback(k=>{i(k)},[]),w=d??[];return u.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsxs("h3",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary",children:[n("query.call_graph.title"),": ",e.includes("#")?e.slice(e.indexOf("#")+1):e]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("div",{className:"flex gap-1",children:[u.jsx(wm,{label:n("query.call_graph.callers"),active:r==="callers",onClick:()=>b("callers")}),u.jsx(wm,{label:n("query.call_graph.callees"),active:r==="callees",onClick:()=>b("callees")})]}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:[n("query.call_graph.depth"),":"]}),jq.map(k=>u.jsx(wm,{label:String(k),active:o===k,onClick:()=>l(k)},k))]})]})]}),m.length>0&&u.jsx(cf,{warnings:m}),p?u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx(fa,{labelKey:"query.symbol.loading"})}):f?u.jsx(At,{title:n("query.call_graph.empty"),description:f}):w.length===0?u.jsx(At,{title:n("query.call_graph.empty"),description:n("query.call_graph.empty_desc",{direction:n(`query.call_graph.${r}`)})}):u.jsx("div",{className:"overflow-y-auto c4a-scrollbar",children:w.map((k,j)=>u.jsx(Cq,{entry:k,direction:r},`${k.caller}-${k.callee}-${j}`))})]})}function wm({label:e,active:t,onClick:n}){return u.jsx("button",{type:"button",className:`rounded px-2.5 py-1 font-mono text-[11px] uppercase tracking-tight cursor-pointer ${t?"bg-c4a-accent text-white":"bg-c4a-bg-surface text-c4a-text-muted hover:bg-c4a-bg-hover"}`,onClick:n,children:e})}function Cq({entry:e,direction:t}){const n=t==="callers"?e.caller:e.callee,r=(e.depth-1)*16,i=n.indexOf("#"),o=i>=0?n.slice(i+1):n,l=i>=0?n.slice(0,i):null;return u.jsxs("div",{className:"flex items-center gap-2 px-3 h-8 border-b border-c4a-border-subtle last:border-b-0 hover:bg-c4a-bg-hover/50",style:{paddingLeft:r+12},children:[u.jsx("span",{className:"shrink-0 w-4 text-center font-mono text-xs text-c4a-text-muted",children:"ฦ’"}),u.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:o}),l&&u.jsxs("span",{className:"font-mono text-xs text-c4a-text-muted truncate",children:[l,e.line!=null?`:${e.line}`:""]}),e.isExternal&&u.jsx("span",{className:"font-mono text-[10px] uppercase text-c4a-text-muted bg-c4a-bg-active px-1 py-0.5 rounded-sm shrink-0",children:"ext"})]})}function Eq({filePath:e,sourceIds:t}){const{t:n}=_e(),[r,i]=_.useState("forward"),{data:o,loading:l,error:d,warnings:p}=Gn(S=>S.imports),f=Gn(S=>S.fetchImports),m=Gn(S=>S.resetQuery),g=Fa(S=>S.openTab);_.useEffect(()=>{if(t?.length)return f({sourceIds:t,filePath:e,direction:r}),()=>m("imports")},[e,r,t?.join(",")]);const y=_.useCallback(S=>{i(S)},[]),b=_.useCallback(S=>{if(!S.hashId)return;const E=r==="forward"?S.to:S.from;g({id:`content:${S.hashId}`,type:"content",resourceId:S.hashId,label:E,meta:{sourcePath:E}})},[r,g]),w=o??[],{external:k,internal:j}=_.useMemo(()=>{const S=[],E=[];for(const C of w)C.isExternal?S.push(C):E.push(C);return{external:S,internal:E}},[w]);return u.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsxs("h3",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary truncate",children:[n("query.import_deps.title"),": ",e]}),u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsx(Iw,{label:n("query.import_deps.forward"),active:r==="forward",onClick:()=>y("forward")}),u.jsx(Iw,{label:n("query.import_deps.reverse"),active:r==="reverse",onClick:()=>y("reverse")})]})]}),p.length>0&&u.jsx(cf,{warnings:p}),l?u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx(fa,{labelKey:"query.symbol.loading"})}):d?u.jsx(At,{title:n("query.import_deps.empty"),description:d}):w.length===0?u.jsx(At,{title:n("query.import_deps.empty"),description:n("query.import_deps.empty")}):u.jsxs("div",{className:"overflow-y-auto c4a-scrollbar",children:[k.length>0&&u.jsx($w,{title:n("query.import_deps.external"),count:k.length,entries:k,isExternal:!0,direction:r}),j.length>0&&u.jsx($w,{title:n("query.import_deps.internal"),count:j.length,entries:j,isExternal:!1,direction:r,onOpen:b})]})]})}function Iw({label:e,active:t,onClick:n}){return u.jsx("button",{type:"button",className:`rounded px-2.5 py-1 font-mono text-[11px] uppercase tracking-tight cursor-pointer ${t?"bg-c4a-accent text-white":"bg-c4a-bg-surface text-c4a-text-muted hover:bg-c4a-bg-hover"}`,onClick:n,children:e})}function $w({title:e,count:t,entries:n,isExternal:r,direction:i,onOpen:o}){return u.jsxs("div",{className:"mb-4",children:[u.jsxs("div",{className:"font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted mb-2",children:[e," (",t,")"]}),n.map((l,d)=>u.jsx(Aq,{entry:l,isExternal:r,direction:i,onOpen:o},`${l.from}-${l.to}-${d}`))]})}function Aq({entry:e,isExternal:t,direction:n,onOpen:r}){const i=t?Hr:Mg,o=n==="forward"?e.to:e.from,l=e.symbols.join(", "),d=!t&&!!e.hashId&&!!r;return u.jsxs("div",{className:`flex items-center gap-2 px-3 h-8 border-b border-c4a-border-subtle last:border-b-0 hover:bg-c4a-bg-hover/50 ${d?"cursor-pointer":""}`,onClick:d?()=>r(e):void 0,children:[u.jsx(i,{size:13,className:"shrink-0 text-c4a-text-muted"}),u.jsx("span",{className:`font-mono text-sm truncate ${d?"text-c4a-accent hover:underline":"text-c4a-text-primary"}`,children:o}),l&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-c4a-text-muted shrink-0",children:"โ†’"}),u.jsx("span",{className:"font-mono text-xs text-c4a-text-secondary truncate",children:l})]})]})}function Tq({className:e,sourceIds:t}){const{t:n}=_e(),[r,i]=_.useState("descendants"),{data:o,loading:l,error:d,warnings:p}=Gn(j=>j.inheritance),f=Gn(j=>j.fetchInheritance),m=Gn(j=>j.resetQuery),g=Ot(j=>j.rootSources),y=_.useMemo(()=>g.filter(j=>j.source_type==="code"&&(j.index_status==="indexed"||j.index_status==="stale")).map(j=>j.id),[g]),b=y.length>0?y:t??[];_.useEffect(()=>{if(b.length)return f({sourceIds:b,className:e,direction:r}),()=>m("inheritance")},[e,r,b.join(",")]);const w=_.useCallback(j=>{i(j)},[]),k=o??[];return u.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsxs("h3",{className:"font-mono text-xs font-semibold uppercase tracking-tight text-c4a-text-secondary truncate",children:[n("query.inheritance.title"),": ",e.includes("#")?e.slice(e.indexOf("#")+1):e]}),u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsx(Bw,{label:n("query.inheritance.descendants"),active:r==="descendants",onClick:()=>w("descendants")}),u.jsx(Bw,{label:n("query.inheritance.ancestors"),active:r==="ancestors",onClick:()=>w("ancestors")})]})]}),p.length>0&&u.jsx(cf,{warnings:p}),l?u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx(fa,{labelKey:"query.symbol.loading"})}):d?u.jsx(At,{title:n("query.inheritance.empty"),description:d}):k.length===0?u.jsx(At,{title:n("query.inheritance.empty"),description:n("query.inheritance.empty")}):u.jsxs("div",{className:"overflow-y-auto c4a-scrollbar",children:[k.map((j,S)=>u.jsx(Rq,{entry:j,direction:r},`${j.child}-${j.parent}-${S}`)),b.length>1&&u.jsx("div",{className:"mt-3 px-3 font-mono text-[11px] text-c4a-text-muted",children:n("query.inheritance.cross_source",{count:b.length})})]})]})}function Bw({label:e,active:t,onClick:n}){return u.jsx("button",{type:"button",className:`rounded px-2.5 py-1 font-mono text-[11px] uppercase tracking-tight cursor-pointer ${t?"bg-c4a-accent text-white":"bg-c4a-bg-surface text-c4a-text-muted hover:bg-c4a-bg-hover"}`,onClick:n,children:e})}function Rq({entry:e,direction:t}){const n=t==="descendants"?e.child:e.parent;return u.jsxs("div",{className:"flex items-center gap-2 px-3 h-8 border-b border-c4a-border-subtle last:border-b-0 hover:bg-c4a-bg-hover/50",children:[u.jsx("span",{className:"shrink-0 w-4 text-center font-mono text-xs text-c4a-text-muted",children:"โ– "}),u.jsx("span",{className:"font-mono text-sm text-c4a-text-primary truncate",children:n}),u.jsx(Yt,{variant:"muted",children:e.kind}),u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted truncate",children:e.sourceId})]})}function Lq({anchor:e,children:t}){const{t:n}=_e(),r=Fa(w=>w.tabs),i=Fa(w=>w.activeTabId),o=Fa(w=>w.mode),{reset:l,setAnchor:d,activateTab:p,closeTab:f,closeAll:m,toggleMode:g}=Fa.getState();_.useEffect(()=>(l(),d({id:`${e.type}:${e.resourceId}`,type:e.type,resourceId:e.resourceId,label:e.label,...e.icon!=null&&{icon:e.icon}}),()=>l()),[e.id]);const y=r.find(w=>w.id===i),b=r.length>1;return u.jsx(V5,{children:u.jsxs("div",{className:"flex flex-1 flex-col",children:[u.jsx("div",{className:"flex flex-1 flex-col",children:!y||y.isAnchor?t:u.jsx(Dq,{tab:y})}),b&&u.jsxs("div",{className:"fixed bottom-0 left-0 right-0 z-40 flex h-6 items-center border-t border-c4a-border-subtle bg-c4a-bg-surface md:left-[220px]",children:[u.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:r.map(w=>{const k=w.id===i;return u.jsxs("div",{className:`flex min-w-0 shrink items-center gap-1 px-2 h-5 font-mono text-[10px] uppercase tracking-tight truncate cursor-pointer border-r border-c4a-border-subtle ${k?"bg-c4a-bg-base text-c4a-text-primary border-b border-b-c4a-accent":"bg-c4a-bg-surface text-c4a-text-muted hover:bg-c4a-bg-hover"}`,onClick:()=>p(w.id),children:[w.icon&&u.jsx("span",{className:"shrink-0 text-[10px]",children:w.icon}),u.jsx("span",{className:"truncate",children:w.label}),!w.isAnchor&&u.jsx("button",{type:"button",className:"ml-0.5 shrink-0 text-c4a-text-muted hover:text-c4a-text-primary",onClick:j=>{j.stopPropagation(),f(w.id)},children:u.jsx(Vr,{className:"h-2 w-2"})})]},w.id)})}),u.jsxs("div",{className:"flex items-center gap-0.5 px-1 shrink-0",children:[u.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded-sm text-c4a-text-muted hover:text-c4a-text-primary hover:bg-c4a-bg-hover cursor-pointer",title:n(o==="append"?"explorer.mode.append_tooltip":"explorer.mode.replace_tooltip"),onClick:g,children:u.jsx("span",{className:"text-[10px]",children:o==="append"?"๐Ÿ“‘":"๐Ÿ“Œ"})}),u.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded-sm text-c4a-text-muted hover:text-c4a-text-primary hover:bg-c4a-bg-hover cursor-pointer",title:n("explorer.close_all"),onClick:m,children:u.jsx(Vr,{className:"h-2.5 w-2.5"})})]})]})]})})}function Dq({tab:e}){switch(e.type){case"content":return u.jsx(h2,{hashId:e.resourceId,sourcePath:e.meta?.sourcePath??e.label,paragraphMeta:e.meta});case"entity":return u.jsx(wq,{entityId:e.resourceId});case"relation":return u.jsx(Sq,{relationId:e.resourceId});case"call-graph":return u.jsx(Nq,{functionName:e.resourceId,sourceIds:e.meta?.sourceIds});case"import-deps":return u.jsx(Eq,{filePath:e.resourceId,sourceIds:e.meta?.sourceIds});case"inheritance":return u.jsx(Tq,{className:e.resourceId,sourceIds:e.meta?.sourceIds});default:return null}}function Pw(e){if(!e)return"";try{const t=new Date(e),n=new Date,r=t.getFullYear()===n.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),l=String(t.getHours()).padStart(2,"0"),d=String(t.getMinutes()).padStart(2,"0");return r?`${i}-${o} ${l}:${d}`:`${t.getFullYear()}-${i}-${o} ${l}:${d}`}catch{return""}}function Oq({versions:e,currentHashId:t,onChange:n}){const[r,i]=_.useState(!1),o=_.useRef(null),l=_.useRef(null),d=_.useCallback(y=>{o.current&&!o.current.contains(y.target)&&i(!1)},[]);_.useEffect(()=>{if(r)return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[r,d]);const p=_.useCallback(()=>{l.current&&(clearTimeout(l.current),l.current=null),e.length>1&&i(!0)},[e.length]),f=_.useCallback(()=>{l.current=setTimeout(()=>i(!1),150)},[]),m=e.find(y=>y.hash_id===t)??e[0],g=Pw(m?.created_at);return u.jsxs("div",{ref:o,className:"relative",onMouseEnter:p,onMouseLeave:f,children:[u.jsxs("button",{type:"button",onClick:e.length>1?()=>i(y=>!y):void 0,className:`flex h-7 items-center gap-1.5 rounded-sm border border-c4a-border-default px-2 font-mono text-[10px] text-c4a-text-secondary transition-colors ${e.length>1?"cursor-pointer hover:border-c4a-border-strong hover:bg-c4a-bg-hover hover:text-c4a-text-primary":""}`,children:[u.jsxs("span",{children:[u.jsx("span",{className:"font-extrabold",children:m?.version_label}),g?` ${g}`:""]}),e.length>1&&u.jsx(Gt,{size:12,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${r?"rotate-90":""}`})]}),r&&u.jsx("div",{className:"absolute right-0 top-full z-10 mt-1 min-w-full rounded-sm border border-c4a-border-default bg-c4a-bg-elevated shadow-c4a-md max-h-40 overflow-y-auto c4a-scrollbar",children:e.map(y=>{const b=y.hash_id===t,w=Pw(y.created_at);return u.jsx("div",{className:`flex cursor-pointer items-center px-2 py-1 font-mono text-[10px] transition-colors hover:bg-c4a-bg-hover ${b?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,onClick:()=>{n(y.hash_id),i(!1)},children:u.jsxs("span",{children:[u.jsx("span",{className:"font-extrabold",children:y.version_label}),w?` ${w}`:""]})},y.hash_id)})})]})}function Fw(e){if(!e)return"";try{const t=new Date(e),n=new Date,r=t.getFullYear()===n.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),l=String(t.getHours()).padStart(2,"0"),d=String(t.getMinutes()).padStart(2,"0");return r?`${i}-${o} ${l}:${d}`:`${t.getFullYear()}-${i}-${o} ${l}:${d}`}catch{return""}}function Mq({commits:e,currentHashId:t,onChange:n}){const[r,i]=_.useState(!1),o=_.useRef(null),l=_.useRef(null),d=_.useCallback(y=>{o.current&&!o.current.contains(y.target)&&i(!1)},[]);_.useEffect(()=>{if(r)return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[r,d]);const p=_.useCallback(()=>{l.current&&(clearTimeout(l.current),l.current=null),e.length>1&&i(!0)},[e.length]),f=_.useCallback(()=>{l.current=setTimeout(()=>i(!1),150)},[]),m=e.find(y=>y.hash_id===t)??e[0];if(!m)return null;const g=Fw(m.created_at);return u.jsxs("div",{ref:o,className:"relative",onMouseEnter:p,onMouseLeave:f,children:[u.jsxs("button",{type:"button",onClick:e.length>1?()=>i(y=>!y):void 0,className:`flex h-7 items-center gap-1.5 rounded-sm border border-c4a-border-default px-2 font-mono text-[10px] text-c4a-text-secondary transition-colors ${e.length>1?"cursor-pointer hover:border-c4a-border-strong hover:bg-c4a-bg-hover hover:text-c4a-text-primary":""}`,children:[u.jsxs("span",{children:[u.jsx("span",{className:"font-extrabold",children:m.branch})," ยท ",m.commit_hash.slice(0,7),g?` ยท ${g}`:""]}),e.length>1&&u.jsx(Gt,{size:12,className:`shrink-0 text-c4a-text-muted transition-transform duration-200 ${r?"rotate-90":""}`})]}),r&&u.jsx("div",{className:"absolute right-0 top-full z-10 mt-1 min-w-full rounded-sm border border-c4a-border-default bg-c4a-bg-elevated shadow-c4a-md max-h-40 overflow-y-auto c4a-scrollbar",children:e.map(y=>{const b=y.hash_id===t,w=Fw(y.created_at);return u.jsx("div",{className:`flex cursor-pointer items-center px-2 py-1 font-mono text-[10px] transition-colors hover:bg-c4a-bg-hover ${b?"text-c4a-accent":"text-c4a-text-secondary hover:text-c4a-text-primary"}`,onClick:()=>{n(y.hash_id),i(!1)},children:u.jsxs("span",{children:[u.jsx("span",{className:"font-extrabold",children:y.branch})," ยท ",y.commit_hash.slice(0,7),w?` ยท ${w}`:""]})},y.hash_id)})})]})}const Uw={none:"bg-c4a-bg-active text-c4a-text-secondary",indexing:"bg-c4a-accent/10 text-c4a-accent animate-pulse",indexed:"bg-c4a-success text-white",stale:"bg-c4a-warning/10 text-c4a-warning"};function zq({sourceId:e,status:t,loading:n,onDeleted:r,isDaemonOnline:i,indexModules:o,isCloudDoc:l}){const{t:d}=_e(),[p,f]=_.useState(!1),[m,g]=_.useState(null),y=Ot(A=>A.triggerIndex),b=Ot(A=>A.deleteIndex),w=_.useCallback((A,P)=>{console.error(`[IndexBadge] ${A}
127
+ `,P),g({title:A,detail:P})},[]),k=_.useCallback(async()=>{if(i)try{const P=(t==="indexed"||t==="stale")&&o?o.map(F=>({...F,force:!0})):o;(await y(e,P)).status==="skipped"&&oa(d("index.code.skipped"))}catch(A){const P=A instanceof kn?`POST /sources/${e}/index
128
+ HTTP ${A.status} ${A.code}
129
+ ${A.message}`:`POST /sources/${e}/index
130
+ ${String(A)}`;w(d("index.code.error"),P)}},[e,i,y,o,t,d,w]),j=_.useCallback(async()=>{if(window.confirm(d("index.code.delete_confirm"))){f(!0);try{await b(e,o),oa(d("index.code.delete_success")),r()}catch(A){const P=A instanceof kn?`DELETE /sources/${e}/index
131
+ HTTP ${A.status} ${A.code}
132
+ ${A.message}`:`DELETE /sources/${e}/index
133
+ ${String(A)}`;w(d("index.code.delete_failed"),P)}finally{f(!1)}}},[e,b,o,d,r,w]),S=_.useCallback(()=>{(t==="none"||t==="indexed"||t==="stale")&&k()},[t,k]),E=(()=>{switch(t){case"indexing":return d("index.code.indexing");case"indexed":return d("sources.status.indexed");case"stale":return d("sources.status.stale");default:return d("sources.status.none")}})(),C=(()=>{switch(t){case"none":return d("index.code.go_index");case"indexed":return d("index.code.reindex");case"stale":return d("index.code.reindex");default:return""}})(),z=t!=="indexing",D=!i;return n?null:u.jsxs(u.Fragment,{children:[t==="indexing"?u.jsx("span",{className:`rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${Uw.indexing}`,children:E}):u.jsxs("span",{className:`group/idx relative inline-block rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${Uw[t]} ${z&&!D?"cursor-pointer hover:bg-c4a-accent hover:text-white":""} ${D?"opacity-40 cursor-not-allowed":""}`,onClick:z&&!D?S:void 0,title:D?d("daemon.offline_tooltip"):void 0,children:[u.jsx("span",{className:z&&!D?"group-hover/idx:hidden":"",children:E}),z&&!D&&u.jsx("span",{className:"hidden group-hover/idx:inline",children:C})]}),t==="indexed"&&!p&&!l&&u.jsx("span",{className:"cursor-pointer rounded-sm p-0.5 text-c4a-text-muted hover:bg-c4a-error/10 hover:text-c4a-error",onClick:j,title:d("index.code.delete"),children:u.jsx(Yd,{size:12})}),p&&u.jsx("span",{className:"inline-flex items-center gap-1 font-mono text-[10px] text-c4a-text-muted",children:u.jsx(sn,{size:10,className:"animate-spin"})}),m&&u.jsx(uc,{error:m,onClose:()=>g(null)})]})}function Iq(e,t){for(const n of t)if(e===n||e.startsWith(n+"/")||n.startsWith(e+"/"))return!0;return!1}function $q(){const{t:e}=_e(),{sourceUuid:t}=fo(),[n]=sc(),r=n.get("path")||"",i=Pt(),{currentRoot:o,loading:l,error:d,fetchRootSource:p}=Ot(),f=an(ji(ss)),[m,g]=_.useState(null),[y,b]=_.useState([]),[w,k]=_.useState(!0),[j,S]=_.useState(!1),[E,C]=_.useState(""),[z,D]=_.useState([]),A=o?.library_id,P=f.find(de=>de.id===A),T=P?.type==="cloud"?!0:P?.is_online??!1,F=Ot(de=>o?de.indexingTasks.get(o.id):void 0),M=_.useMemo(()=>{if(F)return!F.modules||!r||Iq(r,F.modules)?F:void 0},[F,r]),G=_.useMemo(()=>{if(o?.source_type==="code")return!0;if(!o?.tree)return!1;const de=ke=>{for(const ge of ke)if(ge.kind==="source"&&ge.source_type==="code"||ge.children&&de(ge.children))return!0;return!1};return de(o.tree)},[o]),[Q,re]=_.useState(!1);_.useEffect(()=>{t&&p(t).catch(()=>{})},[t,p]),_.useEffect(()=>{S(!1),k(!0),re(!1)},[t,r]),_.useEffect(()=>{if(!o?.id||M)return;let de=!1;return Pe.get(`/sources/${o.id}/index/status`).then(ke=>{de||re(!!ke.is_stale)}).catch(()=>{}),()=>{de=!0}},[o?.id,M]);const $=_.useRef(null);_.useEffect(()=>{!o?.id||M||$.current!==o.id&&($.current=o.id,Pe.get(`/sources/${o.id}/index/status`).then(de=>{if(de.indexing){const ke=de.progress?.stage??"scanning",ge=de.progress?.percent??0;Ot.getState().updateIndexProgress({sourceId:o.id,stage:ke,progress:ge,modules:de.modules_scope??void 0})}}).catch(()=>{}))},[o?.id,M]);const U=_.useMemo(()=>o?r?lc(o.tree,r):o.kind==="source"?{path:"",kind:o.kind,source_type:o.source_type,name:o.name,metadata:o.metadata,index_status:o.index_status}:null:null,[o,r]),I=P,V=o?.id,te=o?.kind==="source"&&!r,oe=_.useCallback(async de=>{if(!V||!U){k(!1),S(!0);return}if(!de&&U.index_status!=="indexed"&&U.index_status!=="stale"){g(null),b([]),k(!1),S(!0);return}const ke=te?"":r||U.path;if(ke===void 0){k(!1),S(!0);return}k(!0),g(null),b([]);try{const ge=await Pe.get(`/sources/${V}/files`,{path:ke});g(ge.hash_id),C(ge.hash_id);try{const we=await Pe.get(`/sources/${V}/files/versions`,{path:ke});b(we.versions??[])}catch{b([{version:ge.version,version_label:ge.version_label,hash_id:ge.hash_id,created_at:ge.created_at??null}])}}catch(ge){ge instanceof kn&&ge.status===404&&(g(null),b([]))}finally{k(!1),S(!0)}},[V,U,r,te]);_.useEffect(()=>{oe()},[oe]);const R=_.useRef(!1);_.useEffect(()=>{const de=R.current,ke=!!M;R.current=ke,de&&!ke&&(V?p(V).then(()=>oe(!0)).catch(()=>{}):oe(!0))},[M,oe,V,p]),_.useEffect(()=>{const de=o?.metadata,ke=de?.pinned_branch?String(de.pinned_branch):"main";if(y.length>0&&U?.source_type==="code"){const ge=y.map(we=>({hash_id:we.hash_id,branch:ke,commit_hash:we.version_label,created_at:we.created_at??null}));D(ge)}else de?.pinned_hash&&de?.pinned_branch?D([{hash_id:E||m||"",branch:String(de.pinned_branch),commit_hash:String(de.pinned_hash),created_at:o?.updated_at??null}]):D([])},[o,y,U?.source_type,E,m]);const B=U?.metadata,K=U?.source_type==="code"||!U?.source_type&&G,O=U?.name??o?.name??"",se=U?.source_type??null,ie=_.useMemo(()=>{if(U){if(K){if(!r)return;const de=r.includes("/")?r.split("/").slice(0,-1).join("/"):".";return de==="."?void 0:[{path:de}]}return r?[{path:r}]:[{path:"."}]}},[U,K,r]),pe=_.useMemo(()=>{if(!o||!I)return[];const de=o.kind==="source"&&!r,ke=[{label:I.is_default?e("sources.library.default_cloud_name"):I.name,to:`/studio/sources/${I.id}`},{label:o.name,...de?{}:{to:`/studio/sources/${I.id}?rootId=${o.id}`}}];if(r){const ge=Nl(o.tree,r);for(let we=0;we<ge.length-1;we++){const Xe=ge[we];ke.push({label:Xe.name,to:`/studio/sources/${I.id}?rootId=${o.id}&path=${encodeURIComponent(Xe.path)}`})}ge.length>0&&ke.push({label:ge[ge.length-1].name})}return ke},[o,I,r,e]);if(!l&&d)return u.jsx("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:u.jsx(At,{fullPage:!0,title:e("sources.detail.not_found_title"),description:e("sources.detail.not_found_desc"),action:u.jsx("button",{className:"rounded bg-c4a-accent px-4 py-2 text-sm font-medium text-white hover:bg-c4a-accent/90",onClick:()=>i("/studio/sources"),children:e("common.back")})})});if(l||!o||!U)return u.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:[u.jsx(Ha,{segments:[]}),u.jsxs("div",{className:"mt-3 mb-3 flex items-center gap-2",children:[u.jsx("div",{className:"h-5 w-5 shrink-0 animate-pulse rounded bg-c4a-bg-hover"}),u.jsx("div",{className:"h-6 w-56 animate-pulse rounded bg-c4a-bg-hover"})]}),u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx(sn,{size:24,className:"animate-spin text-c4a-text-muted"})})]});const Ee=m!==null&&!w,Ie=te?U?.name??"":r||U?.path||U?.name||"",Ue=M&&!M.terminalState?"indexing":M?.terminalState==="done"?"indexed":j?Ee?Q?"stale":"indexed":"none":U?.index_status==="indexed"?"indexed":U?.index_status==="stale"?"stale":"none",be=!!M;return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs("div",{className:"shrink-0 px-4 pt-4 md:px-6 md:pt-6",children:[u.jsx(Ha,{segments:pe}),u.jsxs("div",{className:"mt-3 mb-3 flex flex-wrap items-end gap-x-3 gap-y-2",children:[u.jsxs("div",{className:"flex w-full items-center gap-2 md:w-auto",children:[K?u.jsx(Hr,{size:20,className:"shrink-0 text-c4a-accent"}):u.jsx(Vn,{size:20,className:"shrink-0 text-c4a-accent"}),u.jsx("h1",{className:"mb-[0.125rem] min-w-0 truncate font-mono text-xl font-bold leading-none text-c4a-text-primary",title:O,children:O})]}),V&&u.jsx(zq,{sourceId:V,status:Ue,loading:!j&&w&&U?.index_status!=="indexed",onDeleted:()=>{g(null),C(""),b([]),V&&p(V).catch(()=>{})},isDaemonOnline:T,indexModules:ie,isCloudDoc:P?.type==="cloud"&&!K}),u.jsxs("span",{className:"group relative cursor-default",children:[u.jsx(Yt,{variant:"muted",children:e(se==="code"?"sources.type.code":"sources.type.doc")}),u.jsx("div",{className:"pointer-events-none absolute left-0 top-full z-10 mt-1.5 hidden w-max rounded border border-c4a-border-default bg-c4a-bg-elevated px-3 py-2 shadow-c4a-md group-hover:block",children:u.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-[10px]",children:[u.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.origin")}),u.jsxs("dd",{className:"text-c4a-text-secondary",children:[I?.is_default?e("sources.library.default_cloud_name"):I?.name," / ",o?.name]}),!!B?.repo_name&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.repo")}),u.jsx("dd",{className:"text-c4a-text-secondary",children:B.repo_url?u.jsx("a",{href:String(B.repo_url),target:"_blank",rel:"noopener noreferrer",className:"text-c4a-accent hover:underline",children:String(B.repo_name)}):String(B.repo_name)})]}),u.jsx("dt",{className:"text-c4a-text-muted",children:e("sources.detail.type")}),u.jsx("dd",{className:"text-c4a-text-secondary uppercase",children:O.includes(".")?O.slice(O.lastIndexOf(".")+1):se??"โ€”"})]})})]}),u.jsx("div",{className:"flex-1"}),K&&z.length>0&&u.jsx("div",{className:"self-center",children:u.jsx(Mq,{commits:z,currentHashId:E,onChange:C})}),!K&&Ee&&y.length>0&&u.jsx("div",{className:"self-center",children:u.jsx(Oq,{versions:y,currentHashId:E,onChange:C})})]})]}),u.jsx("div",{className:"flex flex-1 flex-col overflow-y-auto c4a-scrollbar px-4 pb-8 md:px-6 md:pb-10",children:u.jsx(Lq,{anchor:{id:`content:${E||"pending"}`,type:"content",resourceId:E||"pending",label:O,icon:K?"๐Ÿ“ฆ":"๐Ÿ“„"},children:u.jsx(h2,{hashId:E||"",sourcePath:Ie,sourceId:V,isCodeIndexing:be,isDaemonOnline:T,indexModules:ie,sourceType:se,indexStatus:Ue})})})]})}function Bq({docSources:e,onConfirm:t,onCancel:n}){const{t:r}=_e(),[i,o]=_.useState(!0),[l,d]=_.useState(null),[p,f]=_.useState(null),m=_.useMemo(()=>{const g=new Map;for(const y of e)g.has(y.sourceId)||g.set(y.sourceId,[]),g.get(y.sourceId).push(y.modulePath);return[...g.entries()].map(([y,b])=>({sourceId:y,paths:b}))},[e]);return _.useEffect(()=>{let g=!1;async function y(){o(!0);try{const b=await Promise.all(m.map(({sourceId:k,paths:j})=>{const S=j.length>0?`?paths=${j.map(encodeURIComponent).join(",")}`:"";return Pe.get(`/sources/${k}/index/estimate${S}`)}));if(g)return;const w=b.reduce((k,j)=>({tokens:k.tokens+j.estimated_tokens,calls:k.calls+j.estimated_calls,chunks:k.chunks+j.chunk_count}),{tokens:0,calls:0,chunks:0});d(w)}catch(b){if(g)return;const w=b instanceof kn?`GET /sources/:id/index/estimate
134
+ HTTP ${b.status} ${b.code}
135
+ ${b.message}`:`GET /sources/:id/index/estimate
136
+ ${String(b)}`;console.error(`[DocIndexConfirmDialog] estimate failed
137
+ `,w),f({title:r("index.doc.confirm_title"),detail:w})}finally{g||o(!1)}}return y(),()=>{g=!0}},[m,r]),p?u.jsx(uc,{error:p,onClose:()=>{f(null),n()}}):u.jsxs(br,{onClose:n,className:"w-full max-w-lg rounded-xl bg-c4a-bg-surface p-6",children:[u.jsx("h2",{className:"font-mono text-sm uppercase tracking-tight text-c4a-text-primary mb-4",children:r("index.doc.confirm_title")}),i?u.jsx(fa,{labelKey:"index.doc.estimating"}):u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-sm text-c4a-text-secondary mb-4",children:r("index.doc.confirm_desc")}),u.jsx("div",{className:"rounded-lg border border-c4a-border-subtle bg-c4a-bg-base p-3 mb-4 max-h-32 overflow-y-auto c4a-scrollbar",children:e.map((g,y)=>u.jsxs("div",{className:"flex items-center gap-2 py-1",children:[u.jsx(Vn,{size:12,className:"shrink-0 text-c4a-text-muted"}),u.jsx("span",{className:"font-mono text-xs text-c4a-text-primary",children:g.sourceName})]},`${g.sourceId}:${y}`))}),l&&u.jsxs("div",{className:"flex gap-3 mb-4",children:[u.jsx(xn,{icon:u.jsx(JT,{}),label:r("index.doc.estimate_tokens"),value:`~${l.tokens.toLocaleString()}`,size:"sm"}),u.jsx(xn,{icon:u.jsx(u3,{}),label:r("index.doc.estimate_calls"),value:`~${l.calls}`,size:"sm"}),u.jsx(xn,{icon:u.jsx(HR,{}),label:r("index.doc.estimate_chunks"),value:l.chunks,size:"sm"})]}),l&&u.jsx("p",{className:"text-xs text-c4a-text-muted font-mono mb-6",children:r("index.doc.estimate_summary",{tokens:l.tokens.toLocaleString(),calls:l.calls})}),u.jsxs("div",{className:"flex justify-end gap-3",children:[u.jsx("button",{onClick:n,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:r("index.doc.cancel")}),u.jsx("button",{onClick:t,className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover",children:r("index.doc.confirm_btn")})]})]})]})}function hd(e){return e.source_type==="code"?e.path.includes("/")?e.path.split("/").slice(0,-1).join("/"):".":e.path}function U2(e){return e.index_status==="indexed"||e.index_status==="stale"}function Pq(e,t){const n=[],r=i=>{for(const o of i){if(o.kind==="source"){const l=hd(o);n.push({sourceId:t,modulePath:l,moduleName:o.name,moduleType:o.source_type==="code"?"package":"document",hasDigest:U2(o),digestStale:o.index_status==="stale"})}o.children&&r(o.children)}};return r(e),n}function H2(e,t){for(const n of e){if(n.path===t&&n.children)return n.children;if(n.children){const r=H2(n.children,t);if(r.length>0)return r}}return[]}function q2(e,t){for(const n of e){if(n.path===t)return n;if(n.children){const r=q2(n.children,t);if(r)return r}}return null}function Fq({node:e,sourceId:t,depth:n,selected:r,indeterminate:i,expanded:o,onToggleExpand:l,onToggleSelect:d,t:p}){const f=e.kind==="folder",m=e.source_type==="code",g=U2(e),y=f?nr:m?Hr:Vn,b="text-c4a-text-secondary";return u.jsxs("div",{className:"group/row flex h-8 cursor-pointer items-center gap-1.5 hover:bg-c4a-bg-hover",style:{paddingLeft:`${n*24+8}px`},children:[f?u.jsx("button",{onClick:()=>l(t,e.path),className:"flex h-4 w-4 shrink-0 items-center justify-center text-c4a-text-muted",children:u.jsx(Gt,{size:12,className:`transition-transform duration-200 ${o?"rotate-90":""}`})}):u.jsx("span",{className:"h-4 w-4 shrink-0"}),u.jsx("input",{type:"checkbox",checked:r,ref:w=>{w&&(w.indeterminate=i)},onChange:()=>d(t,e.path),className:"c4a-check"}),u.jsx(y,{size:14,className:`shrink-0 ${b}`}),u.jsx("span",{className:`truncate text-xs ${b}`,children:e.name}),!f&&g&&u.jsx("span",{className:"ml-1 shrink-0 rounded-sm bg-c4a-success px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",children:p("index.batch.already_indexed")})]})}function wg({nodes:e,depth:t,selectedPaths:n,expandedPaths:r,sourceId:i,onToggleExpand:o,onToggleSelect:l,getSelectionState:d,t:p}){const f=_.useMemo(()=>[...e].sort((m,g)=>m.kind!==g.kind?m.kind==="folder"?-1:1:m.name.localeCompare(g.name)),[e]);return u.jsx(u.Fragment,{children:f.map(m=>{const{selected:g,indeterminate:y}=d(i,m),b=r.has(`${i}:${m.path}`);return u.jsxs("div",{children:[u.jsx(Fq,{node:m,sourceId:i,depth:t,selected:g,indeterminate:y,expanded:b,onToggleExpand:o,onToggleSelect:l,t:p}),m.kind==="folder"&&b&&m.children&&u.jsx(wg,{nodes:m.children,depth:t+1,selectedPaths:n,expandedPaths:r,sourceId:i,onToggleExpand:o,onToggleSelect:l,getSelectionState:d,t:p})]},m.path)})})}function Uq({root:e,expanded:t,selected:n,indeterminate:r,onToggleExpand:i,onToggleSelect:o}){const l=e.kind==="folder",p=e.metadata?.origin==="remote",f=l?p?oc:nr:e.source_type==="code"?Hr:Vn,m="text-c4a-text-secondary";return u.jsxs("div",{className:"group/row flex h-8 cursor-pointer items-center gap-1.5 hover:bg-c4a-bg-hover",style:{paddingLeft:"8px"},children:[l?u.jsx("button",{onClick:i,className:"flex h-4 w-4 shrink-0 items-center justify-center text-c4a-text-muted",children:u.jsx(Gt,{size:12,className:`transition-transform duration-200 ${t?"rotate-90":""}`})}):u.jsx("span",{className:"h-4 w-4 shrink-0"}),u.jsx("input",{type:"checkbox",checked:n,ref:g=>{g&&(g.indeterminate=r)},onChange:o,className:"c4a-check"}),u.jsx(f,{size:14,className:`shrink-0 ${m}`}),u.jsx("span",{className:`truncate text-xs ${m}`,children:e.name})]})}function Hq({selectedNodes:e,targetRoots:t,setSelectedPaths:n,t:r}){const o=_.useMemo(()=>new Set(e.map(p=>p.sourceId)),[e]).size>1,l=_.useMemo(()=>{const p=new Map;for(const f of t)p.set(f.id,f.name);return p},[t]),d=_.useMemo(()=>{const p=[],f=new Map;for(const m of e){if(!f.has(m.sourceId)){const g=[];f.set(m.sourceId,g),p.push({sourceId:m.sourceId,nodes:g})}f.get(m.sourceId).push(m)}return p},[e]);return u.jsx("div",{className:"flex flex-col gap-0.5",children:d.map(({sourceId:p,nodes:f})=>u.jsxs("div",{children:[o&&u.jsx("div",{className:"mt-1 mb-0.5 border-b border-c4a-border-subtle px-2 pb-1 font-mono text-[10px] uppercase tracking-tight text-c4a-text-muted",children:l.get(p)||p}),f.map(m=>u.jsxs("div",{className:"flex items-center gap-2 rounded-sm px-2 py-1 text-xs text-c4a-text-secondary hover:bg-c4a-bg-hover",children:[m.moduleType==="package"?u.jsx(Hr,{size:12,className:"shrink-0"}):u.jsx(Vn,{size:12,className:"shrink-0"}),u.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[u.jsx("span",{className:"truncate",children:m.moduleName}),m.modulePath!=="."&&m.modulePath!==m.moduleName&&u.jsx("span",{className:"truncate font-mono text-[10px] text-c4a-text-muted",title:m.modulePath,children:m.modulePath})]}),m.hasDigest&&u.jsx("span",{className:"shrink-0 rounded bg-amber-500/10 px-1 font-mono text-[10px] text-amber-500",children:r("index.batch.reindex_tag")}),u.jsx("button",{onClick:()=>{n(g=>{const y=new Set(g);return y.delete(`${m.sourceId}:${m.modulePath}`),y})},className:"shrink-0 text-c4a-text-muted hover:text-c4a-accent",children:u.jsx(Vr,{size:12})})]},`${m.sourceId}:${m.modulePath}`))]},p))})}function qq(){const{t:e}=_e(),t=Pt(),{libId:n}=fo(),[r]=sc(),i=r.get("rootId")||null,o=r.get("path")||"",d=an(ji(ss)).find(be=>be.id===n),{rootSources:p,currentRoot:f,fetchRootSources:m,fetchRootSource:g,triggerIndex:y}=Ot(),b=d?.type==="cloud"?!0:d?.is_online??!1,[w,k]=_.useState(new Set),[j,S]=_.useState(new Set),[E,C]=_.useState(!1),[z,D]=_.useState(null),[A,P]=_.useState(!1),[T,F]=_.useState([]),[M,G]=_.useState([]);_.useEffect(()=>{n&&m({library_id:n})},[n,m]),_.useEffect(()=>{i&&g(i).catch(()=>{})},[i,g]);const Q=_.useMemo(()=>{let be;return i&&f?be=[f]:be=p.filter(de=>de.kind!=="folder"||de.tree&&de.tree.length>0),o?be.map(de=>{const ke=H2(de.tree,o);return{...de,tree:ke}}).filter(de=>de.tree.length>0):be},[i,f,p,o]);_.useEffect(()=>{S(new Set)},[Q]);const re=_.useMemo(()=>{const be=[];for(const de of Q)if(de.kind==="source"){const ke=de.index_status==="indexed"||de.index_status==="stale";be.push({sourceId:de.id,modulePath:".",moduleName:de.name,moduleType:de.source_type==="code"?"package":"document",hasDigest:ke,digestStale:de.index_status==="stale"})}else be.push(...Pq(de.tree,de.id));return be},[Q]),$=_.useMemo(()=>re.filter(be=>w.has(`${be.sourceId}:${be.modulePath}`)),[re,w]),U=_.useCallback(be=>{const de=[],ke=ge=>{ge.kind==="source"&&de.push(hd(ge)),ge.children&&ge.children.forEach(ke)};return ke(be),de},[]),I=_.useCallback((be,de)=>{const ke=Q.find(ge=>ge.id===be);return ke?q2(ke.tree,de):null},[Q]),V=_.useCallback((be,de)=>{const ke=`${be}:${de}`;S(ge=>{const we=new Set(ge);return we.has(ke)?we.delete(ke):we.add(ke),we})},[]),te=_.useCallback((be,de)=>{const ke=I(be,de);ke&&k(ge=>{const we=new Set(ge);if(ke.kind==="source"){const Xe=`${be}:${hd(ke)}`;we.has(Xe)?we.delete(Xe):we.add(Xe)}else{const Xe=U(ke).map(Je=>`${be}:${Je}`);Xe.every(Je=>we.has(Je))?Xe.forEach(Je=>we.delete(Je)):Xe.forEach(Je=>we.add(Je))}return we})},[I,U]),oe=_.useCallback((be,de)=>{if(de.kind==="source"){const we=`${be}:${hd(de)}`;return{selected:w.has(we),indeterminate:!1}}const ke=U(de).map(we=>`${be}:${we}`);if(ke.length===0)return{selected:!1,indeterminate:!1};const ge=ke.filter(we=>w.has(we)).length;return{selected:ge===ke.length,indeterminate:ge>0&&ge<ke.length}},[w,U]),R=!i&&Q.length>0,B=_.useCallback(be=>{const ke=re.filter(ge=>ge.sourceId===be).map(ge=>`${ge.sourceId}:${ge.modulePath}`);ke.length!==0&&k(ge=>{const we=new Set(ge);return ke.every(Me=>we.has(Me))?ke.forEach(Me=>we.delete(Me)):ke.forEach(Me=>we.add(Me)),we})},[re]),K=_.useCallback(be=>{const de=re.filter(we=>we.sourceId===be);if(de.length===0)return{selected:!1,indeterminate:!1};const ke=de.map(we=>`${we.sourceId}:${we.modulePath}`),ge=ke.filter(we=>w.has(we)).length;return{selected:ge===ke.length,indeterminate:ge>0&&ge<ke.length}},[re,w]),O=_.useCallback(async be=>{const de=new Map;for(const ke of be)de.has(ke.sourceId)||de.set(ke.sourceId,[]),de.get(ke.sourceId).push({path:ke.modulePath,force:!!ke.hasDigest});return Promise.allSettled(Array.from(de.entries()).map(async([ke,ge])=>{const we=await y(ke,ge);return{sourceId:ke,...we}}))},[y]),se=_.useCallback((be,de)=>{let ke=!1;const ge=[];for(const we of be)if(we.status==="fulfilled")(we.value.status==="started"||we.value.status==="completed")&&(ke=!0);else{const Xe=we.reason instanceof Error?we.reason.message:String(we.reason);ge.push(Xe)}if(ge.length>0&&console.error("[BatchIndex] index errors:",ge),C(!1),ke&&de.length>0){ge.length>0&&oa(e("index.batch.toast_partial_fail"));const we=[...de].sort((Me,Je)=>{const zt=Me.modulePath==="."?0:Me.modulePath.split("/").length,en=Je.modulePath==="."?0:Je.modulePath.split("/").length;return zt-en})[0],Xe=we.modulePath==="."?"":`?path=${encodeURIComponent(we.modulePath)}`;t(`/studio/source/${we.sourceId}${Xe}`,{replace:!0})}else ge.length>0?D({title:e("index.batch.error"),detail:ge.join(`
138
+
139
+ `)}):(oa(e("index.batch.toast_skipped")),t(-1))},[t,e]),ie=_.useCallback(async()=>{if($.length===0)return;const be=$.filter(ge=>ge.moduleType==="document"),de=$.filter(ge=>ge.moduleType==="package");if(be.length>0){F(be),G(de),P(!0);return}C(!0);const ke=await O(de);se([...ke],de)},[$,O,se]),pe=_.useCallback(async()=>{P(!1),C(!0);const be=[...M,...T],[de,ke]=await Promise.all([M.length>0?O(M):Promise.resolve([]),O(T)]);se([...de,...ke],be)},[T,M,O,se]),Ee=_.useCallback(()=>{P(!1),F([]),G([])},[]),Ie=_.useMemo(()=>{if(!d)return[];const be=[{label:d.is_default?e("sources.library.default_cloud_name"):d.name,to:`/studio/sources/${d.id}`}];if(i&&f&&(be.push({label:f.name,to:`/studio/sources/${d.id}?rootId=${f.id}`}),o)){const de=o.split("/");be.push({label:de[de.length-1]||o,to:`/studio/sources/${d.id}?rootId=${f.id}&path=${encodeURIComponent(o)}`})}return be.push({label:e("index.batch.title")}),be},[d,i,f,o,e]);if(!d)return u.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:u.jsx("p",{className:"text-sm text-c4a-text-muted",children:e("common.loading")})});const Ue=$.length>50;return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col bg-c4a-bg-default p-4 md:p-6",children:[u.jsx(Ha,{segments:Ie}),u.jsxs("div",{className:"mt-4 flex min-h-0 flex-1 flex-col gap-4 lg:flex-row",children:[u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border border-c4a-border-default rounded-lg lg:w-1/2",children:[u.jsx("div",{className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted px-3 py-2 border-b border-c4a-border-subtle",children:e("index.batch.panel_a_title")}),u.jsx("div",{className:"flex-1 overflow-y-auto c4a-scrollbar",children:Q.map(be=>{if(R){const de=`${be.id}:__root__`,ke=j.has(de),{selected:ge,indeterminate:we}=K(be.id);return u.jsxs("div",{children:[u.jsx(Uq,{root:be,expanded:ke,selected:ge,indeterminate:we,onToggleExpand:()=>{S(Xe=>{const Me=new Set(Xe);return Me.has(de)?Me.delete(de):Me.add(de),Me})},onToggleSelect:()=>B(be.id)}),be.kind==="folder"&&ke&&u.jsx(wg,{nodes:be.tree,depth:1,selectedPaths:w,expandedPaths:j,sourceId:be.id,onToggleExpand:V,onToggleSelect:te,getSelectionState:oe,t:e})]},be.id)}return u.jsx(wg,{nodes:be.tree,depth:0,selectedPaths:w,expandedPaths:j,sourceId:be.id,onToggleExpand:V,onToggleSelect:te,getSelectionState:oe,t:e},be.id)})})]}),u.jsxs("div",{className:"flex min-h-0 flex-col border border-c4a-border-default rounded-lg lg:w-1/2",children:[u.jsx("div",{className:"font-mono text-xs uppercase tracking-tight text-c4a-text-muted px-3 py-2 border-b border-c4a-border-subtle",children:e("index.batch.panel_b_title")}),u.jsx("div",{className:"px-3 py-2",children:u.jsx("span",{className:"font-mono text-xs text-c4a-text-muted",children:e("index.batch.selected_count",{n:$.length,total:re.length}).split(/(\d+)/).map((be,de)=>/^\d+$/.test(be)?u.jsx("span",{className:"text-c4a-accent font-extrabold",children:be},de):u.jsx("span",{children:be},de))})}),u.jsx("div",{className:"flex-1 overflow-y-auto c4a-scrollbar px-3",children:$.length===0?null:u.jsx(Hq,{selectedNodes:$,targetRoots:Q,setSelectedPaths:k,t:e})})]})]}),u.jsxs("div",{className:"sticky bottom-0 mt-4 flex items-center justify-end gap-3 bg-c4a-bg-default px-4 py-3",children:[Ue&&u.jsx("span",{className:"mr-auto font-mono text-xs text-c4a-warning",children:e("index.batch.warning_over_50")}),u.jsx("button",{onClick:()=>t(-1),className:"rounded border border-c4a-border-default bg-c4a-bg-surface px-4 py-2 font-mono text-xs uppercase text-c4a-text-secondary transition-colors hover:bg-c4a-bg-hover hover:text-c4a-text-primary",children:e("index.batch.back")}),u.jsxs("button",{onClick:ie,disabled:$.length===0||E||!b,title:b?void 0:e("daemon.offline_tooltip"),className:"rounded bg-c4a-accent px-4 py-2 font-mono text-xs uppercase text-white transition-colors hover:bg-c4a-accent-hover disabled:opacity-40 disabled:cursor-not-allowed",children:[e("index.batch.confirm")," (",$.length,")"]})]}),z&&u.jsx(uc,{error:z,onClose:()=>{D(null),t(-1)}}),A&&u.jsx(Bq,{docSources:T.map(be=>({sourceId:be.sourceId,sourceName:be.moduleName,modulePath:be.modulePath})),onConfirm:pe,onCancel:Ee})]})}const Vq=_.lazy(()=>ue(()=>import("./ContentDetail-CG3O_1rk.js"),[]).then(e=>({default:e.ContentDetail}))),Gq=_.lazy(()=>ue(()=>import("./EntityDetail-Bsgi44vT.js"),[]).then(e=>({default:e.EntityDetail}))),Yq=_.lazy(()=>ue(()=>import("./RelationDetail-Dc1QmQGi.js"),[]).then(e=>({default:e.RelationDetail}))),Kq=CT([{element:u.jsx(nL,{}),errorElement:u.jsx(A1,{}),children:[{path:"/",element:u.jsx(dL,{})},{path:"/login",element:u.jsx(hL,{})},{path:"/auth/callback",element:u.jsx(gL,{})},{path:"/docs",element:u.jsx(xL,{})}]},{path:"/studio",element:u.jsx(uL,{}),errorElement:u.jsx(A1,{}),children:[{index:!0,element:u.jsx(tT,{to:"/studio/sources",replace:!0})},{path:"sources",element:u.jsx(u5,{})},{path:"sources/add-client",element:u.jsx(H5,{})},{path:"sources/import/:libId",element:u.jsx(j5,{})},{path:"sources/import-dir/:libId",element:u.jsx(T5,{})},{path:"sources/import-remote/:libId",element:u.jsx(U5,{})},{path:"sources/:libId",element:u.jsx(c5,{})},{path:"sources/:libId/batch-index",element:u.jsx(qq,{})},{path:"source/:sourceUuid",element:u.jsx($q,{})},{path:"contents/:hashId",element:u.jsx(_.Suspense,{fallback:null,children:u.jsx(Vq,{})})},{path:"entities/:entityId",element:u.jsx(_.Suspense,{fallback:null,children:u.jsx(Gq,{})})},{path:"relations/:relationId",element:u.jsx(_.Suspense,{fallback:null,children:u.jsx(Yq,{})})},{path:"modeling",element:u.jsx(bL,{})},{path:"modeling/code/setup",element:u.jsx(AL,{})},{path:"modeling/code/compile",element:u.jsx(TL,{})},{path:"modeling/code/review",element:u.jsx(RL,{})},{path:"modeling/code/result",element:u.jsx(LL,{})},{path:"brain",element:u.jsx(vL,{})},{path:"discovery",element:u.jsx(_L,{})},{path:"sharing",element:u.jsx(wL,{})},{path:"collaboration",element:u.jsx(kL,{})},{path:"settings/api-keys",element:u.jsx(SL,{})}]},{path:"*",element:u.jsx(yL,{})}]);function Xq(){return _.useEffect(()=>{ar.getState().init(),Ul.getState().init();const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return In.connect(t),()=>{In.disconnect()}},[]),u.jsx(WA,{router:Kq})}pE.createRoot(document.getElementById("root")).render(u.jsx(_.StrictMode,{children:u.jsx(Xq,{})}));export{h2 as C,wq as E,Sq as R,_e as a,fo as b,Fe as c,u as j,Pt as u};