diff --git a/.changeset/web-composer-placeholder-caret.md b/.changeset/web-composer-placeholder-caret.md new file mode 100644 index 00000000000..52046b208ff --- /dev/null +++ b/.changeset/web-composer-placeholder-caret.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Fix the web composer swallowing the first keystroke typed after clicking the empty-input placeholder — most visibly the first character of an IME composition. diff --git a/apps/kimi-code/dist-web/assets/CodeBlockNode-TQKPIcUp.js b/apps/kimi-code/dist-web/assets/CodeBlockNode-CuI0kUU2.js similarity index 99% rename from apps/kimi-code/dist-web/assets/CodeBlockNode-TQKPIcUp.js rename to apps/kimi-code/dist-web/assets/CodeBlockNode-CuI0kUU2.js index 4ba616436ec..4e5b684d91a 100644 --- a/apps/kimi-code/dist-web/assets/CodeBlockNode-TQKPIcUp.js +++ b/apps/kimi-code/dist-web/assets/CodeBlockNode-CuI0kUU2.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dq61ZbBp.js","assets/index-CvgiEu-R.js","assets/index-BxiMZi52.css"])))=>i.map(i=>d[i]); -import{bR as xi,cb as Si,bQ as Ho,M as pl,bl as Ci,af as fl,bY as Mi,cc as Bi,b$ as hl,aU as $,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Mo,aD as No,bE as ue,az as Li,cd as wn,c8 as mt,aI as To,aL as Y,s as Sn,aw as Vt,au as pt,bk as J,ce as Bo,u as ie,I as Ro,A as Oi,bJ as Gt,aY as ht,bL as vl,v as w,t as we,bB as ml,bb as Be,q as b,b7 as $i,cf as zi,cg as bn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as A,cl as Eo,cm as Di,cn as Ai,co as Wt,cp as Fo,bO as Do,T as ji,G as qi,F as Po,g as Wi,c7 as _i,b_ as Ii}from"./index-CvgiEu-R.js";import{i as fe,t as kn}from"./safeRaf-DGuzXxDK.js";var xn=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});let Lo=!1,_t=null,It=null,Ut=null;function Ui(){return xn(this,null,function*(){if(Ut)return Ut;Ut=xn(null,null,function*(){if(!It)try{if(It=(function(k){const M=k;if(typeof M?.useMonaco=="function")return M;const y=k?.default;return typeof y?.useMonaco=="function"?y:null})(yield xi(()=>import("./index-Dq61ZbBp.js"),__vite__mapDeps([0,1,2]))),!It)return null}catch{return null}try{return yield(function(k){return xn(this,null,function*(){return Lo?void 0:_t||(_t=xn(null,null,function*(){const y=globalThis?.MonacoEnvironment;y&&(typeof y.getWorker=="function"||typeof y.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),Lo=!0}).finally(()=>{_t=null}),_t)})})(It),Si(),It}catch{return null}});try{return yield Ut}finally{Ut=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,$o=(k,M,y)=>M in k?Vi(k,M,{enumerable:!0,configurable:!0,writable:!0,value:y}):k[M]=y,U=(k,M)=>{for(var y in M||(M={}))Yi.call(M,y)&&$o(k,y,M[y]);if(Oo)for(var y of Oo(M))Qi.call(M,y)&&$o(k,y,M[y]);return k},Me=(k,M)=>Gi(k,Ji(M)),j=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=pl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(k,{emit:M}){const y=k,te=M,ne=$(!1),be=$(null),ke=$(null);function r(){mt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",H,{once:!0,capture:!0})}function P(){mt(!0),ne.value=!1}function H(Q){var v,z;const wt=Q.target;(v=be.value)!=null&&v.contains(wt)||(z=ke.value)!=null&&z.contains(wt)?document.addEventListener("click",H,{once:!0,capture:!0}):P()}const re=b(()=>y.showFontSizeButtons&&y.enableFontSizeControl||y.showExpandButton||y.isPreviewable&&y.showPreviewButton),{t:T}=hl(),gt=b(()=>y.showTooltips!==!1);function Ge(Q,v){gt.value&&_i(Q.currentTarget,v,"top",!1,void 0,y.isDark)}function Ee(){gt.value&&mt()}function yt(Q){Ge(Q,y.copyText?T("common.copied")||"Copied":T("common.copy")||"Copy")}const gl=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)<=((v=y.codeFontMin)!=null?v:0)}),Jt=b(()=>!y.fontBaselineReady||y.codeFontSize===y.defaultCodeFontSize),Yt=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)>=((v=y.codeFontMax)!=null?v:100)});return(Q,v)=>(Y(),ie(Po,null,[y.showHeader?(Y(),ie("div",Xi,[ht(Q.$slots,"header-left"),ht(Q.$slots,"header-right",{},()=>[w("div",Ki,[k.diffStats?(Y(),ie("div",{key:0,class:"code-diff-stats","aria-label":k.diffStatsAriaLabel},[w("span",er,"-"+Be(k.diffStats.removed),1),w("span",tr,"+"+Be(k.diffStats.added),1)],8,Zi)):we("",!0),y.showCopyButton?(Y(),ie("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":k.copyText?J(T)("common.copied")||"Copied":J(T)("common.copy")||"Copy",onClick:v[0]||(v[0]=z=>te("copy")),onMouseenter:v[1]||(v[1]=z=>yt(z)),onFocus:v[2]||(v[2]=z=>yt(z)),onMouseleave:Ee,onBlur:Ee},[k.copyText?(Y(),ie("svg",or,[...v[14]||(v[14]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(Y(),ie("svg",lr,[...v[13]||(v[13]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):we("",!0),y.showCollapseButton?(Y(),ie("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":k.isCollapsed,onClick:v[3]||(v[3]=z=>te("toggleCollapse")),onMouseenter:v[4]||(v[4]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onFocus:v[5]||(v[5]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onMouseleave:Ee,onBlur:Ee},[(Y(),ie("svg",{style:Vt({rotate:k.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...v[15]||(v[15]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):we("",!0),re.value?(Y(),ie("div",rr,[w("button",{ref_key:"moreBtnRef",ref:ke,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Do(r,["stop"]),onMouseenter:v[6]||(v[6]=z=>Ge(z,J(T)("common.more")||"More")),onFocus:v[7]||(v[7]=z=>Ge(z,J(T)("common.more")||"More")),onMouseleave:Ee,onBlur:Ee},[...v[16]||(v[16]=[qi('',1)])],40,ar),Ro(Wi,{name:"code-menu"},{default:Gt(()=>[ne.value?(Y(),ie("div",{key:0,ref_key:"moreMenuRef",ref:be,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[y.showFontSizeButtons&&y.enableFontSizeControl?(Y(),ie(Po,{key:0},[w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:gl.value,onClick:v[8]||(v[8]=z=>{J(mt)(!0),te("decreaseFont")})},[v[17]||(v[17]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),w("span",null,Be(J(T)("common.fontSmaller")||"Font size −"),1)],8,ur),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:v[9]||(v[9]=z=>{J(mt)(!0),te("resetFont")})},[v[18]||(v[18]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)),w("span",null,Be(J(T)("common.fontReset")||"Font size reset"),1)],8,sr),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Yt.value,onClick:v[10]||(v[10]=z=>{J(mt)(!0),te("increaseFont")})},[v[19]||(v[19]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),w("span",null,Be(J(T)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):we("",!0),y.showExpandButton?(Y(),ie("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[11]||(v[11]=z=>{P(),te("toggleExpand")})},[k.isExpanded?(Y(),ie("svg",cr,[...v[20]||(v[20]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(Y(),ie("svg",fr,[...v[21]||(v[21]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),w("span",null,Be(k.isExpanded?J(T)("common.collapse")||"Collapse":J(T)("common.expand")||"Expand"),1)])):we("",!0),k.isPreviewable&&y.showPreviewButton?(Y(),ie("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[12]||(v[12]=z=>{P(),te("preview")})},[v[22]||(v[22]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)),w("span",null,Be(J(T)("common.preview")||"Preview"),1)])):we("",!0)],512)):we("",!0)]),_:1})])):we("",!0)])])])):we("",!0),vl(w("div",{class:pt(["code-block-shell-content",{"code-block-shell-content--collapsed":k.isCollapsed}])},[ht(Q.$slots,"default")],2),[[ml,!!k.stream||!k.loading]]),vl(w("div",vr,[ht(Q.$slots,"loading",{},()=>[v[23]||(v[23]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))])],512),[[ml,!k.stream&&k.loading]]),w("span",mr,Be(k.copyText?J(T)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=Ho(pl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const M=k,y=import.meta!==void 0&&!1;let te=null;const{t:ne}=hl(),be=b(()=>{const P=M.code||"",H=P.trim().toLowerCase();return H.startsWith(" +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bx4TPvIQ.js","assets/index-BRkLL_ut.js","assets/index-C31Y85AG.css"])))=>i.map(i=>d[i]); +import{bR as xi,cb as Si,bQ as Ho,M as pl,bl as Ci,af as fl,bY as Mi,cc as Bi,b$ as hl,aU as $,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Mo,aD as No,bE as ue,az as Li,cd as wn,c8 as mt,aI as To,aL as Y,s as Sn,aw as Vt,au as pt,bk as J,ce as Bo,u as ie,I as Ro,A as Oi,bJ as Gt,aY as ht,bL as vl,v as w,t as we,bB as ml,bb as Be,q as b,b7 as $i,cf as zi,cg as bn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as A,cl as Eo,cm as Di,cn as Ai,co as Wt,cp as Fo,bO as Do,T as ji,G as qi,F as Po,g as Wi,c7 as _i,b_ as Ii}from"./index-BRkLL_ut.js";import{i as fe,t as kn}from"./safeRaf-DGuzXxDK.js";var xn=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});let Lo=!1,_t=null,It=null,Ut=null;function Ui(){return xn(this,null,function*(){if(Ut)return Ut;Ut=xn(null,null,function*(){if(!It)try{if(It=(function(k){const M=k;if(typeof M?.useMonaco=="function")return M;const y=k?.default;return typeof y?.useMonaco=="function"?y:null})(yield xi(()=>import("./index-Bx4TPvIQ.js"),__vite__mapDeps([0,1,2]))),!It)return null}catch{return null}try{return yield(function(k){return xn(this,null,function*(){return Lo?void 0:_t||(_t=xn(null,null,function*(){const y=globalThis?.MonacoEnvironment;y&&(typeof y.getWorker=="function"||typeof y.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),Lo=!0}).finally(()=>{_t=null}),_t)})})(It),Si(),It}catch{return null}});try{return yield Ut}finally{Ut=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,$o=(k,M,y)=>M in k?Vi(k,M,{enumerable:!0,configurable:!0,writable:!0,value:y}):k[M]=y,U=(k,M)=>{for(var y in M||(M={}))Yi.call(M,y)&&$o(k,y,M[y]);if(Oo)for(var y of Oo(M))Qi.call(M,y)&&$o(k,y,M[y]);return k},Me=(k,M)=>Gi(k,Ji(M)),j=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=pl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(k,{emit:M}){const y=k,te=M,ne=$(!1),be=$(null),ke=$(null);function r(){mt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",H,{once:!0,capture:!0})}function P(){mt(!0),ne.value=!1}function H(Q){var v,z;const wt=Q.target;(v=be.value)!=null&&v.contains(wt)||(z=ke.value)!=null&&z.contains(wt)?document.addEventListener("click",H,{once:!0,capture:!0}):P()}const re=b(()=>y.showFontSizeButtons&&y.enableFontSizeControl||y.showExpandButton||y.isPreviewable&&y.showPreviewButton),{t:T}=hl(),gt=b(()=>y.showTooltips!==!1);function Ge(Q,v){gt.value&&_i(Q.currentTarget,v,"top",!1,void 0,y.isDark)}function Ee(){gt.value&&mt()}function yt(Q){Ge(Q,y.copyText?T("common.copied")||"Copied":T("common.copy")||"Copy")}const gl=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)<=((v=y.codeFontMin)!=null?v:0)}),Jt=b(()=>!y.fontBaselineReady||y.codeFontSize===y.defaultCodeFontSize),Yt=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)>=((v=y.codeFontMax)!=null?v:100)});return(Q,v)=>(Y(),ie(Po,null,[y.showHeader?(Y(),ie("div",Xi,[ht(Q.$slots,"header-left"),ht(Q.$slots,"header-right",{},()=>[w("div",Ki,[k.diffStats?(Y(),ie("div",{key:0,class:"code-diff-stats","aria-label":k.diffStatsAriaLabel},[w("span",er,"-"+Be(k.diffStats.removed),1),w("span",tr,"+"+Be(k.diffStats.added),1)],8,Zi)):we("",!0),y.showCopyButton?(Y(),ie("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":k.copyText?J(T)("common.copied")||"Copied":J(T)("common.copy")||"Copy",onClick:v[0]||(v[0]=z=>te("copy")),onMouseenter:v[1]||(v[1]=z=>yt(z)),onFocus:v[2]||(v[2]=z=>yt(z)),onMouseleave:Ee,onBlur:Ee},[k.copyText?(Y(),ie("svg",or,[...v[14]||(v[14]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(Y(),ie("svg",lr,[...v[13]||(v[13]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):we("",!0),y.showCollapseButton?(Y(),ie("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":k.isCollapsed,onClick:v[3]||(v[3]=z=>te("toggleCollapse")),onMouseenter:v[4]||(v[4]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onFocus:v[5]||(v[5]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onMouseleave:Ee,onBlur:Ee},[(Y(),ie("svg",{style:Vt({rotate:k.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...v[15]||(v[15]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):we("",!0),re.value?(Y(),ie("div",rr,[w("button",{ref_key:"moreBtnRef",ref:ke,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Do(r,["stop"]),onMouseenter:v[6]||(v[6]=z=>Ge(z,J(T)("common.more")||"More")),onFocus:v[7]||(v[7]=z=>Ge(z,J(T)("common.more")||"More")),onMouseleave:Ee,onBlur:Ee},[...v[16]||(v[16]=[qi('',1)])],40,ar),Ro(Wi,{name:"code-menu"},{default:Gt(()=>[ne.value?(Y(),ie("div",{key:0,ref_key:"moreMenuRef",ref:be,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[y.showFontSizeButtons&&y.enableFontSizeControl?(Y(),ie(Po,{key:0},[w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:gl.value,onClick:v[8]||(v[8]=z=>{J(mt)(!0),te("decreaseFont")})},[v[17]||(v[17]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),w("span",null,Be(J(T)("common.fontSmaller")||"Font size −"),1)],8,ur),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:v[9]||(v[9]=z=>{J(mt)(!0),te("resetFont")})},[v[18]||(v[18]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)),w("span",null,Be(J(T)("common.fontReset")||"Font size reset"),1)],8,sr),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Yt.value,onClick:v[10]||(v[10]=z=>{J(mt)(!0),te("increaseFont")})},[v[19]||(v[19]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),w("span",null,Be(J(T)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):we("",!0),y.showExpandButton?(Y(),ie("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[11]||(v[11]=z=>{P(),te("toggleExpand")})},[k.isExpanded?(Y(),ie("svg",cr,[...v[20]||(v[20]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(Y(),ie("svg",fr,[...v[21]||(v[21]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),w("span",null,Be(k.isExpanded?J(T)("common.collapse")||"Collapse":J(T)("common.expand")||"Expand"),1)])):we("",!0),k.isPreviewable&&y.showPreviewButton?(Y(),ie("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[12]||(v[12]=z=>{P(),te("preview")})},[v[22]||(v[22]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)),w("span",null,Be(J(T)("common.preview")||"Preview"),1)])):we("",!0)],512)):we("",!0)]),_:1})])):we("",!0)])])])):we("",!0),vl(w("div",{class:pt(["code-block-shell-content",{"code-block-shell-content--collapsed":k.isCollapsed}])},[ht(Q.$slots,"default")],2),[[ml,!!k.stream||!k.loading]]),vl(w("div",vr,[ht(Q.$slots,"loading",{},()=>[v[23]||(v[23]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))])],512),[[ml,!k.stream&&k.loading]]),w("span",mr,Be(k.copyText?J(T)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=Ho(pl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const M=k,y=import.meta!==void 0&&!1;let te=null;const{t:ne}=hl(),be=b(()=>{const P=M.code||"",H=P.trim().toLowerCase();return H.startsWith(" diff --git a/apps/kimi-code/dist-web/assets/Tooltip-3Kylewm2.js b/apps/kimi-code/dist-web/assets/Tooltip-B_XKKsoo.js similarity index 98% rename from apps/kimi-code/dist-web/assets/Tooltip-3Kylewm2.js rename to apps/kimi-code/dist-web/assets/Tooltip-B_XKKsoo.js index 6b417a44997..41f1acb4a18 100644 --- a/apps/kimi-code/dist-web/assets/Tooltip-3Kylewm2.js +++ b/apps/kimi-code/dist-web/assets/Tooltip-B_XKKsoo.js @@ -1 +1 @@ -import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-CvgiEu-R.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default}; +import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-BRkLL_ut.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default}; diff --git a/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DZ5l2NNF.js b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DXIJHUhi.js similarity index 86% rename from apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DZ5l2NNF.js rename to apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DXIJHUhi.js index 2cd0a936db1..e1ceead0ef8 100644 --- a/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DZ5l2NNF.js +++ b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DXIJHUhi.js @@ -1 +1 @@ -import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-BWiH3s-c.js";import{p as f}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{_ as n,l as o}from"./mermaid.core-CGrLstUA.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; +import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-DEUKbfBz.js";import{p as f}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{_ as n,l as o}from"./mermaid.core-D1bi95DL.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; diff --git a/apps/kimi-code/dist-web/assets/arc-C525Mmp6.js b/apps/kimi-code/dist-web/assets/arc-DvnRk6Nq.js similarity index 98% rename from apps/kimi-code/dist-web/assets/arc-C525Mmp6.js rename to apps/kimi-code/dist-web/assets/arc-DvnRk6Nq.js index 3101b9c2af5..8f9efc0bfaf 100644 --- a/apps/kimi-code/dist-web/assets/arc-C525Mmp6.js +++ b/apps/kimi-code/dist-web/assets/arc-DvnRk6Nq.js @@ -1 +1 @@ -import{P as ln,Q as an,R as j,S,T as W,V as un,W as y,X as tn,Y as C,$ as _,a0 as rn,a1 as o,a2 as on,a3 as sn,a4 as fn}from"./mermaid.core-CGrLstUA.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,E,q,v,R,X,a){var I=E-l,i=q-h,n=X-v,d=a-R,u=d*I-n*i;if(!(u*ur*r+$*$&&(Q=w,V=p),{cx:Q,cy:V,x01:-n,y01:-d,x11:Q*(v/T-1),y11:V*(v/T-1)}}function hn(){var l=cn,h=yn,E=W(0),q=null,v=gn,R=dn,X=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,Y=rn(c-f),t=c>f;if(a||(a=n=I()),sy))a.moveTo(0,0);else if(Y>tn-y)a.moveTo(s*j(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*j(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=Y,O=Y,Q=X.apply(this,arguments)/2,V=Q>y&&(q?+q.apply(this,arguments):C(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(V>y){var $=sn(V/u*S(Q)),F=sn(V/s*S(Q));(P-=$*2)>y?($*=t?1:-1,A+=$,T-=$):(P=0,A=T=(f+c)/2),(O-=F*2)>y?(F*=t?1:-1,m+=F,g-=F):(O=0,m=g=(f+c)/2)}var z=s*j(m),B=s*S(m),G=u*j(T),H=u*S(T);if(w>y){var J=s*j(g),K=s*S(g),M=u*j(A),N=u*S(A),D;if(Yy?x>y?(e=L(M,N,z,B,s,x,t),r=L(J,K,G,H,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(G,H):p>y?(e=L(G,H,J,K,u,-p,t),r=L(z,B,M,N,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+$*$&&(Q=w,V=p),{cx:Q,cy:V,x01:-n,y01:-d,x11:Q*(v/T-1),y11:V*(v/T-1)}}function hn(){var l=cn,h=yn,E=W(0),q=null,v=gn,R=dn,X=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,Y=rn(c-f),t=c>f;if(a||(a=n=I()),sy))a.moveTo(0,0);else if(Y>tn-y)a.moveTo(s*j(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*j(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=Y,O=Y,Q=X.apply(this,arguments)/2,V=Q>y&&(q?+q.apply(this,arguments):C(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(V>y){var $=sn(V/u*S(Q)),F=sn(V/s*S(Q));(P-=$*2)>y?($*=t?1:-1,A+=$,T-=$):(P=0,A=T=(f+c)/2),(O-=F*2)>y?(F*=t?1:-1,m+=F,g-=F):(O=0,m=g=(f+c)/2)}var z=s*j(m),B=s*S(m),G=u*j(T),H=u*S(T);if(w>y){var J=s*j(g),K=s*S(g),M=u*j(A),N=u*S(A),D;if(Yy?x>y?(e=L(M,N,z,B,s,x,t),r=L(J,K,G,H,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(G,H):p>y?(e=L(G,H,J,K,u,-p,t),r=L(z,B,M,N,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),ps?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=e}),(function(A,G,N){var v=N(0);function h(){}for(var i in v)h[i]=v[i];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,G,N){function v(h,i){h==null&&i==null?(this.x=0,this.y=0):(this.x=h,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(0),r=N(7),a=N(3),f=N(1),e=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,C=0;C-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(w,1),g.target!=g.source&&g.target.edges.splice(P,1);var S=g.source.owner.getEdges().indexOf(g);if(S==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(S,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,C=this.getNodes(),S=C.length,w=0;wT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?d=C[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,C,S,w,P,B,U=this.nodes,V=U.length,M=0;MC&&(l=C),Tw&&(g=w),dC&&(l=C),Tw&&(g=w),d=this.nodes.length){var V=0;T.forEach(function(M){M.owner==c&&V++}),V==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,G,N){var v,h=N(1);function i(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,u){if(f==null&&e==null&&u==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{u=f,e=a,f=r;var t=e.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,u);if(f.isInterGraph=!0,f.source=e,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,u=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var u=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(u=1);var t=u*a[0],s=a[1]/u;a[0]t)return a[0]=f,a[1]=o,a[2]=u,a[3]=U,!1;if(eu)return a[0]=s,a[1]=e,a[2]=P,a[3]=t,!1;if(fu?(a[0]=l,a[1]=T,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>u?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=T,n=!0)),-m===y?u>f?(a[2]=B,a[3]=U,E=!0):(a[2]=P,a[3]=w,E=!0):m===y&&(u>f?(a[2]=S,a[3]=w,E=!0):(a[2]=V,a[3]=U,E=!0)),n&&E)return!1;if(f>u?e>t?(I=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(I=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,R=f+-C/y,a[0]=R,a[1]=W;break;case 2:R=g,W=e+d*y,a[0]=R,a[1]=W;break;case 3:W=T,R=f+C/y,a[0]=R,a[1]=W;break;case 4:R=l,W=e+-d*y,a[0]=R,a[1]=W;break}if(!E)switch(O){case 1:Q=w,x=u+-_/y,a[2]=x,a[3]=Q;break;case 2:x=V,Q=t+M*y,a[2]=x,a[3]=Q;break;case 3:Q=U,x=u+_/y,a[2]=x,a[3]=Q;break;case 4:x=B,Q=t+-M*y,a[2]=x,a[3]=Q;break}}return!1},h.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},h.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,u=i.y,t=r.x,s=r.y,o=a.x,c=a.y,l=f.x,T=f.y,g=void 0,d=void 0,C=void 0,S=void 0,w=void 0,P=void 0,B=void 0,U=void 0,V=void 0;return C=s-u,w=e-t,B=t*u-e*s,S=T-c,P=o-l,U=l*c-o*T,V=C*P-S*w,V===0?null:(g=(w*U-P*B)/V,d=(S*B-C*U)/V,new v(g,d))},h.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=v}),(function(A,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,A.exports=v}),(function(A,G,N){var v=(function(){function e(u,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},A.exports=h}),(function(A,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(C.push(w[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),d.add(P);for(var B=P.getEdges(),g=0;g-1&&w.splice(_,1)}d=new Set,S=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(U,1);var V=S.getNeighborsList();V.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},A.exports=v}),(function(A,G,N){var v=N(5);function h(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(i){this.lworldExtX=i},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(i){this.lworldExtY=i},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},h.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},h.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},h.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},h.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},h.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},A.exports=h}),(function(A,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oC||d>C)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(C=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>C||d>C)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||C>=g[0].length)){for(var S=0;Se}}]),a})();A.exports=r}),(function(A,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),a=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/h,r=Math.abs(h)*Math.sqrt(1+r*r)):i!=0?(r=h/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},A.exports=v}),(function(A,G,N){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},h.emit=function(i,r){for(var a=0;a{var G={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var u in f)e[u]=f[u];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),u=a(880),t=a(991),s=a(767),o=a(806),c=a(902),l=a(551).FDLayoutConstants,T=a(551).LayoutConstants,g=a(551).Point,d=a(551).PointD,C=a(551).DimensionD,S=a(551).Layout,w=a(551).Integer,P=a(551).IGeometry,B=a(551).LGraph,U=a(551).Transform,V=a(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var _ in f)M[_]=f[_];M.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var O=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new V,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var D=n.idToNodeMap.get($.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;Rm&&(m=Math.floor(O.y)),I=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var y=B.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var O=0;O1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),$--,X--}E!=null?D=(z.indexOf(H[0])+1)%$:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;M.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},M.maxDiagonalInTree=function(n){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[R]=[]),E[R]=E[R].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,O)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,O=m.labelMarginLeft,R=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,O,R)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),O;return IR&&(R=$.getWidth())});var W=I/y,x=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return R>rt&&(rt=R),rt+=m*2,rt},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(D){return D.rect.width*D.rect.height},W=function(D,H){return R(H)-R(D)};n.sort(function($,D){var H=W;return O.idealRowWidth?(H=I,H($.id,D.id)):H($,D)});for(var x=0,Q=0,z=0;z0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var O=n.rowWidth[I];if(O+n.horizontalPadding+E<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+R)/(O+E+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,R=0;RO&&(O=m[R].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(I0)for(var rt=O;rt<=R;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,D,H,k=0;k{var f=a(551).FDLayoutNode,e=a(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?C[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?C[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var At=function(){var ot=dt.shift(),Lt=Y.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(Y){var Z=0,K=0,q=0,at=0;if(Y.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:C[g.get(j.top)]-C[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,Y){m[Y]=[F.position.x,F.position.y],y[Y]=[d[g.get(F.nodeId)],C[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var Y=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;Y[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),At=void 0;dt.size>0?At=d[g.get(dt.values().next().value)]:At=V(j).x,Y[et].forEach(function(pt){m[F]=[At,C[g.get(pt)]],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},K=0;K0?At=d[g.get(dt.values().next().value)]:At=V(j).y,q[et].forEach(function(pt){m[F]=[d[g.get(pt)],At],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,Y){var Z={x:d[g.get(F.nodeId)],y:C[g.get(F.nodeId)]},K=F.position,q=U(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(F,Y){d[Y]+=mt.x}),C.forEach(function(F,Y){C[Y]+=mt.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,C[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(Y){var Z=new Set;Dt[Y].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=V(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=C[g.get(K.values().next().value)]:q=V(Z).y,Z.forEach(function(at){R.has(at)||(C[g.get(at)]=q)})},Ft=0;Ft{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(45);return h})()})})(he)),he.exports}var pr=se.exports,De;function yr(){return De||(De=1,(function(L,b){(function(G,N){L.exports=N(vr())})(pr,function(A){return(()=>{var G={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),C;!(l=(C=d.next()).done)&&(c.push(C.value),!(o&&c.length===o));l=!0);}catch(S){T=!0,g=S}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var O=0;O1){C=g[0],S=C.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),B),U},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,C=!1,S=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var B=P.value,U=f(B,2),V=U[0],M=U[1],_=o.cy.getElementById(V);if(_){var n=_.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,y=s.yCoords[M]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){C=!0,S=x}finally{try{!d&&w.return&&w.return()}finally{if(C)throw S}}var I=t.x-(l+c)/2,O=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+O})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,w=void 0,P=void 0,B=t.descendants().not(":parent"),U=B.length,V=0;VC&&(l=C),Tw&&(g=w),d{var f=a(548),e=a(140).CoSELayout,u=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,T=function(d,C){var S=d.cy,w=d.eles,P=w.nodes(),B=w.edges(),U=void 0,V=void 0,M=void 0,_={};d.randomize&&(U=C.nodeIndexes,V=C.xCoords,M=C.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(S,w),m=function W(x,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,R=O.newGraphManager();return m(R.addRoot(),f.getTopMostNodes(P),O,d),y(O,R,B),I(O,d),O.runLayout(),_};i.exports={coseLayout:T}}),212:((i,r,a)=>{var f=(function(){function d(C,S){for(var w=0;w0)if(p){var I=t.getTopMostNodes(w.eles.nodes());if(M=t.connectComponents(P,w.eles,I),M.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&M.forEach(function(vt){w.eles=vt,U.push(o(w))}),w.quality=="default"||w.quality=="proof"){var O=P.collection();if(w.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},X=[];if(M.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),M.push(O),U.push(z);for(var $=X.length-1;$>=0;$--)M.splice(X[$],1),U.splice(X[$],1),_.splice(X[$],1)}}M.forEach(function(vt,it){w.eles=vt,V.push(l(w,U[it])),t.relocateComponent(_[it],V[it],w)})}else M.forEach(function(vt,it){t.relocateComponent(_[it],U[it],w)});var D=new Set;if(M.length>1){var H=[],k=B.filter(function(vt){return vt.css("display")=="none"});M.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=U[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(w.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:U[it].xCoords[wt]-Ot.boundingbox().w/2,y:U[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,U[it].xCoords,U[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else V[it][Ot.id()]&&Et.nodes.push({x:V[it][Ot.id()].getLeft(),y:V[it][Ot.id()].getTop(),width:V[it][Ot.id()].getWidth(),height:V[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,U[it].xCoords,U[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[it].xCoords[Rt]),Ut.push(U[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[it].xCoords,U[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[it].xCoords[Ht]),Pt.push(U[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else V[it][mt.id()]&&V[it][Dt.id()]&&Et.edges.push({startX:V[it][mt.id()].getCenterX(),startY:V[it][mt.id()].getCenterY(),endX:V[it][Dt.id()].getCenterX(),endY:V[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")U.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys(V[vt]).forEach(function(it){var ut=V[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);U.push(y)}w.quality=="default"||w.quality=="proof"?(V.push(l(w,U[0])),t.relocateComponent(_[0],V[0],w)):t.relocateComponent(_[0],U[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return V.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),w.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,B),Nt=B.filter(function(vt){return vt.css("display")=="none"});w.eles=B.not(Nt),B.nodes().not(":parent").not(Nt).layoutPositions(S,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,u=a(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,C=new Map,S=new Map,w=[],P=[],B=[],U=[],V=[],M=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,O=o.nodeSeparation,R=void 0,W=function(){for(var Y=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=V[Lt],At=Lt)}return At},Q=function(Y){var Z=void 0;if(Y){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?w[Y].push(S.get(Z.id())):w[Y].push(Z.id()))})});var Nt=function(Y){var Z=C.get(Y),K=void 0;d.get(Y).forEach(function(q){c.getElementById(q).isParent()?K=S.get(q):K=q,w[Z].push(K),w[C.get(K)].push(Y)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(F){it=!0,ut=F}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=C.size;var mt=void 0;if(E>2){R=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(579);return h})()})})(se)),se.exports}var mr=yr();const Er=cr(mr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:gt(L=>`${L},${L/2} 0,${L} 0,0`,"L"),R:gt(L=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:gt(L=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:gt(L=>`${L/2},0 ${L},${L} 0,${L}`,"B")},oe={L:gt((L,b)=>L-b+2,"L"),R:gt((L,b)=>L-2,"R"),T:gt((L,b)=>L-b+2,"T"),B:gt((L,b)=>L-2,"B")},Tr=gt(function(L){return Wt(L)?L==="L"?"R":"L":L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=gt(function(L){const b=L;return b==="L"||b==="R"||b==="T"||b==="B"},"isArchitectureDirection"),Wt=gt(function(L){const b=L;return b==="L"||b==="R"},"isArchitectureDirectionX"),qt=gt(function(L){const b=L;return b==="T"||b==="B"},"isArchitectureDirectionY"),Te=gt(function(L,b){const A=Wt(L)&&qt(b),G=qt(L)&&Wt(b);return A||G},"isArchitectureDirectionXY"),Nr=gt(function(L){const b=L[0],A=L[1],G=Wt(b)&&qt(A),N=qt(b)&&Wt(A);return G||N},"isArchitecturePairXY"),Lr=gt(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),pe=gt(function(L,b){const A=`${L}${b}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=gt(function([L,b],A){const G=A[0],N=A[1];return Wt(G)?qt(N)?[L+(G==="L"?-1:1),b+(N==="T"?1:-1)]:[L+(G==="L"?-1:1),b]:Wt(N)?[L+(N==="L"?1:-1),b+(G==="T"?1:-1)]:[L,b+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wr=gt(function(L){return L==="LT"||L==="TL"?[1,1]:L==="BL"||L==="LB"?[1,-1]:L==="BR"||L==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(L,b){return Te(L,b)?"bend":Wt(L)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=gt(function(L){return L.type==="service"},"isArchitectureService"),Or=gt(function(L){return L.type==="junction"},"isArchitectureJunction"),be=gt(L=>L.data(),"edgeData"),ie=gt(L=>L.data(),"nodeData"),Dr=ar.architecture,Pe=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}static{gt(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",er()}addService({id:L,icon:b,in:A,title:G,iconText:N}){if(this.registeredIds[L]!==void 0)throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The service [${L}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[A]==="node")throw new Error(`The service [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"service",icon:b,iconText:N,title:G,edges:[],in:A}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:L,in:b}){if(this.registeredIds[L]!==void 0)throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);if(b!==void 0){if(L===b)throw new Error(`The junction [${L}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[b]==="node")throw new Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(L){return this.nodes[L]??null}addGroup({id:L,icon:b,in:A,title:G}){if(this.registeredIds?.[L]!==void 0)throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The group [${L}] cannot be placed within itself`);if(this.registeredIds?.[A]===void 0)throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[A]==="node")throw new Error(`The group [${L}]'s parent is not a group`)}this.registeredIds[L]="group",this.groups[L]={id:L,icon:b,title:G,in:A}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:L,rhsId:b,lhsDir:A,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:i,title:r}){if(!Re(A))throw new Error(`Invalid direction given for left hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(A)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[b]===void 0&&this.groups[b]===void 0)throw new Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[L].in,f=this.nodes[b].in;if(h&&a&&f&&a==f)throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&f&&a==f)throw new Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const e={lhsId:L,lhsDir:A,lhsInto:N,lhsGroup:h,rhsId:b,rhsDir:G,rhsInto:v,rhsGroup:i,title:r};this.edges.push(e),this.nodes[L]&&this.nodes[b]&&(this.nodes[L].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw new Error(`An align directive requires at least two members; got ${L.members.length}`);const b=new Set;L.members.forEach(A=>{if(this.registeredIds[A]!=="node")throw new Error(`align ${L.direction} references [${A}], which is not a service or junction`);if(b.has(A))throw new Error(`align ${L.direction} lists [${A}] more than once`);b.add(A)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const L={},b=Object.entries(this.nodes).reduce((i,[r,a])=>(i[r]=a.edges.reduce((f,e)=>{const u=this.getNode(e.lhsId)?.in,t=this.getNode(e.rhsId)?.in;if(u&&t&&u!==t){const s=Ar(e.lhsDir,e.rhsDir);s!=="bend"&&(L[u]??={},L[u][t]=s,L[t]??={},L[t][u]=s)}if(e.lhsId===r){const s=pe(e.lhsDir,e.rhsDir);s&&(f[s]=e.rhsId)}else{const s=pe(e.rhsDir,e.lhsDir);s&&(f[s]=e.lhsId)}return f},{}),i),{}),A=Object.keys(b)[0],G={[A]:1},N=Object.keys(b).reduce((i,r)=>r===A?i:{...i,[r]:1},{}),v=gt(i=>{const r={[i]:[0,0]},a=[i];for(;a.length>0;){const f=a.shift();if(f){G[f]=1,delete N[f];const e=b[f],[u,t]=r[f];Object.entries(e).forEach(([s,o])=>{G[o]||(r[o]=Cr([u,t],s),a.push(o))})}}return r},"BFS"),h=[v(A)];for(;Object.keys(N).length>0;)h.push(v(Object.keys(N)[0]));this.dataStructures={adjList:b,spatialMaps:h,groupAlignments:L}}return this.dataStructures}setElementForId(L,b){this.elements[L]=b}getElementById(L){return this.elements[L]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(L){return this.getConfig()[L]}},xr=gt((L,b)=>{ke(L,b),L.groups.map(A=>b.addGroup(A)),L.services.map(A=>b.addService({...A,type:"service"})),L.junctions.map(A=>b.addJunction({...A,type:"junction"})),L.edges.map(A=>b.addEdge(A)),L.alignments?.map(A=>b.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ge={parser:{yy:void 0},parse:gt(async L=>{const b=await fr("architecture",L);Se.debug(b);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(b,A)},"parse")},Ir=gt(L=>` +import{p as ke}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{_ as gt,D as Ze,ad as qe,l as Se,b as Qe,a as Je,n as Ke,o as je,g as _e,s as tr,p as er,A as rr,y as ir,B as ar,c as me,a$ as Ee,ai as ve,i as nr,d as or,q as sr,aj as hr,b7 as lr}from"./mermaid.core-D1bi95DL.js";import{p as fr}from"./cynefin-VYW2F7L2-DshBI3i_.js";import{c as Fe}from"./cytoscape.esm-OyMbaexL.js";import{g as cr}from"./_commonjsHelpers-CqkleIqs.js";import"./index-BRkLL_ut.js";var se={exports:{}},he={exports:{}},le={exports:{}},gr=le.exports,Me;function ur(){return Me||(Me=1,(function(L,b){(function(G,N){L.exports=N()})(gr,function(){return(function(A){var G={};function N(v){if(G[v])return G[v].exports;var h=G[v]={i:v,l:!1,exports:{}};return A[v].call(h.exports,h,h.exports,N),h.l=!0,h.exports}return N.m=A,N.c=G,N.i=function(v){return v},N.d=function(v,h,i){N.o(v,h)||Object.defineProperty(v,h,{configurable:!1,enumerable:!0,get:i})},N.n=function(v){var h=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(h,"a",h),h},N.o=function(v,h){return Object.prototype.hasOwnProperty.call(v,h)},N.p="",N(N.s=28)})([(function(A,G,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,A.exports=v}),(function(A,G,N){var v=N(2),h=N(8),i=N(9);function r(f,e,u){v.call(this,u),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=u,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var a in v)r[a]=v[a];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var u=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(u.getOwner()==e)return u;if(u.getOwner()==t)break;u=u.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},A.exports=r}),(function(A,G,N){function v(h){this.vGraphObject=h}A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(13),r=N(0),a=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new i(s.x,s.y,o.width,o.height):this.rect=new i}e.prototype=Object.create(v.prototype);for(var u in v)e[u]=v[u];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;ls?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=e}),(function(A,G,N){var v=N(0);function h(){}for(var i in v)h[i]=v[i];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,G,N){function v(h,i){h==null&&i==null?(this.x=0,this.y=0):(this.x=h,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(0),r=N(7),a=N(3),f=N(1),e=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,C=0;C-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(w,1),g.target!=g.source&&g.target.edges.splice(P,1);var S=g.source.owner.getEdges().indexOf(g);if(S==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(S,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,C=this.getNodes(),S=C.length,w=0;wT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?d=C[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,C,S,w,P,B,U=this.nodes,V=U.length,M=0;MC&&(l=C),Tw&&(g=w),dC&&(l=C),Tw&&(g=w),d=this.nodes.length){var V=0;T.forEach(function(M){M.owner==c&&V++}),V==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,G,N){var v,h=N(1);function i(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,u){if(f==null&&e==null&&u==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{u=f,e=a,f=r;var t=e.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,u);if(f.isInterGraph=!0,f.source=e,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,u=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var u=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(u=1);var t=u*a[0],s=a[1]/u;a[0]t)return a[0]=f,a[1]=o,a[2]=u,a[3]=U,!1;if(eu)return a[0]=s,a[1]=e,a[2]=P,a[3]=t,!1;if(fu?(a[0]=l,a[1]=T,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>u?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=T,n=!0)),-m===y?u>f?(a[2]=B,a[3]=U,E=!0):(a[2]=P,a[3]=w,E=!0):m===y&&(u>f?(a[2]=S,a[3]=w,E=!0):(a[2]=V,a[3]=U,E=!0)),n&&E)return!1;if(f>u?e>t?(I=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(I=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,R=f+-C/y,a[0]=R,a[1]=W;break;case 2:R=g,W=e+d*y,a[0]=R,a[1]=W;break;case 3:W=T,R=f+C/y,a[0]=R,a[1]=W;break;case 4:R=l,W=e+-d*y,a[0]=R,a[1]=W;break}if(!E)switch(O){case 1:Q=w,x=u+-_/y,a[2]=x,a[3]=Q;break;case 2:x=V,Q=t+M*y,a[2]=x,a[3]=Q;break;case 3:Q=U,x=u+_/y,a[2]=x,a[3]=Q;break;case 4:x=B,Q=t+-M*y,a[2]=x,a[3]=Q;break}}return!1},h.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},h.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,u=i.y,t=r.x,s=r.y,o=a.x,c=a.y,l=f.x,T=f.y,g=void 0,d=void 0,C=void 0,S=void 0,w=void 0,P=void 0,B=void 0,U=void 0,V=void 0;return C=s-u,w=e-t,B=t*u-e*s,S=T-c,P=o-l,U=l*c-o*T,V=C*P-S*w,V===0?null:(g=(w*U-P*B)/V,d=(S*B-C*U)/V,new v(g,d))},h.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=v}),(function(A,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,A.exports=v}),(function(A,G,N){var v=(function(){function e(u,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},A.exports=h}),(function(A,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(C.push(w[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),d.add(P);for(var B=P.getEdges(),g=0;g-1&&w.splice(_,1)}d=new Set,S=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(U,1);var V=S.getNeighborsList();V.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},A.exports=v}),(function(A,G,N){var v=N(5);function h(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(i){this.lworldExtX=i},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(i){this.lworldExtY=i},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},h.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},h.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},h.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},h.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},h.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},A.exports=h}),(function(A,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oC||d>C)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(C=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>C||d>C)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||C>=g[0].length)){for(var S=0;Se}}]),a})();A.exports=r}),(function(A,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),a=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/h,r=Math.abs(h)*Math.sqrt(1+r*r)):i!=0?(r=h/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},A.exports=v}),(function(A,G,N){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},h.emit=function(i,r){for(var a=0;a{var G={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var u in f)e[u]=f[u];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),u=a(880),t=a(991),s=a(767),o=a(806),c=a(902),l=a(551).FDLayoutConstants,T=a(551).LayoutConstants,g=a(551).Point,d=a(551).PointD,C=a(551).DimensionD,S=a(551).Layout,w=a(551).Integer,P=a(551).IGeometry,B=a(551).LGraph,U=a(551).Transform,V=a(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var _ in f)M[_]=f[_];M.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var O=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new V,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var D=n.idToNodeMap.get($.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;Rm&&(m=Math.floor(O.y)),I=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var y=B.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var O=0;O1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),$--,X--}E!=null?D=(z.indexOf(H[0])+1)%$:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;M.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},M.maxDiagonalInTree=function(n){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[R]=[]),E[R]=E[R].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,O)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,O=m.labelMarginLeft,R=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,O,R)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),O;return IR&&(R=$.getWidth())});var W=I/y,x=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return R>rt&&(rt=R),rt+=m*2,rt},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(D){return D.rect.width*D.rect.height},W=function(D,H){return R(H)-R(D)};n.sort(function($,D){var H=W;return O.idealRowWidth?(H=I,H($.id,D.id)):H($,D)});for(var x=0,Q=0,z=0;z0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var O=n.rowWidth[I];if(O+n.horizontalPadding+E<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+R)/(O+E+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,R=0;RO&&(O=m[R].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(I0)for(var rt=O;rt<=R;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,D,H,k=0;k{var f=a(551).FDLayoutNode,e=a(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?C[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?C[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var At=function(){var ot=dt.shift(),Lt=Y.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(Y){var Z=0,K=0,q=0,at=0;if(Y.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:C[g.get(j.top)]-C[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,Y){m[Y]=[F.position.x,F.position.y],y[Y]=[d[g.get(F.nodeId)],C[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var Y=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;Y[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),At=void 0;dt.size>0?At=d[g.get(dt.values().next().value)]:At=V(j).x,Y[et].forEach(function(pt){m[F]=[At,C[g.get(pt)]],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},K=0;K0?At=d[g.get(dt.values().next().value)]:At=V(j).y,q[et].forEach(function(pt){m[F]=[d[g.get(pt)],At],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,Y){var Z={x:d[g.get(F.nodeId)],y:C[g.get(F.nodeId)]},K=F.position,q=U(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(F,Y){d[Y]+=mt.x}),C.forEach(function(F,Y){C[Y]+=mt.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,C[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(Y){var Z=new Set;Dt[Y].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=V(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=C[g.get(K.values().next().value)]:q=V(Z).y,Z.forEach(function(at){R.has(at)||(C[g.get(at)]=q)})},Ft=0;Ft{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(45);return h})()})})(he)),he.exports}var pr=se.exports,De;function yr(){return De||(De=1,(function(L,b){(function(G,N){L.exports=N(vr())})(pr,function(A){return(()=>{var G={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),C;!(l=(C=d.next()).done)&&(c.push(C.value),!(o&&c.length===o));l=!0);}catch(S){T=!0,g=S}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var O=0;O1){C=g[0],S=C.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),B),U},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,C=!1,S=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var B=P.value,U=f(B,2),V=U[0],M=U[1],_=o.cy.getElementById(V);if(_){var n=_.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,y=s.yCoords[M]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){C=!0,S=x}finally{try{!d&&w.return&&w.return()}finally{if(C)throw S}}var I=t.x-(l+c)/2,O=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+O})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,w=void 0,P=void 0,B=t.descendants().not(":parent"),U=B.length,V=0;VC&&(l=C),Tw&&(g=w),d{var f=a(548),e=a(140).CoSELayout,u=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,T=function(d,C){var S=d.cy,w=d.eles,P=w.nodes(),B=w.edges(),U=void 0,V=void 0,M=void 0,_={};d.randomize&&(U=C.nodeIndexes,V=C.xCoords,M=C.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(S,w),m=function W(x,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,R=O.newGraphManager();return m(R.addRoot(),f.getTopMostNodes(P),O,d),y(O,R,B),I(O,d),O.runLayout(),_};i.exports={coseLayout:T}}),212:((i,r,a)=>{var f=(function(){function d(C,S){for(var w=0;w0)if(p){var I=t.getTopMostNodes(w.eles.nodes());if(M=t.connectComponents(P,w.eles,I),M.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&M.forEach(function(vt){w.eles=vt,U.push(o(w))}),w.quality=="default"||w.quality=="proof"){var O=P.collection();if(w.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},X=[];if(M.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),M.push(O),U.push(z);for(var $=X.length-1;$>=0;$--)M.splice(X[$],1),U.splice(X[$],1),_.splice(X[$],1)}}M.forEach(function(vt,it){w.eles=vt,V.push(l(w,U[it])),t.relocateComponent(_[it],V[it],w)})}else M.forEach(function(vt,it){t.relocateComponent(_[it],U[it],w)});var D=new Set;if(M.length>1){var H=[],k=B.filter(function(vt){return vt.css("display")=="none"});M.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=U[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(w.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:U[it].xCoords[wt]-Ot.boundingbox().w/2,y:U[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,U[it].xCoords,U[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else V[it][Ot.id()]&&Et.nodes.push({x:V[it][Ot.id()].getLeft(),y:V[it][Ot.id()].getTop(),width:V[it][Ot.id()].getWidth(),height:V[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,U[it].xCoords,U[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[it].xCoords[Rt]),Ut.push(U[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[it].xCoords,U[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[it].xCoords[Ht]),Pt.push(U[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else V[it][mt.id()]&&V[it][Dt.id()]&&Et.edges.push({startX:V[it][mt.id()].getCenterX(),startY:V[it][mt.id()].getCenterY(),endX:V[it][Dt.id()].getCenterX(),endY:V[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")U.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys(V[vt]).forEach(function(it){var ut=V[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);U.push(y)}w.quality=="default"||w.quality=="proof"?(V.push(l(w,U[0])),t.relocateComponent(_[0],V[0],w)):t.relocateComponent(_[0],U[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return V.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),w.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,B),Nt=B.filter(function(vt){return vt.css("display")=="none"});w.eles=B.not(Nt),B.nodes().not(":parent").not(Nt).layoutPositions(S,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,u=a(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,C=new Map,S=new Map,w=[],P=[],B=[],U=[],V=[],M=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,O=o.nodeSeparation,R=void 0,W=function(){for(var Y=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=V[Lt],At=Lt)}return At},Q=function(Y){var Z=void 0;if(Y){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?w[Y].push(S.get(Z.id())):w[Y].push(Z.id()))})});var Nt=function(Y){var Z=C.get(Y),K=void 0;d.get(Y).forEach(function(q){c.getElementById(q).isParent()?K=S.get(q):K=q,w[Z].push(K),w[C.get(K)].push(Y)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(F){it=!0,ut=F}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=C.size;var mt=void 0;if(E>2){R=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(579);return h})()})})(se)),se.exports}var mr=yr();const Er=cr(mr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:gt(L=>`${L},${L/2} 0,${L} 0,0`,"L"),R:gt(L=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:gt(L=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:gt(L=>`${L/2},0 ${L},${L} 0,${L}`,"B")},oe={L:gt((L,b)=>L-b+2,"L"),R:gt((L,b)=>L-2,"R"),T:gt((L,b)=>L-b+2,"T"),B:gt((L,b)=>L-2,"B")},Tr=gt(function(L){return Wt(L)?L==="L"?"R":"L":L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=gt(function(L){const b=L;return b==="L"||b==="R"||b==="T"||b==="B"},"isArchitectureDirection"),Wt=gt(function(L){const b=L;return b==="L"||b==="R"},"isArchitectureDirectionX"),qt=gt(function(L){const b=L;return b==="T"||b==="B"},"isArchitectureDirectionY"),Te=gt(function(L,b){const A=Wt(L)&&qt(b),G=qt(L)&&Wt(b);return A||G},"isArchitectureDirectionXY"),Nr=gt(function(L){const b=L[0],A=L[1],G=Wt(b)&&qt(A),N=qt(b)&&Wt(A);return G||N},"isArchitecturePairXY"),Lr=gt(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),pe=gt(function(L,b){const A=`${L}${b}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=gt(function([L,b],A){const G=A[0],N=A[1];return Wt(G)?qt(N)?[L+(G==="L"?-1:1),b+(N==="T"?1:-1)]:[L+(G==="L"?-1:1),b]:Wt(N)?[L+(N==="L"?1:-1),b+(G==="T"?1:-1)]:[L,b+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wr=gt(function(L){return L==="LT"||L==="TL"?[1,1]:L==="BL"||L==="LB"?[1,-1]:L==="BR"||L==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(L,b){return Te(L,b)?"bend":Wt(L)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=gt(function(L){return L.type==="service"},"isArchitectureService"),Or=gt(function(L){return L.type==="junction"},"isArchitectureJunction"),be=gt(L=>L.data(),"edgeData"),ie=gt(L=>L.data(),"nodeData"),Dr=ar.architecture,Pe=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}static{gt(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",er()}addService({id:L,icon:b,in:A,title:G,iconText:N}){if(this.registeredIds[L]!==void 0)throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The service [${L}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[A]==="node")throw new Error(`The service [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"service",icon:b,iconText:N,title:G,edges:[],in:A}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:L,in:b}){if(this.registeredIds[L]!==void 0)throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);if(b!==void 0){if(L===b)throw new Error(`The junction [${L}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[b]==="node")throw new Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(L){return this.nodes[L]??null}addGroup({id:L,icon:b,in:A,title:G}){if(this.registeredIds?.[L]!==void 0)throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The group [${L}] cannot be placed within itself`);if(this.registeredIds?.[A]===void 0)throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[A]==="node")throw new Error(`The group [${L}]'s parent is not a group`)}this.registeredIds[L]="group",this.groups[L]={id:L,icon:b,title:G,in:A}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:L,rhsId:b,lhsDir:A,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:i,title:r}){if(!Re(A))throw new Error(`Invalid direction given for left hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(A)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[b]===void 0&&this.groups[b]===void 0)throw new Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[L].in,f=this.nodes[b].in;if(h&&a&&f&&a==f)throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&f&&a==f)throw new Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const e={lhsId:L,lhsDir:A,lhsInto:N,lhsGroup:h,rhsId:b,rhsDir:G,rhsInto:v,rhsGroup:i,title:r};this.edges.push(e),this.nodes[L]&&this.nodes[b]&&(this.nodes[L].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw new Error(`An align directive requires at least two members; got ${L.members.length}`);const b=new Set;L.members.forEach(A=>{if(this.registeredIds[A]!=="node")throw new Error(`align ${L.direction} references [${A}], which is not a service or junction`);if(b.has(A))throw new Error(`align ${L.direction} lists [${A}] more than once`);b.add(A)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const L={},b=Object.entries(this.nodes).reduce((i,[r,a])=>(i[r]=a.edges.reduce((f,e)=>{const u=this.getNode(e.lhsId)?.in,t=this.getNode(e.rhsId)?.in;if(u&&t&&u!==t){const s=Ar(e.lhsDir,e.rhsDir);s!=="bend"&&(L[u]??={},L[u][t]=s,L[t]??={},L[t][u]=s)}if(e.lhsId===r){const s=pe(e.lhsDir,e.rhsDir);s&&(f[s]=e.rhsId)}else{const s=pe(e.rhsDir,e.lhsDir);s&&(f[s]=e.lhsId)}return f},{}),i),{}),A=Object.keys(b)[0],G={[A]:1},N=Object.keys(b).reduce((i,r)=>r===A?i:{...i,[r]:1},{}),v=gt(i=>{const r={[i]:[0,0]},a=[i];for(;a.length>0;){const f=a.shift();if(f){G[f]=1,delete N[f];const e=b[f],[u,t]=r[f];Object.entries(e).forEach(([s,o])=>{G[o]||(r[o]=Cr([u,t],s),a.push(o))})}}return r},"BFS"),h=[v(A)];for(;Object.keys(N).length>0;)h.push(v(Object.keys(N)[0]));this.dataStructures={adjList:b,spatialMaps:h,groupAlignments:L}}return this.dataStructures}setElementForId(L,b){this.elements[L]=b}getElementById(L){return this.elements[L]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(L){return this.getConfig()[L]}},xr=gt((L,b)=>{ke(L,b),L.groups.map(A=>b.addGroup(A)),L.services.map(A=>b.addService({...A,type:"service"})),L.junctions.map(A=>b.addJunction({...A,type:"junction"})),L.edges.map(A=>b.addEdge(A)),L.alignments?.map(A=>b.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ge={parser:{yy:void 0},parse:gt(async L=>{const b=await fr("architecture",L);Se.debug(b);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(b,A)},"parse")},Ir=gt(L=>` .edge { stroke-width: ${L.archEdgeWidth}; stroke: ${L.archEdgeColor}; diff --git a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DHUznNgz.js b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-dcwx65-g.js similarity index 99% rename from apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DHUznNgz.js rename to apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-dcwx65-g.js index 88703a4666a..8c58e917471 100644 --- a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DHUznNgz.js +++ b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-dcwx65-g.js @@ -1,4 +1,4 @@ -import{g as de}from"./chunk-5VM5RSS4-K_NNkrmw.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,y as rt,d as D,e as Pe,l as k,p as Fe,r as We,c as R,aZ as Ye,a7 as He,a8 as Ke,L as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,x as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-CGrLstUA.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-5_2atmZK.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: +import{g as de}from"./chunk-5VM5RSS4-T6ZfJwFq.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,y as rt,d as D,e as Pe,l as k,p as Fe,r as We,c as R,aZ as Ye,a7 as He,a8 as Ke,L as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,x as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-D1bi95DL.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-DRV27vN-.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: `+O.showPosition()+` Expecting `+it.join(", ")+", got '"+(this.terminals_[P]||P)+"'":ft="Parse error on line "+(C+1)+": Unexpected "+(P==at?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(ft,{text:O.match,token:this.terminals_[P]||P,line:O.yylineno,loc:dt,expected:it})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+P);switch(H[0]){case 1:x.push(P),E.push(O.yytext),o.push(O.yylloc),x.push(H[1]),P=null,Z=O.yyleng,f=O.yytext,C=O.yylineno,dt=O.yylloc;break;case 2:if(G=this.productions_[H[1]][1],J.$=E[E.length-G],J._$={first_line:o[o.length-(G||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(G||1)].first_column,last_column:o[o.length-1].last_column},ge&&(J._$.range=[o[o.length-(G||1)].range[0],o[o.length-1].range[1]]),pt=this.performAction.apply(J,[f,Z,C,j.yy,H[1],E,o].concat(gt)),typeof pt<"u")return pt;G&&(x=x.slice(0,-1*G*2),E=E.slice(0,-1*G),o=o.slice(0,-1*G)),x.push(this.productions_[H[1]][0]),E.push(J.$),o.push(J._$),It=F[x[x.length-2]][x[x.length-1]],x.push(It);break;case 3:return!0}}return!0},"parse")},N=(function(){var T={EOF:1,parseError:g(function(p,x){if(this.yy.parser)this.yy.parser.parseError(p,x);else throw new Error(p)},"parseError"),setInput:g(function(m,p){return this.yy=p||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var p=m.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:g(function(m){var p=m.length,x=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===L.length?this.yylloc.first_column:0)+L[L.length-x.length].length-x[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(m){this.unput(this.match.slice(m))},"less"),pastInput:g(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var m=this.pastInput(),p=new Array(m.length+1).join("-");return m+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BRKLxvwh.js b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-CKCcIU8j.js similarity index 99% rename from apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BRKLxvwh.js rename to apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-CKCcIU8j.js index db1d5769ab4..44999517c0b 100644 --- a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BRKLxvwh.js +++ b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-CKCcIU8j.js @@ -1,4 +1,4 @@ -import{g as Oe,d as Re}from"./chunk-32BRIVSS-0ImWpiFu.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-CGrLstUA.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: +import{g as Oe,d as Re}from"./chunk-32BRIVSS-IAHjo_8M.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-D1bi95DL.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: `+D.showPosition()+` Expecting `+Lt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Kt="Parse error on line "+(Et+1)+": Unexpected "+(I==le?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Kt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:qt,expected:Lt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,re=D.yyleng,f=D.yytext,Et=D.yylineno,qt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},we&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Gt=this.performAction.apply(wt,[f,re,Et,At.yy,N[1],R,h].concat(Ce)),typeof Gt<"u")return Gt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ce=Rt[E[E.length-2]][E[E.length-1]],E.push(ce);break;case 3:return!0}}return!0},"parse")},Ae=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/channel-5_2atmZK.js b/apps/kimi-code/dist-web/assets/channel-5_2atmZK.js deleted file mode 100644 index 0d0fdbfbe4c..00000000000 --- a/apps/kimi-code/dist-web/assets/channel-5_2atmZK.js +++ /dev/null @@ -1 +0,0 @@ -import{U as a,O as n}from"./mermaid.core-CGrLstUA.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/channel-DRV27vN-.js b/apps/kimi-code/dist-web/assets/channel-DRV27vN-.js new file mode 100644 index 00000000000..ca902b9ce21 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/channel-DRV27vN-.js @@ -0,0 +1 @@ +import{U as a,O as n}from"./mermaid.core-D1bi95DL.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-CldwFnN4.js b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BZszbgyO.js similarity index 67% rename from apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-CldwFnN4.js rename to apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BZszbgyO.js index 23b8a59016e..abf655ac642 100644 --- a/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-CldwFnN4.js +++ b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BZszbgyO.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-CGrLstUA.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; +import{_ as i}from"./mermaid.core-D1bi95DL.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; diff --git a/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-0ImWpiFu.js b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-IAHjo_8M.js similarity index 96% rename from apps/kimi-code/dist-web/assets/chunk-32BRIVSS-0ImWpiFu.js rename to apps/kimi-code/dist-web/assets/chunk-32BRIVSS-IAHjo_8M.js index 87b50d0e3ab..def2a222083 100644 --- a/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-0ImWpiFu.js +++ b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-IAHjo_8M.js @@ -1 +1 @@ -import{_ as i,d as l,N as d,j as o}from"./mermaid.core-CGrLstUA.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; +import{_ as i,d as l,N as d,j as o}from"./mermaid.core-D1bi95DL.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; diff --git a/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-K_NNkrmw.js b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-T6ZfJwFq.js similarity index 83% rename from apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-K_NNkrmw.js rename to apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-T6ZfJwFq.js index 88a0ce744d1..b66df8b306f 100644 --- a/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-K_NNkrmw.js +++ b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-T6ZfJwFq.js @@ -1,4 +1,4 @@ -import{_ as e}from"./mermaid.core-CGrLstUA.js";var l=e(()=>` +import{_ as e}from"./mermaid.core-D1bi95DL.js";var l=e(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; diff --git a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-Du5tJK2w.js b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-BwdwY9_G.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-Du5tJK2w.js rename to apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-BwdwY9_G.js index 8f3a8377893..16a75f9cb6a 100644 --- a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-Du5tJK2w.js +++ b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-BwdwY9_G.js @@ -1,4 +1,4 @@ -import{g as te}from"./chunk-XXDRQBXY-BwEKpC0s.js";import{s as ee}from"./chunk-VR4S4FIN-Cp8JVohH.js";import{_ as f,l as _,c as $,v as se,x as ie,a as re,b as ae,g as ne,s as oe,n as le,o as ce,a9 as he,k as j,p as ue,d as bt,a5 as de}from"./mermaid.core-CGrLstUA.js";import{f as fe}from"./chunk-32BRIVSS-0ImWpiFu.js";var vt=(function(){var t=f(function(V,a,d,r){for(d=d||{},r=V.length;r--;d[V[r]]=a);return d},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],u=[1,22],L=[1,23],I=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],w=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,d,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,d){if(d.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=d,r}},"parseError"),parse:f(function(a){var d=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(N){r.length=r.length-2*N,E.length=E.length-N,i.length=i.length-N}f(Zt,"popStack");function Lt(){var N;return N=g.pop()||b.lex()||Q,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=d.symbols_[N]||N),N}f(Lt,"lex");for(var A,W,R,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?R=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),R=B[W]&&B[W][A]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: +import{g as te}from"./chunk-XXDRQBXY-B34NejJn.js";import{s as ee}from"./chunk-VR4S4FIN-SMzu0FAl.js";import{_ as f,l as _,c as $,v as se,x as ie,a as re,b as ae,g as ne,s as oe,n as le,o as ce,a9 as he,k as j,p as ue,d as bt,a5 as de}from"./mermaid.core-D1bi95DL.js";import{f as fe}from"./chunk-32BRIVSS-IAHjo_8M.js";var vt=(function(){var t=f(function(V,a,d,r){for(d=d||{},r=V.length;r--;d[V[r]]=a);return d},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],u=[1,22],L=[1,23],I=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],w=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,d,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,d){if(d.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=d,r}},"parseError"),parse:f(function(a){var d=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(N){r.length=r.length-2*N,E.length=E.length-N,i.length=i.length-N}f(Zt,"popStack");function Lt(){var N;return N=g.pop()||b.lex()||Q,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=d.symbols_[N]||N),N}f(Lt,"lex");for(var A,W,R,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?R=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),R=B[W]&&B[W][A]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: `+b.showPosition()+` Expecting `+dt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":mt="Parse error on line "+(Y+1)+": Unexpected "+(A==Q?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:Et,expected:dt})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(R[0]){case 1:r.push(A),E.push(b.yytext),i.push(b.yylloc),r.push(R[1]),A=null,K=b.yyleng,l=b.yytext,Y=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[R[1]][1],X.$=E[E.length-G],X._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},Qt&&(X._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(X,[l,K,Y,U.yy,R[1],E,i].concat(gt)),typeof _t<"u")return _t;G&&(r=r.slice(0,-1*G*2),E=E.slice(0,-1*G),i=i.slice(0,-1*G)),r.push(this.productions_[R[1]][0]),E.push(X.$),i.push(X._$),It=B[r[r.length-2]][r[r.length-1]],r.push(It);break;case 3:return!0}}return!0},"parse")},qt=(function(){var V={EOF:1,parseError:f(function(d,r){if(this.yy.parser)this.yy.parser.parseError(d,r);else throw new Error(d)},"parseError"),setInput:f(function(a,d){return this.yy=d||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var d=a.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var d=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===g.length?this.yylloc.first_column:0)+g[g.length-r.length].length-r[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),d=new Array(a.length+1).join("-");return a+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-CnsTQcA8.js b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DAAIR0Fi.js similarity index 71% rename from apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-CnsTQcA8.js rename to apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DAAIR0Fi.js index 002892581eb..6560354cd01 100644 --- a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-CnsTQcA8.js +++ b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DAAIR0Fi.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-CGrLstUA.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; +import{_ as i}from"./mermaid.core-D1bi95DL.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; diff --git a/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-BWiH3s-c.js b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DEUKbfBz.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-BWiH3s-c.js rename to apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DEUKbfBz.js index 29dd8606317..1d6aeda142d 100644 --- a/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-BWiH3s-c.js +++ b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DEUKbfBz.js @@ -1,4 +1,4 @@ -import{_ as p,l as w,D as L,y as E,p as I,E as X,e as H,i as q,c as G}from"./mermaid.core-CGrLstUA.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>q(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` +import{_ as p,l as w,D as L,y as E,p as I,E as X,e as H,i as q,c as G}from"./mermaid.core-D1bi95DL.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>q(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` `),w.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ee=p(()=>N,"getAccDescription"),te=_,re=W,ie={clear:U,setTitle:_,getTitle:W,addRule:j,getRules:K,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:V,getAccDescription:ee,setDiagramTitle:te,getDiagramTitle:re},g={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),B=p(e=>e?Object.keys(e).every(i=>i==="railroad"||oe.has(i)):!1,"isRailroadStyleOptions"),le=p(e=>e?"railroad"in e&&e.railroad?e.railroad:B(e)?e:{}:{},"extractRailroadOverrides"),se=p(e=>{if(!e||B(e))return{};const{railroad:i,svgId:a,theme:r,look:t,...n}=e;return n},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ne.test(a)?a:i},"sanitizeColorValue"),Y=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ae.test(a)?a:i},"sanitizeFontFamilyValue"),S=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),de=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),ce=p(e=>{const i=Y(e.fontFamily,g.fontFamily),a=de(e.fontSize)??g.fontSize;return{...g,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,g.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,g.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,g.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,g.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,g.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,g.nonTerminalTextColor),lineColor:m(e.lineColor,g.lineColor),markerFill:m(e.lineColor,g.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,g.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,g.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,g.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,g.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,g.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,g.ruleNameColor)}},"buildThemeDefaults"),M=p(e=>{const i=E(),a={...X(),...i.themeVariables??{},...se(e)},r=ce(a),t={...i.railroad??{},...le(e)};return{compactMode:t.compactMode??r.compactMode,padding:S(t.padding,r.padding),verticalSeparation:S(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:S(t.horizontalSeparation,r.horizontalSeparation),arcRadius:S(t.arcRadius,r.arcRadius),fontSize:S(t.fontSize,r.fontSize),fontFamily:Y(t.fontFamily,r.fontFamily),terminalFill:m(t.terminalFill,r.terminalFill),terminalStroke:m(t.terminalStroke,r.terminalStroke),terminalTextColor:m(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:m(t.lineColor,r.lineColor),strokeWidth:S(t.strokeWidth,r.strokeWidth),markerFill:m(t.markerFill,r.markerFill),commentFill:m(t.commentFill,r.commentFill),commentStroke:m(t.commentStroke,r.commentStroke),commentTextColor:m(t.commentTextColor,r.commentTextColor),specialFill:m(t.specialFill,r.specialFill),specialStroke:m(t.specialStroke,r.specialStroke),ruleNameColor:m(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:S(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),ue=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:r,terminalStroke:t,terminalTextColor:n,nonTerminalFill:h,nonTerminalStroke:s,nonTerminalTextColor:o,lineColor:u,strokeWidth:c,markerFill:d,commentFill:x,commentStroke:l,commentTextColor:f,specialFill:y,specialStroke:v,ruleNameColor:C}=M(e);return` .railroad-diagram { font-family: ${i}; diff --git a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-Bg4GHN0V.js b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-DC1nQV1h.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-Bg4GHN0V.js rename to apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-DC1nQV1h.js index 06e693b4c39..cf878b1d0eb 100644 --- a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-Bg4GHN0V.js +++ b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-DC1nQV1h.js @@ -1 +1 @@ -import{_ as u,l as i}from"./mermaid.core-CGrLstUA.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; +import{_ as u,l as i}from"./mermaid.core-D1bi95DL.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; diff --git a/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-5w7loxVR.js b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-CBy4In3c.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-5w7loxVR.js rename to apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-CBy4In3c.js index c07a52cacc7..f736db909b1 100644 --- a/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-5w7loxVR.js +++ b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-CBy4In3c.js @@ -1,4 +1,4 @@ -import{g as tt}from"./chunk-5VM5RSS4-K_NNkrmw.js";import{g as st}from"./chunk-XXDRQBXY-BwEKpC0s.js";import{s as it}from"./chunk-VR4S4FIN-Cp8JVohH.js";import{_ as f,l as Ie,c as F,u as at,v as nt,x as Oe,d as de,a5 as rt,b as ut,a as lt,s as ct,g as ot,n as ht,o as dt,k as I,p as pt,q as At,i as ft,a6 as G}from"./mermaid.core-CGrLstUA.js";import{f as gt}from"./chunk-32BRIVSS-0ImWpiFu.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: +import{g as tt}from"./chunk-5VM5RSS4-T6ZfJwFq.js";import{g as st}from"./chunk-XXDRQBXY-B34NejJn.js";import{s as it}from"./chunk-VR4S4FIN-SMzu0FAl.js";import{_ as f,l as Ie,c as F,u as at,v as nt,x as Oe,d as de,a5 as rt,b as ut,a as lt,s as ct,g as ot,n as ht,o as dt,k as I,p as pt,q as At,i as ft,a6 as G}from"./mermaid.core-D1bi95DL.js";import{f as gt}from"./chunk-32BRIVSS-IAHjo_8M.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: `+D.showPosition()+` Expecting `+he.join(", ")+", got '"+(this.terminals_[B]||B)+"'":ve="Parse error on line "+(ce+1)+": Unexpected "+(B==Ke?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(ve,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Le,expected:he})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ye=D.yyleng,s=D.yytext,ce=D.yylineno,Le=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],R.$=C[C.length-v],R._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},$e&&(R._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),xe=this.performAction.apply(R,[s,Ye,ce,w.yy,L[1],C,e].concat(Ze)),typeof xe<"u")return xe;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(R.$),e.push(R._$),Qe=J[p[p.length-2]][p[p.length-1]],p.push(Qe);break;case 3:return!0}}return!0},"parse")},He=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(o){this.unput(this.match.slice(o))},"less"),pastInput:f(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Cp8JVohH.js b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-SMzu0FAl.js similarity index 87% rename from apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Cp8JVohH.js rename to apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-SMzu0FAl.js index 8577ffba007..87b05ff816c 100644 --- a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Cp8JVohH.js +++ b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-SMzu0FAl.js @@ -1 +1 @@ -import{_ as a,e as w,l as x}from"./mermaid.core-CGrLstUA.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; +import{_ as a,e as w,l as x}from"./mermaid.core-D1bi95DL.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-BwEKpC0s.js b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-B34NejJn.js similarity index 72% rename from apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-BwEKpC0s.js rename to apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-B34NejJn.js index 5112d162876..28027c32b06 100644 --- a/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-BwEKpC0s.js +++ b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-B34NejJn.js @@ -1 +1 @@ -import{_ as a,d as o}from"./mermaid.core-CGrLstUA.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; +import{_ as a,d as o}from"./mermaid.core-D1bi95DL.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-BouDd7KD.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-BouDd7KD.js new file mode 100644 index 00000000000..a54ee1ab30f --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-BouDd7KD.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-CBy4In3c.js";import{_ as i}from"./mermaid.core-D1bi95DL.js";import"./chunk-5VM5RSS4-T6ZfJwFq.js";import"./chunk-XXDRQBXY-B34NejJn.js";import"./chunk-VR4S4FIN-SMzu0FAl.js";import"./chunk-32BRIVSS-IAHjo_8M.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-CNk36E8O.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-CNk36E8O.js deleted file mode 100644 index 9bbafb42417..00000000000 --- a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-CNk36E8O.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-5w7loxVR.js";import{_ as i}from"./mermaid.core-CGrLstUA.js";import"./chunk-5VM5RSS4-K_NNkrmw.js";import"./chunk-XXDRQBXY-BwEKpC0s.js";import"./chunk-VR4S4FIN-Cp8JVohH.js";import"./chunk-32BRIVSS-0ImWpiFu.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-BouDd7KD.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-BouDd7KD.js new file mode 100644 index 00000000000..a54ee1ab30f --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-BouDd7KD.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-CBy4In3c.js";import{_ as i}from"./mermaid.core-D1bi95DL.js";import"./chunk-5VM5RSS4-T6ZfJwFq.js";import"./chunk-XXDRQBXY-B34NejJn.js";import"./chunk-VR4S4FIN-SMzu0FAl.js";import"./chunk-32BRIVSS-IAHjo_8M.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-CNk36E8O.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-CNk36E8O.js deleted file mode 100644 index 9bbafb42417..00000000000 --- a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-CNk36E8O.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-5w7loxVR.js";import{_ as i}from"./mermaid.core-CGrLstUA.js";import"./chunk-5VM5RSS4-K_NNkrmw.js";import"./chunk-XXDRQBXY-BwEKpC0s.js";import"./chunk-VR4S4FIN-Cp8JVohH.js";import"./chunk-32BRIVSS-0ImWpiFu.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-CyvFRDuS.js b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-BoiGDa4E.js similarity index 99% rename from apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-CyvFRDuS.js rename to apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-BoiGDa4E.js index 89672219db5..32065a199c2 100644 --- a/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-CyvFRDuS.js +++ b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-BoiGDa4E.js @@ -1 +1 @@ -import{_ as V,l as k,d as lt}from"./mermaid.core-CGrLstUA.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index-CvgiEu-R.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; +import{_ as V,l as k,d as lt}from"./mermaid.core-D1bi95DL.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index-BRkLL_ut.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; diff --git a/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-Ct8il_Gb.js b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DshBI3i_.js similarity index 99% rename from apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-Ct8il_Gb.js rename to apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DshBI3i_.js index f7887cadd93..71f70040ecb 100644 --- a/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-Ct8il_Gb.js +++ b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DshBI3i_.js @@ -1,4 +1,4 @@ -import{bR as et}from"./index-CvgiEu-R.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` +import{bR as et}from"./index-BRkLL_ut.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` `,`\r `,"\r"],(function(e){function t(s,o,l,u){return new lh(s,o,l,u)}i(t,"create"),e.create=t;function r(s){let o=s;return!!(A.defined(o)&&A.string(o.uri)&&(A.undefined(o.languageId)||A.string(o.languageId))&&A.uinteger(o.lineCount)&&A.func(o.getText)&&A.func(o.positionAt)&&A.func(o.offsetAt))}i(r,"is"),e.is=r;function n(s,o){let l=s.getText(),u=a(o,(f,d)=>{let m=f.range.start.line-d.range.start.line;return m===0?f.range.start.character-d.range.start.character:m}),c=l.length;for(let f=u.length-1;f>=0;f--){let d=u[f],m=s.offsetAt(d.range.start),g=s.offsetAt(d.range.end);if(g<=c)l=l.substring(0,m)+d.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");c=m}return l}i(n,"applyEdits"),e.applyEdits=n;function a(s,o){if(s.length<=1)return s;const l=s.length/2|0,u=s.slice(0,l),c=s.slice(l);a(u,o),a(c,o);let f=0,d=0,m=0;for(;f({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` +import{p as xt}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{s as gt,g as $t,o as bt,n as wt,a as Ct,b as vt,_ as s,l as O,D as Dt,e as kt,p as At,A as U,y as Q,B as Tt,E as ot}from"./mermaid.core-D1bi95DL.js";import{p as Bt}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` .cynefinDomain { stroke: none; } diff --git a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BuaL-XNK.js b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-CsRzig98.js similarity index 97% rename from apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BuaL-XNK.js rename to apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-CsRzig98.js index 774d0e4b194..956d987d583 100644 --- a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BuaL-XNK.js +++ b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-CsRzig98.js @@ -1,4 +1,4 @@ -import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-Bg4GHN0V.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-CGrLstUA.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX +import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-DC1nQV1h.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-D1bi95DL.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX Node.id = `,d,` data=`,u.height,` Parent cluster`,c.height),t.setNode(c.id,u),t.parent(d)||(l.trace("Setting parent",d,c.id),t.setParent(d,c.id,u))}if(l.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),e?.clusterNode){l.info("Cluster identified XBX",d,e.width,t.node(d));const{ranksep:u,nodesep:x}=t.graph();e.graph.setGraph({...e.graph.graph(),ranksep:u+25,nodesep:x});const N=await T(n,e.graph,g,m,t.node(d),o),M=N.elem;W(e,M),e.diff=N.diff||0,l.info("New compound node after recursive render XAX",d,"width",e.width,"height",e.height),$(M,e)}else t.children(d).length>0?(l.trace("Cluster - the non recursive path XBX",d,e.id,e,e.width,"Graph:",t),l.trace(P(e.id,t)),E.set(e.id,{id:P(e.id,t),node:e})):(l.trace("Node - the non recursive path XAX",d,n,t.node(d),r),await j(n,t.node(d),{config:o,dir:r}))})),await w(async()=>{const d=t.edges().map(async function(e){const u=t.edge(e.v,e.w,e.name);if(l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),l.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),l.info("Fix",E,"ids:",e.v,e.w,"Translating: ",E.get(e.v),E.get(e.w)),p&&u.selfLoop){if(u.selfLoop.order!==1)return;const x=u.id;u.id=u.selfLoop.id,await G(i,u),u.id=x;return}await G(i,u)});await Promise.all(d)},"processEdges")(),l.info("Graph before layout:",JSON.stringify(I(t))),l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),U(t),l.info("Graph after layout:",JSON.stringify(I(t)));let X=0,{subGraphTitleTotalMargin:S}=q(o);await Promise.all(A(t).map(async function(d){const e=t.node(d);if(l.info("Position XBX => "+d+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e?.clusterNode)e.y+=S,l.info("A tainted cluster node XBX1",d,e.id,e.width,e.height,e.x,e.y,t.parent(d)),E.get(e.id).node=e,R(e);else if(t.children(d).length>0){l.info("A pure cluster node XBX1",d,e.id,e.x,e.y,e.width,e.height,t.parent(d)),e.height+=S,t.node(e.parentId);const u=e?.padding/2||0,x=e?.labelBBox?.height||0,N=x-u||0;l.debug("OffsetY",N,"labelHeight",x,"halfPadding",u),await F(h,e),E.get(e.id).node=e}else{const u=t.node(e.parentId);e.y+=S/2,l.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",u,u?.offsetY,e),R(e)}}));const b=S/2;return ne(t,b,{mergeSelfLoops:p}).forEach(function({edge:d,start:e,end:u}){l.info("Edge "+e+" -> "+u+": "+JSON.stringify(d),d),d.points.forEach(k=>k.y+=b);const x=t.node(e),N=t.node(u),M=z(a,d,E,g,x,N,m);K(d,M)}),t.nodes().forEach(function(d){const e=t.node(d);l.info(d,e.type,e.diff),e.isGroup&&(X=e.diff)}),l.warn("Returning from recursive render XAX",f,X),{elem:f,diff:X}},"recursiveRender"),le=w(async(s,t)=>{const g=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:s.direction,nodesep:s.config?.nodeSpacing||s.config?.flowchart?.nodeSpacing||s.nodeSpacing,ranksep:s.config?.rankSpacing||s.config?.flowchart?.rankSpacing||s.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),m=t.select("g");v(m,s.markers,s.type,s.diagramId),D(),H(),Y(),O(),s.nodes.forEach(o=>{g.setNode(o.id,{...o}),o.parentId&&g.setParent(o.id,o.parentId)}),l.debug("Edges:",s.edges),s.edges.forEach(o=>{if(o.start===o.end){const r=o.start,f=r+"---"+r+"---1",h=r+"---"+r+"---2",a=g.node(r);g.setNode(f,{domId:f,id:f,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),g.setParent(f,a.parentId),g.setNode(h,{domId:h,id:h,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),g.setParent(h,a.parentId);const i=structuredClone(o),n=structuredClone(o),p=structuredClone(o),y=structuredClone(o);n.originalEdge=i,n.selfLoop={id:i.id,order:0},p.originalEdge=i,p.selfLoop={id:i.id,order:1},y.originalEdge=i,y.selfLoop={id:i.id,order:2},n.label="",n.arrowTypeEnd="none",n.endLabelLeft="",n.endLabelRight="",n.startLabelLeft="",n.id=r+"-cyclic-special-1",p.startLabelRight="",p.startLabelLeft="",p.endLabelLeft="",p.endLabelRight="",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=r+"-cyclic-special-mid",y.label="",y.startLabelRight="",y.startLabelLeft="",y.arrowTypeStart="none",a.isGroup&&(n.fromCluster=r,y.toCluster=r),y.id=r+"-cyclic-special-2",y.arrowTypeStart="none",g.setEdge(r,f,n,r+"-cyclic-special-0"),g.setEdge(f,h,p,r+"-cyclic-special-1"),g.setEdge(h,r,y,r+"-cyclic-special-2")}else g.setEdge(o.start,o.end,{...o},o.id)}),l.warn("Graph at first:",JSON.stringify(I(g))),J(g),l.warn("Graph after XAX:",JSON.stringify(I(g)));const c=_();await T(m,g,s.type,s.diagramId,void 0,c)},"render");export{ne as getEdgesToRender,le as render}; diff --git a/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-BXKGXolr.js b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-CIGMiRNq.js similarity index 98% rename from apps/kimi-code/dist-web/assets/diagram-FQU43EPY-BXKGXolr.js rename to apps/kimi-code/dist-web/assets/diagram-FQU43EPY-CIGMiRNq.js index 209d57bbb1e..6e2826759b6 100644 --- a/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-BXKGXolr.js +++ b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-CIGMiRNq.js @@ -1,3 +1,3 @@ -import{p as re}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./mermaid.core-CGrLstUA.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ +import{p as re}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./mermaid.core-D1bi95DL.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Te=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` `,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,Ue={parser:Ee,db:F,renderer:$e,styles:Ne};export{Ue as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-DsoHq3g9.js b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-CgpekfqC.js similarity index 97% rename from apps/kimi-code/dist-web/assets/diagram-G47NLZAW-DsoHq3g9.js rename to apps/kimi-code/dist-web/assets/diagram-G47NLZAW-CgpekfqC.js index 5359ecb28c6..14eedfdc166 100644 --- a/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-DsoHq3g9.js +++ b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-CgpekfqC.js @@ -1,4 +1,4 @@ -import{p as me}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{_ as w,E as ge,y as te,A as Q,D as ye,e as Se,l as ee,be as B,d as j,b as ve,a as xe,n as be,o as we,g as Ce,s as Te,B as Le,bf as $e,p as Ae}from"./mermaid.core-CGrLstUA.js";import{s as Fe}from"./chunk-VR4S4FIN-Cp8JVohH.js";import{p as Ne}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(je)}function Xe(e){return e.children}function Ye(e){return Array.isArray(e)?e[1]:null}function je(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=j(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);Y.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=j(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` +import{p as me}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{_ as w,E as ge,y as te,A as Q,D as ye,e as Se,l as ee,be as B,d as j,b as ve,a as xe,n as be,o as we,g as Ce,s as Te,B as Le,bf as $e,p as Ae}from"./mermaid.core-D1bi95DL.js";import{s as Fe}from"./chunk-VR4S4FIN-SMzu0FAl.js";import{p as Ne}from"./cynefin-VYW2F7L2-DshBI3i_.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(je)}function Xe(e){return e.children}function Ye(e){return Array.isArray(e)?e[1]:null}function je(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=j(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);Y.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=j(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` .treemapNode.section { stroke: ${r.sectionStrokeColor}; stroke-width: ${r.sectionStrokeWidth}; diff --git a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-l2Pip_5t.js b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-Cdv1wVCe.js similarity index 93% rename from apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-l2Pip_5t.js rename to apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-Cdv1wVCe.js index b5ee9099596..7bb5bf0a7a7 100644 --- a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-l2Pip_5t.js +++ b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-Cdv1wVCe.js @@ -1,4 +1,4 @@ -import{p as B}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{_ as b,A as u,D as $,e as C,l as m,b as S,a as D,n as T,o as P,g as z,s as A,y as E,B as F,p as W}from"./mermaid.core-CGrLstUA.js";import{p as _}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return` +import{p as B}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{_ as b,A as u,D as $,e as C,l as m,b as S,a as D,n as T,o as P,g as z,s as A,y as E,B as F,p as W}from"./mermaid.core-D1bi95DL.js";import{p as _}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return` .packetByte { font-size: ${e.byteFontSize}; } diff --git a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-DO8otT0J.js b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BH80-JW9.js similarity index 96% rename from apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-DO8otT0J.js rename to apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BH80-JW9.js index 47b5fa97417..4e8ad112aa2 100644 --- a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-DO8otT0J.js +++ b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BH80-JW9.js @@ -1,4 +1,4 @@ -import{I as X}from"./chunk-2Q5K7J3B-CldwFnN4.js";import{p as O}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./mermaid.core-CGrLstUA.js";import{p as ne}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` +import{I as X}from"./chunk-2Q5K7J3B-BZszbgyO.js";import{p as O}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./mermaid.core-D1bi95DL.js";import{p as ne}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` `),t=new Map;let r=-1;for(const[s,o]of e.entries())if(o.trim()==="treeView-beta"){r=s;break}if(r===-1)return{text:n,lineMap:t};const i=[];for(let s=r+1;s({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),J()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=f(()=>A(ce,N().treeView),"getConfig"),de=f((n,e,t,r,i,a)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const c={id:x.records.cnt++,level:n,name:e,nodeType:t,icon:i,cssClass:r,description:a,children:[]};x.records.stack[x.records.stack.length-1].children.push(c),x.records.stack.push(c)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:Z,getAccDescription:F,getDiagramTitle:j,setAccDescription:P,setAccTitle:Y,setDiagramTitle:G},I=he,pe=f(n=>{O(n,I);for(const e of n.nodes){const t=typeof e.indent=="number"?e.indent:0;let r=e.name;const i=r.endsWith("/");i&&(r=r.slice(0,-1));const a=i?"directory":"file",c=e.classAnnotation||void 0,l=e.iconAnnotation,s=l!==void 0?l||"none":void 0,o=e.descAnnotation||void 0,h=o?K(o,N()):void 0;I.addNode(t,r,a,c,s,h)}},"populate"),fe={parse:f(async n=>{const{text:e,lineMap:t}=R(n);try{const r=await ne("treeView",e);D.debug(r),pe(r)}catch(r){throw t.size>0&&r instanceof Error&&(r.message=M(r.message,t)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function H(n,e){const t=e?.filenameIcons?.[n];if(t)return t;const r=n.lastIndexOf(".");if(r>0){const i=n.substring(r).toLowerCase(),a=e?.extensionIcons;return a?.[i]??a?.[i.slice(1)]}}f(H,"detectIcon");function C(n,e){return n.includes(":")?n:n in b.icons||!e?`${b.prefix}:${n}`:`${e}:${n}`}f(C,"qualifyIcon");function B(n,e){if(n.icon!=="none"){if(n.icon)return C(n.icon,e.defaultIconPack);if(e.showIcons){if(n.nodeType==="file"){const t=H(n.name,e);if(t==="none")return;if(t)return C(t,e.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}f(B,"getNodeIcon");te([{name:b.prefix,icons:b}]);var y=14,ge=4,ue=16,z=f((n,e)=>`tv-icon-${n}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=f(async(n,e,t,r)=>{const i=new Set,a=f(s=>{const o=B(s,t);o&&i.add(o),s.children.forEach(a)},"collect");if(a(e),i.size===0)return;const c=await Promise.all([...i].map(async s=>({icon:s,svg:await Q(s,{height:y,width:y})}))),l=n.append("defs");for(const{icon:s,svg:o}of c)l.append("g").attr("id",z(r,s)).html(o)},"injectIconDefs"),me=f((n,e,t,r,i,a)=>{const c=r.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const s=y+ge,o=B(t,i),h=o!==void 0;o&&c.append("use").attr("xlink:href",`#${z(a,o)}`).attr("x",n+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const p=c.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:d,width:w}=p.node().getBBox(),g=d+i.paddingY*2,m=n+i.paddingX+(h?s:0);p.attr("x",m),p.attr("y",e+g/2);const u=m+w,v=w+i.paddingX*2+(h?s:0);return t.BBox={x:n,y:e,width:v,height:g},t.cssClass?.split(/\s+/).includes("highlight")&&c.insert("rect",":first-child").attr("x",n).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:c,labelRightEdge:u,centerY:e+g/2}},"positionLabel"),T=f((n,e,t,r,i,a)=>n.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),xe=f((n,e,t,r)=>{let i=0,a=0;const c=[],l=f((h,p,d,w)=>{const g=w*(d.rowIndent+d.paddingX),m=me(g,i,p,h,d,r);c.push(m);const{height:u,width:v}=p.BBox;T(h,g-d.rowIndent,i+u/2,g,i+u/2,d.lineThickness),a=Math.max(a,g+v),i+=u},"drawNode"),s=f((h,p=0)=>{l(n,h,t,p),h.children.forEach(m=>{s(m,p+1)});const{x:d,y:w,height:g}=h.BBox;if(h.children.length){const{y:m,height:u}=h.children[h.children.length-1].BBox;T(n,d+t.paddingX,w+g,d+t.paddingX,m+u/2+t.lineThickness/2,t.lineThickness)}},"processNode");s(e);const o=c.filter(h=>h.node.description);if(o.length>0){const p=Math.max(...c.map(d=>d.labelRightEdge))+ue;for(const d of o){const g=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",d.centerY).node().getBBox();a=Math.max(a,p+g.width+t.paddingX)}}for(const h of c)if(h.node.cssClass?.split(/\s+/).includes("highlight")){const p=h.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const d=a-h.node.BBox.x+8;p.attr("width",d),a=Math.max(a,h.node.BBox.x+d+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),ve=f(async(n,e,t,r)=>{D.debug(`Rendering treeView diagram `+n);const i=r.db,a=i.getRoot(),c=i.getConfig(),l=q(e);await we(l,a,c,e);const s=l.append("g");s.attr("class","tree-view");const{totalHeight:o,totalWidth:h}=xe(s,a,c,e);l.attr("viewBox",`-${c.lineThickness/2} 0 ${h} ${o}`),U(l,o,h,c.useMaxWidth)},"draw"),be={draw:ve},Ie=be,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:n})=>{const{labelFontSize:e,labelColor:t,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:c,highlightStroke:l}=A(Ce,n);return` diff --git a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-tJhlXXXb.js b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY--QJ6KdgL.js similarity index 95% rename from apps/kimi-code/dist-web/assets/diagram-WEI45ONY-tJhlXXXb.js rename to apps/kimi-code/dist-web/assets/diagram-WEI45ONY--QJ6KdgL.js index 55a84455361..7cd418a5fdd 100644 --- a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-tJhlXXXb.js +++ b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY--QJ6KdgL.js @@ -1,4 +1,4 @@ -import{p as k}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{s as R,g as E,o as I,n as _,a as D,b as F,_ as c,D as P,p as z,A as y,y as C,B as G,l as B,E as W,e as V}from"./mermaid.core-CGrLstUA.js";import{p as H}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:m},x=structuredClone(w),j=G.radar,N=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),U=c(()=>x.curves,"getCurves"),X=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;ry({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),U=c(()=>x.curves,"getCurves"),X=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; +import{g as l,r as m,d as n}from"./chunk-MOJQB5TN-DEUKbfBz.js";import{p}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{_ as t,l as o}from"./mermaid.core-D1bi95DL.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; diff --git a/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-q8LwmVdA.js b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-BeHEHU1X.js similarity index 99% rename from apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-q8LwmVdA.js rename to apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-BeHEHU1X.js index 575361c3fcd..055e57c0c8a 100644 --- a/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-q8LwmVdA.js +++ b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-BeHEHU1X.js @@ -1,4 +1,4 @@ -import{g as Mt}from"./chunk-XXDRQBXY-BwEKpC0s.js";import{s as Bt}from"./chunk-VR4S4FIN-Cp8JVohH.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,n as Gt,o as Kt,c as it,l as V,p as Ut,q as Zt,r as jt,t as Wt,u as qt,v as Qt,d as Xt,x as Ht}from"./mermaid.core-CGrLstUA.js";import{c as Jt}from"./channel-5_2atmZK.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],S=[1,19],q=[1,28],M=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,71,72],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],gt=[66,67,68,69,70],bt=[1,85],kt=[1,84],mt=[1,82],Et=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],X=[1,93],H=[1,92],J=[1,91],U=[19,58],Tt=[1,102],Ot=[1,101],ht=[19,58,61,63],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 68:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 80:case 81:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 67:case 70:this.$=t[s];break;case 66:this.$=t[s-1]+t[s];break;case 69:t[s-2].push(t[s]),this.$=t[s-2];break;case 71:this.$=t[s].replace(/"/g,"");break;case 72:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:nt,67:at,68:ct,69:ot,70:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(Y,[2,77]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:nt,67:at,68:ct,69:ot,70:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:nt,67:at,68:ct,69:ot,70:lt},e(gt,[2,78]),e(gt,[2,79]),{6:bt,10:kt,39:81,42:mt,47:Et},{40:[1,86],41:[1,87]},e(St,[2,43],{46:88,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:89,42:mt,47:Et},{14:90,40:X,50:H,73:J},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:98,57:99,60:100,62:Tt,63:Ot}),e([19,58,62,63],[2,67]),{58:[2,66]},e(i,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(i,[2,36]),{13:P,41:z,45:105,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,80]),e(i,[2,81]),e(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},e(i,[2,15]),e(U,[2,62],{57:110,61:[1,111],63:Ot}),e(U,[2,63]),e(ht,[2,68]),e(U,[2,71]),e(ht,[2,70]),{18:112,19:[1,113],53:53,54:54,58:F},{16:114,40:O,41:N},e(St,[2,44],{46:88,13:P,41:z,48:G,49:K}),{14:115,40:X,50:H,73:J},{16:116,40:O,41:N},{14:117,40:X,50:H,73:J},e(i,[2,13]),e(U,[2,64]),{60:118,62:Tt},{19:[1,119]},e(i,[2,20]),e(i,[2,23],{17:[1,120],42:A}),e(i,[2,11]),{13:[1,121],42:A},e(i,[2,10]),e(ht,[2,69]),e(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:F},{14:124,40:X,50:H,73:J},{19:[1,125]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: +import{g as Mt}from"./chunk-XXDRQBXY-B34NejJn.js";import{s as Bt}from"./chunk-VR4S4FIN-SMzu0FAl.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,n as Gt,o as Kt,c as it,l as V,p as Ut,q as Zt,r as jt,t as Wt,u as qt,v as Qt,d as Xt,x as Ht}from"./mermaid.core-D1bi95DL.js";import{c as Jt}from"./channel-DRV27vN-.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],S=[1,19],q=[1,28],M=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,71,72],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],gt=[66,67,68,69,70],bt=[1,85],kt=[1,84],mt=[1,82],Et=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],X=[1,93],H=[1,92],J=[1,91],U=[19,58],Tt=[1,102],Ot=[1,101],ht=[19,58,61,63],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 68:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 80:case 81:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 67:case 70:this.$=t[s];break;case 66:this.$=t[s-1]+t[s];break;case 69:t[s-2].push(t[s]),this.$=t[s-2];break;case 71:this.$=t[s].replace(/"/g,"");break;case 72:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:nt,67:at,68:ct,69:ot,70:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(Y,[2,77]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:nt,67:at,68:ct,69:ot,70:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:nt,67:at,68:ct,69:ot,70:lt},e(gt,[2,78]),e(gt,[2,79]),{6:bt,10:kt,39:81,42:mt,47:Et},{40:[1,86],41:[1,87]},e(St,[2,43],{46:88,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:89,42:mt,47:Et},{14:90,40:X,50:H,73:J},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:98,57:99,60:100,62:Tt,63:Ot}),e([19,58,62,63],[2,67]),{58:[2,66]},e(i,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(i,[2,36]),{13:P,41:z,45:105,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,80]),e(i,[2,81]),e(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},e(i,[2,15]),e(U,[2,62],{57:110,61:[1,111],63:Ot}),e(U,[2,63]),e(ht,[2,68]),e(U,[2,71]),e(ht,[2,70]),{18:112,19:[1,113],53:53,54:54,58:F},{16:114,40:O,41:N},e(St,[2,44],{46:88,13:P,41:z,48:G,49:K}),{14:115,40:X,50:H,73:J},{16:116,40:O,41:N},{14:117,40:X,50:H,73:J},e(i,[2,13]),e(U,[2,64]),{60:118,62:Tt},{19:[1,119]},e(i,[2,20]),e(i,[2,23],{17:[1,120],42:A}),e(i,[2,11]),{13:[1,121],42:A},e(i,[2,10]),e(ht,[2,69]),e(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:F},{14:124,40:X,50:H,73:J},{19:[1,125]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: `+_.showPosition()+` Expecting `+st.join(", ")+", got '"+(this.terminals_[g]||g)+"'":yt="Parse error on line "+(tt+1)+": Unexpected "+(g==At?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:pt,expected:st})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),p.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,Nt=_.yyleng,s=_.yytext,tt=_.yylineno,pt=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=p[p.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},wt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),ft=this.performAction.apply(w,[s,Nt,tt,x.yy,k[1],p,t].concat(Lt)),typeof ft<"u")return ft;E&&(o=o.slice(0,-1*E*2),p=p.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),p.push(w.$),t.push(w._$),Rt=Z[o[o.length-2]][o[o.length-1]],o.push(Rt);break;case 3:return!0}}return!0},"parse")},vt=(function(){var I={EOF:1,parseError:l(function(c,o){if(this.yy.parser)this.yy.parser.parseError(c,o);else throw new Error(c)},"parseError"),setInput:l(function(n,c){return this.yy=c||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:l(function(n){var c=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(n){this.unput(this.match.slice(n))},"less"),pastInput:l(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CSk8qFwd.js b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-BBsDuEMp.js similarity index 99% rename from apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CSk8qFwd.js rename to apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-BBsDuEMp.js index 498755f63f5..bb2b76e4f8d 100644 --- a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CSk8qFwd.js +++ b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-BBsDuEMp.js @@ -1,4 +1,4 @@ -import{g as He}from"./chunk-5VM5RSS4-K_NNkrmw.js";import{g as Xe}from"./chunk-XXDRQBXY-BwEKpC0s.js";import{s as Qe}from"./chunk-VR4S4FIN-Cp8JVohH.js";import{_ as b,b6 as Je,F as Oe,l as J,c as g1,u as Ze,v as $e,x as ie,b as et,s as tt,n as st,a as it,g as rt,o as at,k as nt,G as ut,J as ot,bo as lt,q as te,d as se,a5 as ct,p as ht,b8 as dt,r as pt}from"./mermaid.core-CGrLstUA.js";import{f as ft}from"./chunk-32BRIVSS-0ImWpiFu.js";import{c as gt}from"./channel-5_2atmZK.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(` +import{g as He}from"./chunk-5VM5RSS4-T6ZfJwFq.js";import{g as Xe}from"./chunk-XXDRQBXY-B34NejJn.js";import{s as Qe}from"./chunk-VR4S4FIN-SMzu0FAl.js";import{_ as b,b6 as Je,F as Oe,l as J,c as g1,u as Ze,v as $e,x as ie,b as et,s as tt,n as st,a as it,g as rt,o as at,k as nt,G as ut,J as ot,bo as lt,q as te,d as se,a5 as ct,p as ht,b8 as dt,r as pt}from"./mermaid.core-D1bi95DL.js";import{f as ft}from"./chunk-32BRIVSS-IAHjo_8M.js";import{c as gt}from"./channel-DRV27vN-.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(` `)?k=A+` `:k=`{ `+A+` diff --git a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BliHEJI2.js b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-Bnt6x8v3.js similarity index 99% rename from apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BliHEJI2.js rename to apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-Bnt6x8v3.js index 011ae5e7200..41e164a045d 100644 --- a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BliHEJI2.js +++ b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-Bnt6x8v3.js @@ -1,4 +1,4 @@ -import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,p as Gn,x as jn}from"./mermaid.core-CGrLstUA.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-Cu3jckud.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-CvgiEu-R.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: +import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,p as Gn,x as jn}from"./mermaid.core-D1bi95DL.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-HTwyis_A.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-BRkLL_ut.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: `+H.showPosition()+` Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-DbTFMBma.js b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CHnhMzpt.js similarity index 99% rename from apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-DbTFMBma.js rename to apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CHnhMzpt.js index c569811fd2c..9440b5d44c6 100644 --- a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-DbTFMBma.js +++ b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CHnhMzpt.js @@ -1,4 +1,4 @@ -import{I as le}from"./chunk-2Q5K7J3B-CldwFnN4.js";import{p as he}from"./chunk-JWPE2WC7-CnsTQcA8.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,d as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core-CGrLstUA.js";import{p as Ee}from"./cynefin-VYW2F7L2-Ct8il_Gb.js";import"./index-CvgiEu-R.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` +import{I as le}from"./chunk-2Q5K7J3B-BZszbgyO.js";import{p as he}from"./chunk-JWPE2WC7-DAAIR0Fi.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,d as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core-D1bi95DL.js";import{p as Ee}from"./cynefin-VYW2F7L2-DshBI3i_.js";import"./index-BRkLL_ut.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` ${s-i/2-L/2},${x+R} ${s-i/2-L/2},${x-R} ${t.posWithOffset-i/2-L},${x-c-R} diff --git a/apps/kimi-code/dist-web/assets/index-BlRksujk.js b/apps/kimi-code/dist-web/assets/index-43G4l3IG.js similarity index 99% rename from apps/kimi-code/dist-web/assets/index-BlRksujk.js rename to apps/kimi-code/dist-web/assets/index-43G4l3IG.js index 3a50a605553..47a9ea2770c 100644 --- a/apps/kimi-code/dist-web/assets/index-BlRksujk.js +++ b/apps/kimi-code/dist-web/assets/index-43G4l3IG.js @@ -1,4 +1,4 @@ -import{t as pe,b as Ln,n as Or,c as Nr,a as Fr,d as zr,s as Ur,g as Vr,e as Br}from"./index-DuIqvsra.js";import{f as Ld}from"./index-DuIqvsra.js";import{bR as k}from"./index-CvgiEu-R.js";const Ei="diffs-container",$r=(()=>{try{return!1}catch{return!1}})(),Wr=/(?=^From [a-f0-9]+ .+$)/m,Ti=/(?=^diff --git)/gm,Ul=/(?=^---\s+\S)/gm,Vl=/(?=^@@ )/gm,Gr=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,jr=/(?<=\n)/,qr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Kr=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Yr=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Xr=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Bl=/^<{7,}(?:\s.*)?$/,$l=/^\|{7,}(?:\s.*)?$/,Wl=/^={7,}$/,Gl=/^>{7,}(?:\s.*)?$/,on="header-prefix",sn="header-metadata",an="header-custom",_={dark:"pierre-dark",light:"pierre-light"},Ii="data-theme-css",Ri="data-unsafe-css",Qr="data-core-css",Jr="data-diffs-scrollbar-measure",Ai="--diffs-scrollbar-gutter-measured",jl=1,Zr=1e5,ln={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},_e={...ln,hunkLineCount:1},eo={paddingTop:8,paddingBottom:8,gap:8},to={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},no=Object.freeze({fromStart:0,fromEnd:0}),Ae={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Hi={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Ie=new Set;let Re=null;function Y(e){Ie.add(e),Re??=requestAnimationFrame(Mi)}function io(e){Ie.delete(e),Ie.size===0&&Re!=null&&(cancelAnimationFrame(Re),Re=null)}function Mi(e){const t=new Set(Ie);Ie.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Ie.size>0?Re=requestAnimationFrame(Mi):Re=null}function He(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function De(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function dn(e,t){const n=e?.theme??_,i=t?.theme??_,r=kn(e),o=kn(t);return De(n,i)&&He(e,t,["theme","parseDiffOptions"])&&He(r,o)}function kn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function Wt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Gt({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const h=Math.max(e-r,0),c=Math.min(e+l,t);return{top:h,bottom:Math.max(c,h)}}let a=e+n/2-s/2,d=a+s;return a<0&&(a=0),d>t&&(d=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(d,t),a))}}function ro(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function W(e){return{type:"text",value:e}}function A({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function pt({name:e,width:t=16,height:n=16,properties:i}){return A({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[A({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function oo(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Ee(e){return A({tagName:"div",properties:{"data-gutter":""},children:e})}function Di(e,t,n,i={}){return A({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[A({tagName:"span",properties:{"data-line-number-content":""},children:[W(`${t}`)]})]:void 0})}function j(e,t,n){return A({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function so(){return A({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[pt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function ao(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}var Pi=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){const n=!(e===this.selectedRange||Wt(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&n==null&&i==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&et(e.composedPath())||(he(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:s=!1}=this.options;t==="disabled"&&!s&&n==null&&i==null&&r==null&&o==null||(he(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(he(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){he(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();he(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const r=this.resolvePointerTarget(i);he(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:s,onLineEnter:l,onLineLeave:a,onTokenClick:d,onTokenEnter:h,onTokenLeave:c,onHunkExpand:u,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{const g=Tt(r)&&this.hoveredLine?.lineElement===r.lineElement;ut(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),ut(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),h?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(a?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Tt(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(co(r)&&f!=null){f(r);break}if(ho(r)&&u!=null){u(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Tt(r))break;ut(r)&&d!=null&&d(this.toTokenEventBaseProps(r),t);const g=this.toEventBaseProps(r);s!=null&&r.numberColumn?s({...g,event:t}):o?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:s,onTokenClick:l,onTokenEnter:a,onTokenLeave:d,onHunkExpand:h,onMergeConflictActionClick:c,enableGutterUtility:u=!1,enableLineSelection:f=!1,onGutterUtilityClick:g}=this.options,b=g!=null,y=n!=="disabled"||i!=null||r!=null||o!=null||s!=null||l!=null||a!=null||d!=null||h!=null||c!=null||u||f||b;y&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,he(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const C=[];return(t==="both"||t==="click")&&(i!=null&&C.push("onLineClick"),r!=null&&C.push("onLineNumberClick"),h!=null&&C.push("expandable hunk separators"),c!=null&&C.push("merge conflict actions")),C})()),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!y&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const m=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",p=this.pointerSession.mode==="gutterSelecting";(!f&&m||!b&&p)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,r=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();et(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:r,eventSide:o,lineIndex:s}=n;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const a=l.start<=l.end?s>=l.start:s<=l.end;this.selectionAnchor={lineNumber:a?this.selectedRange.start:this.selectedRange.end,side:a?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){const l={lineNumber:r,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;const i=this.currentSelectionEnds(),r=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),o=i?.top??r;r==null||o==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:o,current:r},t&&(this.selectionAnchor={lineNumber:o.lineNumber,side:o.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;const i={lineNumber:n.lineNumber,side:n.eventSide};if(ao(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=pe(so());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);Ve(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(!(i==null||r==null))return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const r of i){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(Ze(r));if(Ve(o)&&!(this.mode==="diff"&&e.side!=null&&o.side!==e.side))return o}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(Ve(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(Ve(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&et(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=Ze(e);if(t&&et(n))return;const i=fo(e);return i!=null?Ze(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=go(po(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?Ze(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=En(t)?t:En(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let r;if(e==null)r=null;else{const o=this.selectionAnchor?.side??t,s=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(s,e,o,t)}Wt(i??void 0,r??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const l of e)l.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",i=this.getIndexesFromSelection(this.selectedRange,n);if(i==null)throw console.error({rowRange:i,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const r=i.start===i.end,o=Math.min(i.start,i.end),s=Math.max(i.start,i.end);for(const l of t){const[a,d]=l.children,h=d.children.length;if(h!==a.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let c=0;cs)break;if(g==null||gNumber.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Ke({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,renderGutterUtility:c,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p},C,v,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:lo({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:i}),usesCustomGutterUtility:c!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:C,onMergeConflictActionClick:x,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p,getLineIndex:v}}function lo({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function Ve(e){return e!=null&&"kind"in e&&e.kind==="line"}function ut(e){return e!=null&&"kind"in e&&e.kind==="token"}function Tt(e){return Ve(e)||ut(e)}function ho(e){return"type"in e&&e.type==="line-info"}function co(e){return"kind"in e&&e.kind==="merge-conflict-action"}function uo(e){return e==="current"||e==="incoming"||e==="both"}function wn(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Ze(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function fo(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function po(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function go(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function En(e){return e!=null&&typeof e.elementFromPoint=="function"}function Tn(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function In(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function et(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}function he(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var _i=class ue{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=ue.resizeObserver??new ResizeObserver(ue.handleSharedResizeEntries);return ue.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const r=ue.managersByElement.get(i.target);if(r==null)continue;const o=n.get(r);o==null?n.set(r,[i]):o.push(i)}for(const[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,n){const i=new Set;let r=0;const o=new Map(this.observedNodes);this.observedNodes.clear();for(const s of t.children){if(r===2)break;const l=(()=>{if(s instanceof HTMLElement&&s.tagName==="CODE")return s})();if(l==null)continue;r++;let a=o.get(l);if(a!=null&&a.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let d=l.firstElementChild;d instanceof HTMLElement||(d=null),a!=null?(this.observedNodes.set(l,a),o.delete(l),a.numberElement!==d?(a.numberElement!=null&&(this.unobserve(a.numberElement),o.delete(a.numberElement)),d!=null&&(this.observe(d),o.delete(d),this.observedNodes.set(d,a)),a.numberElement=d,a.numberWidth=0):a.numberElement!=null?(o.delete(a.numberElement),this.observedNodes.set(a.numberElement,a)):a.numberWidth=0):(a={type:"code",codeElement:l,numberElement:d,codeWidth:"auto",numberWidth:0},this.observedNodes.set(l,a),this.observe(l),d!=null&&(this.observedNodes.set(d,a),this.observe(d)))}if(r>1&&!n){const s=t.querySelectorAll('[data-line-annotation*=","]'),l=new Map;for(const a of s){if(!(a instanceof HTMLElement))continue;const d=a.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(d)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:d,element:a});continue}let h=l.get(d);h==null&&(h=[],l.set(d,h)),h.push(a)}for(const[a,d]of l){if(d.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",a,d);continue}const[h,c]=d,u=h.firstElementChild,f=c.firstElementChild;if(!(h instanceof HTMLElement)||!(c instanceof HTMLElement)||!(u instanceof HTMLElement)||!(f instanceof HTMLElement))continue;let g=o.get(u);if(g!=null){this.observedNodes.set(u,g),this.observedNodes.set(f,g),o.delete(u),o.delete(f);continue}const b=u.getBoundingClientRect().height,y=f.getBoundingClientRect().height;g={type:"annotations",column1:{container:h,child:u,childHeight:b},column2:{container:c,child:f,childHeight:y},currentHeight:"auto"},i.add({child1:u,child2:f,item:g,newHeight:Math.max(b,y)})}for(const a of i)this.applyNewHeight(a.item,a.newHeight),this.observedNodes.set(a.child1,a.item),this.observedNodes.set(a.child2,a.item),this.observe(a.child1),this.observe(a.child2);i.clear()}for(const[s,l]of o)this.unobserve(s),l.type==="code"?bo(l):Co(l);o.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=ue,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),ue.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=ue,r=n.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),ue.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const r of t){const{target:o,borderBoxSize:s,contentBoxSize:l}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}const a=this.observedNodes.get(o);if(a==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(a.type==="annotations"){const d=(()=>{if(o===a.column1.child)return a.column1;if(o===a.column2.child)return a.column2})();if(d==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:o});continue}d.childHeight=s[0].blockSize,i.add(a)}else if(a.type==="code"){const d=n.get(a)??{},h=l[0].inlineSize;o===a.codeElement?d.codeInlineSize=h:o===a.numberElement&&(d.numberInlineSize=h),n.set(a,d)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const r=i.codeInlineSize!=null?mo(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?vo(i.numberInlineSize):n.numberWidth,s=r!==n.codeWidth,l=o!==n.numberWidth;if(!(!s&&!l)&&(n.codeWidth=r,n.numberWidth=o,s&&n.codeElement.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),l&&n.codeElement.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),s||l&&r!=="auto")){const a=typeof r=="number"?Math.max(r-o,0):0;n.codeElement.style.setProperty("--diffs-column-content-width",`${a>0?`${a}px`:"auto"}`)}}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function mo(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function vo(e){return Math.max(Math.ceil(e),0)}function bo(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width"))}function Co(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty("--diffs-annotation-min-height"),e.column2.container.isConnected&&e.column2.container.style.removeProperty("--diffs-annotation-min-height")}const Se=new Map,It=new Map,jt=new Map,gt=new Set;function mt(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!gt.has(t))return!1;return!0}function Rn(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(gt.has(n.name))continue;let i=Se.get(n.name);i==null&&(i=n,Se.set(n.name,i)),gt.add(i.name),t.loadLanguageSync(i.data)}}function So(){Se.clear(),gt.clear()}function Oi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function Ni(e){if(Oi())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=It.get(e);if(t!=null)return t;try{let n=jt.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(Ln,e)&&(n=Ln[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const i=n().then(({default:r})=>{const o={name:e,data:r};return Se.has(e)||Se.set(e,o),o});return It.set(e,i),await i}finally{It.delete(e)}}function Fi(e){return Se.get(e)??Ni(e)}const vt=new Set;function Ye(e){const t=[],n=new Set;for(const c of yo(e.themes)){const u=zi(c)?c.getThemes():[c];for(const f of u){if(n.has(f.name))throw new Error(`Theme collection already contains theme "${f.name}"`);n.add(f.name),t.push(f)}}const i=Object.freeze([...t]),r=Object.freeze(i.filter(c=>c.colorScheme==="light")),o=Object.freeze(i.filter(c=>c.colorScheme==="dark")),s=new Map(i.map(c=>[c.name,c])),l=Object.freeze(i.map(c=>c.name)),a=Object.freeze(r.map(c=>c.name)),d=Object.freeze(o.map(c=>c.name));function h(c){if(c==null)return i;const{colorScheme:u,collection:f}=c;return f==null?u==="light"?r:u==="dark"?o:i:i.filter(g=>g.collection!==f?!1:u==null||g.colorScheme===u)}return{getTheme(c){return s.get(c)},getThemes(c){return h(c)},getThemeNames(c){return c?.collection==null?c?.colorScheme==="light"?a:c?.colorScheme==="dark"?d:l:h(c).map(u=>u.name)},hasTheme(c){return s.has(c)},orderBy(c){return Ye({themes:i.map((u,f)=>({descriptor:u,index:f})).sort((u,f)=>{const g=c(u.descriptor,f.descriptor);return g!==0?g:u.index-f.index}).map(u=>u.descriptor)})},pick(c){const u=[],f=new Set;for(const g of c){if(f.has(g))throw new Error(`Theme collection pick already includes theme "${g}"`);f.add(g);const b=s.get(g);if(b==null)throw new Error(`Theme collection does not contain theme "${g}"`);u.push(b)}return Ye({themes:u})},registerInto(c){for(const u of i)c.registerThemeIfAbsent(u.name,u.load)}}}function yo(e){return xo(e)?[e]:e}function xo(e){return zi(e)||Lo(e)}function Lo(e){return typeof e.name=="string"&&typeof e.load=="function"}function zi(e){return typeof e.getThemes=="function"}function Ui(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Vi=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},ko=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},wo=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Eo(){const e=new Map,t=new Map,n=new Map;let i=0;function r(m,p){if(e.has(m))throw new Vi(m);e.set(m,p)}function o(m,p){return e.has(m)?!1:(e.set(m,p),!0)}function s(m){return e.has(m)}function l(m){const p=t.get(m);if(p!==void 0)return Promise.resolve(p);const C=n.get(m);if(C!==void 0)return C;const v=e.get(m);if(v===void 0)return Promise.reject(new ko(m));const x=i,S=v().then(L=>{const E=Ui(L);return x===i&&t.set(m,E),n.get(m)===S&&n.delete(m),E}).catch(L=>{throw n.get(m)===S&&n.delete(m),L});return n.set(m,S),S}function a(m){return Promise.all(m.map(p=>l(p)))}function d(m,p){t.set(m,p)}function h(m){for(const[p,C]of m)d(p,C)}function c(m){return t.get(m)}function u(m){const p=[];for(const C of m){const v=t.get(C);if(v===void 0)throw new wo(C);p.push(v)}return p}function f(m){return t.has(m)}function g(m){for(const p of m)if(!t.has(p))return!1;return!0}function b(m){const p=t.get(m);return p!==void 0?p:l(m)}function y(){i++,t.clear(),n.clear()}return{clearResolvedThemes:y,getResolvedOrResolveTheme:b,getResolvedTheme:c,getResolvedThemes:u,hasRegisteredTheme:s,hasResolvedTheme:f,hasResolvedThemes:g,registerTheme:r,registerThemeIfAbsent:o,resolveTheme:l,resolveThemes:a,seedResolvedTheme:d,seedResolvedThemes:h}}const X=Eo();function An(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=X.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,X.getResolvedTheme(n)==null&&X.seedResolvedTheme(n,i);vt.has(n)||(vt.add(n),t.loadThemeSync(i))}}function To(){X.clearResolvedThemes(),vt.clear()}function hn({name:e,load:t,colorScheme:n,collection:i,displayName:r}){return{name:e,colorScheme:n,collection:i,displayName:r,load:Io(t)}}function Io(e){return async()=>Or(Ui(await e()))}const Ro="pierre",Ao=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],Bi=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],Ho=[...Bi,...Ao],Mo=new Set(Bi);function Do(e){return Mo.has(e)?"light":"dark"}const Po={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},_o={"pierre-dark":()=>k(()=>import("./pierre-dark-CyvmCCZW.js"),[]),"pierre-dark-soft":()=>k(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[]),"pierre-dark-vibrant":()=>k(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[]),"pierre-dark-protanopia-deuteranopia":()=>k(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[]),"pierre-dark-tritanopia":()=>k(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[]),"pierre-light":()=>k(()=>import("./pierre-light-480U9XYS.js"),[]),"pierre-light-soft":()=>k(()=>import("./pierre-light-soft-CVdyfjmI.js"),[]),"pierre-light-vibrant":()=>k(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[]),"pierre-light-protanopia-deuteranopia":()=>k(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[]),"pierre-light-tritanopia":()=>k(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[])};function Oo(e){return hn({name:e,collection:Ro,colorScheme:Do(e),displayName:Po[e],load:_o[e]})}const $i=Ye({themes:Ho.map(e=>Oo(e))}),No="shiki",Wi=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],Fo=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],zo=new Set(Wi);function Uo(e){return zo.has(e)?"light":"dark"}const Vo={andromeeda:()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[]),"aurora-x":()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[]),"ayu-dark":()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[]),"ayu-light":()=>k(()=>import("./ayu-light-BA47KaF1.js"),[]),"ayu-mirage":()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[]),"catppuccin-frappe":()=>k(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]),"catppuccin-latte":()=>k(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]),"catppuccin-macchiato":()=>k(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]),"catppuccin-mocha":()=>k(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]),"dark-plus":()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[]),dracula:()=>k(()=>import("./dracula-BzJJZx-M.js"),[]),"dracula-soft":()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[]),"everforest-dark":()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[]),"everforest-light":()=>k(()=>import("./everforest-light-C8M2exoo.js"),[]),"github-dark":()=>k(()=>import("./github-dark-DHJKELXO.js"),[]),"github-dark-default":()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[]),"github-dark-dimmed":()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]),"github-dark-high-contrast":()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]),"github-light":()=>k(()=>import("./github-light-DAi9KRSo.js"),[]),"github-light-default":()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[]),"github-light-high-contrast":()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]),"gruvbox-dark-hard":()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]),"gruvbox-dark-medium":()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]),"gruvbox-dark-soft":()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]),"gruvbox-light-hard":()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]),"gruvbox-light-medium":()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]),"gruvbox-light-soft":()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]),horizon:()=>k(()=>import("./horizon-BUw7H-hv.js"),[]),"horizon-bright":()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[]),houston:()=>k(()=>import("./houston-DnULxvSX.js"),[]),"kanagawa-dragon":()=>k(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]),"kanagawa-lotus":()=>k(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]),"kanagawa-wave":()=>k(()=>import("./kanagawa-wave-DWedfzmr.js"),[]),laserwave:()=>k(()=>import("./laserwave-DUszq2jm.js"),[]),"light-plus":()=>k(()=>import("./light-plus-B7mTdjB0.js"),[]),"material-theme":()=>k(()=>import("./material-theme-D5KoaKCx.js"),[]),"material-theme-darker":()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[]),"material-theme-lighter":()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]),"material-theme-ocean":()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[]),"material-theme-palenight":()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]),"min-dark":()=>k(()=>import("./min-dark-CafNBF8u.js"),[]),"min-light":()=>k(()=>import("./min-light-CTRr51gU.js"),[]),monokai:()=>k(()=>import("./monokai-D4h5O-jR.js"),[]),"night-owl":()=>k(()=>import("./night-owl-C39BiMTA.js"),[]),"night-owl-light":()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[]),nord:()=>k(()=>import("./nord-Ddv68eIx.js"),[]),"one-dark-pro":()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]),"one-light":()=>k(()=>import("./one-light-C3Wv6jpd.js"),[]),plastic:()=>k(()=>import("./plastic-3e1v2bzS.js"),[]),poimandres:()=>k(()=>import("./poimandres-CS3Unz2-.js"),[]),red:()=>k(()=>import("./red-bN70gL4F.js"),[]),"rose-pine":()=>k(()=>import("./rose-pine-qdsjHGoJ.js"),[]),"rose-pine-dawn":()=>k(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]),"rose-pine-moon":()=>k(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]),"slack-dark":()=>k(()=>import("./slack-dark-BthQWCQV.js"),[]),"slack-ochin":()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[]),"snazzy-light":()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[]),"solarized-dark":()=>k(()=>import("./solarized-dark-DXbdFlpD.js"),[]),"solarized-light":()=>k(()=>import("./solarized-light-L9t79GZl.js"),[]),"synthwave-84":()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[]),"tokyo-night":()=>k(()=>import("./tokyo-night-hegEt444.js"),[]),vesper:()=>k(()=>import("./vesper-DRje8inN.js"),[]),"vitesse-black":()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[]),"vitesse-dark":()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[]),"vitesse-light":()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[])};function Hn(e){return hn({name:e,collection:No,colorScheme:Uo(e),load:Vo[e]})}const Gi=Ye({themes:Object.freeze([...Wi.map(e=>Hn(e)),...Fo.map(e=>Hn(e))])});Ye({themes:[$i,Gi]});function ji(e){if(Oi())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(X.hasRegisteredTheme(e))return;const t=Gi.getTheme(e);if(t!=null){X.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function qi(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Bo(e){ji(e);const t=await X.resolveTheme(e);return qi(e,t),t}function $o(e){return X.getResolvedTheme(e)??Bo(e)}let $;async function xt({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){$??=Nr({themes:[],langs:["text"],engine:n==="shiki-wasm"?Fr(k(()=>import("./wasm-CG6Dc4jp.js"),[])):zr()});const i=Wo($)?await $:$;$=i;const r=[];for(const s of t){if(s==="text"||s==="ansi")continue;const l=Fi(s);"then"in l?r.push(l):Rn(l,i)}const o=[];for(const s of e){const l=$o(s);"then"in l?o.push(l):An(l,$)}return(r.length>0||o.length>0)&&await Promise.all([Promise.all(r).then(s=>{Rn(s,i)}),Promise.all(o).then(s=>{An(s,i)})]),i}function ql(e=$){return e!=null&&!("then"in e)}function Ki(){if($!=null&&!("then"in $))return $}function Wo(e=$){return e!=null&&"then"in e}function Kl(e=$){return e==null}async function Yl(e){await xt(e)}async function Xl(){$!=null&&((await $).dispose(),So(),To(),$=void 0)}for(const e of $i.getThemes())X.registerThemeIfAbsent(e.name,e.load);function cn(e=_){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Ge(e){for(const t of cn(e))if(!vt.has(t))return!1;return!0}function Go(e){return X.hasResolvedThemes(e)}function Oe(e,t){return De(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function ae(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Lt(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function qt(e){return A({tagName:"div",children:[A({tagName:"div",children:e.annotations?.map(t=>A({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function jo(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function Yi({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return A({tagName:"div",children:[t==="custom"?A({tagName:"slot",properties:{name:an}}):qo({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[Ko(i)]],properties:r})}function qo({name:e,prevName:t,iconType:n}){const i=[A({tagName:"slot",properties:{name:on}}),pt({name:jo(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(t)]})],properties:{"data-prev-name":""}})),i.push(pt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(e)]})],properties:{"data-title":""}})),A({tagName:"div",children:i,properties:{"data-header-content":""}})}function Ko(e){const t=[];if(e!=null){let n=0,i=0;for(const r of e.hunks)n+=r.additionLines,i+=r.deletionLines;(i>0||n===0)&&t.push(A({tagName:"span",children:[W(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(A({tagName:"span",children:[W(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(A({tagName:"slot",properties:{name:sn}})),A({tagName:"div",children:t,properties:{"data-metadata":""}})}function Xi(e){return A({tagName:"pre",properties:Yo(e)})}function Yo({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:s,customProperties:l}){return{...l,"data-diff":s==="diff"?"":void 0,"data-file":s==="file"?"":void 0,"data-diff-type":s==="diff"?r?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}const Z=new Map;let bt=0;const Ne={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Q(e){if(Z.has(e))return Z.get(e)??"text";if(Ne[e]!=null)return Ne[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Z.has(t[1]))return Z.get(t[1])??"text";if(Ne[t[1]]!=null)return Ne[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Z.has(n)?Z.get(n)??"text":Ne[n]??"text"}function Ql(e,t){if(e<=bt)return!1;Z.clear();for(const n in t){const i=t[n];i!=null&&Z.set(n,i)}return bt=e,!0}function Jl(){return bt}function Xo(e,t){const n=Z.get(e);return n===t?!1:(n!=null&&console.warn(`setCustomExtension: overriding custom mapping for "${e}" from "${n}" to "${t}"`),Z.set(e,t),bt++,!0)}function Zl(){return Object.fromEntries(Z)}function un(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:cn(t),preferredHighlighter:n}}function ge(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function xe(e){return e.replace(/\n$|\r\n$/,"")}function Qo(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),new Error(r)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(W(` +import{t as pe,b as Ln,n as Or,c as Nr,a as Fr,d as zr,s as Ur,g as Vr,e as Br}from"./index-DvnquuzZ.js";import{f as Ld}from"./index-DvnquuzZ.js";import{bR as k}from"./index-BRkLL_ut.js";const Ei="diffs-container",$r=(()=>{try{return!1}catch{return!1}})(),Wr=/(?=^From [a-f0-9]+ .+$)/m,Ti=/(?=^diff --git)/gm,Ul=/(?=^---\s+\S)/gm,Vl=/(?=^@@ )/gm,Gr=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,jr=/(?<=\n)/,qr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Kr=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Yr=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Xr=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Bl=/^<{7,}(?:\s.*)?$/,$l=/^\|{7,}(?:\s.*)?$/,Wl=/^={7,}$/,Gl=/^>{7,}(?:\s.*)?$/,on="header-prefix",sn="header-metadata",an="header-custom",_={dark:"pierre-dark",light:"pierre-light"},Ii="data-theme-css",Ri="data-unsafe-css",Qr="data-core-css",Jr="data-diffs-scrollbar-measure",Ai="--diffs-scrollbar-gutter-measured",jl=1,Zr=1e5,ln={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},_e={...ln,hunkLineCount:1},eo={paddingTop:8,paddingBottom:8,gap:8},to={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},no=Object.freeze({fromStart:0,fromEnd:0}),Ae={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Hi={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Ie=new Set;let Re=null;function Y(e){Ie.add(e),Re??=requestAnimationFrame(Mi)}function io(e){Ie.delete(e),Ie.size===0&&Re!=null&&(cancelAnimationFrame(Re),Re=null)}function Mi(e){const t=new Set(Ie);Ie.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Ie.size>0?Re=requestAnimationFrame(Mi):Re=null}function He(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function De(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function dn(e,t){const n=e?.theme??_,i=t?.theme??_,r=kn(e),o=kn(t);return De(n,i)&&He(e,t,["theme","parseDiffOptions"])&&He(r,o)}function kn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function Wt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Gt({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const h=Math.max(e-r,0),c=Math.min(e+l,t);return{top:h,bottom:Math.max(c,h)}}let a=e+n/2-s/2,d=a+s;return a<0&&(a=0),d>t&&(d=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(d,t),a))}}function ro(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function W(e){return{type:"text",value:e}}function A({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function pt({name:e,width:t=16,height:n=16,properties:i}){return A({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[A({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function oo(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Ee(e){return A({tagName:"div",properties:{"data-gutter":""},children:e})}function Di(e,t,n,i={}){return A({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[A({tagName:"span",properties:{"data-line-number-content":""},children:[W(`${t}`)]})]:void 0})}function j(e,t,n){return A({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function so(){return A({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[pt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function ao(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}var Pi=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){const n=!(e===this.selectedRange||Wt(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&n==null&&i==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&et(e.composedPath())||(he(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:s=!1}=this.options;t==="disabled"&&!s&&n==null&&i==null&&r==null&&o==null||(he(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(he(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){he(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();he(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const r=this.resolvePointerTarget(i);he(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:s,onLineEnter:l,onLineLeave:a,onTokenClick:d,onTokenEnter:h,onTokenLeave:c,onHunkExpand:u,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{const g=Tt(r)&&this.hoveredLine?.lineElement===r.lineElement;ut(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),ut(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),h?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(a?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Tt(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(co(r)&&f!=null){f(r);break}if(ho(r)&&u!=null){u(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Tt(r))break;ut(r)&&d!=null&&d(this.toTokenEventBaseProps(r),t);const g=this.toEventBaseProps(r);s!=null&&r.numberColumn?s({...g,event:t}):o?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:s,onTokenClick:l,onTokenEnter:a,onTokenLeave:d,onHunkExpand:h,onMergeConflictActionClick:c,enableGutterUtility:u=!1,enableLineSelection:f=!1,onGutterUtilityClick:g}=this.options,b=g!=null,y=n!=="disabled"||i!=null||r!=null||o!=null||s!=null||l!=null||a!=null||d!=null||h!=null||c!=null||u||f||b;y&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,he(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const C=[];return(t==="both"||t==="click")&&(i!=null&&C.push("onLineClick"),r!=null&&C.push("onLineNumberClick"),h!=null&&C.push("expandable hunk separators"),c!=null&&C.push("merge conflict actions")),C})()),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!y&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const m=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",p=this.pointerSession.mode==="gutterSelecting";(!f&&m||!b&&p)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,r=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();et(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:r,eventSide:o,lineIndex:s}=n;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const a=l.start<=l.end?s>=l.start:s<=l.end;this.selectionAnchor={lineNumber:a?this.selectedRange.start:this.selectedRange.end,side:a?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){const l={lineNumber:r,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;const i=this.currentSelectionEnds(),r=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),o=i?.top??r;r==null||o==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:o,current:r},t&&(this.selectionAnchor={lineNumber:o.lineNumber,side:o.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;const i={lineNumber:n.lineNumber,side:n.eventSide};if(ao(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=pe(so());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);Ve(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(!(i==null||r==null))return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const r of i){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(Ze(r));if(Ve(o)&&!(this.mode==="diff"&&e.side!=null&&o.side!==e.side))return o}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(Ve(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(Ve(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&et(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=Ze(e);if(t&&et(n))return;const i=fo(e);return i!=null?Ze(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=go(po(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?Ze(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=En(t)?t:En(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let r;if(e==null)r=null;else{const o=this.selectionAnchor?.side??t,s=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(s,e,o,t)}Wt(i??void 0,r??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const l of e)l.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",i=this.getIndexesFromSelection(this.selectedRange,n);if(i==null)throw console.error({rowRange:i,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const r=i.start===i.end,o=Math.min(i.start,i.end),s=Math.max(i.start,i.end);for(const l of t){const[a,d]=l.children,h=d.children.length;if(h!==a.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let c=0;cs)break;if(g==null||gNumber.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Ke({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,renderGutterUtility:c,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p},C,v,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:lo({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:i}),usesCustomGutterUtility:c!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:C,onMergeConflictActionClick:x,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p,getLineIndex:v}}function lo({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function Ve(e){return e!=null&&"kind"in e&&e.kind==="line"}function ut(e){return e!=null&&"kind"in e&&e.kind==="token"}function Tt(e){return Ve(e)||ut(e)}function ho(e){return"type"in e&&e.type==="line-info"}function co(e){return"kind"in e&&e.kind==="merge-conflict-action"}function uo(e){return e==="current"||e==="incoming"||e==="both"}function wn(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Ze(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function fo(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function po(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function go(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function En(e){return e!=null&&typeof e.elementFromPoint=="function"}function Tn(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function In(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function et(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}function he(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var _i=class ue{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=ue.resizeObserver??new ResizeObserver(ue.handleSharedResizeEntries);return ue.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const r=ue.managersByElement.get(i.target);if(r==null)continue;const o=n.get(r);o==null?n.set(r,[i]):o.push(i)}for(const[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,n){const i=new Set;let r=0;const o=new Map(this.observedNodes);this.observedNodes.clear();for(const s of t.children){if(r===2)break;const l=(()=>{if(s instanceof HTMLElement&&s.tagName==="CODE")return s})();if(l==null)continue;r++;let a=o.get(l);if(a!=null&&a.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let d=l.firstElementChild;d instanceof HTMLElement||(d=null),a!=null?(this.observedNodes.set(l,a),o.delete(l),a.numberElement!==d?(a.numberElement!=null&&(this.unobserve(a.numberElement),o.delete(a.numberElement)),d!=null&&(this.observe(d),o.delete(d),this.observedNodes.set(d,a)),a.numberElement=d,a.numberWidth=0):a.numberElement!=null?(o.delete(a.numberElement),this.observedNodes.set(a.numberElement,a)):a.numberWidth=0):(a={type:"code",codeElement:l,numberElement:d,codeWidth:"auto",numberWidth:0},this.observedNodes.set(l,a),this.observe(l),d!=null&&(this.observedNodes.set(d,a),this.observe(d)))}if(r>1&&!n){const s=t.querySelectorAll('[data-line-annotation*=","]'),l=new Map;for(const a of s){if(!(a instanceof HTMLElement))continue;const d=a.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(d)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:d,element:a});continue}let h=l.get(d);h==null&&(h=[],l.set(d,h)),h.push(a)}for(const[a,d]of l){if(d.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",a,d);continue}const[h,c]=d,u=h.firstElementChild,f=c.firstElementChild;if(!(h instanceof HTMLElement)||!(c instanceof HTMLElement)||!(u instanceof HTMLElement)||!(f instanceof HTMLElement))continue;let g=o.get(u);if(g!=null){this.observedNodes.set(u,g),this.observedNodes.set(f,g),o.delete(u),o.delete(f);continue}const b=u.getBoundingClientRect().height,y=f.getBoundingClientRect().height;g={type:"annotations",column1:{container:h,child:u,childHeight:b},column2:{container:c,child:f,childHeight:y},currentHeight:"auto"},i.add({child1:u,child2:f,item:g,newHeight:Math.max(b,y)})}for(const a of i)this.applyNewHeight(a.item,a.newHeight),this.observedNodes.set(a.child1,a.item),this.observedNodes.set(a.child2,a.item),this.observe(a.child1),this.observe(a.child2);i.clear()}for(const[s,l]of o)this.unobserve(s),l.type==="code"?bo(l):Co(l);o.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=ue,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),ue.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=ue,r=n.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),ue.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const r of t){const{target:o,borderBoxSize:s,contentBoxSize:l}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}const a=this.observedNodes.get(o);if(a==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(a.type==="annotations"){const d=(()=>{if(o===a.column1.child)return a.column1;if(o===a.column2.child)return a.column2})();if(d==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:o});continue}d.childHeight=s[0].blockSize,i.add(a)}else if(a.type==="code"){const d=n.get(a)??{},h=l[0].inlineSize;o===a.codeElement?d.codeInlineSize=h:o===a.numberElement&&(d.numberInlineSize=h),n.set(a,d)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const r=i.codeInlineSize!=null?mo(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?vo(i.numberInlineSize):n.numberWidth,s=r!==n.codeWidth,l=o!==n.numberWidth;if(!(!s&&!l)&&(n.codeWidth=r,n.numberWidth=o,s&&n.codeElement.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),l&&n.codeElement.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),s||l&&r!=="auto")){const a=typeof r=="number"?Math.max(r-o,0):0;n.codeElement.style.setProperty("--diffs-column-content-width",`${a>0?`${a}px`:"auto"}`)}}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function mo(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function vo(e){return Math.max(Math.ceil(e),0)}function bo(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width"))}function Co(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty("--diffs-annotation-min-height"),e.column2.container.isConnected&&e.column2.container.style.removeProperty("--diffs-annotation-min-height")}const Se=new Map,It=new Map,jt=new Map,gt=new Set;function mt(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!gt.has(t))return!1;return!0}function Rn(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(gt.has(n.name))continue;let i=Se.get(n.name);i==null&&(i=n,Se.set(n.name,i)),gt.add(i.name),t.loadLanguageSync(i.data)}}function So(){Se.clear(),gt.clear()}function Oi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function Ni(e){if(Oi())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=It.get(e);if(t!=null)return t;try{let n=jt.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(Ln,e)&&(n=Ln[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const i=n().then(({default:r})=>{const o={name:e,data:r};return Se.has(e)||Se.set(e,o),o});return It.set(e,i),await i}finally{It.delete(e)}}function Fi(e){return Se.get(e)??Ni(e)}const vt=new Set;function Ye(e){const t=[],n=new Set;for(const c of yo(e.themes)){const u=zi(c)?c.getThemes():[c];for(const f of u){if(n.has(f.name))throw new Error(`Theme collection already contains theme "${f.name}"`);n.add(f.name),t.push(f)}}const i=Object.freeze([...t]),r=Object.freeze(i.filter(c=>c.colorScheme==="light")),o=Object.freeze(i.filter(c=>c.colorScheme==="dark")),s=new Map(i.map(c=>[c.name,c])),l=Object.freeze(i.map(c=>c.name)),a=Object.freeze(r.map(c=>c.name)),d=Object.freeze(o.map(c=>c.name));function h(c){if(c==null)return i;const{colorScheme:u,collection:f}=c;return f==null?u==="light"?r:u==="dark"?o:i:i.filter(g=>g.collection!==f?!1:u==null||g.colorScheme===u)}return{getTheme(c){return s.get(c)},getThemes(c){return h(c)},getThemeNames(c){return c?.collection==null?c?.colorScheme==="light"?a:c?.colorScheme==="dark"?d:l:h(c).map(u=>u.name)},hasTheme(c){return s.has(c)},orderBy(c){return Ye({themes:i.map((u,f)=>({descriptor:u,index:f})).sort((u,f)=>{const g=c(u.descriptor,f.descriptor);return g!==0?g:u.index-f.index}).map(u=>u.descriptor)})},pick(c){const u=[],f=new Set;for(const g of c){if(f.has(g))throw new Error(`Theme collection pick already includes theme "${g}"`);f.add(g);const b=s.get(g);if(b==null)throw new Error(`Theme collection does not contain theme "${g}"`);u.push(b)}return Ye({themes:u})},registerInto(c){for(const u of i)c.registerThemeIfAbsent(u.name,u.load)}}}function yo(e){return xo(e)?[e]:e}function xo(e){return zi(e)||Lo(e)}function Lo(e){return typeof e.name=="string"&&typeof e.load=="function"}function zi(e){return typeof e.getThemes=="function"}function Ui(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Vi=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},ko=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},wo=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Eo(){const e=new Map,t=new Map,n=new Map;let i=0;function r(m,p){if(e.has(m))throw new Vi(m);e.set(m,p)}function o(m,p){return e.has(m)?!1:(e.set(m,p),!0)}function s(m){return e.has(m)}function l(m){const p=t.get(m);if(p!==void 0)return Promise.resolve(p);const C=n.get(m);if(C!==void 0)return C;const v=e.get(m);if(v===void 0)return Promise.reject(new ko(m));const x=i,S=v().then(L=>{const E=Ui(L);return x===i&&t.set(m,E),n.get(m)===S&&n.delete(m),E}).catch(L=>{throw n.get(m)===S&&n.delete(m),L});return n.set(m,S),S}function a(m){return Promise.all(m.map(p=>l(p)))}function d(m,p){t.set(m,p)}function h(m){for(const[p,C]of m)d(p,C)}function c(m){return t.get(m)}function u(m){const p=[];for(const C of m){const v=t.get(C);if(v===void 0)throw new wo(C);p.push(v)}return p}function f(m){return t.has(m)}function g(m){for(const p of m)if(!t.has(p))return!1;return!0}function b(m){const p=t.get(m);return p!==void 0?p:l(m)}function y(){i++,t.clear(),n.clear()}return{clearResolvedThemes:y,getResolvedOrResolveTheme:b,getResolvedTheme:c,getResolvedThemes:u,hasRegisteredTheme:s,hasResolvedTheme:f,hasResolvedThemes:g,registerTheme:r,registerThemeIfAbsent:o,resolveTheme:l,resolveThemes:a,seedResolvedTheme:d,seedResolvedThemes:h}}const X=Eo();function An(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=X.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,X.getResolvedTheme(n)==null&&X.seedResolvedTheme(n,i);vt.has(n)||(vt.add(n),t.loadThemeSync(i))}}function To(){X.clearResolvedThemes(),vt.clear()}function hn({name:e,load:t,colorScheme:n,collection:i,displayName:r}){return{name:e,colorScheme:n,collection:i,displayName:r,load:Io(t)}}function Io(e){return async()=>Or(Ui(await e()))}const Ro="pierre",Ao=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],Bi=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],Ho=[...Bi,...Ao],Mo=new Set(Bi);function Do(e){return Mo.has(e)?"light":"dark"}const Po={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},_o={"pierre-dark":()=>k(()=>import("./pierre-dark-CyvmCCZW.js"),[]),"pierre-dark-soft":()=>k(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[]),"pierre-dark-vibrant":()=>k(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[]),"pierre-dark-protanopia-deuteranopia":()=>k(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[]),"pierre-dark-tritanopia":()=>k(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[]),"pierre-light":()=>k(()=>import("./pierre-light-480U9XYS.js"),[]),"pierre-light-soft":()=>k(()=>import("./pierre-light-soft-CVdyfjmI.js"),[]),"pierre-light-vibrant":()=>k(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[]),"pierre-light-protanopia-deuteranopia":()=>k(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[]),"pierre-light-tritanopia":()=>k(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[])};function Oo(e){return hn({name:e,collection:Ro,colorScheme:Do(e),displayName:Po[e],load:_o[e]})}const $i=Ye({themes:Ho.map(e=>Oo(e))}),No="shiki",Wi=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],Fo=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],zo=new Set(Wi);function Uo(e){return zo.has(e)?"light":"dark"}const Vo={andromeeda:()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[]),"aurora-x":()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[]),"ayu-dark":()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[]),"ayu-light":()=>k(()=>import("./ayu-light-BA47KaF1.js"),[]),"ayu-mirage":()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[]),"catppuccin-frappe":()=>k(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]),"catppuccin-latte":()=>k(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]),"catppuccin-macchiato":()=>k(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]),"catppuccin-mocha":()=>k(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]),"dark-plus":()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[]),dracula:()=>k(()=>import("./dracula-BzJJZx-M.js"),[]),"dracula-soft":()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[]),"everforest-dark":()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[]),"everforest-light":()=>k(()=>import("./everforest-light-C8M2exoo.js"),[]),"github-dark":()=>k(()=>import("./github-dark-DHJKELXO.js"),[]),"github-dark-default":()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[]),"github-dark-dimmed":()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]),"github-dark-high-contrast":()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]),"github-light":()=>k(()=>import("./github-light-DAi9KRSo.js"),[]),"github-light-default":()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[]),"github-light-high-contrast":()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]),"gruvbox-dark-hard":()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]),"gruvbox-dark-medium":()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]),"gruvbox-dark-soft":()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]),"gruvbox-light-hard":()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]),"gruvbox-light-medium":()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]),"gruvbox-light-soft":()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]),horizon:()=>k(()=>import("./horizon-BUw7H-hv.js"),[]),"horizon-bright":()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[]),houston:()=>k(()=>import("./houston-DnULxvSX.js"),[]),"kanagawa-dragon":()=>k(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]),"kanagawa-lotus":()=>k(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]),"kanagawa-wave":()=>k(()=>import("./kanagawa-wave-DWedfzmr.js"),[]),laserwave:()=>k(()=>import("./laserwave-DUszq2jm.js"),[]),"light-plus":()=>k(()=>import("./light-plus-B7mTdjB0.js"),[]),"material-theme":()=>k(()=>import("./material-theme-D5KoaKCx.js"),[]),"material-theme-darker":()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[]),"material-theme-lighter":()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]),"material-theme-ocean":()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[]),"material-theme-palenight":()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]),"min-dark":()=>k(()=>import("./min-dark-CafNBF8u.js"),[]),"min-light":()=>k(()=>import("./min-light-CTRr51gU.js"),[]),monokai:()=>k(()=>import("./monokai-D4h5O-jR.js"),[]),"night-owl":()=>k(()=>import("./night-owl-C39BiMTA.js"),[]),"night-owl-light":()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[]),nord:()=>k(()=>import("./nord-Ddv68eIx.js"),[]),"one-dark-pro":()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]),"one-light":()=>k(()=>import("./one-light-C3Wv6jpd.js"),[]),plastic:()=>k(()=>import("./plastic-3e1v2bzS.js"),[]),poimandres:()=>k(()=>import("./poimandres-CS3Unz2-.js"),[]),red:()=>k(()=>import("./red-bN70gL4F.js"),[]),"rose-pine":()=>k(()=>import("./rose-pine-qdsjHGoJ.js"),[]),"rose-pine-dawn":()=>k(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]),"rose-pine-moon":()=>k(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]),"slack-dark":()=>k(()=>import("./slack-dark-BthQWCQV.js"),[]),"slack-ochin":()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[]),"snazzy-light":()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[]),"solarized-dark":()=>k(()=>import("./solarized-dark-DXbdFlpD.js"),[]),"solarized-light":()=>k(()=>import("./solarized-light-L9t79GZl.js"),[]),"synthwave-84":()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[]),"tokyo-night":()=>k(()=>import("./tokyo-night-hegEt444.js"),[]),vesper:()=>k(()=>import("./vesper-DRje8inN.js"),[]),"vitesse-black":()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[]),"vitesse-dark":()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[]),"vitesse-light":()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[])};function Hn(e){return hn({name:e,collection:No,colorScheme:Uo(e),load:Vo[e]})}const Gi=Ye({themes:Object.freeze([...Wi.map(e=>Hn(e)),...Fo.map(e=>Hn(e))])});Ye({themes:[$i,Gi]});function ji(e){if(Oi())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(X.hasRegisteredTheme(e))return;const t=Gi.getTheme(e);if(t!=null){X.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function qi(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Bo(e){ji(e);const t=await X.resolveTheme(e);return qi(e,t),t}function $o(e){return X.getResolvedTheme(e)??Bo(e)}let $;async function xt({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){$??=Nr({themes:[],langs:["text"],engine:n==="shiki-wasm"?Fr(k(()=>import("./wasm-CG6Dc4jp.js"),[])):zr()});const i=Wo($)?await $:$;$=i;const r=[];for(const s of t){if(s==="text"||s==="ansi")continue;const l=Fi(s);"then"in l?r.push(l):Rn(l,i)}const o=[];for(const s of e){const l=$o(s);"then"in l?o.push(l):An(l,$)}return(r.length>0||o.length>0)&&await Promise.all([Promise.all(r).then(s=>{Rn(s,i)}),Promise.all(o).then(s=>{An(s,i)})]),i}function ql(e=$){return e!=null&&!("then"in e)}function Ki(){if($!=null&&!("then"in $))return $}function Wo(e=$){return e!=null&&"then"in e}function Kl(e=$){return e==null}async function Yl(e){await xt(e)}async function Xl(){$!=null&&((await $).dispose(),So(),To(),$=void 0)}for(const e of $i.getThemes())X.registerThemeIfAbsent(e.name,e.load);function cn(e=_){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Ge(e){for(const t of cn(e))if(!vt.has(t))return!1;return!0}function Go(e){return X.hasResolvedThemes(e)}function Oe(e,t){return De(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function ae(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Lt(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function qt(e){return A({tagName:"div",children:[A({tagName:"div",children:e.annotations?.map(t=>A({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function jo(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function Yi({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return A({tagName:"div",children:[t==="custom"?A({tagName:"slot",properties:{name:an}}):qo({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[Ko(i)]],properties:r})}function qo({name:e,prevName:t,iconType:n}){const i=[A({tagName:"slot",properties:{name:on}}),pt({name:jo(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(t)]})],properties:{"data-prev-name":""}})),i.push(pt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(e)]})],properties:{"data-title":""}})),A({tagName:"div",children:i,properties:{"data-header-content":""}})}function Ko(e){const t=[];if(e!=null){let n=0,i=0;for(const r of e.hunks)n+=r.additionLines,i+=r.deletionLines;(i>0||n===0)&&t.push(A({tagName:"span",children:[W(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(A({tagName:"span",children:[W(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(A({tagName:"slot",properties:{name:sn}})),A({tagName:"div",children:t,properties:{"data-metadata":""}})}function Xi(e){return A({tagName:"pre",properties:Yo(e)})}function Yo({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:s,customProperties:l}){return{...l,"data-diff":s==="diff"?"":void 0,"data-file":s==="file"?"":void 0,"data-diff-type":s==="diff"?r?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}const Z=new Map;let bt=0;const Ne={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Q(e){if(Z.has(e))return Z.get(e)??"text";if(Ne[e]!=null)return Ne[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Z.has(t[1]))return Z.get(t[1])??"text";if(Ne[t[1]]!=null)return Ne[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Z.has(n)?Z.get(n)??"text":Ne[n]??"text"}function Ql(e,t){if(e<=bt)return!1;Z.clear();for(const n in t){const i=t[n];i!=null&&Z.set(n,i)}return bt=e,!0}function Jl(){return bt}function Xo(e,t){const n=Z.get(e);return n===t?!1:(n!=null&&console.warn(`setCustomExtension: overriding custom mapping for "${e}" from "${n}" to "${t}"`),Z.set(e,t),bt++,!0)}function Zl(){return Object.fromEntries(Z)}function un(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:cn(t),preferredHighlighter:n}}function ge(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function xe(e){return e.replace(/\n$|\r\n$/,"")}function Qo(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),new Error(r)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(W(` `)),e}const tt=Symbol("no-token"),Rt=Symbol("multiple-tokens");function Qi(e){const t=Jo(e);if(t!=null)return t;let n=tt;const i=[];let r=[],o;const s=()=>{if(r.length===0||o==null){r=[],o=void 0;return}if(r.length===1){const a=r[0];if(a?.type==="element"){Zo(a,o);for(const d of a.children)ft(d)}else ft(a);i.push(a),r=[],o=void 0;return}for(const a of r)ft(a);i.push(A({tagName:"span",properties:{"data-char":o},children:r})),r=[],o=void 0},l=a=>{if(a!==tt){if(a===Rt){n=Rt;return}if(n===tt){n=a;return}n!==a&&(n=Rt)}};for(const a of e.children){const d=a.type==="element"?Qi(a):tt;if(l(d),typeof d!="number"){s(),i.push(a);continue}o!=null&&o!==d&&s(),o??=d,r.push(a)}return s(),e.children=i,n}function Jo(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function ft(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)ft(t)}}function Zo(e,t){e.properties["data-char"]=t}function es(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:i=l=>l}=e,r=new Map;function o(l){return Object.entries(l).map(([a,d])=>`${a}:${d}`).join(";")}function s(l){let a=t+ts(typeof l=="string"?l:o(l))+n;return a=i(a),r.has(a)||r.set(a,typeof l=="string"?l:{...l}),a}return{name:"@shikijs/transformers:style-to-class",pre(l){if(!l.properties.style)return;const a=s(l.properties.style);delete l.properties.style,this.addClassToHast(l,a)},tokens(l){for(const a of l)for(const d of a){if(!d.htmlStyle)continue;const h=s(d.htmlStyle);d.htmlStyle={},d.htmlAttrs||={},d.htmlAttrs.class?d.htmlAttrs.class+=` ${h}`:d.htmlAttrs.class=h}},getClassRegistry(){return r},getCSS(){let l="";for(const[a,d]of r.entries())l+=`.${a}{${typeof d=="string"?d:o(d)}}`;return l},clearRegistry(){r.clear()}}}function ts(e,t=0){let n=3735928559^t,i=1103547991^t;for(let r=0,o;r>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&i)+(n>>>0)).toString(36).slice(0,6)}function Ji(e=!1,t=!1){const n={lineInfo:[]},i=[{line(r){return delete r.properties.class,r},pre(r){const o=oo(r),s=[];if(o!=null){let l=1;for(const a of o.children)a.type==="element"&&(e&&Qi(a),s.push(Qo(a,l,n)),l++);o.children=s}return r},...e?{tokens(r){for(const o of r){let s=0;for(const l of o){const a=l;a.__lineChar??=s,s+=l.content.length}}},preprocess(r,o){o.mergeWhitespaces="never"},span(r,o,s,l,a){if(a?.offset!=null&&a.content!=null){const d=a.__lineChar;return d!=null&&(r.properties["data-char"]=d),r}return r}}:null}];return t&&i.push(ns,Mn),{state:n,transformers:i,toClass:Mn}}const Mn=es({classPrefix:"hl-"}),ns={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const i={};n.color!=null&&(i.color=n.color),n.bgColor!=null&&(i["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(i["font-style"]="italic"),(n.fontStyle&2)!==0&&(i["font-weight"]="bold"),(n.fontStyle&4)!==0&&(i["text-decoration"]="underline")),Object.keys(i).length>0&&(n.htmlStyle=i)}}};function B(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const is=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,rs=/^0(?:\.0+)?%?$/;function os(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;const i=e.slice(t+1,-1).trim();if(i.length===0)return;const r=i.lastIndexOf("/");if(r!==-1)return i.slice(r+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const o=i.split(",");if(o.length===4)return o[3]?.trim()}}function ss(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const n=t[1];let i,r=1;return n.length===3?i=n.split("").map(o=>o+o).join(""):n.length===6?i=n:(i=n.slice(0,6),r=parseInt(n.slice(6,8),16)/255),[parseInt(i.slice(0,2),16),parseInt(i.slice(2,4),16),parseInt(i.slice(4,6),16),r]}function At(e){if(e==null)return null;const t=ss(e);if(t==null)return null;const n=t[0]/255,i=t[1]/255,r=t[2]/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(i)+.0722*o(r)}function Dn(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||is.test(t))return!0;const n=os(t);return n!=null&&rs.test(n)}function as(e,t,n){if(t==null||n==null)return!1;const i=At(e),r=At(t),o=At(n);return i==null||r==null||o==null?!1:Math.abs(i-o){const s=e.at(-1);return s===""||s===` `||s===`\r `||s==="\r"?Math.max(0,e.length-2):e.length-1})();for(let s=t;s0||l<1/0,{state:h,transformers:c}=Ji(r),u=o?"text":e.lang??Q(e.name),f=typeof n=="string"?t.getTheme(n).type:void 0,g=fn({theme:n,highlighter:t});h.lineInfo=p=>({type:"context",lineIndex:p-1+s,lineNumber:p+s});const b=typeof n=="string"?{lang:u,theme:n,transformers:c,defaultColor:!1,cssVariablePrefix:B("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0}:{lang:u,themes:n,transformers:c,defaultColor:!1,cssVariablePrefix:B("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0},y=Kt(t.codeToHast(d?cs(a??St(e.contents),s,l):xe(e.contents),b)),m=d?new Array(s):y;return d&&m.push(...y),{code:m,themeStyles:g,baseThemeType:f}}function cs(e,t,n){let i="";return Ct({lines:e,startingLine:t,totalLines:n,callback({content:r}){i+=r}}),i}const Zi="-1,-1";function Yt(e){return e?.some(t=>t.lineNumber===0)??!1}function Xt(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function kt(e){return e.startingLine===0&&e.totalLines>0}function er(e,t){return A({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function Qt(e){return(e.lang??Q(e.name))==="text"}function tr(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}let us=-1;var fs=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++us}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;constructor(e={theme:_},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Ge(e.theme??_)?Ki():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0}clearRenderCache(){this.renderCache=void 0}hydrate(e){const{options:t}=this.getRenderOptions(e),n=Pt(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let i=this.workerManager?.getFileResultCache(e);i!=null&&!Oe(t,i.options)&&(i=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!Qt(e),result:n?void 0:i?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter==null&&(this.computedLang=e.lang??Q(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();const{theme:i=_,tokenizeMaxLineLength:r=1e3}=this.options;return{theme:i,useTokenTransformer:tr(this.options),tokenizeMaxLineLength:r}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!ae(e,n.file)||!Oe(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){if(e.cacheKey==null)return this.lineCache=void 0,St(e.contents);let{lineCache:t}=this;return(t==null||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:St(e.contents)}),this.lineCache=t,t.lines}renderFile(e=this.renderCache?.file,t=Ae){if(e==null)return;let{options:n,forceHighlight:i}=this.getRenderOptions(e);const r=this.getMatchingWorkerResultCache(e,n);r!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...r},i=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};const o=this.getOrCreateLineCache(e),s=e.contents.length>0,l=!s||Qt(e)||Pt(o.length,this.getTokenizeMaxLength()),a=!ae(e,this.renderCache.file),d=!Lt(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(l||this.renderCache.result==null||!this.renderCache.highlighted&&(a||d))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||a||d||i)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,o)),this.renderCache.renderRange=t),!l&&s&&(!this.renderCache.highlighted||i)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??Q(e.name);const h=this.highlighter!=null&&Ge(n.theme),c=this.highlighter!=null&&mt(this.computedLang),u=!l&&c;if(this.highlighter!=null&&h&&(i||l||!this.renderCache.highlighted&&u||this.renderCache.result==null)){const{result:f,options:g}=this.renderFileWithHighlighter(e,this.highlighter,l||!c);this.renderCache={file:e,options:g,highlighted:u,result:f,renderRange:void 0}}(!h||!l&&!c)&&this.asyncHighlight(e).then(({result:f,options:g})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,f,g,!l)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=Ae){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){const t=Pt(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??Q(e.name);const n=this.highlighter!=null&&Go(cn(this.options.theme)),i=t||this.highlighter!=null&&mt(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e);return{result:hs(e,t,i,{forcePlainText:n}),options:i}}processFileResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){const{disableFileHeader:o=!1}=this.options,s=[],l=Ee(),a=this.getOrCreateLineCache(e);let d=0;const h=kt(t)?Xt(this.lineAnnotations):void 0;return h!=null&&(l.children.push(j("context","annotation",1)),s.push(qt({hunkIndex:-1,lineIndex:-1,annotations:h.map(c=>ge(c))})),d++),Ct({lines:a,startingLine:t.startingLine,totalLines:t.totalLines,callback:({lineIndex:c,lineNumber:u})=>{const f=n[c];if(f==null){const g="FileRenderer.processFileResult: Line doesnt exist";throw console.error(g,{name:e.name,lineIndex:c,lineNumber:u,lines:a}),new Error(g)}if(f!=null){l.children.push(Di("context",u,`${c}`)),s.push(f),d++;const g=this.lineAnnotations[u];g!=null&&(l.children.push(j("context","annotation",1)),s.push(qt({hunkIndex:0,lineIndex:u,annotations:g.map(b=>ge(b))})),d++)}}}),l.properties.style=`grid-row: span ${d}`,{gutterAST:l.children??[],contentAST:s,preAST:this.createPreElement(a.length),headerAST:o?void 0:this.renderHeader(e),totalLines:a.length,rowCount:d,themeStyles:i,baseThemeType:r,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){const{headerRenderMode:t="default",stickyHeader:n=!1}=this.options;return Yi({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return pe(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(A({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=Ee();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,er(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return t?pe(A({tagName:"code",children:e,properties:{"data-code":""}})):pe(e)}async initializeHighlighter(){return this.highlighter=await xt(un(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n,i=!0){if(this.renderCache==null)return;const r=!ae(e,this.renderCache.file)||!this.renderCache.highlighted||!Oe(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:i,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getFileResultCache(e);if(!(n==null||!Oe(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&ae(e,n.file)&&Oe(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){const{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return Xi({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function Pt(e,t){return e>t}const nr=`
+`:`
+`)+`
+
    +`}function Eue(){return`
+
+`}function Lue(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`
  • `}function Nue(){return`
  • +`}function Due(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),` ↩︎`}function Fue(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Iue,e.renderer.rules.footnote_block_open=Tue,e.renderer.rules.footnote_block_close=Eue,e.renderer.rules.footnote_open=Lue,e.renderer.rules.footnote_close=Nue,e.renderer.rules.footnote_anchor=Due,e.renderer.rules.footnote_caption=Mue,e.renderer.rules.footnote_anchor_name=_ue;function i(l,a,u,c){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h=f||l.src.charCodeAt(++h)!==58)return!1;if(c)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const m=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${m}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:m},g.level=l.level++,l.tokens.push(g);const v=l.bMarks[a],y=l.tShift[a],b=l.sCount[a],C=l.parentType,A=h,T=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let N=T;for(;h=u||l.src.charCodeAt(c)!==94||l.src.charCodeAt(c+1)!==91)return!1;const d=c+2,f=t(l,c+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,m=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,m);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:m}}return l.pos=f+1,l.posMax=u,!0}function s(l,a){const u=l.posMax,c=l.pos;if(c+3>u||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(c)!==91||l.src.charCodeAt(c+1)!==94)return!1;let d;for(d=c+2;d=u)return!1;d++;const f=l.src.slice(c+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const m=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:m,label:f}}return l.pos=d,l.posMax=u,!0}function r(l){let a,u,c,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(m){return m.type==="footnote_reference_open"?(d=!0,u=[],c=m.meta.label,!1):m.type==="footnote_reference_close"?(d=!1,f[":"+c]=u,!1):(d&&u.push(m),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let m=0,g=h.length;m0?h[m].count:1;for(let C=0;C?@[\]^_`{|}~-])/g;function $ue(e,t){const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==94||t||i+2>=n)return!1;e.pos=i+1;let o=!1;for(;e.pos{t.exports=function(g,v){v=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},v),g.core.ruler.after("inline","github-task-lists",function(y){for(var b=y.tokens,C=0,A=2;A=0;b--)if(g[b].level===y)return b;return-1}function o(g,v){return d(g[v])&&f(g[v-1])&&h(g[v-2])&&m(g[v])}function s(g,v,y,b){var C=y.idPrefix+v;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(C,b)),g.children.push(a(b)),g.children.unshift(r(g,C,y,b)),y.divWrap&&(g.children.unshift(u(y,b)),g.children.push(c(b)))}function r(g,v,y,b){var C=new b("checkbox_input","input",0);return C.attrs=[["type","checkbox"],["id",v]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&C.attrs.push(["checked","true"]),y.disabled===!0&&C.attrs.push(["disabled","true"]),C}function l(g,v){var y=new v("label_open","label",1);return y.attrs=[["for",g]],y}function a(g){return new g("label_close","label",-1)}function u(g,v){var y=new v("checkbox_open","div",0);return y.attrs=[["class",g.divClass]],y}function c(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function m(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})});const jue=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Hue(e){return e>=55296&&e<=57343||e>1114111?65533:jue.get(e)??e}function Wue(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let o=0,s=0;o=Eo.ZERO&&e<=Eo.NINE}function Uue(e){return e>=Eo.UPPER_A&&e<=Eo.UPPER_F||e>=Eo.LOWER_A&&e<=Eo.LOWER_F}function Vue(e){return e>=Eo.UPPER_A&&e<=Eo.UPPER_Z||e>=Eo.LOWER_A&&e<=Eo.LOWER_Z||hC(e)}function Kue(e){return e===Eo.EQUALS||Vue(e)}var zs;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(zs||(zs={}));var dd;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(dd||(dd={}));var Zue=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=zs.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=dd.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=zs.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case zs.EntityStart:return e.charCodeAt(t)===Eo.NUM?(this.state=zs.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=zs.NamedEntity,this.stateNamedEntity(e,t));case zs.NumericStart:return this.stateNumericStart(e,t);case zs.NumericDecimal:return this.stateNumericDecimal(e,t);case zs.NumericHex:return this.stateNumericHex(e,t);case zs.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|xT)===Eo.LOWER_X?(this.state=zs.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=zs.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const l=i&$r.JUMP_TABLE;if(e.charCodeAt(t)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return-1;const l=this.runConsumed-1,a=n[this.treeIndex+1+(l>>1)],u=l%2===0?a&255:a>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(r>>1),i=n[this.treeIndex],o=(i&$r.VALUE_LENGTH)>>14}if(t>=e.length)break;const s=e.charCodeAt(t);if(s===Eo.SEMI&&o!==0&&(i&$r.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=Que(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===dd.Attribute&&(o===0||Kue(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&$r.VALUE_LENGTH)>>14,o!==0){if(s===Eo.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==dd.Strict&&(i&$r.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:e,decodeTree:t}=this,n=(t[e]&$r.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~($r.VALUE_LENGTH|$r.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case zs.NamedEntity:return this.result!==0&&(this.decodeMode!==dd.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case zs.NumericDecimal:return this.emitNumericEntity(0,2);case zs.NumericHex:return this.emitNumericEntity(0,3);case zs.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case zs.EntityStart:return 0}}};function Gue(e){let t="";const n=new Zue(e,i=>t+=String.fromCodePoint(i));return function(o,s){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(s);const u=n.write(o,l+1);if(u<0){r=l+n.end();break}r=l+u,l=u===0?r+1:r}const a=t+o.slice(r);return t="",a}}function Que(e,t,n,i){const o=(t&$r.BRANCH_LENGTH)>>7,s=t&$r.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const u=i-s;return u<0||u>=o?-1:e[n+u]-1}const r=o+1>>1;let l=0,a=o-1;for(;l<=a;){const u=l+a>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(ci)a=u-1;else return e[n+r+u]}return-1}const Yue=Gue(que);function n7(e,t=dd.Legacy){return Yue(e,t)}var Jue=mz(zue());const ST={};function Xue(e){let t=ST[e];if(t)return t;t=ST[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),s+=6;continue}}if((l&248)===240&&s+91114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}o+="�"}return o})}jb.defaultChars=";/?:@&=+$,#";jb.componentChars="";var pC=jb;const _T={};function ece(e){let t=_T[e];if(t)return t;t=_T[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=ece(t);let o="";for(let s=0,r=e.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&a<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}Hb.defaultChars=";/?:@&=+$,-_.!~*'()#";Hb.componentChars="-_.!~*'()";var gz=Hb;function i7(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function X9(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const tce=/^([a-z0-9.+-]+:)/i,nce=/:[0-9]*$/,ice=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,oce=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` +`," "]),sce=["'"].concat(oce),MT=["%","/","?",";","#"].concat(sce),IT=["/","?","#"],rce=255,TT=/^[+a-z0-9A-Z_-]{0,63}$/,lce=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ET={javascript:!0,"javascript:":!0},LT={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function ace(e,t){if(e&&e instanceof X9)return e;const n=new X9;return n.parse(e,t),n}X9.prototype.parse=function(e,t){let n,i,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=ice.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=tce.exec(s);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,s=s.substr(r.length)),(t||r||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(r&&ET[r])&&(s=s.substr(2),this.slashes=!0)),!ET[r]&&(o||r&&!LT[r])){let u=-1;for(let m=0;m127?b+="x":b+=y[C];if(!b.match(TT)){const C=m.slice(0,g),A=m.slice(g+1),T=y.match(lce);T&&(C.push(T[1]),A.unshift(T[2])),A.length&&(s=A.join(".")+s),this.hostname=C.join(".");break}}}}this.hostname.length>rce&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const a=s.indexOf("?");return a!==-1&&(this.search=s.substr(a),s=s.slice(0,a)),s&&(this.pathname=s),LT[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};X9.prototype.parseHost=function(e){let t=nce.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var o7=ace,vz=xue({decode:()=>pC,encode:()=>gz,format:()=>i7,parse:()=>o7}),uce=Object.defineProperty,yz=e=>{let t={};for(var n in e)uce(t,n,{get:e[n],enumerable:!0});return t},Ds=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},cce=yz({arrayReplaceAt:()=>vce,assign:()=>mce,countLines:()=>zo,escapeHtml:()=>_ce,escapeRE:()=>Ice,fromCodePoint:()=>H0,has:()=>pce,isMdAsciiPunct:()=>nk,isPunctChar:()=>tk,isPunctCode:()=>mC,isSpace:()=>gce,isString:()=>fce,isValidEntityCode:()=>qb,isWhiteSpace:()=>j0,lib:()=>Tce,mdurl:()=>vz,normalizeReference:()=>Wb,ucmicro:()=>ek,unescapeAll:()=>W0,unescapeMd:()=>wce});const ek={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function dce(e){return Object.prototype.toString.call(e)}function fce(e){return dce(e)==="[object String]"}const hce=Object.prototype.hasOwnProperty;function pce(e,t){return hce.call(e,t)}function mce(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(i=>{e[i]=n[i]})}}),e}function gce(e){return e===9||e===32}function j0(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function tk(e){return ek.P.test(e)||ek.S.test(e)}const NT=new Map;function mC(e){if(nk(e))return!0;if(e>=0&&e<128)return!1;const t=NT.get(e);if(t!==void 0)return t;const n=tk(String.fromCharCode(e));return NT.set(e,n),n}function nk(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Wb(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function vce(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function qb(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function H0(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const kz=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,yce=new RegExp(`${kz.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),kce=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function bce(e,t){if(t.charCodeAt(0)===35&&kce.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return qb(i)?H0(i):e}const n=n7(e);return n!==e?n:e}function wce(e){return e.includes("\\")?e.replace(kz,"$1"):e}function W0(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(yce,(t,n,i)=>n||bce(t,i))}const Cce=/[&<>"]/,Ace=/[&<>"]/g,xce={"&":"&","<":"<",">":">",'"':"""};function Sce(e){return xce[e]}function _ce(e){return Cce.test(e)?e.replace(Ace,Sce):e}const Mce=/[.?*+^$[\]\\(){}|-]/g;function Ice(e){return e.replace(Mce,"\\$&")}const Tce={mdurl:vz,ucmicro:ek};function zo(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` +`,n+1))!==-1;)t++;return t}const Ece=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Lce=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Nce=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,s7=["references","footnotes","abbreviations","abbr","abbrs"],r7=Symbol.for("markdown-it-ts.global-state"),l7=Object.prototype.hasOwnProperty;function DT(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function ja(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Sd(e){if(Array.isArray(e))return e.map(t=>Sd(t));if(ja(e)){const t={};for(const n of Object.keys(e))t[n]=Sd(e[n]);return t}return e}function ik(e){return Array.isArray(e)?e.map((t,n)=>String(n)):ja(e)?Object.keys(e):[]}function gC(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ns.has(r)?!gC(o[r],bz(i.value,r)):!0)}}function Ic(e){const t=a7(e);if(t){for(const n of s7){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){Fce(e,n,i);continue}i.existed?e[n]=Dce(e[n],i.value):delete e[n]}delete e[r7]}}function Y3(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const vC=Symbol.for("markdown-it-ts.diagnostics");function Lv(e,t){if(e)try{const n=e[vC];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[vC]=i,i}catch{return}}function oc(e){return Lv(e,!1)}function Rce(e){if(e)try{const t=e[vC];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function Pr(e){Rce(e)}function Jm(e,t){const n=Lv(e,!0);n&&(n.stockFast=t)}function fs(e,t){const n=Lv(e,!0);n&&(n.strategy=t)}function J3(e,t){const n=Lv(e,!0);n&&(n.chunk=t)}function wz(e,t){const n=Lv(e,!0);n&&(n.unbounded=t)}const Oce=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,$ce=/[\0-\x1F\x7F-\x9F]/,Pce=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,zce=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var jce=class{src_Any=Oce.source;src_Cc=$ce.source;src_Z=zce.source;src_P=Pce.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${i}|${o}).)`;let r=`${i}${s}{0,1000}${o}`;for(let l=2;l<=n;l++)r=`${i}(?:${s}|${r}){0,1000}${o}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},X3={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},Hce={"http:":X3,"https:":X3,"ftp:":X3,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const o=i.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},Wce="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",qce="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function Uce(){const e=qce.split("|");return Wce.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const o of t.slice(n+1))e.push(i+o)}),e}var Vce={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:Uce(),urlAuth:!1,maxLength:1e4},FT=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,i){const o=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=o,this.text=o,this.url=o}},Cz=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...Vce,...n},this.__schemas__={...Hce},this.re=t||new jce,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,o)=>o.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,o,s,r,l,a,u=!1,c=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const h=Math.max(f-1,0);if(o&&s&&!d&&(!l||l.index=f)break;o.lastIndex=f)break;i.lastIndexm.lastIndex))&&(m=r);let g;if(!u)for(;;){if(!a){n.lastIndexm.index)break;const b=a;a=void 0;const C=this.testSchemaAt(e,b.schema,b.lastIndex);if(C){g={schema:b.schema,index:b.index,lastIndex:b.lastIndex+C};break}}let v=g;if((!v||l&&(l.indexv.lastIndex))&&(v=l),(!v||r&&(r.indexv.lastIndex))&&(v=r),!v)break;v===l?l=void 0:v===r&&(r=void 0);const y=new FT(e,v.schema,v.index,v.lastIndex);y.schema?this.__schemas__[y.schema].normalize(y,this):this.normalize(y),t.push(y),f=v.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new FT(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},Kce=pz({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,v=Math.floor,y=String.fromCharCode;function b(P){throw new RangeError(m[P])}function C(P,O){const R=[];let z=P.length;for(;z--;)R[z]=O(P[z]);return R}function A(P,O){const R=P.split("@");let z="";R.length>1&&(z=R[0]+"@",P=R[1]),P=P.replace(h,".");const H=C(P.split("."),O).join(".");return z+H}function T(P){const O=[];let R=0;const z=P.length;for(;R=55296&&H<=56319&&RString.fromCodePoint(...P),_=function(P){return P>=48&&P<58?26+(P-48):P>=65&&P<91?P-65:P>=97&&P<123?P-97:36},w=function(P,O){return P+22+75*(P<26)-((O!=0)<<5)},M=function(P,O,R){let z=0;for(P=R?v(P/700):P>>1,P+=v(P/O);P>g*26>>1;z+=36)P=v(P/g);return v(z+(g+1)*P/(P+38))},x=function(P){const O=[],R=P.length;let z=0,H=128,j=72,K=P.lastIndexOf("-");K<0&&(K=0);for(let re=0;re=128&&b("not-basic"),O.push(P.charCodeAt(re));for(let re=K>0?K+1:0;re=R&&b("invalid-input");const ge=_(P.charCodeAt(re++));ge>=36&&b("invalid-input"),ge>v((2147483647-z)/ne)&&b("overflow"),z+=ge*ne;const Ae=te<=j?1:te>=j+26?26:te-j;if(gev(2147483647/me)&&b("overflow"),ne*=me}const Q=O.length+1;j=M(z-q,Q,q==0),v(z/Q)>2147483647-H&&b("overflow"),H+=v(z/Q),z%=Q,O.splice(z++,0,H)}return String.fromCodePoint(...O)},E=function(P){const O=[];P=T(P);const R=P.length;let z=128,H=0,j=72;for(const q of P)q<128&&O.push(y(q));const K=O.length;let re=K;for(K&&O.push("-");re=z&&nev((2147483647-H)/Q)&&b("overflow"),H+=(q-z)*Q,z=q;for(const ne of P)if(ne2147483647&&b("overflow"),ne===z){let te=H;for(let ge=36;;ge+=36){const Ae=ge<=j?1:ge>=j+26?26:ge-j;if(te32))return s;if(i===41){if(r===0)break;r--}o++}return t===o||r!==0||(s.str=W0(e.slice(t,o)),s.pos=o,s.ok=!0),s}var xz=d7;const qy=-2;function Zce(e,t,n,i){let o=1,s=t+1;for(;s=0&&t+1>=c)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=Zce(l,t,a,n);if(f!==qy)return f;for(e.pos=t+1;e.pos=n)return r;let l=e.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return r;t++,s++,l===40&&(l=41),r.marker=l}for(;s=0?e.attrs[n][1]:null}function Yce(e,t,n){const i=Ub(e,t);i<0?p7(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var Jce=yz({attrGet:()=>Qce,attrIndex:()=>Ub,attrJoin:()=>Yce,attrPush:()=>p7,attrSet:()=>Gce,parseLinkDestination:()=>d7,parseLinkLabel:()=>f7,parseLinkTitle:()=>h7});function Xce(e){return e.includes("\r")||e.includes("\0")}function _z(e){return typeof e=="string"?e:e.toString()}function ede(e){if(e.inlineMode){const t=new Ds("inline","",0);t.content=_z(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const tde=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,nde=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function ide(e,t){let n=e.pos;const i=e.src;if(i.charCodeAt(n)!==60)return!1;const o=n,s=e.posMax;for(;;){if(++n>=s)return!1;const l=i.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=i.slice(o+1,n);if(nde.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}if(tde.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}return!1}var Mz=ide;function ode(e,t){const n=e.src;let i=e.pos;if(n.charCodeAt(i)!==96)return!1;const o=i;i++;const s=e.posMax;for(;i2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var Iz=ode;function BT(e){const t={},n=e.length;if(!n)return;let i=0,o=-2;const s=[];for(let r=0;ra;u-=s[u]+1){const d=e[u];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=u>0&&!e[u-1].open?s[u-1]+1:0;s[r]=r-u+h,s[u]=h,l.open=!1,d.end=r,d.close=!1,c=-1,o=-2;break}}}c!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function sde(e){const t=e.tokens_meta,n=e.tokens_meta.length;BT(e.delimiters);for(let i=0;i=0;o--){const s=t[o],r=s.marker;if(r!==95&&r!==42||s.end===-1)continue;const l=t[s.end],a=s.token,u=l.token,c=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===r&&t[o-1].token===a-1&&t[s.end+1].token===u+1,d=r===42?Tz:Ez,f=i[a];c?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=i[u];c?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),c&&(i[t[o-1].token].content="",i[t[s.end+1].token].content="",o--)}}function ade(e){const t=e.tokens_meta,n=e.tokens_meta.length;RT(e,e.delimiters);for(let i=0;i=48&&e<=57}function ude(e){const t=e|32;return m7(e)||t>=97&&t<=102}function Nz(e){const t=e|32;return t>=97&&t<=122}function cde(e){return Nz(e)||m7(e)}function dde(e,t,n){let i=t+2;if(i>=n)return null;let o=!1,s=7,r=i;for((e.charCodeAt(i)|32)===120&&(o=!0,s=6,i++,r=i);i=n||e.charCodeAt(i)!==59?null:e.slice(t,i+1)}function fde(e,t,n){let i=t+1;if(i>=n||!Nz(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const o=e.slice(t,i+1);return Lz(o)!==o?o:null}function hde(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=dde(e.src,n,i);if(o){if(!t){const s=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=qb(s)?H0(s):H0(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=fde(e.src,n,i);if(o){const s=Lz(o);if(!t){const r=e.push("text_special","",0);r.content=s,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var Dz=hde;const Fz=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),kC=new Array(128),Bz=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);kC[e]=`\\${t}`,Bz[e]=Fz[e]?t:kC[e]}function OT(e,t,n){e.pending&&e.pushPending();const i=new Ds("text_special","",0);i.level=e.level,i.content=t,i.markup=n,i.info="escape",e.pendingLevel=e.level,e.tokens.push(i),e.tokens_meta.push(null)}function pde(e,t){let n=e.pos;const i=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=i))return!1;let s=o.charCodeAt(n);if(s===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&s<=56319&&n+1=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(s>=55296&&s<=56319&&n+1=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return OT(e,s<256&&Fz[s]?r:l,l),e.pos=n+1,!0}var Rz=pde;function mde(e){let t,n,i=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t0&&i++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,$z="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",vde=new RegExp(`^(?:${Oz}|${$z}||<\\?[\\s\\S]*?\\?>|]*>|)`),yde=new RegExp(`^(?:${Oz}|${$z})`);function Pz(e){return e===32||e===9||e===10||e===12||e===13}function kde(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||Pz(t)}function bde(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function Cde(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos,o=e.src;if(o.charCodeAt(i)!==60||i+2>=n)return!1;const s=o.charCodeAt(i+1);if(s!==33&&s!==63&&s!==47&&!wde(s))return!1;const r=o.slice(i).match(vde);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,kde(l)&&e.linkLevel++,bde(l)&&e.linkLevel--}return e.pos+=l.length,!0}var zz=Cde;function Ade(e,t){let n,i,o,s,r,l,a,u,c="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,m=ok(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=f)return!1;if(l=xz(e.src,s,e.posMax),l.ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?s=l.pos:c="",u=s;s=f||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?o=e.src.slice(u,s++):s=m+1):s=m+1,o||(o=e.src.slice(h,m)),r=e.env.references[Wb(o)],!r)return e.pos=d,!1;c=r.href,a=r.title}if(!t){i=e.src.slice(h,m);const g=[];e.md.inline.parse(i,e.md,e.env,g);const v=e.push("image","img",0);v.attrs=[["src",c],["alt",""]],v.children=g,v.content=i,a&&v.attrs.push(["title",a])}return e.pos=s,e.posMax=f,!0}var jz=Ade;function e8(e,t,n){for(;t"u")return!1;let d;if(l=r+1,l=0?(d=n.slice(h,m),d||(d=n.slice(s,r)),l=m+1):d=n.slice(s,r)}else d=n.slice(s,r);const f=e.env.references[Wb(d)];if(!f)return e.pos=i,!1;a=f.href,u=f.title}if(!t){e.pos=s,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=u?[["href",a],["title",u]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=o,!0}var Hz=xde;function Wz(e){const t=e|32;return t>=97&&t<=122}function Sde(e){return e>=48&&e<=57}function _de(e){return Wz(e)||Sde(e)||e===43||e===45||e===46}function Mde(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&_de(e.charCodeAt(t));)t--;return t++,t>=e.length||!Wz(e.charCodeAt(t))?null:e.slice(t)}function Ide(e,t,n){let i=t;for(;i0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=Mde(e.pending);if(!o)return!1;const s=Ide(e.src,n-o.length,i),r=e.md.linkify.matchAtStart(s);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-o.length,!0}function Tde(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,o=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let s=i-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=o||PT(n.charCodeAt(i)))return!1;let s=i+1;for(;si-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function Fde(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function Kz(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,i={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:g7(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function g1(e,t,n,i,o,s){const r=Kz(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=Fde(t,n));a.calls++,a.inclusiveMs+=i,i>a.maxMs&&(a.maxMs=i),a.samples.push(i),s?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=g7()}function Bde(e){const t=Kz(e);if(!t)return null;const n=Object.keys(t.records);for(let i=0;io.name===e);i>=0&&this.rules.splice(i,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(i<0)return;const o=this.rules[i];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(i<0)throw new Error(`Parser rule not found: ${e}`);this.rules[i].fn=t,n?.alt!==void 0&&(this.rules[i].alt=n.alt),this.invalidateCache()}before(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const o of i.alt)e.add(o);const t=new Map,n=new Map;for(const i of e){const o=[],s=[];for(const r of this.rules)r.enabled&&(i!==""&&!r.alt?.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t.set(i,o),n.set(i,s)}this.cache=t,this.namedCache=n}},Zz=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.tokens_meta=new Array(i.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Ds("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Ds(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const i=new Ds(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i}scanDelims(e,t){const{src:n,posMax:i}=this,o=n.charCodeAt(e);let s=e;for(;s0?n.charCodeAt(e-1):32,a=s@[\]\\^_`{}~]/;function jT(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return Uz(e,t);case 33:return jz(e,t);case 38:return Dz(e,t);case 42:case 95:return yC.tokenize(e,t);case 58:return e.md.options.linkify&&qz(e,t);case 60:return Mz(e,t)||zz(e,t);case 91:return Hz(e,t);case 92:return Rz(e,t);case 96:return Iz(e,t);case 126:return bC.tokenize(e,t);default:return Vz(e,t)}}function Gz(e){return!Rde.test(e)}var Ode=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new zT,this.ruler2=new zT,this.ruler.push("text",Vz),this.ruler.push("linkify",qz),this.ruler.push("newline",Uz),this.ruler.push("escape",Rz),this.ruler.push("backticks",Iz),this.ruler.push("strikethrough",bC.tokenize),this.ruler.push("emphasis",yC.tokenize),this.ruler.push("link",Hz),this.ruler.push("image",jz),this.ruler.push("autolink",Mz),this.ruler.push("html_inline",zz),this.ruler.push("entity",Dz),this.ruler2.push("balance_pairs",rde),this.ruler2.push("strikethrough",bC.postProcess),this.ruler2.push("emphasis",yC.postProcess),this.ruler2.push("fragments_join",gde),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),i=n.length,o=e.cache,s=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(s!==void 0){e.pos=s;return}let l=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,l=jT(e,!0),e.level--,l&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,i=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const s=this.isDefaultRuleset();for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos")}if(l){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,i){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&Gz(e)){const a=new Ds("text","",0);a.content=e,i.push(a);return}const o=new Zz(e,t,n,i);this.tokenize(o);const s=this.getRules2(),r=s.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a0&&Gz(s.content)){const r=new Ds("text","",0);r.content=s.content,s.children.push(r);continue}e.md.inline.parse(s.content,e.md,e.env,s.children)}}}const Pde=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,zde=/[0-9a-z]/i;function jde(e){return/^\s]/i.test(e)}function Hde(e){return/^<\/a\s*>/i.test(e)}function Wde(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(jde(l.content)&&s>0&&s--,Hde(l.content)&&s++),s>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let u=(e.md.linkify.match(a)||[]).map(h=>Wde(e.md.linkify,h));if(u.length===0)continue;const c=[];let d=l.level,f=0;u.length>0&&u[0].index===0&&r>0&&o[r-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hf){const T=new Ds("text","",0);T.content=a.slice(f,y),T.level=d,c.push(T)}const b=new Ds("link_open","a",1);b.attrs=[["href",g]],b.level=d++,b.markup="linkify",b.info="auto",c.push(b);const C=new Ds("text","",0);C.content=v,C.level=d,c.push(C);const A=new Ds("link_close","a",-1);A.level=--d,A.markup="linkify",A.info="auto",c.push(A),f=m.lastIndex}if(f!==0){if(f=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(Gde,Yde)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function Xde(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&Qz.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function efe(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");Zde.test(i)&&Jde(n.children||[]),Qz.test(i)&&Xde(n.children||[])}}var tfe=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(i=>i.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(i=>i.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const nfe=/['"]/,HT=/['"]/g,WT="’";function j2(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function ife(e,t){let n;const i=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let s=0;s=0&&!(i[n].level<=l);n--);if(i.length=n+1,r.type!=="text")continue;let a=r.content,u=0,c=a.length;e:for(;u=0)g=a.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let v=32;if(u=48&&g<=57&&(h=f=!1),f&&h&&(f=y,h=b),!f&&!h){m&&(r.content=j2(r.content,d.index,WT));continue}if(h)for(n=i.length-1;n>=0;n--){let T=i[n];if(i[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!nfe.test(i)||!n.children||ife(n.children,e)}}function sfe(e){const t=e.tokens||[],n=t.length;for(let i=0;i=4||o.charCodeAt(c)!==62)return!1;if(i)return!0;const h=[],m=[],g=[],v=[],y=e.md.block.ruler.getRulesForState(e,"blockquote"),b=e.parentType;e.parentType="blockquote";let C=!1,A;for(A=t;A=d)break;if(o.charCodeAt(c++)===62&&!M){let E=a[A]+1,I,F;o.charCodeAt(c)===32?(c++,E++,F=!1,I=!0):o.charCodeAt(c)===9?(I=!0,(u[A]+E)%4===3?(c++,E++,F=!1):F=!0):I=!1;let W=E;for(h.push(s[A]),s[A]=c;c=d,m.push(u[A]),u[A]=a[A]+1+(I?1:0),g.push(a[A]),a[A]=W-E,v.push(l[A]),l[A]=c-s[A];continue}if(C)break;let x=!1;for(let E=0,I=y.length;E";const _=[t,0];N.map=_,e.md.block.tokenize(e,t,A);const w=e.push("blockquote_close","blockquote",-1);w.markup=">",e.lineMax=f,e.parentType=b,_[1]=e.line;for(let M=0;M=4){i++,o=i;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=`${e.getLines(t,o,4+e.blkIndent,!1)} +`,s.map=[t,e.line],!0}function dfe(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const u=e.src.slice(l,o),c=e.src.slice(o,s);if(r===96&&c.includes(String.fromCharCode(r)))return!1;if(i)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],o=4)&&(o=e.skipChars(o,r),!(o-l=4)return!1;let c=o.charCodeAt(a);if(c!==35||a>=u)return!1;let d=1;for(c=o.charCodeAt(++a);c===35&&a6||aa&&VT(o.charCodeAt(f-1))&&(u=f),e.line=t+1;const h=e.push("heading_open",qT[d],1);h.markup=UT[d],h.map=[t,e.line];const m=e.push("inline","",0);m.content=o.slice(a,u).trim(),m.map=[t,e.line],m.children=[];const g=e.push("heading_close",qT[d],-1);return g.markup=UT[d],!0}function hfe(e){switch(e){case 9:case 32:return!0}return!1}function pfe(e,t,n,i){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;s|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${yde.source}\\s*$`),/^$/,!1]];function mfe(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,s),l=0;for(;l=48&&e<=57}var tj=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i;const o=this.src;let s=0,r=0,l=0,a=!1,u=0;for(let c=0,d=o.length;c0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,i=this.eMarks;for(let o=this.lineMax;et;){const i=n.charCodeAt(--e);if(i!==9&&i!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let i=n.length;en;)if(t!==i.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";if(e+1===t){const c=e,d=this.bMarks[c];let f=d;const h=i?this.eMarks[c]+1:this.eMarks[c];let m=0;const g=this.src,v=this.bsCount,y=this.tShift;for(;fn?new Array(m-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const o=new Array(t-e),s=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,u=this.tShift;for(let c=0,d=e;dn?o[c]=new Array(f-n+1).join(" ")+s.slice(m,g):o[c]=s.slice(m,g)}return o.join("")}};tj.prototype.Token=Ds;function vfe(e,t,n){for(let i=t;i=o)return!1;const s=n.charCodeAt(i);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:vfe(n,i,o)}const ZT=["","h1","h2"];function yfe(e,t,n){const i=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,s=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,u=e.blkIndent,c=nj(e);if(a[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,m=t+1;for(;m=T)break;if(a[m]-u>3)continue;if(a[m]>=u&&(h=o.charCodeAt(A),h===45||h===61)){let _=A+1,w=_;for(;_=T){f=h===61?1:2;break}if(w-A>1)continue}if(a[m]<0||c&&!ij(e,m,o,A,T))continue;let N=!1;for(let _=0,w=i.length;_A;){const N=o.charCodeAt(T-1);if(N!==9&&N!==32)break;T--}g=o.slice(A,T)}else g=e.getLines(t,m,u,!1).trim();e.line=m+1;const v=h===61?"=":"-",y=e.push("heading_open",ZT[f],1);y.markup=v,y.map=[t,e.line];const b=e.push("inline","",0);b.content=g,b.map=[t,e.line-1],b.children=[];const C=e.push("heading_close",ZT[f],-1);return C.markup=v,e.parentType=d,!0}function oj(e){switch(e){case 9:case 32:return!0}return!1}function GT(e,t){const n=e.eMarks,i=e.bMarks,o=e.tShift,s=e.src,r=n[t];let l=i[t]+o[t];const a=s.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l=l)return-1;let u=s.charCodeAt(a++);if(u<48||u>57)return-1;for(;;){if(a>=l)return-1;if(u=s.charCodeAt(a++),u>=48&&u<=57){if(a-r>=10)return-1;continue}if(u===41||u===46)break;return-1}return a0&&++o=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(u=!0);let c,d,f;const h=e.src,m=e.bMarks,g=e.tShift,v=e.eMarks,y=e.sCount,b=e.bsCount,C=m[l]+g[l];if(C>=v[l])return!1;const A=h.charCodeAt(C);if(A>=48&&A<=57){if(f=QT(e,l),f<0||(c=!0,r=C,d=kfe(e,l,f),u&&d!==1))return!1}else if(A===42||A===45||A===43){if(f=GT(e,l),f<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(f)>=v[l])return!1;if(i)return!0;const T=h.charCodeAt(f-1),N=String.fromCharCode(T);if(c){const I=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(I.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const _=[l,0];e.tokens[e.tokens.length-1].map=_,e.tokens[e.tokens.length-1].markup=N;let w=!1;const M=e.tokens.length-1,x=e.md.block.ruler.getRulesForState(e,"list"),E=e.parentType;for(e.parentType="list";l=o?P=1:P=F-I,P>4&&(P=1);const O=I+P,R=e.push("list_item_open","li",1);R.markup=N;const z=[l,0];R.map=z,c&&(R.info=f-r-1===1?bfe[h.charCodeAt(r)-48]:h.slice(r,f-1));const H=e.tight,j=e.tShift[l],K=e.sCount[l],re=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=O,e.tight=!0,e.tShift[l]=W-m[l],e.sCount[l]=F,W>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||w)&&(a=!1),w=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=re,e.tShift[l]=j,e.sCount[l]=K,e.tight=H,e.push("list_item_close","li",-1).markup=N,l=e.line,z[1]=l,l>=n||e.sCount[l]=4)break;let q=!1;for(let Q=0,ne=x.length;Q3||u[f]<0)continue;if(o==="list"&&u[f]>=c){const C=r[f]+l[f],A=a[f];if(C=A||YT(s.charCodeAt(C+1)))break}else if(T>=48&&T<=57&&C+1=A){N=-1;break}const _=s.charCodeAt(N++);if(_>=48&&_<=57){if(N-C>=10){N=-1;break}continue}if((_===41||_===46)&&(N>=A||YT(s.charCodeAt(N))))break;N=-1;break}if(N>=0)break}}}const v=r[f]+l[f],y=a[f];if(d&&!ij(e,f,s,v,y))continue;let b=!1;for(let C=0,A=i.length;C=4||e.src.charCodeAt(o)!==91)return!1;function a(C){const A=e.lineMax;if(C>=A||e.isEmpty(C))return null;let T=!1;if(e.sCount[C]-e.blkIndent>3&&(T=!0),e.sCount[C]<0&&(T=!0),!T){const w=e.parentType;e.parentType="reference";let M=!1;for(let x=0,E=l.length;x"u"&&(e.env.references={}),typeof e.env.references[b]>"u"&&(e.env.references[b]={title:y,href:f}),e.line=r),!0):!1}function t8(e){switch(e){case 9:case 32:return!0}return!1}const Sfe=65536;function n8(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function _fe(e,t){if(e.lineFlags)return(e.lineFlags[t]&Qg.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];nn)return!1;let o=t+1;if(e.sCount[o]=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const r=e.src.charCodeAt(s++);if(r!==124&&r!==45&&r!==58||s>=e.eMarks[o])return!1;const l=e.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!t8(l)||r===45&&t8(l)||!_fe(e,t))return!1;for(;s=4)return!1;u=JT(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g;const v=e.push("thead_open","thead",1);v.map=[t,t+1];const y=e.push("tr_open","tr",1);y.map=[t,t+1];for(let A=0;A=4||(u=JT(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),C+=d-u.length,C>Sfe))break;if(o===t+2){const N=e.push("tbody_open","tbody",1);N.map=b=[t+2,0]}const T=e.push("tr_open","tr",1);T.map=[o,o+1];for(let N=0;Nr.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}after(e,t,n,i){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:i,fn:o})=>(s,r,l,a)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=o(s,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return g1(s?.env,"block",i,d-u,c,!!a),c}):this.getRules(t)}at(e,t,n){const i=this._rules.findIndex(o=>o.name===e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[i].fn=t,n?.alt&&(this._rules[i].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this._rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const i of this._rules)if(i.enabled)for(const o of i.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const i of e){const o=[],s=[];for(const r of this._rules)r.enabled&&(i!==""&&!r.alt.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t[i]=o,n[i]=s}this.cache=t,this.namedCache=n}};const W2=[["table",Mfe,["paragraph","reference"]],["code",cfe],["fence",dfe,["paragraph","reference","blockquote","list"]],["blockquote",ufe,["paragraph","reference","blockquote","list"]],["hr",pfe,["paragraph","reference","blockquote","list"]],["list",Cfe,["paragraph","reference","blockquote"]],["reference",xfe],["html_block",mfe,["paragraph","reference","blockquote"]],["heading",ffe,["paragraph","reference","blockquote"]],["lheading",yfe],["paragraph",Afe]];var Tfe=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Ife;for(let e=0;e=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}return}const f=this.ruler.getNamedRules("");for(;c=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}}parse(e,t,n,i){if(!e||e.length===0)return;const o=new tj(e,t,n,i);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},sj=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};sj.prototype.Token=Ds;const XT=[["normalize",Kde],["block",ede],["inline",$de],["linkify",qde],["replacements",efe],["smartquotes",ofe],["text_join",sfe]],Efe={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Lfe={parseLinkLabel:f7,parseLinkDestination:d7,parseLinkTitle:h7};function Nfe(){return{...Efe}}function Dfe(){return{...Lfe}}var Ffe=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Tfe,this.inline=new Ode,this.ruler=new tfe;for(let e=0;e@[\]\\^_`{}~]/;function sk(e){return!Bfe.test(e)}function wg(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function Uy(e,t,n){for(let i=t;i3)return sk(e);for(let t=0;t=i||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;ll&&t.charCodeAt(a-1)===32;)a--;let u=a;for(;u>l&&t.charCodeAt(u-1)===35;)u--;if(u>l&&t.charCodeAt(u-1)===32)for(a=u-1;a>l&&t.charCodeAt(a-1)===32;)a--;const c=t.slice(l,a);if(!sk(c))return!1;const d=Ofe[s],f=$fe[s],h=ga("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(v7(c,o,1));const m=ga("heading_close",d,-1,0);return m.markup=f,e.push(m),!0}function zfe(e,t,n){const i=ga("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(v7(t,n,1)),e.push(ga("paragraph_close","p",-1,0))}function jfe(e,t,n){const i=e.charCodeAt(n-1);return i===32||i===9?e.slice(t,n).trim():e.slice(t,n)}function r8(e,t){for(;t=1e5?tE:s8,o="",s=!1,r=!1,l=0,a=0;for(;l"]/,nE=/[&<>"]/g,Zfe=/&/g,Gfe=/[<>"]/g,Qfe={"&":"&","<":"<",">":">",'"':"""};function l8(e){return Qfe[e]||e}function qi(e){if(e.length===0)return"";if(e.length<32)return Kfe.test(e)?e.replace(nE,l8):e;const t=e.includes("&"),n=e.includes("<"),i=e.includes(">"),o=e.includes('"');return!t&&!n&&!i&&!o?e:t&&!n&&!i&&!o?e.replace(Zfe,"&"):t?e.replace(nE,l8):e.replace(Gfe,l8)}const Yfe=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Jfe=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function rj(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Yfe,(t,n,i)=>{if(n)return n;if(Jfe.test(i)){const s=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return qb(s)?H0(s):"�"}const o=n7(t);return o!==t?o:t})}const Xfe=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,ehe=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,the=/"/g;function Gp(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function rk(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!rk(e,t,Gp(e,t))}function iE(e,t,n){return t+2=n||e.charCodeAt(o)!==32)return null;let s=o+1;for(;ss&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>s&&e.charCodeAt(l-1)===35;)l--;if(l>s&&e.charCodeAt(l-1)===32)for(r=l-1;r>s&&e.charCodeAt(r-1)===32;)r--;const a=y7(e.slice(s,r));return a===null?null:`${a} +`}function oE(e,t,n){return t+1" +`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`
  • ${e[t]}
  • +`}function rhe(e,t,n){const i=t+2;if(n===i+1)return she(e,i);const o=y7(e.slice(t+2,n));return o===null?null:`
  • ${o}
  • +`}function lhe(e,t,n){for(;tt;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let i=n;for(let o=t;o`:"
    ",i.lang=s,i.open=d),{html:`${d}${qi(c)}
    +`,nextPos:u=25e4,s=[],r={lang:null,open:""};let l="",a="",u="",c="";for(;n +`;A +`,l=y,a=b}let C=q2(e,v);for(;C${v}

    +`,u=h,c=m}const g=de.core.parse(t,n,e).tokens);let r=Vy(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=hhe(r,o.maxChunks)),Ky(t,r))return J3(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),m1(n,s,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return J3(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:s||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!s}),m1(n,s,()=>{for(let u=0;u=3&&(c?c.marker===C&&T>=c.length&&(c=null):c={marker:C,length:T})}}const v=m-f;o+=v,s+=1,l+=1,g?(a=0,u=0):(a+=1,u+=v);const y=g;if((o>=t.maxChunkChars||s>=t.maxChunkLines)&&!c)if(y)d(m);else{const b=Math.max(10,Math.floor(t.maxChunkLines*.5)),C=Math.max(t.maxChunkChars,8e3);(a>=b||u>=C)&&d(m)}f=m}return n&&d(e.length),i}function Ky(e,t,n={rangesCoverWholeSource:!0}){const i=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;oe.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let i=n+1;i=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function fhe(e,t){for(let n=0;n=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Uc(e){return e.length===0?0:zo(e)+(e.charCodeAt(e.length-1)===10?0:1)}function bhe(e,t,n){for(let i=t;i=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}i=o===e.length?e.length:o+1}return n!==null}function Che(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return bhe(e,n+1,e.length-1)?!whe(e,t):!1}function Ahe(e,t,n,i={}){const o=i.mode??"full",s=i.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(i.maxChunkChars!==void 0||i.maxChunkLines!==void 0||i.autoTune===!1){const r=i.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??vhe:e.options.fullChunkSizeChars??mhe),l=i.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??yhe:e.options.fullChunkSizeLines??ghe);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:s}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:s}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:s}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}}var Nv=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=Uc(this.pending);if(this.pending.length=i||n>=o}function fj(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??aj))return"yes";const i=e.options.autoUnboundedThresholdLines??uj;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const s=[],r=new Nv(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(l){cj(s,l)}});if(o&&u7(n,o),r.feed(t),r.flushForce(n),o&&(c7(n),i.fallbackOnGlobalState===!1)){const l=oc(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return s}const v1=(e,t,n)=>en?n:e;function hj(e){return e.experimental?{...e,...e.experimental}:e}const lE=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],aE=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function pj(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function Ihe(e,t=Math.max(0,e/40|0),n={}){const i=hj(n),o=i.fullChunkFenceAware??!0,s=i.fullChunkTargetChunks??8,r=i.fullChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:v1(Math.ceil(e/s),8e3,64e3),maxChunkLines:v1(Math.ceil(t/s),150,700),maxChunks:v1(Math.ceil(e/64e3),s,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.fullChunkSizeChars??1e4,maxChunkLines:i.fullChunkSizeLines??200,fenceAware:o,maxChunks:i.fullChunkMaxChunks}}function uE(e,t=Math.max(0,e/40|0),n={}){const i=hj(n),o=i.streamChunkFenceAware??!0,s=i.streamChunkTargetChunks??8,r=i.streamChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:v1(Math.ceil(e/s),8e3,64e3),maxChunkLines:v1(Math.ceil(t/s),150,700),maxChunks:v1(Math.ceil(e/64e3),s,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.streamChunkSizeChars??1e4,maxChunkLines:i.streamChunkSizeLines??200,maxChunks:i.streamChunkMaxChunks,fenceAware:o}}var The={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},Ehe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Lhe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function Vb(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Zy(e,t){if(Vb(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const cE=e=>Vb(e)?e:Promise.resolve(e);function Jg(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return qi(e)}}function zd(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Jg(t[0])}="${qi(t[1])}"`;for(let i=1;i=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${t} +`;const s=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${i}`;return s<0?r.push(["class",l]):(r[s]=r[s].slice(),r[s][1]+=` ${l}`),`
    ${t}
    +`}return`
    ${t}
    +`}function q0(e){return!e.attrs||e.attrs.length===0?`${qi(e.content)}`:`${qi(e.content)}`}function wC(e){const t=qi(e.content);return e.attrs?`${t} +`:`
    ${t}
    +`}function Nhe(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

    `;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function dE(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function Dhe(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function fE(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function ak(e,t){if(e.hidden)return"";const n=e.attrs,i=e.nesting,o=e.tag;if(!n||n.length===0)return i===0?t?`<${o} />`:`<${o}>`:i===-1?``:`<${o}>`;let s=(i===-1?"`}const Fhe={langPrefix:"language-",xhtmlOut:!1,breaks:!1},U2=Object.prototype.hasOwnProperty,_i={code_inline(e,t){return q0(e[t])},code_block(e,t){return wC(e[t])},fence(e,t,n,i,o){const s=e[t],r=s.info?rj(s.info).trim():"",{langName:l,langAttrs:a}=mj(r),u=n.highlight,c=qi(s.content);if(!u)return Xg(s,c,r,l,n);const d=u(s.content,l,a);return Vb(d)?d.then(f=>Xg(s,f||c,r,l,n)):Xg(s,d||c,r,l,n)},image(e,t,n,i,o){const s=e[t],r=o.renderInlineAsText(s.children||[],n,i),l=s.attrIndex("alt");return l>=0&&s.attrs?s.attrs[l][1]=r:s.attrs?s.attrs.push(["alt",r]):s.attrs=[["alt",r]],ak(s,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
    +`:`
    +`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
    +`:`
    +`:` +`},text(e,t){return qi(e[t].content)},text_special(e,t){return qi(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function hE(e,t,n){const i=e.info?rj(e.info).trim():"",{langName:o,langAttrs:s}=mj(i),r=t.highlight,l=qi(e.content);if(!r)return Xg(e,l,i,o,t);const a=r(e.content,o,s);if(Vb(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Xg(e,a||l,i,o,t)}function a8(e,t,n,i){switch(e.type){case"text":return t.text===_i.text?e.content.length===0?"":qi(e.content):null;case"text_special":return t.text_special===_i.text_special?e.content.length===0?"":qi(e.content):null;case"softbreak":return t.softbreak===_i.softbreak?i:null;case"hardbreak":return t.hardbreak===_i.hardbreak?n:null;case"html_inline":return t.html_inline===_i.html_inline?e.content:null;case"code_inline":return t.code_inline===_i.code_inline?q0(e):null;default:return null}}function Bhe(e,t,n,i,o){const s=e[0];switch(s.type){case"text":if(o.text===_i.text)return s.content.length===0?"":qi(s.content);break;case"text_special":if(o.text_special===_i.text_special)return s.content.length===0?"":qi(s.content);break;case"softbreak":if(o.softbreak===_i.softbreak)return t.breaks?t.xhtmlOut?`
    +`:`
    +`:` +`;break;case"hardbreak":if(o.hardbreak===_i.hardbreak)return t.xhtmlOut?`
    +`:`
    +`;break;case"html_inline":if(o.html_inline===_i.html_inline)return s.content;break;case"code_inline":if(o.code_inline===_i.code_inline)return q0(s);break}const r=o[s.type];if(!r)return ak(s,t.xhtmlOut===!0);const l=r(e,0,t,n,i);return typeof l=="string"?l:Zy(l,s.type)}var Rhe=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={..._i}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const i=this.mergeOptions(t),o=n??{},s=this.rules,r=i.xhtmlOut===!0;let l,a,u,c,d,f,h="",m="",g=!1,v="";for(let y=0;y0&&e[y-1].hidden?` +`:"";if(C==="list_item_open"&&(!b.attrs||b.attrs.length===0)&&y+3${this.renderInlineTokens(w.children||[],i,o)}`,y+=3;continue}}if(y+2 +`,y+=2;continue}}}if(C==="inline"){const _=b.children||[];if(_.length===1){g||(l=s.text,a=s.text_special,u=s.softbreak,c=s.hardbreak,d=s.html_inline,f=s.code_inline,h=i.xhtmlOut?`
    +`:`
    +`,m=i.breaks?h:` +`,g=!0);const w=_[0];switch(w.type){case"text":if(l===_i.text){v+=qi(w.content);continue}break;case"text_special":if(a===_i.text_special){v+=qi(w.content);continue}break;case"softbreak":if(u===_i.softbreak){v+=m;continue}break;case"hardbreak":if(c===_i.hardbreak){v+=h;continue}break;case"html_inline":if(d===_i.html_inline){v+=w.content;continue}break;case"code_inline":if(f===_i.code_inline){v+=q0(w);continue}break}}v+=this.renderInlineTokens(_,i,o);continue}const T=s[C];if(!T){const _=b.attrs;if(!b.hidden){if(!_||_.length===0)switch(C){case"hr":v+=r?`


    +`:`
    +`;continue;case"heading_open":v+=`<${b.tag}>`;continue;case"heading_close":v+=` +`;continue;case"paragraph_open":v+=`${A}

    `;continue;case"paragraph_close":v+=`

    +`;continue;case"list_item_open":{const w=e[y+1];v+=A+(w&&(w.type==="inline"||w.hidden||w.nesting===-1&&w.tag==="li")?"
  • ":`
  • +`);continue}case"list_item_close":v+=`
  • +`;continue;case"bullet_list_open":v+=`${A}
      +`;continue;case"bullet_list_close":v+=`
    +`;continue;case"blockquote_open":v+=A+(e[y+1]&&e[y+1].nesting===-1&&e[y+1].tag==="blockquote"?"
    ":`
    +`);continue;case"blockquote_close":v+=`
    +`;continue;case"ordered_list_open":v+=`${A}
      +`;continue;case"ordered_list_close":v+=`
    +`;continue;case"table_open":v+=`${A} +`;continue;case"table_close":v+=`
    +`;continue;case"thead_open":v+=`${A} +`;continue;case"thead_close":v+=` +`;continue;case"tbody_open":v+=`${A} +`;continue;case"tbody_close":v+=` +`;continue;case"tr_open":v+=`${A} +`;continue;case"tr_close":v+=` +`;continue;case"td_open":v+=`${A}`;continue;case"td_close":v+=` +`;continue;case"th_open":v+=`${A}`;continue;case"th_close":v+=` +`;continue}else if(_.length===1){const w=_[0];if(C==="ordered_list_open"&&w[0]==="start"){v+=`${A}
      +`;continue}if(C==="td_open"&&w[0]==="style"){v+=`${A}`;continue}if(C==="th_open"&&w[0]==="style"){v+=`${A}`;continue}}}v+=this.renderToken(e,y,i);continue}if(C==="code_block"&&T===_i.code_block){v+=wC(b);continue}if(C==="fence"&&T===_i.fence){v+=hE(b,i);continue}if(C==="html_block"&&T===_i.html_block){v+=b.content;continue}const N=T(e,y,i,o,this);typeof N=="string"?v+=N:v+=Zy(N,b.type)}return v}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const i=this.mergeOptions(t),o=n??{},s=this.rules;let r="";for(let l=0;l0&&e[t-1].hidden?` +`:"",c=a?`> +`:">";if(!l||l.length===0)return s===0?n.xhtmlOut?`${u}<${r} /${c}`:`${u}<${r}${c}`:s===-1?`${u}(n||(n={...t}),n);if(U2.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),U2.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(i().langPrefix=o)}if(U2.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(i().xhtmlOut=o)}if(U2.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(i().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...Fhe,...this.baseOptions})}renderSingleToken(e,t,n,i){const o=this.rules,s=t.type;if(s==="code_block"&&o.code_block===_i.code_block)return wC(t);if(s==="html_block"&&o.html_block===_i.html_block)return t.content;const r=this.mergeOptions(n),l=i??{};if(s==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[s];if(!a)return t.block?this.renderToken(e,0,r):ak(t,r.xhtmlOut===!0);if(s==="fence"&&a===_i.fence)return hE(t,r);const u=a(e,0,r,l,this);return typeof u=="string"?u:Zy(u,s)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return Bhe(e,t,n,this,i);const o=t.xhtmlOut===!0,s=o?`
      +`:`
      +`,r=t.breaks?s:` +`,l=i.text,a=i.text_special,u=i.softbreak,c=i.hardbreak,d=i.html_inline,f=i.code_inline,h=i.link_open,m=i.link_close,g=i.em_open,v=i.em_close,y=i.strong_open,b=i.strong_close;let C="";for(let A=0;A`;if(u===_i.softbreak&&A+3`,A+=1;continue}if(T.type==="em_open"&&!g&&!v&&A+2${M}`,A+=2;continue}}}if(T.type==="strong_open"&&!y&&!b&&A+2${M}`,A+=2;continue}}}switch(T.type){case"text":if(l===_i.text){const w=T.content.length===0?"":qi(T.content);if(d===_i.html_inline&&A+1=4)return!0;continue}if(l===9){if(r+=4-r%4,s++,r>=4)return!0;continue}break}if(s0&&u<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=s+1;for(;a57)break;a++}if(a=Ae,!Y&&me!==void 0&&(de=zo(e),Y=de>=me)),Y){const Z=this.parseFullDocument(e,F,n,de,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",fs(F,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!oc(F)?.unbounded}),Z.tokens}else if(z){const Z=(fe,ve,Ce)=>feCe?Ce:fe;de===void 0&&(de=zo(e));const se=ne&&!Q?uE(e.length,de,n.options):null,ke=se?.maxChunkChars??(H?Z(Math.ceil(e.length/j),8e3,64e3):K??1e4),be=se?.maxChunkLines??(H?Z(Math.ceil(de/j),150,700):re??200),we=se?.maxChunks??(H?Z(Math.ceil(e.length/64e3),j,32):q),oe=e.length>0&&e.charCodeAt(e.length-1)===10,J=R&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&se?.strategy!=="plain";if((O||J)&&(e.length>=ke*2||de>=be*2)&&oe){const fe=lk(n,e,F,{maxChunkChars:ke,maxChunkLines:be,fenceAware:se?.fenceAware??te,maxChunks:we});return this.cache={src:e,tokens:fe,env:F,lineCount:de,lastSegment:void 0,globalStateReason:ll(e)},this.updateCacheLineCount(this.cache,de),this.recordChunkedParseResult(F,O?"explicit-initial-large-doc":"default-initial-large-doc"),fe}}const ue=this.parseFullDocument(e,F,n,de);return de=ue.lineCount,this.cache={src:e,tokens:ue.tokens,env:F,lineCount:de,lastSegment:void 0,globalStateReason:ll(e)},this.updateCacheLineCount(this.cache,de),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",fs(F,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!oc(F)?.unbounded}),ue.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",fs(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const s=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=ll(o.src),o.globalStateReason=r);const l=r?null:s!==null?this.detectGlobalStateForAppend(o,s):ll(e),a=r||l;if(a){const F=i??o.env;Ic(F);const W=ll(e),P=this.parseFullDocument(e,F,n),O=P.tokens,R=P.lineCount;return this.cache={src:e,tokens:O,env:F,lineCount:R,lastSegment:void 0,globalStateReason:W},this.updateCacheLineCount(this.cache,R),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",fs(F,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!oc(F)?.unbounded}),O}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length5e3?W=8:c.length>1e3?W=6:c.length>200&&(W=4),W=Math.min(W,F);let P=null;const O=n.options?.streamContextParseStrategy??"chars",R=n.options?.streamContextParseMinChars??200,z=n.options?.streamContextParseMinLines??2;let H;const j=()=>(H===void 0&&(H=zo(c)),H),K=this.canDirectlyParseAppend(o),re=K&&this.shouldUseUnboundedAppend(e,o,c);let q=!1;if(!K)switch(O){case"lines":q=j()>=z;break;case"constructs":if(c.length>=R){q=!0;break}if(Phe(c)){q=!0;break}q=j()>=z;break;case"chars":default:q=c.length>=R}if(W>0&&q){const te=this.getTailLines(o.src,W)+c;try{const ge=this.core.parse(te,o.env,n).tokens,Ae=ge.findIndex(me=>me.map&&typeof me.map[1]=="number"&&me.map[1]>W);if(Ae!==-1){const me=ge.slice(Ae),de=F-W;de!==0&&this.shiftTokenLines(me,de),P={tokens:me}}}catch{P=null}}else P=null;if(!P){const te=F;if(re)P={tokens:Yg(n,c,o.env,{mode:"stream"})},te>0&&this.shiftTokenLines(P.tokens,te);else{const ge=this.core.parse(c,o.env,n);te>0&&this.shiftTokenLines(ge.tokens,te),P=ge}}let Q=0;if(o.tokens.length>0&&P.tokens.length>0){const te=o.tokens[o.tokens.length-1],ge=P.tokens[0];try{te.type==="inline"&&ge.type==="inline"&&(ge.children&&ge.children.length>0&&(te.children||(te.children=[]),this.appendTokens(te.children,ge.children)),te.content=(te.content||"")+(ge.content||""),Q=1)}catch{Q=0}}const ne=o.tokens.length;if(P.tokens.length>Q){const te=o.tokens,ge=P.tokens,Ae=Math.min(te.length,ge.length-Q);let me=0;for(let de=Ae;de>0;de--){let Y=!0;for(let ue=0;ue0&&(Q+=me),ge.length>Q&&this.appendTokens(o.tokens,ge,Q)}if(o.src=e,o.globalStateReason=null,o.lineCount=F+(H??j()),o.tokens.length>ne){const te=this.getLastSegment(o.tokens,e,ne,o.tokens.length,e.length-c.length,F);te?o.lastSegment=te:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,re&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",fs(o.env,{area:"stream",path:re?"stream-unbounded-append":"stream-append",reason:re?"large-delta":"safe-append",unbounded:re}),o.tokens}const d=i??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",fs(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,v=!h&&!c&&m,y=g||v,b=n.options?.streamChunkAdaptive!==!1,C=n.options?.streamChunkTargetChunks??8,A=n.options?.streamChunkSizeChars,T=n.options?.streamChunkSizeLines,N=n.options?.streamChunkMaxChunks,_=!!n.__explicitStreamChunkConfig,w=n.options?.autoTuneChunks!==!1,M=n.options?.streamChunkFenceAware??!0;let x=c&&o.lineCount!==void 0?o.lineCount+zo(c):void 0;if(y){x===void 0&&(x=zo(e));const F=(j,K,re)=>jre?re:j,W=w&&!_?uE(e.length,x,n.options):null,P=W?.maxChunkChars??(b?F(Math.ceil(e.length/C),8e3,64e3):A??1e4),O=W?.maxChunkLines??(b?F(Math.ceil(x/C),150,700):T??200),R=W?.maxChunks??(b?F(Math.ceil(e.length/64e3),C,32):N),z=e.length>0&&e.charCodeAt(e.length-1)===10,H=v&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&W?.strategy!=="plain";if((g||H)&&(e.length>=P*2||x>=O*2)&&z){const j=lk(n,e,d,{maxChunkChars:P,maxChunkLines:O,fenceAware:W?.fenceAware??M,maxChunks:R});return this.cache={src:e,tokens:j,env:d,lineCount:x,lastSegment:void 0,globalStateReason:ll(e)},this.updateCacheLineCount(this.cache,x),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),j}}const E=this.parseFullDocument(e,d,n,x),I=E.tokens;return x=E.lineCount,this.cache={src:e,tokens:I,env:d,lineCount:x,lastSegment:void 0,globalStateReason:ll(e)},this.updateCacheLineCount(this.cache,x),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",fs(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!oc(d)?.unbounded}),I}recordChunkedParseResult(e,t){const n=oc(e)?.chunk,i=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,i){this.stats.fullParses+=1,this.stats.lastMode="full",fs(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!oc(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",fs(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,o=!0){const s=ll(e);Ev(t)&&Ic(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?fj(n,e.length,i):"no";if(r==="yes"){const a=Yg(n,e,t);return fs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:i??(o?zo(e):0)}}let l=i;if(r==="need-lines"&&(l=zo(e),dj(n,e.length,l))){const a=Yg(n,e,t);return fs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?zo(e):0),{tokens:m1(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:zo(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` +`))return null;const i=n??t.slice(e.length);if(!i)return null;const o=i.length;if(i.charCodeAt(o-1)!==10)return null;let s=0,r=-1;for(let a=0;a=2));a++);if(s<2)return null;const l=(r===-1?i:i.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),u=a.lastIndexOf(` +`);if(a.slice(u+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,i){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const s=t.src.slice(0,o.srcOffset);if(!e.startsWith(s))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const u=this.tryContainerTailAppendMerge(e,t,n,i,o,a);if(u)return u}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const u=this.core.parse(l,n,i),c=this.getLastSegment(u.tokens,l);return o.lineStart>0&&this.shiftTokenLines(u.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,u.tokens),t.lineCount=o.lineStart+zo(l),c?t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:o.lineStart+c.lineStart,lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let i=e.length-1;i>=0;i--)if(e.charCodeAt(i)===10&&(n--,n===0))return e.slice(i+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,i=e.slice(n),o=i.length;let s=null,r=0;for(;r<=o;){let l=i.indexOf(` +`,r);l===-1&&(l=o);let a=r;for(;a=3&&(s?s.marker===u&&d>=s.length&&(s=null):s={marker:u,length:d})}}if(l===o)break;r=l+1}return s!==null}peek(){return this.cache?.tokens??$he}getStats(){return{...this.stats}}appendTokens(e,t,n=0,i=t.length){for(let o=n;ou8?n.slice(n.length-u8):n,i&&(e.globalStateReason=i),i}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,i=e.length,o,s){if(i<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let u=i-1;u>=n;u--){const c=e[u];if(c.map&&(c.map[0]l&&(l=c.map[1])),c.nesting<0){a+=-c.nesting;continue}if(c.nesting>0){if(a-=c.nesting,c.level===0&&a<=0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}continue}if(c.level===0&&a===0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}}return null}getLineStartOffset(e,t,n,i){if(n!==void 0&&i!==void 0&&t>=i)return this.getLineStartOffsetFrom(e,n,t-i);if(t<=0)return 0;let o=t,s=-1;for(;o>0;){if(s=e.indexOf(` +`,s+1),s===-1)return e.length;o--}return s+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let i=n,o=t-1;for(;i>0;){if(o=e.indexOf(` +`,o+1),o===-1)return e.length;i--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,i,o,s){if(!s||this.mayContainReferenceDefinition(s))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,i,o,s,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,i,o,s,r);default:return null}}tryListTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),m=this.getListParagraphMode(c,0,c.length,0);(h==="loose"||m==="loose"||this.endsWithBlankLine(t.src)||(c[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+zo(s);t.lineCount=g;const v=this.getDocLineCount(e,g);return r.map&&(r.map[1]=v),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:v,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(s))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(m.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(m,g);const v=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,y=t.lineCount??zo(t.src);t.tokens.splice(v,0,...m),t.src=e,t.env=n,t.globalStateReason=null;const b=y+zo(s);t.lineCount=b;const C=this.getDocLineCount(e,b);if(r.map&&(r.map[1]=C),h.tbodyOpenIndex>=0){const A=t.tokens[h.tbodyOpenIndex];A?.map&&(A.map[1]=C)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:C,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` +`);if(t<0)return null;const n=e.indexOf(` +`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,i){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===i){o=l;break}}if(o<0)return null;let s=-1,r=-1;for(let l=t+1;l=0){for(let l=o-1;l>s;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===i+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:s,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,i){if(e.length<2)return!1;const o=e[0],s=e[e.length-1];if(o.type!==t||s.type!==n||o.level!==0||s.level!==0||i!==void 0&&o.markup!==i)return!1;let r=0;for(let l=0;l0&&l0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,i){let o=!1,s=!1;const r=i+2;for(let l=t;l=0;){const i=e.charCodeAt(n);if(i===32||i===9){n--;continue}return i===10}return!0}getDocLineCount(e,t=zo(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let i=0;i=0;s--)n.push(o.children[s]);for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let r=s.children.length-1;r>=0;r--)n.push(s.children[r])}}}}};const mE={default:Ehe,zero:Lhe,commonmark:The};function Whe(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function qhe(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function gE(e){return e.experimental?{...e,...e.experimental}:e}function aa(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function vE(e,t,n){for(let i=0;i=4?n.quotes=[w[0],w[1],w[2],w[3]]:n.quotes=["“","”","‘","’"]}let r=vE(s?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=vE(s?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=yE(s?.options,o,"fullChunkedFallback"),u=yE(s?.options,o,"streamChunkedFallback"),c=!1,d=null,f=null;const h=new Ffe;let m=null;const g=()=>(m||(m=new Ohe(n)),m);let v=null;const y=()=>(v||(v=new Hhe(h)),v);let b=null;const C=()=>(b||(b=new Cz({fuzzyLink:!0})),b),A=w=>!c&&!!d&&!qhe(w,d),T=(w,M)=>i==="default"&&!c&&m===null&&f!==null&&w.parse===f&&A(w)&&!w.stream.enabled&&M<(w.options.autoUnboundedThresholdChars??4e6)&&w.options.html===!1&&w.options.xhtmlOut===!1&&w.options.breaks===!1&&w.options.langPrefix==="language-"&&w.options.linkify===!1&&w.options.typographer===!1&&w.options.highlight===null,N=(w,M)=>i==="default"&&!c&&A(w)&&!w.stream.enabled&&!w.options.fullChunkedFallback&&M<(w.options.autoUnboundedThresholdChars??4e6)&&w.options.html===!1&&w.options.linkify===!1&&w.options.typographer===!1,_={core:h,block:h.block,inline:h.inline,get linkify(){const w=C();return Object.defineProperty(this,"linkify",{value:w,writable:!0,configurable:!0}),w},get renderer(){const w=g();return Object.defineProperty(this,"renderer",{value:w,writable:!0,configurable:!0}),w},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return A(this)},set(w){const M=gE(w);return this.options={...this.options,...M},(aa(w,"fullChunkSizeChars")||aa(w,"fullChunkSizeLines")||aa(w,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(aa(w,"streamChunkSizeChars")||aa(w,"streamChunkSizeLines")||aa(w,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),aa(w,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),aa(w,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(M),typeof M.stream=="boolean"&&(this.stream.enabled=M.stream,v&&(v.reset(),v.resetStats())),this},configure(w){const M=typeof w=="string"?mE[w]:w;if(!M)throw new Error("Wrong `markdown-it` preset, can't be empty");if(M.options&&this.set(M.options),M.components){const x=M.components;x.core?.rules&&this.core.ruler.enableOnly(x.core.rules),x.block?.rules&&this.block.ruler.enableOnly(x.block.rules),x.inline?.rules&&this.inline.ruler.enableOnly(x.inline.rules),x.inline2?.rules&&this.inline.ruler2.enableOnly(x.inline2.rules)}return this},enable(w,M){const x=Array.isArray(w)?w:[w],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const F of E){if(!F)continue;const W=F.enable(x,!0);for(let P=0;P!I.has(W));if(F.length)throw new Error(`Rules manager: invalid rule name ${F.join(", ")}`)}return this},disable(w,M){const x=Array.isArray(w)?w:[w],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const F of E){if(!F)continue;const W=F.disable(x,!0);for(let P=0;P!I.has(W));if(F.length)throw new Error(`Rules manager: invalid rule name ${F.join(", ")}`)}return this},use(w,...M){const x=typeof w=="function"?w:w&&typeof w.default=="function"?w.default:void 0;if(!x)throw new TypeError("MarkdownIt.use: plugin must be a function");const E=[this,...M],I=w;return c=!0,x.apply(I,E),this},render(w,M){let x;if(T(this,w.length)){M!==void 0&&(Pr(M),x=Y3("render"));const F=x?Cp():0,W=x?rE(w,x):sE(w);if(x&&(x.attemptMs=Cp()-F,W===null&&(x.fallbackReason="unsupported-stock-subset"),Jm(M,x)),W!==null)return M!==void 0&&fs(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),W}const E=M??{},I=this.parse(w,E);return x&&Jm(E,x),g().render(I,this.options,E)},async renderAsync(w,M){let x;if(T(this,w.length)){M!==void 0&&(Pr(M),x=Y3("render"));const F=x?Cp():0,W=x?rE(w,x):sE(w);if(x&&(x.attemptMs=Cp()-F,W===null&&(x.fallbackReason="unsupported-stock-subset"),Jm(M,x)),W!==null)return M!==void 0&&fs(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),W}const E=M??{},I=this.parse(w,E);return x&&Jm(E,x),g().renderAsync(I,this.options,E)},renderIterable(w,M={}){const x=this.parseIterable(w,M);return g().render(x,this.options,M)},async renderAsyncIterable(w,M={}){const x=await this.parseAsyncIterable(w,M);return g().renderAsync(x,this.options,M)},renderInline(w,M={}){const x=this.parseInline(w,M);return g().render(x,this.options,M)},validateLink:Jz,normalizeLink:Xz,normalizeLinkText:ej,utils:cce,helpers:{...Jce},parse(w,M){if(typeof w!="string")throw new TypeError("Input data should be a String");if(M!==void 0&&Pr(M),N(this,w.length)){const F=M===void 0?void 0:Y3("parse"),W=F?Cp():0,P=Vfe(w,F);if(F&&(F.attemptMs=Cp()-W,P===null&&(F.fallbackReason="unsupported-stock-subset"),Jm(M,F)),P!==null)return M!==void 0&&fs(M,{area:"parse",path:"stock-fast",reason:"stock-subset"}),P}const x=M??{};let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&A(this)){const F=fj(this,w.length);if(F==="yes"){const W=Yg(this,w,x);return fs(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),W}F==="need-lines"&&(E=zo(w))}if(!this.stream.enabled){const F=w.length,W=this.options.autoTuneChunks!==!1,P=r,O=!a&&A(this),R=!!this.options.fullChunkedFallback,z=O&&F>=2e5;let H;(R||z||E!==void 0)&&(H=E??zo(w));const j=(R||z)&&W&&!P?Ihe(F,H,this.options):null;if(R||z){const K=H??0;if(R?F>=(this.options.fullChunkThresholdChars??2e4)||K>=(this.options.fullChunkThresholdLines??400):z){if(j&&j.strategy!=="plain"){const re=lk(this,w,x,{maxChunkChars:j.maxChunkChars,maxChunkLines:j.maxChunkLines,fenceAware:j.fenceAware,maxChunks:j.maxChunks});return M&&kE(M,R?"explicit-full-chunk":"default-large-string"),re}if(R){const re=(Y,ue,Z)=>YZ?Z:Y,q=this.options.fullChunkAdaptive!==!1,Q=this.options.fullChunkTargetChunks??8,ne=re(Math.ceil(F/Q),8e3,64e3),te=re(Math.ceil(K/Q),150,700),ge=q?ne:this.options.fullChunkSizeChars??1e4,Ae=q?te:this.options.fullChunkSizeLines??200,me=q?re(Math.ceil(F/64e3),Q,32):this.options.fullChunkMaxChunks,de=lk(this,w,x,{maxChunkChars:ge,maxChunkLines:Ae,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:me});return M&&kE(M,"explicit-full-chunk"),de}}}if(E!==void 0&&A(this)&&dj(this,F,H??E)){const K=Yg(this,w,x);return fs(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),K}}const I=ll(w);return fs(M,{area:"parse",path:"plain",reason:"default-plain"}),m1(x,I,()=>h.parse(w,x,this).tokens)},parseIterable(w,M={}){return Pr(M),xhe(this,w,M)},parseAsyncIterable(w,M={}){return Pr(M),She(this,w,M)},parseIterableToSink(w,M,x={}){return Pr(x),_he(this,w,M,x)},parseAsyncIterableToSink(w,M,x={}){return Pr(x),Mhe(this,w,M,x)},parseInline(w,M={}){if(typeof w!="string")throw new TypeError("Input data should be a String");Pr(M),Ev(M)&&Ic(M);const x=h.createState(w,M,this);return x.inlineMode=!0,h.process(x),x.tokens}};if(_.stream={enabled:!!n.stream,parse(w,M){return _.stream.enabled?y().parse(w,M,_):_.parse(w,M??{})},reset(){y().reset()},peek(){return v?v.peek():[]},stats(){return v?v.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){v&&v.resetStats()}},s?.components){const w=s.components;w.core?.rules&&_.core.ruler.enableOnly(w.core.rules),w.block?.rules&&_.block.ruler.enableOnly(w.block.rules),w.inline?.rules&&_.inline.ruler.enableOnly(w.inline.rules),w.inline2?.rules&&_.inline.ruler2.enableOnly(w.inline2.rules)}return d=Whe(_),f=_.parse,_}var Vhe=Uhe;const vj=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Khe=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],yj=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],Zhe=["svg","g","path"],Ghe=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],Qhe=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],Yhe=["action","data","href","src","srcset","poster","xlink:href","formaction"],Jhe=["script"],Xhe=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],jd=new Set(vj),kj=new Set(yj),U0=new Set([...vj,...Khe,...yj,...Zhe]),bj=new Set([...U0,...Ghe]),epe=new Set(Qhe),tpe=new Set(Yhe),Dv=new Set(Jhe),wj=new Set(Xhe);function Cj(e){let t="";for(const n of e){const i=n.charCodeAt(0);i<=31||i>=127&&i<=159||/\s/u.test(n)||(t+=n)}return t}const npe={amp:"&",bsol:"\\",colon:":",newline:` +`,sol:"/",tab:" "};function Aj(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,i,o)=>{const s=n??i;if(s){const r=Number.parseInt(s,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return npe[String(o??"").toLowerCase()]??t})}const V2=new Set(["http","https","mailto","tel"]),ipe=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Ef=new Set(["http","https"]);function xj(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const ope=/^https?:\/\//i;function spe(e){if(!ope.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function rpe(e,t,n){if(!e0(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function e0(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function lpe(e,t){return t==="href"||t==="xlink:href"?e0(e,t)?V2:Ef:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Ef:(e0(e,t),V2)}function yh(e,t={}){if(spe(e))return!1;const n=Cj(Aj(e)).toLowerCase(),i=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return i==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const s=xj(n);return s?s==="file"?!rpe(n,i,o):e0(i,o)?ipe.has(s):!lpe(i,o).has(s):!1}function ape(e){const t=Aj(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=xj(Cj(t).toLowerCase());return n==="http"||n==="https"}function upe(e,t={}){const n=String(e??"").trim();return n?yh(n,t)?"":n:""}function bE(e){return upe(e,{tagName:"img",attrName:"src"})}function cpe(e,t,n){function i(f){return f.trim().split(" ",2)[0]===t}function o(f,h,m,g,v){return f[h].nesting===1&&f[h].attrJoin("class",t),v.renderToken(f,h,m,g,v)}n=n||{};const s=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,u=n.validate||i,c=n.render||o;function d(f,h,m,g){let v,y=!1,b=f.bMarks[h]+f.tShift[h],C=f.eMarks[h];if(l!==f.src.charCodeAt(b))return!1;for(v=b+1;v<=C&&r[(v-b)%a]===f.src[v];v++);const A=Math.floor((v-b)/a);if(A=m||(b=f.bMarks[_]+f.tShift[_],C=f.eMarks[_],b=4)){for(v=b+1;v<=C&&r[(v-b)%a]===f.src[v];v++);if(!(Math.floor((v-b)/a)=2){const r=Number(s[0]),l=Number(s[1]);Number.isFinite(r)&&Number.isFinite(l)&&(o.map=[r+t,Math.min(l+t,n)])}Array.isArray(o.children)&&Sj(o.children,t,n)}}function fpe(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(cpe,t,{render(n,i){return n[i].nesting===1?`
      `:`
      +`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,i,o)=>{const s=t,r=s.bMarks[n]+s.tShift[n],l=s.eMarks[n],a=s.src.slice(r,l),u=a.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const d=a.slice(u[0].length).trim();let f,h;const m=d.indexOf("{"),g=m>=0?d.slice(m).trimStart():void 0;if(m===-1)f=d||void 0;else{if(f=d.slice(0,m).trim()||void 0,g?.startsWith("{")){let N=0,_=-1;for(let w=0;w0&&(h=g.slice(0,_))}h||(f=d||void 0)}if(o)return!0;const v=!!s.env.__markstreamFinal;let y=n+1,b=!1;for(;y<=i;){const N=s.bMarks[y]+s.tShift[y],_=s.eMarks[y];if(s.src.slice(N,_).trim()===":::"){b=!0;break}y++}b||(y=i);const C=s.push("vmr_container_open","div",1);if(C.attrSet("class",`vmr-container vmr-container-${c}`),C.map=[n,b?y:i],C.meta={...C.meta??{},unclosed:!b&&!v},f&&C.attrSet("data-args",f),h)try{const N=JSON.parse(h);for(const[_,w]of Object.entries(N)){const M=w!=null&&typeof w=="object";C.attrSet(`data-${_}`,M?JSON.stringify(w):String(w))}}catch{const N=dpe(h);if(N)for(const[_,w]of Object.entries(N)){const M=w!=null&&typeof w=="object";C.attrSet(`data-${_}`,M?JSON.stringify(w):String(w))}else C.attrSet("data-attrs",h)}const A=[];for(let N=n+1;NN.trim().length>0)){let N=A.join(` +`);N.endsWith(` +`)||(N+=` +`),N.endsWith(` + +`)||(N+=` +`);const _=s.tokens[s.tokens.length-1];_&&(_.raw=N);const w=[];s.md.block.parse(N,s.md,s.env,w),Sj(w,n+1,n+1+A.length),s.tokens.push(...w)}const T=s.push("vmr_container_close","div",-1);return b||(T.hidden=!0,T.map=[i,i]),s.line=b?y+1:y,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ga(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qo(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function Kb(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=i[2]||i[3]||i[4]||"";t.push([o,s])}return t}const hpe=/^[a-z][a-z0-9_-]*$/;function wE(e){return hpe.test(String(e??"").trim().toLowerCase())}function Ca(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return wE(t)?t.toLowerCase():"";let n=1;for(;n]/.test(s)?"":wE(o)?o:""}function Yh(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const i of e){const o=Ca(i);!o||t.has(o)||(t.add(o),n.push(o))}return n}function ppe(...e){const t=new Set,n=[];for(const i of e)for(const o of Yh(i))t.has(o)||(t.add(o),n.push(o));return n}function mpe(e){const t=Yh(e);return{key:t.join(","),tags:t}}function _j(e){return Ca(e)}function gpe(e,t){const n=String(e??""),i=Ca(t);if(!i)return!1;const o=Ga(i),s=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return s?s[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function Mj(e,t){const n=Ca(t);return!!n&&!U0.has(n)&&!gpe(e,n)}function vpe(e,t){const n=String(e??""),i=Ca(t);if(!i)return n;const o=Ga(i),s=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(s,"").replace(r,"")}const Ij=jd,ype=U0,Tj=new Set(kj);Tj.delete("details");const kpe=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,bpe=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,CC=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,wpe=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function uk(e){return(e.match(CC)?.[1]??"").toLowerCase()}function k7(e){return/^\s*<\s*\//.test(e)}function b7(e,t){return Ij.has(t)||/\/\s*>\s*$/.test(e)}function Cpe(e,t){let n=0;for(let i=0;i0&&n--;continue}b7(o,s)||n++}}return n}function CE(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${Ga(t)}(?=[\s>/])[^>]*>`,"gi");i.lastIndex=Math.max(0,n);let o=0,s;for(;(s=i.exec(e))!==null;){const r=s[0]??"",l=!!s[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:s.index,end:s.index+r.length};o--;continue}a||o++}return null}function xpe(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ga(t)}(?=[\s>/])[^>]*>`,"gi");let i=0,o;for(;(o=n.exec(e))!==null;){const s=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(s);if(r){i>0&&i--;continue}l||i++}return i}function ck(e){const t=e;return String(t.raw??t.content??t.markup??"")}function Spe(e){const t=e;return t.meta||(t.meta={}),t.meta}function c8(e,t,n){const i=Spe(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function _pe(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Ga(h)}(?=[\s>/])`,"i")),i=[];let o=!1;const s=h=>h?n.some(m=>m.test(h)):!1,r=h=>{if(!(!h||!i.length))for(const m of i)m.raw+=h,m.inner+=h},l=()=>{!i.length||!o||(r(` +`),o=!1)},a=h=>{r(h)},u=h=>{for(let g=0;g{const m=i[i.length-1]?.tag;if(!m)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Ga(m)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!c(h),f=(h,m,g)=>{const v=g??(h.type==="html_inline"?uk(m):"");if(!(v&&t.has(v))){r(m);return}const y=k7(m),b=!y&&b7(m,v);if(y){if(!i.length||i[i.length-1].tag!==v){r(m);return}u(m);return}if(r(m),b){c8(h,m,"");return}i.push({tag:v,token:h,raw:m,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const m=String(h.content??"");if(d(m)?o=!1:l(),!i.length&&!s(m)){o=!1;continue}let g=0,v=!0;for(const y of h.children){const b=ck(y),C=y.type==="html_inline"?uk(b):"",A=C&&t.has(C);let T=b;if(v&&m&&b&&(i.length||A)){const N=m.indexOf(b,g);if(N!==-1)a(m.slice(g,N)),T=m.slice(N,N+b.length),g=N+b.length;else{if(i.length&&!A)continue;v=!1}}f(y,T,C)}v&&m&&g0;continue}if(i.length&&typeof h.content=="string"){const m=ck(h),g=h.type==="html_block"?c(m):null;if(g){u(`${o?` +`:""}${g}`),o=i.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of i)c8(h.token,h.raw,h.inner)}function Mpe(e){return/^\s*<\s*[!?]/.test(e)}function Ipe(e){const t=new Set(ype);if(e&&Array.isArray(e))for(const n of e){const i=String(n??"").trim();if(!i)continue;const o=i.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function AE(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function Tpe(e,t){let n=null;for(const s of e.matchAll(kpe)){const r=s.index??-1;if(r<0)continue;const l=(s[1]??"").toLowerCase();AE(l,t)&&qo(e.slice(r))===-1&&(!n||r")&&(!n||s")&&(!n||s{const h=f,m=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const C of g){const A=Ca(String(C??""));A&&m.add(A)}const v=Ipe(Array.from(m)),y=new Set(Npe);for(const C of m)y.add(C);return{autoCloseInlineTagSet:y,commonHtmlTags:v,customTagSet:m,shouldMergeHtmlBlockTag:C=>m.has(C)||!v.has(C)||Tj.has(C)}},o=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},s=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),u=(f,h)=>{const m=r(f);if(!/\S/.test(m))return[];if(l(m))return[{type:"code_block",content:a(m),raw:m}];const g=m.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const v={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},v,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[v]},c=(f,h,m)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":m,d=(f,h)=>{const m=r(h);return!/\S/.test(m)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${m}`,f.children.push({type:"text",content:m,raw:m}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:m,customTagSet:g}=i(f);for(const v of h){const y=v;if(y.type!=="inline"||!Array.isArray(y.children))continue;const b=String(y.content??""),C=y.children.length?y.children:b.includes("<")?[{type:"text",content:b,raw:b}]:null;if(C)try{const A=Lpe(C,m);if(y.children=A.children,A.pendingBuffer){const T=b.lastIndexOf(A.pendingBuffer);if(T!==-1){const N=b.slice(0,T);y.content=N,typeof y.raw=="string"&&(y.raw=N)}}}catch(A){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",A)}}_pe(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:m,customTagSet:g,shouldMergeHtmlBlockTag:v}=i(f),y=[];for(let b=0;b0){const[T,N]=y[y.length-1];if(b!==N){if(C.type==="paragraph_open"||C.type==="paragraph_close"){h.splice(b,1),b--;continue}const _=String(C.content??C.raw??"");if(_){const w=h[N],M=`${String(w.content||"")} +${_}`,x=qo(M),E=x===-1?null:CE(M,T,x+1);if(E){const I=M.slice(0,E.end),F=M.slice(E.end);w.content=I,w.loading=!1,h.splice(b,1),y.pop();const W=d(w,F)?[]:u(F,c(h,b,"paragraph"));W.length&&h.splice(b,0,...W),b--;continue}w.content=M,w.loading!==!1&&(w.loading=!0)}h.splice(b,1),b--;continue}}const A=o(C);if(A){if(Mpe(A))continue;const T=(A.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),N=/^\s*<\s*\//.test(A);if(!T||!v(T))continue;if(s(C,A),!N)T&&!new RegExp(`^\\s*<\\s*${T}\\b[^>]*\\/\\s*>`,"i").test(A)&&xpe(A,T)>0&&y.push([T,b]);else if(y.length>0&&T&&y[y.length-1][0]===T){const[,_]=y[y.length-1],w=h[_];w.content=`${String(w.content||"")} +${A}`,w.loading=!1,y.pop(),h.splice(b,1),b--}continue}else if(y.length>0){if(C.type==="paragraph_open"||C.type==="paragraph_close"){h.splice(b,1),b--;continue}const T=C.content||"",N=new RegExp(`<\\s*\\/\\s*${y[y.length-1][0]}\\s*>`,"i").test(T);if(T){const[,_]=y[y.length-1],w=h[_];w.content=`${w.content||""} +${T}`,w.loading!==!1&&(w.loading=!N)}N&&y.pop(),h.splice(b,1),b--}else continue}if(g.size>0){const b=new Map,C=new Map,A=_=>{let w=b.get(_);return w||(w=new RegExp(`<\\s*${_}\\b`,"i"),b.set(_,w)),w},T=_=>{let w=C.get(_);return w||(w=new RegExp(`<\\s*\\/\\s*${_}\\s*>`,"i"),C.set(_,w)),w},N=[];for(let _=0;_0){const E=N[N.length-1],I=h[E.index],F=w.type==="html_block"?T(E.tag).exec(M):null;if(F){const O=F.index+F[0].length,R=M.slice(0,O),z=M.slice(O);I.content=`${String(I.content??"")} +${R}`,Array.isArray(I.children)&&I.children.push({type:"html_inline",content:``,raw:``}),N.pop();const H=d(I,z)?[]:u(z,c(h,_,"paragraph"));H.length?h.splice(_,1,...H):(h.splice(_,1),_--);continue}if(w.type!=="inline")continue;const W=Array.isArray(w.children)?w.children:[],P=Cpe(W,E.tag);if(P!==-1){const O=W.slice(0,P+1),R=W.slice(P+1),z=O.map(H=>String(H?.content??H?.raw??"")).join("");if(I.content=`${String(I.content??"")} +${z}`,Array.isArray(I.children)&&I.children.push(...O),R.length){const H=R.map(j=>String(j.content??j.raw??"")).join("");if(H.trim()){const j=H.replace(/^\s+/,"");if(d(I,H))h.splice(_,1),_--;else if(j.startsWith("<"))h.splice(_,1,{type:"html_block",content:j});else{const K=u(H,c(h,_,"paragraph"));h.splice(_,1,...K)}}else h.splice(_,1),_--}else h.splice(_,1),_--;N.pop();continue}I.content=`${String(I.content??"")} +${M}`,Array.isArray(I.children)&&I.children.push(...W),h.splice(_,1),_--;continue}if(w.type!=="inline")continue;const x=Array.isArray(w.children)?w.children:[];for(const E of g)if((x.length?Ape(x,E):A(E).test(M)&&!T(E).test(M)?1:0)>0){N.push({tag:E,index:_});break}}}{let b=0;for(let C=0;C0?b--:(h.splice(C,1),C--))}}for(let b=0;b/]+)/)?.[1]??"").toLowerCase();if(w.startsWith("!")||w.startsWith("?")){C.loading=!1;continue}if(g.has(w)){const P=String(C.content??""),O=qo(P),R=O===-1?null:CE(P,w,O+1);C.loading=R?!1:C.loading!==void 0?C.loading:!0;const z=R?.start??-1,H=R?R.end-R.start:0;if(z!==-1){const j=P.slice(0,z+H);let K="";O!==-1&&O]+)))?/g;let x;for(;(x=M.exec(C.content||""))!==null;)x[1],x[2]||x[3]||x[4];const E=String(C.content??""),I=new RegExp(`<\\/\\s*${w}\\s*>`,"i").exec(E),F=I?I.index:-1,W=I?I[0].length:0;if(F!==-1){const P=E.slice(0,F+W),O=(E.slice(F+W)||"").replace(/^\s+/,"");C.children=[{type:"html_block",content:P,tag:w,loading:!1}],C.content=P,C.raw=P,O&&h.splice(b+1,0,O.startsWith("<")?{type:"html_block",content:O}:{type:"text",content:O,raw:O})}else C.children=[{type:"html_block",content:C.content,tag:w,loading:!0}];continue}if(!C||C.type!=="inline")continue;if(C.children.length===2&&C.children[0].type==="html_inline"){const w=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),M=C.children[1],x=String(M?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(M?.type==="html_inline"&&x===w)continue;m.has(w)?(C.children[0].loading=!0,C.children[0].tag=w,C.children.push({type:"html_inline",tag:w,loading:!0,content:``})):C.children=[{type:"html_block",loading:!0,tag:w,content:String(C.children[0]?.content??"")+String(C.children[1]?.content??"")}];continue}else if(C.children.length===3&&C.children[0].type==="html_inline"&&C.children[2].type==="html_inline"){const w=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(m.has(w))continue;C.children=[{type:"html_block",loading:!1,tag:w,content:C.children.map(M=>M.content).join("")}];continue}if(!C.content?.startsWith("<")||C.children?.length!==1)continue;const A=String(C.content),T=C,N=T.children[0];if(N?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(A)&&(T.children.length=0);continue}const _=String(N.content??A).match(wpe)?.[1]?.toLowerCase()??"";if(_){if(/\/\s*>\s*$/.test(A)||Ij.has(_)){T.children=[{type:"html_inline",content:A}];continue}T.children.length=0}}})}function Fpe(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function Bpe(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const i=n.tokens??[];for(let o=0;oa.trim().length>0);if(l.length===1&&!Fpe(l[0]??"")){const a=l[0]??"",u=s.level??0;i.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:a,children:[{type:"text",content:a,level:u+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),o+=2}}})}const Ej=/\.([a-z0-9]{1,15})$/i,Rpe=/[_()[\]{}<>]/u,Ope=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,$pe=/[?#@]/u,Ppe=/[\\/]/u,zpe=/^[\p{L}\p{N}./\\-]+$/u,jpe=/^[A-Za-z0-9-]{1,63}$/u,Hpe=/^xn--[a-z0-9-]{2,59}$/i,Wpe=/^(?:[A-Z]{1,6}|\d{1,8})$/u,qpe=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,Upe=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,Vpe=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,Kpe=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,Zpe=2e3,Gpe=512,Qpe={},Ype=new Set(["ai","md","py","rs","sh","zip"]),Lj=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),Jpe=new Set([...Lj,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),Xpe=new Set(["com","dev","io","page","site"]),e1e=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),t1e=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),ih=new Map;function xE(e,t){if(!e||e.length>Gpe)return t;for(ih.set(e,t);ih.size>Zpe;){const n=ih.keys().next().value;if(!n)break;ih.delete(n)}return t}function V0(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function d8(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return V0(n)?n:void 0}function SE(e,t){if(!V0(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function _E(e){const t=Fv(e);return V0(t)?t:void 0}function n1e(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function ME(e,t){if(!V0(t))return;const n=String(e??"").trim().split(/\s+/u).map(n1e).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(o=>dk(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(o=>dk(o,{marketTicker:!0}))&&(i.marketTicker=!0),V0(i)?i:void 0}function lf(e,t=!1){let n;return{options(i){return t||i==null?SE(e,n):SE(e,d8(_E(i),ME(i,n)))},remember(i){const o=_E(i);n=t?d8(n,o):d8(o,ME(i,n))},reset(){n=void 0}}}function IE(e){return jpe.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function i1e(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return IE(n)||Hpe.test(n)?t.every(IE):!1}function Nj(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function o1e(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function s1e(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function Dj(e,t,n){const i=o1e(t);return Nj(e)&&s1e(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function r1e(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function Fv(e){const t=String(e??""),n=ih.get(t);return n?(ih.delete(t),ih.set(t,n),n):r1e(t)?xE(t,{explicitFilename:Upe.test(t),filename:Vpe.test(t),marketTicker:Kpe.test(t)}):xE(t,Qpe)}function l1e(e){return i1e(e.split(/[\\/]/)[0]??"")}function a1e(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function u1e(e){if(Rpe.test(e)||!zpe.test(e))return!0;if(Ppe.test(e))return!l1e(e);const t=e.replace(Ej,"");return Nj(t)?!0:t.split(".").filter(Boolean).some(a1e)}function c1e(e,t,n){if(!(n?Jpe:Lj).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?qpe:Wpe).test(i)}function dk(e,t={}){if(!e||Ope.test(e)||$pe.test(e))return!1;const n=e.match(Ej);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return c1e(e,i,t.marketTicker===!0)?!0:t1e.has(i)?!Ype.has(i)||t.filename?!0:u1e(e):!!(t.explicitFilename&&Xpe.has(i)||t.filename&&e1e.has(i))}const Fj=new WeakMap,Bj=new WeakSet;function AC(e,t){return Fj.set(e,t),e}function d1e(e){return Fj.get(e)}function f1e(e){Bj.add(e)}function h1e(e){return e===void 0||Bj.has(e)}const TE=["!"];function EE(e){return e==="linkify"||e==="autolink"?e:"recovery"}function ol(e){return{type:"text",content:e,raw:e}}function Lf(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function Nf(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Vc(e,t,n,i="recovery"){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return AC({type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function p1e(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(ol(t))}}function LE(e,t){let n=-1;for(const i of t){const o=e.indexOf(i);o!==-1&&(n===-1||on?.[0]==="href")?.[1];return typeof t=="string"?t:""}function g1e(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(i=>i?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function NE(e,t,n){let i="";for(let o=t+1;o{const n=t.tokens??[];for(let i=0;ir.type==="code_inline"),i=new Map;let o=0;for(let r=0;r0&&u?DE(u):-1;if(c!==-1&&u)for(const d of u.slice(c))d==="("?o++:d===")"&&o>0&&o--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?o++:a===")"&&o>0&&o--}const s=Fv(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let u=r+1;u0){const m=DE(u);m!==-1&&(d===-1||m=g.content.length){h-=g.content.length;continue}if(h<0)break;const v=g.content[h],y=g.content.slice(0,h);let b=g.content.slice(h);for(let T=m+1;T0&&(e.splice(m+1,C),a=m+1);let A=c;if(v==="!"&&f!==-1)A=c.slice(0,f);else if(b){const T=encodeURI(b);if(T&&c.endsWith(T))A=c.slice(0,c.length-T.length);else{const N=v?encodeURI(v):"",_=N?c.indexOf(N):-1;_!==-1&&(A=c.slice(0,_))}}A!==c&&g1e(l,A),b&&e.splice(a+1,0,ol(b));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let u=r+1;ud[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(c+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(Vc(u,c,f,"linkify"));const h=e[r+3].content?.replace(/^\)\**/,"");h&&a.push(ol(h)),e.splice(r-4,8,...a)}else a.push(AC({type:"link",loading:!0,href:c,title:"",text:u,children:[{type:"text",content:c,raw:c}],raw:`[${u}](${c})`},"linkify")),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,u]=e[r-3].content?.split("[**")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,u]=e[r-3].content?.split("[*")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,u]=e[r-3].content?.split("[")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",u=e[r-2].attrs||[],c=u.find(y=>y[0]==="href")?.[1]||"",d=u.find(y=>y[0]==="title")?.[1]||"";let f=3,h=2;const m=(e[r-3]?.content||"").match(/^(\*+)$/),g=[];if(m){h+=1;const y=m[1].length;Lf(g,y)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let y=r+1;yv[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(g||f)+e[r+5].content,e[r+5].content=""):f=g||f,h+=3}let m=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const g=(e[r+2]?.content??"").indexOf(")");m=g===-1,g===-1&&(f+=e[r+2]?.content?.slice(0,g)||"",e[r+2].content="")}a.push(Vc(d,f,m)),Nf(a,2),e.splice(r-2,h,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const u=(a[2]||"")+a[1];let c=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!c&&e[r+4]?.type==="text"&&(c=e[r+4].content||"");const d=[];Lf(d,2),d.push(Vc(u,c,!1)),Nf(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let i=0;i{const n=t.tokens??[];for(let i=0;i=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v{const n=t;try{const i=L1e(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function FE(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function BE(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function RE(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function Rj(e,t){if(!e.startsWith("|")||e.includes(` +`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(i=>i.trim().length>0)?n:null}function f8(e){return Rj(e)!==null}function Oj(e){return/^:?-+:?$/.test(e.trim())}function _1e(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(Oj)}function M1e(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function I1e(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(Oj)&&M1e(n)}function T1e(e){return e==="|"||e==="|:"}function E1e(e){const t=Rj(e);return t!==null&&t.every(n=>!n.includes(":"))}function L1e(e,t=!1,n=""){const i=[...e];if(e.length<3)return i;const o=e.length-2,s=e[o];if(s.type==="inline"){const r=String(s.content??""),l=r.split(` +`)[0]??"",[a="",u="",...c]=r.split(` +`),d=!t&&!r.includes(` +`)&&/\r?\n$/.test(n)&&f8(r);if(!t&&(r.includes(` +`)&&c.length===0&&f8(a)&&I1e(u)||d)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>RE(m)),h=[...FE(),...f,...BE()];i.splice(o-1,3,...h)}else if(r.includes(` +`)&&c.length===0&&f8(a)&&_1e(u)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>RE(m)),h=[...FE(),...f,...BE()];i.splice(o-1,3,...h)}else r.includes(` +`)&&c.length===0&&E1e(a)&&T1e(u)&&(s.content=r.slice(0,-2),s.children.splice(2,1))}return i}function N1e(e,t,n,i){const o=e.length;if(n==="$$"&&i==="$$"){let u=t;for(;u=0&&e[c]==="\\";)d++,c--;if(d%2===0)return u}u++}return-1}const s=n[n.length-1],r=i;let l=0,a=t;for(;a=0&&e[c]==="\\";)d++,c--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const u=e[a];if(u==="\\"){a+=2;continue}u===s?l++:u===r[r.length-1]&&l>0&&l--,a++}return-1}var D1e=N1e;const F1e=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],fk=F1e.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),B1e=/\\[a-z]+/i,$j="(?:\\\\|\\u0008)",R1e=new RegExp(String.raw`${$j}(?:${fk})\s*\{[^}]+\}`,"i"),O1e=new RegExp(String.raw`(?:${$j})?(?:${fk})\s*\{`,"i"),$1e=/\\(?:text|frac|left|right|times)/,P1e=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,z1e=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,j1e=/[A-Z]+\s*\([^)]+\)/i,H1e=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,W1e=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,q1e=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,U1e={"\b":"\\b","\v":"\\v","\f":"\\f"};function V1e(e){let t="";for(const n of e)t+=U1e[n]??n;return t}function fd(e){if(!e)return!1;const t=V1e(e),n=t.trim();if(q1e.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=B1e.test(t),o=R1e.test(t),s=O1e.test(t),r=$1e.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=P1e.test(t)&&!z1e.test(t),u=j1e.test(t),c=H1e.test(n),d=W1e.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return i||o||s||r||l||a||u||c||d||f||h}const Pj="__markstreamMathPluginApplied",xC=80,zj=2e4,OE=zj+4096;function w7(e){return!!e[Pj]}function K1e(e){e[Pj]=!0}const jj=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],Z1e=["cdot","mathbf{","partial","mu_{"],Hj=jj.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Wj="[ \r\b\f\v]",G1e=new RegExp(`([^\\\\])(${Z1e.map(e=>e).join("|")})+`,"g"),Q1e=/span\{([^}]+)\}/,Y1e=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,J1e=/(^|[^\\])\\\r?\n/g,X1e=/(^|[^\\])\\$/g,eme=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,tme=new RegExp(`(${Wj})|(${Hj})\\b`,"g"),$E=new Map,PE=new Map;function nme(e){if(!e)return tme;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),i=$E.get(n);if(i)return i;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,s=new RegExp(`(${Wj})|(${o})\\b`,"g");return $E.set(n,s),s}function ime(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const i=e?"__default__":n.join(""),o=PE.get(i);if(o)return o;const s=e?[fk,Hj].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),fk].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${s})\\s*\\{`,"g");return PE.set(i,r),r}const zE={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function jE(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function ome(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&eme.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function HE(e){const t=/(^|[^\\])(__|\*\*)/g;let n,i=null;for(;(n=t.exec(e))!==null;)i={marker:n[2],index:n.index+(n[1]?.length??0)};return i}function Kc(e,t){const n=t?.commands??jj,i=t?.escapeExclamation??!0,o=t?.commands==null,s=nme(o?void 0:n);let r=e.replace(s,(u,c,d,f,h)=>{if(c!==void 0&&zE[c]!==void 0)return`\\${zE[c]}`;if(d&&n.includes(d)){const m=h&&typeof f=="number"?h[f-1]:void 0;return m==="\\"||m&&/\w/.test(m)?u:`\\${d}`}return u});i&&(r=ome(r));let l=r;const a=ime(o,o?void 0:n);return l=l.replace(a,(u,c,d)=>`${c}\\${d}{`),l=l.replace(Q1e,"span\\{$1\\}").replace(Y1e,"\\operatorname{span}\\{$1\\}"),l=l.replace(J1e,`$1\\\\ +`),l=l.replace(X1e,"$1\\\\"),l=l.replace(G1e,"$1\\$2"),l}function WE(e){const t=e.trim();return!(!fd(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function qj(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[s]==="\\"&&s+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)i++,n--;return i%2===1}function SC(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=l)break;const u=hk(o,a);if(u){r=Math.max(a+Math.max(1,t.length),u[1]);continue}Bv(e,a)||s++,r=a+Math.max(1,t.length)}return s}function C7(e,t,n){const i=Z0(String(e??""));if(!i.endsWith(t))return-1;const o=i.length-t.length;if(o<=0||!Z0(i.slice(0,o)).trim()||Bv(i,o))return-1;const s=qj(i);if(hk(s,o))return-1;const r=qE(i,t,0,o,s);if(t==="$$"){if(r%2===1)return-1}else if(r>qE(i,n,0,o,s))return-1;return o}function K0(e){return e===" "||e===" "}function Z0(e){let t=e.length;for(;t>0&&K0(e[t-1]);)t--;return e.slice(0,t)}function UE(e){let t=0;for(let n=0;n=48&&t<=57}function rme(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let i=0;i=3}function lme(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let i=0;for(;t[n]==="-";)i++,n++;return i<3?!1:(t[n]===":"&&n++,n===t.length)}function ame(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(lme)}function ume(e){let t=0;if(!VE(e[t]))return!1;for(;VE(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:K0(e[t+1])}function Uj(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&K0(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&K0(t[1])||ume(t)||rme(t)||ame(t))}function KE(e,t){return e?t?`${e} +${t}`:e:t}function _C(e){const t=String(e??"").trim();return t?fd(t):!1}function ZE(e){let t=0;for(let n=0;nxC){h=!0;break}const g=o[m],v=$p(g,c);if(v!==-1){const y=KE(f,g.slice(0,v));if(!_C(y)){h=!0;break}const b=g.slice(v+c.length),C=b.trim()?`suffix:${ZE(b)}`:"nosuffix";return["closed",u,i+l,d,i+m,v,ZE(y),C].join(":")}if(Uj(g)){h=!0;break}if(f=KE(f,g),f.length>zj){h=!0;break}}if(!h&&_C(f))return["pending",u,i+l,d].join(":")}}return null}function p8(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function dme(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const i=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(i)?!1:i===""||/^[)\s,.!?;:]/.test(i)}function m8(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function fme(e,t){K1e(e);const n=(r,l,a)=>{const u=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=r.push("paragraph_open","p",1);c.map=[a,a+1];const d=r.push("inline","",0);d.content=u,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},i=(r,l)=>{const a=r,u=!!t?.strictDelimiters,c=!a?.env?.__markstreamFinal,d=(b,C)=>{let A=C;for(;A=3&&(!A||/\s/.test(A))){const T=a.push("text","",0);return T.content=a.src.slice(a.pos,b),a.pos=b,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),m=Math.max(0,a.pos-h.length);let g=m,v=m;const y=m;for(const[b,C]of f){const A=a.src,T=qj(A),N=sme(A,c);let _=!1;b==="$$"&&g!==y&&(g=y);let w=-1,M=-1,x=0;const E=I=>{if((I==="undefined"||I==null)&&(I=""),I==="\\"){a.pos=a.pos+I.length,g=a.pos;return}if(I==="\\)"||I==="\\("){const P=a.push("text_special","",0);P.content=I==="\\)"?")":"(",P.markup=I,a.pos=a.pos+I.length,g=a.pos;return}if(!I)return;if(b==="$$"&&I.includes("$")){let P=0;for(;P0&&I[O-1]==="$"||O+10){const R=I.slice(0,F),z=a.push("text","",0);z.content=R,a.pos=a.pos+R.length,g=a.pos}const P=I.slice(F).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(P){const[,R,z]=P,H=z.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),j=H?H[1]:z,K=H&&H[2]?H[2]:null,re=a.push("image","img",0);re.attrs=[["src",j],["alt",R]],K&&re.attrs.push(["title",K]),re.content=R,re.children=[{type:"text",content:R,tag:""}],a.pos=a.pos+P[0].length,g=a.pos;const q=I.slice(F+P[0].length);q&&E(q);return}const O=a.push("text","",0);O.content=I,a.pos=a.pos+I.length,g=a.pos;return}const W=a.push("text","",0);W.content=I,a.pos=a.pos+I.length,g=a.pos};for(;!(g>=A.length);){const I=A.indexOf(b,g);if(I===-1)break;if(Bv(A,I)){g=I+Math.max(1,b.length);continue}const F=hk(T,I);if(F){g=F[1];continue}const W=hk(N,I);if(W){g=W[1];continue}if(I===w&&g===M){if(x++,x>2){g=I+Math.max(1,b.length);continue}}else x=0,w=I,M=g;if(b==="("&&I>0){let q=I-1;for(;q>=0&&A[q]===" ";)q--;if(q>=0&&A[q]==="]"){g=I+b.length;continue}}if(b==="$"&&I>0&&A[I-1]==="$"){g=I+1;continue}if(b==="$"&&I=A.length);){const F=SC(A,I);if(F===-1)break;if(F+10&&A[F-1]==="$"){I=F+1;continue}const W=h8(A,F+1);if(W===-1)break;const P=A.slice(F+1,W),O=P.includes("`"),R=!P||!P.trim(),z=A[W+1],H=p8(P,z),j=m8(P);if(!O&&!R&&!H&&!j){const K=A.slice(g,F);K&&E(K);const re=a.push("math_inline","math",0);re.content=Kc(P,t),re.markup="$",re.raw=`$${P}$`,re.loading=!1,g=W+1,I=W+1}else E("$"),I=F+1}I{const c=r,d=!c?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[l]+c.tShift[l];let g=c.src.slice(m,c.eMarks[l]).trim(),v=!1,y="",b="",C=!1,A="",T=!1;for(const[K,re]of h)if(g.startsWith(K))if(K.includes("[")){const q=K==="\\["?g.slice(K.length):"";if(K==="\\["&&$p(q,re)===-1&&!/^\s*!\[/.test(q)&&!q.includes("`")&&fd(q)){v=!0,y=K,b=re;break}if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1=0?"\\]":b,x=w>=0?w:$p(g,b,_);if(!C&&x>y.length){const K=g.slice(N+y.length,x),re=c.push("math_block","math",0);re.content=Kc(K),re.markup=y==="$$"?"$$":y==="["?"[]":"\\[\\]",re.map=[l,l+1],re.raw=`${y}${K}${M}`,re.block=!0,re.loading=!1,c.line=l+1;const q=g.slice(x+M.length);return q.trim()&&n(c,q,l),!0}let E=l,I="",F=!1,W="",P=l;const O=C?g:g===y?"":g.slice(y.length),R=!f&&y==="\\["?"]":"",z=$p(O,b);if(z!==-1){const K=z;I=O.slice(0,K),W=O.slice(K+b.length),P=C?l+1:l,F=!0,E=P}else for(O&&!C&&(I=O),E=l+1;E{const c=r,d=c.bMarks[l]+c.tShift[l],f=c.src.slice(d,c.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,l,a,u)};e.inline.ruler.before("escape","math",i),e.block.ruler.before("lheading","explicit_math_block",s,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function hme(e){const t=e.renderer.rules.image||function(n,i,o,s,r){const l=n,a=r;return a.renderToken?a.renderToken(l,i,o):""};e.renderer.rules.image=(n,i,o,s,r)=>{const l=n;return l[i].attrSet?.("loading","lazy"),t(l,i,o,s,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,i)=>{const o=n[i],s=String(o.info??"").trim();return`
      ${e.utils.escapeHtml(String(o.content??""))}
      `})}const pme=/^\s]/i,mme=/^<\/a\s*>/i;function gme(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let i=0;for(let o=n.length-1;o>=0;o--){const s=n[o];if(s?.type==="link_close"){for(o--;o>=0&&n[o]?.level!==s.level&&n[o]?.type!=="link_open";)o--;continue}if(s?.type==="html_inline"){const r=String(s.content??"");pme.test(r)&&i>0&&i--,mme.test(r)&&i++}if(!(i>0)&&s?.type==="text"&&t.test(String(s.content??"")))return!0}return!1}function vme(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(i=>i.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",i=>{if(!i.md?.options?.linkify)return;const o=Array.isArray(i.tokens)?i.tokens:[],s=i.md.linkify;if(!s)return;const r=o.filter(l=>gme(l,s));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function yme(e){const t=e.inline.ruler,n=t.getNamedRules?.(),i=n?.find(l=>l.name==="link")?.fn,o=n?.find(l=>l.name==="image")?.fn;if(typeof i!="function"||typeof o!="function")return;const s=e.validateLink,r=e;r.__markstreamOriginalValidateLink=s,t.at("link",(...l)=>{const a=l[0].md,u=a?.validateLink===s?a.options?.validateLink:a?.validateLink;if(!a||typeof u!="function")return i(...l);const c=a.validateLink;a.validateLink=u;try{return i(...l)}finally{a.validateLink=c}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return o(...l);const u=a.validateLink;a.validateLink=s;try{return o(...l)}finally{a.validateLink=u}})}function kme(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},i=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),s=new Vhe({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!o){const r=l=>!yh(l,{tagName:"a",attrName:"href"});f1e(r),s.set({validateLink:r})}return yme(s),vme(s),(e.enableMath??!0)&&fme(s,{...e.mathOptions??{}}),(e.enableContainers??!0)&&fpe(s),e.enableFixIndentedCodeBlock!==!1&&Bpe(s),v1e(s),w1e(s),k1e(s),S1e(s),hme(s),Dpe(s,{customHtmlTags:e.customHtmlTags}),s}function kh(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>kh(n))),t}function bme(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function wme(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,i=n===""||n==="true";return{type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}}function Cme(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function K2(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;sn.startsWith(t)||t.startsWith(n)):!1}function GE(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function QE(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function _me(e,t){const n=[],i=[],o=[],s=[],r=e.split(xme),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),u=h=>{const m=h;if(!Zj.some(g=>m.startsWith(g)))if(m.startsWith("-")){const g=m.slice(1);o.push(QE(g,a))}else if(m.startsWith("+")){const g=m.slice(1);s.push(QE(g,a))}else{GE(n,i,o,s);const g=a&&m.startsWith(" ")?m.slice(1):m;n.push(g),i.push(g)}},c=l?Math.max(0,r.length-1):r.length;for(let h=0;h0||s.length>0)&&GE(n,i,o,s);const d=n.join(` +`),f=i.join(` +`);return{original:t&&l&&d?`${d} +`:d,updated:t&&l&&f?`${f} +`:f}}function A7(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},i=typeof n.closed=="boolean"?n.closed:void 0,o=i===!0||i!==!1&&t,s=String(e.info??""),r=s.startsWith("diff"),l=r?(()=>{const u=s,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():s;let a=String(e.content??"");if(!o&&e.markup){const u=e.markup[0],c=e.markup.length,d=Ame(u,c);d.test(a)&&(a=a.replace(d,""))}if(r){const{original:u,updated:c}=_me(a,o===!0);return{type:"code_block",language:l,code:String(c??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t}}function Mme(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function Ime(){return{type:"hardbreak",raw:`\\ +`}}function Tme(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s\s*$/.test(t)||jd.has(e)}function Eme(e){if(!e||e.length===0)return YE();const t=v8.get(e);if(t)return t;const n=e.map(Ca).filter(Boolean);if(!n.length){const o=YE();return v8.set(e,o),o}const i={customTagSet:new Set(n),allowedTagSet:Yb({customHtmlTags:e})};return v8.set(e,i),i}function Jj(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function Lme(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function pk(e,t){const n=t.toLowerCase();for(let i=e.length-1;i>=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function Nme(e,t,n){const i=e.slice();return pk(i,"href")||i.push(["href",t]),n!=null&&!pk(i,"title")&&i.push(["title",n]),i}function MC(e){return e.map(Jj).join("")}function Gy(e){const t=[],n=i=>{const o=String(i??"");if(!o)return;const s=t[t.length-1];if(s?.type==="text"){s.content=`${s.content}${o}`,s.raw=`${s.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const i of e)if(i){if(i.type==="reference"||i.type==="footnote_reference"){n(String(i.raw??""));continue}if("children"in i&&Array.isArray(i.children)){t.push({...i,children:Gy(i.children)});continue}t.push(i)}return t}function Dme(e,t,n){let i=0;for(let o=t;o`;g.toLowerCase().includes(T.toLowerCase())||(g+=T),y=!0,v=!0}const b=[],C=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let A;for(;(A=C.exec(l))!==null;){const T=A[1],N=A[2]||A[3]||A[4]||"";b.push([T,N])}if(u?.has(a)){const T=Lme(e);return[{type:a,tag:a,attrs:b,content:T?T.inner:h.innerTokens.length?MC(h.innerTokens):"",children:h.innerTokens.length?i(h.innerTokens,o,s,r):[],raw:T?.raw??g,loading:e.loading||v,autoClosed:y},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:b,content:g,children:m,raw:g,loading:v,autoClosed:y},h.nextIndex]}function Xj(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>Xj(t)).join(""):String(e.content??"")}function Bme(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>Xj(t)).join("")}function JE(e,t=!1){let n=e.attrs??[],i=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,i=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),s=n.find(d=>d[0]==="alt")?.[1],r=Bme(i??e);let l="";r?l=r:s!=null&&String(s).length>0?l=String(s):i?.content!=null&&String(i.content).length>0?l=String(i.content):Array.isArray(i?.children)&&i.children[0]?.content?l=String(i.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,u=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:o,alt:l,title:u,raw:c,loading:t}}function Rme(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function Ome(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function Pme(e,t,n){const i=e.slice();return mk(i,"href")||i.push(["href",t]),n!=null&&!mk(i,"title")&&i.push(["title",n]),i}function Z2(e,t,n){const i=e[t],o=$me(i.attrs),s=String(mk(o,"href")??""),r=mk(o,"title"),l=r==null?null:String(r),a=Pme(o,s,l);let u=t+1;const c=[];let d=!0;for(;uv.type==="strong_open")){const v=String(h.content??""),y=String(h.raw??v),b=kh(h);b.content=v.slice(0,-2),b.raw=y.replace(/\*\*$/,""),f=c.slice(),f[f.length-1]=b}const m=Lo(f,void 0,void 0,n),g=m.map(v=>{const y=v;return"content"in v?String(y.content??""):String(y.raw??"")}).join("");return{node:{type:"link",href:s,title:l,text:g,children:m,raw:`[${g}](${s}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:u0?i:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:s0?i:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:s?@[\\\]^_`{|}~]/,Jme=/\p{P}/u,Xme=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,ege=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,tge=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,nge=/:\/\//,IC=1,eH=2,ige=4,oge=8,tH=16,Xc=32,Qy=64,Cg=128,nH=256,sge=512,Ag=1024,rge=1982;function G2(e){let t=0;for(let n=0;n=t){n++,i++;continue}n++,i++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function Hd(e){return!!e&&Qme.test(e)}function Wd(e){return!!e&&(Yme.test(e)||Jme.test(e))}function oH(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&Xme.test(e)}function sH(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&ege.test(e)}function age(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||Hd(i)?!1:!(Wd(i)&&!oH(i,n)&&n&&!Hd(n)&&!Wd(n))}function uge(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||Hd(n)?!1:!(Wd(n)&&!sH(n,i)&&i&&!Hd(i)&&!Wd(i))}function cge(e,t,n=0){let i=n,o=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||Hd(i)?!1:!(Wd(i)&&!oH(i,n)&&n&&!Hd(n)&&!Wd(n))}function fge(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||Hd(n)?!1:!(Wd(n)&&!sH(n,i)&&i&&!Hd(i)&&!Wd(i))}function hge(e,t=0){let n=t,i=!1;for(;n=0&&e[s]==="\\";s--)o++;return o%2===1}const vge=/[\p{L}\p{N}]/u,yge=/^[\p{L}\p{N}]+$/u;function TC(e){return e?vge.test(e):!1}function rH(e){return e?yge.test(e):!1}function t0(e,t){let n=t;for(;n0?e[t-1]:void 0,o=n=2&&i.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n=3)return i;n=i+o.len}return-1}function Cge(e){return e?tge.test(e)||nge.test(e):!1}function Age(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Lo(e,t,n,i){if(!e||e.length===0)return[];const o=i?.__linkifyDemotionContext,s=Fv(t),r={filename:o?.filename||s.filename,explicitFilename:o?.explicitFilename||s.explicitFilename,marketTicker:o?.marketTicker||s.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(i={...i,__linkifyDemotionContext:r});const l=i,a=[];let u=null,c=0;const d=i?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function m(){u=null}function g(Y,ue){const Z=e.length===1?t:String(ue.content??""),se=[],ke=kge(Y);if(ke!==-1){T(Y.slice(0,ke),Y.slice(0,ke));const we=Y.slice(ke);return we&&(E({type:"text",content:we,raw:we}),c--),c++,!0}if(Vme.test(Y)){const we=Y.indexOf("~~");we!==-1&&se.push({type:"strikethrough",index:we})}if(Kme.test(Y)){const we=Y.indexOf("**");we!==-1&&se.push({type:"strong",index:we})}if(/[^*]*\*[^*]+/.test(Y)){const we=Z?iH(Z,0):Y.indexOf("*");if(Z&&we===-1)return!1;we!==-1&&se.push({type:"emphasis",index:we})}se.sort((we,oe)=>we.index!==oe.index?we.index-oe.index:we.type===oe.type?0:we.type==="strong"?-1:oe.type==="strong"?1:0);const be=se[0];if(!be)return!1;if(be.type==="strikethrough"){const we=be.index,oe=we>-1?Y.slice(0,we):"";if(oe&&T(oe,oe),we===-1)return c++,!0;const J=Y.indexOf("~~",we+2),fe=J===-1?Y.slice(we+2):Y.slice(we+2,J),ve=J===-1?"":Y.slice(J+2),{node:Ce}=eL([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:fe,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return m(),A(Ce),ve&&(E({type:"text",content:ve,raw:ve}),c--),c++,!0}if(be.type==="strong"){const we=be.index,oe=we>-1?Y.slice(0,we):"";if(oe&&T(oe,oe),we===-1)return c++,!0;if(t&&we===0){let ie=!1,Ee=0;for(;Ee=2)return T(Y,Y),c++,!0}}if(t&&(Y.match(/\*/g)||[]).length>lge(t))return T(Y.slice(oe.length),Y.slice(oe.length)),c++,!0;const J=t0(Y,we);if(J.len>=3){const ie=wge(Y,we+J.len);if(ie!==-1){const Ee=Y.slice(we+J.len,ie);if(bge(Ee)){const{node:Ke}=Xm([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ee,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);m(),A(Ke);const Ue=Y.slice(ie+3);return Ue&&(E({type:"text",content:Ue,raw:Ue}),c--),c++,!0}}}if(!dge(Y,we)){const ie=Y.slice(we,we+J.len);T(ie,ie);const Ee=Y.slice(we+J.len);return Ee&&(E({type:"text",content:Ee,raw:Ee}),c--),c++,!0}const fe=hge(Y,we+2);let ve="",Ce="";if(fe.index!==-1){ve=Y.slice(we+2,fe.index),Ce=Y.slice(fe.index+2);const ie=fe.index,Ee=t0(Y,ie);if(J.intraword&&Ee.intraword&&!rH(ve)||!ve&&J.len>=4&&J.intraword)return T(Y.slice(oe.length),Y.slice(oe.length)),c++,!0}else{if(d||fe.sawInvalidClose||J.intraword)return T(Y.slice(oe.length),Y.slice(oe.length)),c++,!0;ve=Y.slice(we+2),Ce=""}if(!ve&&/^\*+$/.test(Ce))return T(Y,Y),c++,!0;const{node:le}=Xm([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:ve,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);return m(),A(le),Ce&&(E({type:"text",content:Ce,raw:Ce}),c--),c++,!0}if(be.type==="emphasis"){let we=be.index;we===-1&&(we=0);const oe=Y.slice(0,we);if(oe&&T(oe,oe),!age(Y,we)){T(Y[we],Y[we]);const ie=Y.slice(we+1);return ie&&(E({type:"text",content:ie,raw:ie}),c--),c++,!0}const J=t0(Y,we),fe=cge(Z,Y,we+1),ve=fe.index,Ce=e[c+1];if(i?.final&&Ce?.type==="em_open"&&ve!==-1&&Y.slice(we+1,ve).trim()!==Y.slice(we+1,ve)||ve===-1&&(fe.sawInvalidClose||i?.final||J.intraword||!TC(Y[we+1])))return T(Y.slice(we),Y.slice(we)),c++,!0;const{node:le}=K2([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ve>-1?Y.slice(we+1,ve):Y.slice(we+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(m(),A(le),ve!==-1&&ve{for(let le=0;le=0&&Ce[Ee]==="\\";Ee--)ie++;if(ie%2===0)return le}return-1})(Y);if(se===-1)return!1;let ke=1;for(let Ce=se+1;Cebe?.type==="math_inline")||!Zme.test(Y))return null;const Z=ue.parseInline(Y,{__markstreamFinal:!!i?.final});if(!Array.isArray(Z)||Z.length===0)return null;const se=(Z.find(be=>be?.type==="inline")?.children??[]).filter(be=>!(be?.type==="text"&&String(be.content??"")===""));if(!se.length||!se.some(be=>be?.type!=="text")||se.length===1&&se[0]?.type==="text"&&String(se[0].content??"")===Y)return null;const ke=Lo(se,Y,n,i);return ke.length?ke:null}function b(Y){m(),a.push(Y)}function C(Y){m();const ue=kh(Y);a.push(ue)}function A(Y){b(Y)}function T(Y,ue){u?(u.content+=Y,u.raw+=ue??Y):(u={type:"text",content:String(Y??""),raw:String(ue??Y??"")},a.push(u))}function N(Y,ue){if(!Y)return;const Z=Lo([{...ue,type:"text",content:Y,raw:Y}],Y,n,i);if(Z.length===1&&Z[0]?.type==="text"){const se=Z[0];T(String(se.content??""),String(se.raw??se.content??""));return}for(const se of Z)A(se)}function _(Y,ue){return String(Y.markup??"").startsWith(ue)}function w(Y){if(!u||Y.loading!==!0||Y.markup!=="\\(\\)")return;const ue=e[c-1];!ue||ue.type!=="text"||!_(ue,"\\(")||u.content.endsWith("(")&&(u.content=u.content.slice(0,-1),u.raw.endsWith("(")&&(u.raw=u.raw.slice(0,-1)),!u.content&&a[a.length-1]===u&&(a.pop(),u=null))}function M(Y){return Y.endsWith("](")?e[c+1]?.type==="link_open"&&e[c+1]?.markup==="linkify"&&e[c+2]?.type==="text"&&e[c+3]?.type==="link_close"&&e[c+4]?.type==="text"&&String(e[c+4]?.content??"").startsWith(")"):!1}function x(Y,ue,Z=G2(Y)){let se=Y;const ke=String(ue.content??"");return(Z&IC)!==0&&se.endsWith("\\")&&!_(ue,"\\\\")&&!ke.endsWith("\\\\")&&(se=se.slice(0,-1)),(Z&Ag)!==0&&se.endsWith("(")&&!_(ue,"\\(")&&!ke.endsWith("\\(")&&(se=se.slice(0,-1)),(Z&eH)!==0&&/\*+$/.test(se)&&!_(ue,"\\*")&&!ke.endsWith("\\*")&&(se=se.replace(/\*+$/,"")),se}for(;c=0;ie--){const Ee=a[ie];if(Ee.type!=="text")break;J=ie,fe=String(Ee.content??"")+fe}JJ==="href")?.[1],oe=String(we??"");if(t&&oe){const J=t.indexOf("](");if(J!==-1){const fe=t.indexOf(")",J+2);fe===-1?Z.loading=!0:Z.loading&&t.slice(J+2,fe).includes(oe)&&(Z.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(Z.href)&&j(Z,ue-1)||R(Z)||b(Z)}function P(Y){if(Y.markup!=="linkify")return!1;const{node:ue,nextIndex:Z}=Z2(e,c,i);return H(ue,Z)?(c=Z,!0):!1}function O(Y){m(),A(zme(Y)),c++}function R(Y){if(Y.type!=="link")return!1;const ue=a[a.length-1];if(!ue||ue.type!=="text")return!1;const Z=String(ue.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!Z)return!1;const se=Y,ke=String(se.href??""),be=String(se.text??""),we=String(Z[2]??""),oe=ke.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ke||!(be===ke||be===oe||Cge(be)))return!1;const J=String(Z[1]??"");return J?(ue.content=J,ue.raw=J):a.pop(),b({...Y,text:we,children:[{type:"text",content:we,raw:we}],raw:`[${we}](${ke}${se.title?` "${se.title}"`:""})`}),!0}function z(Y){if(Y.type!=="link")return!1;const ue=Y,Z=String(ue.href??"");return Z?H({href:Z,title:ue.title==null||ue.title===""?null:String(ue.title),loading:!!ue.loading},c+1):!1}function H(Y,ue){const Z=a[a.length-1];if(Z?.type!=="image"||Z.src||!Z.loading||!String(Z.raw??"").endsWith("]("))return!1;const se=e[ue],ke=String(se?.content??"");if(se?.type!=="text"||!ke.startsWith(")"))return!1;a.pop(),u=null;const be=String(Z.alt??"");b({type:"image",src:Y.href,alt:be,title:Y.title,raw:`![${be}](${Y.href}${Y.title?` "${Y.title}"`:""})`,loading:!!Y.loading});const we=ke.slice(1),oe=kh(se);return oe.content=we,oe.raw=we,h()[ue]=oe,!0}function j(Y,ue=c-1){if(Y.type!=="link")return!1;const Z=a[a.length-1],se=e[ue];if(!Z||Z.type!=="text"||se?.type!=="text")return!1;const ke=String(Z.content??""),be=String(se.content??"");if(!ke.endsWith("!")||!be.endsWith("!")||_(se,"\\!"))return!1;const we=ke.slice(0,-1);we?(Z.content=we,Z.raw=we,u=Z):(a.pop(),u=null);const oe=Y,J=String(oe.text??oe.children?.map(Ce=>String(Ce?.content??Ce?.raw??"")).join("")??""),fe=String(oe.href??""),ve=oe.title==null||oe.title===""?null:String(oe.title);return b({type:"image",src:fe,alt:J,title:ve,raw:`![${J}](${fe}${ve?` "${ve}"`:""})`,loading:!!oe.loading}),!0}function K(Y,ue="",Z=null){const se=String(Y.alt??Y.raw??"");return{type:"link",href:ue,title:Z,text:se,children:[Y],raw:`[${se}](${ue}${Z?` "${Z}"`:""})`,loading:!0}}function re(Y){const ue=Y.startsWith("![")?Y:`![${Y}`,Z=ue.slice(2),se=Z.indexOf("](");return{type:"image",src:"",alt:se===-1?Z.replace(/\]$/,""):Z.slice(0,se),title:null,raw:ue,loading:!0}}function q(Y){const ue=Y.indexOf("[![");if(ue===-1||typeof t=="string"&&e.length===1&&gge(t,ue,"["))return!1;const Z=Y.slice(0,ue);return Z&&T(Z,Z),b(K(re(Y.slice(ue+1)))),c++,!0}function Q(Y){if(i?.final)return!1;const ue=e[c-1];if(ue?.type!=="text"||!String(ue.content??"").endsWith("[")||_(ue,"\\["))return!1;const Z=a[a.length-1];if(Z?.type==="text"&&Z.content.endsWith("[")){const se=Z.content.slice(0,-1);se?(Z.content=se,Z.raw=se,u=Z):(a.pop(),u=null)}return b(K(JE(Y))),c++,!0}function ne(Y){if(Y.type!=="link")return!1;const ue=Y,Z=String(ue.raw??""),se=String(ue.text??"");if(!Z.startsWith("[![")&&!se.startsWith("!["))return!1;const ke=ue.title==null||ue.title===""?null:String(ue.title);return b(K({type:"image",src:String(ue.href??""),alt:se.replace(/^!\[/,"").replace(/\]$/,""),title:ke,raw:Z.startsWith("[![")?Z.slice(1):Z,loading:!0})),!0}function te(Y){if(!Y.startsWith("]("))return!1;const ue=e[c-2];if(ue?.type==="text"&&String(ue.content??"").endsWith("[")&&_(ue,"\\["))return!1;const Z=a[a.length-1];if(Z?.type!=="image"&&Z?.type!=="link")return!1;const se=Z,ke=Z?.type==="link"&&Array.isArray(se.children)&&se.children.length===1&&se.children[0]?.type==="image"?a.pop():null,be=ke?ke.children[0]:a.pop();if(!be||be.type!=="image")return!1;const we=e[c+1];let oe=String(ke?.href??""),J=ke?.title==null?null:String(ke.title),fe=!0;if(we?.type==="link_open"){const{node:Ce,nextIndex:le}=Z2(e,c+1,i);oe=Ce.href,J=Ce.title,fe=!0,c=le}else{if(oe=Y.slice(2),oe.includes('"')){const Ce=oe.split('"');oe=String(Ce[0]??"").trim(),J=Ce[1]==null?null:String(Ce[1]).trim()}c++}const ve=K(be,oe,J);return ve.loading=fe,b(ve),!0}function ge(){const Y=e[c-3];return e[c-2]?.type==="image"&&e[c-1]?.type==="text"&&String(e[c-1].content??"")==="]("&&Y?.type==="text"&&String(Y.content??"").endsWith("[")&&_(Y,"\\[")}function Ae(Y,ue){const Z=Y.indexOf("[");if(Z===-1)return!1;let se=Y.slice(0,Z);const ke=Y.indexOf("](",Z);if(ke!==-1){const be=e[c+2];let we=Y.slice(Z+1,ke);if(we.includes("[")){const ie=we.indexOf("[");se+=Y.slice(0,Z+ie+1);const Ee=Z+ie+1;we=Y.slice(Ee+1,ke)}const oe=e[c+1];if(Y.endsWith("](")&&oe?.type==="link_open"&&be){const ie=e[c+4];let Ee=4,Ke=!0;if(ie?.type==="text"){const at=String(ie.content??"");if(at.startsWith(")")){Ke=!1;const bt=at.slice(1);if(bt){const It=kh(ie);It.content=bt,It.raw=bt,h()[c+4]=It}else Ee++}else at==="."&&Ee++}N(se,ue);const Ue=String(be.content??"");return i?.validateLink&&!i.validateLink(Ue)?T(we,we):b({type:"link",href:Ue,title:null,text:we,children:[{type:"text",content:we,raw:we}],loading:Ke}),c+=Ee,!0}const J=Y.indexOf(")",ke),fe=J!==-1?Y.slice(ke+2,J):"",ve=J===-1;let Ce=se.match(/\*+$/);if(Ce&&(se=se.replace(/\*+$/,"")),N(se,ue),Ce||(Ce=we.match(/^\*+/)),!d&&Ce){const ie=Ce[0].length;we=we.replace(/^\*+/,"").replace(/\*+$/,"");const Ee=[];if(ie===1?Ee.push({type:"em_open",tag:"em",nesting:1}):ie===2?Ee.push({type:"strong_open",tag:"strong",nesting:1}):ie===3&&(Ee.push({type:"strong_open",tag:"strong",nesting:1}),Ee.push({type:"em_open",tag:"em",nesting:1})),Ee.push({type:"link",href:fe,title:null,text:we,children:[{type:"text",content:we,raw:we}],loading:ve}),ie===1){Ee.push({type:"em_close",tag:"em",nesting:-1});const{node:Ke}=K2(Ee,0,i);A(Ke)}else if(ie===2){Ee.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ke}=Xm(Ee,0,void 0,i);A(Ke)}else if(ie===3){Ee.push({type:"em_close",tag:"em",nesting:-1}),Ee.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ke}=Xm(Ee,0,void 0,i);A(Ke)}else{const{node:Ke}=K2(Ee,0,i);A(Ke)}}else i?.validateLink&&!i.validateLink(fe)?T(we,we):b({type:"link",href:fe,title:null,text:we,children:[{type:"text",content:we,raw:we}],loading:ve});const le=J!==-1?Y.slice(J+1):"";return le&&(E({type:"text",content:le,raw:le}),c--),c++,!0}return!1}function me(Y){const ue=Y.indexOf("![");if(ue===-1)return!1;const Z=Y.slice(0,ue);return Z&&!u?u={type:"text",content:Z,raw:Z}:Z&&u&&(u.content+=Z),u&&(a.push(u),u=null),b(re(Y.slice(ue))),c++,!0}function de(Y){if(!(Y?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ue=Y.slice(1).match(/[^\s\]]/);if(ue===null)return c++,!0;if(ue&&/x/i.test(ue[0])){const Z=ue[0]==="x"||ue[0]==="X";return b({type:"checkbox_input",checked:Z,raw:Z?"[x]":"[ ]"}),c++,!0}return!1}return a}function S7(e,t,n){const i=n?.__sourceLineMapper;if(!i)return{startLine:e,endLine:t};const o=i(e),s=t>e?i(t-1).endLine:i(t).startLine;return{startLine:o.startLine,endLine:Math.max(o.startLine,s)}}function tL(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let i=0;for(let o=0;oi&&e[o-1]!==` +`&&r++,{startLine:s,endLine:r}}function G0(e,t,n,i){const o=xge(e,t,n);return S7(o.startLine,o.endLine,i)}function Sge(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const i=Number(n[0]),o=Number(n[1]);return!Number.isFinite(i)||!Number.isFinite(o)?null:S7(i,o,t)}function Ii(e,t,n){if(!n?.includeSourceMap)return e;const i=Sge(t,n);if(!i)return e;if(e.sourceMap=i,e.type==="code_block"){const o=e;o.startLine=i.startLine,o.endLine=i.endLine}return e}function _ge(e,t,n,i){if(!i?.includeSourceMap)return e;const o=t?.map;if(!Array.isArray(o)||o.length<2)return e;const s=Number(o[0]),r=Number(o[1]),l=Number(n);return!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=S7(s,Math.max(r,l),i)),e}function Mge(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??""),r=s.replace(/[ \t\r\n]+$/g,"");if(r===s)break;if(r){o.content=r;break}i.pop();continue}break}}function Ige(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(s)){i.pop();continue}const r=s.replace(/[ \t\r\n\d.)]+$/g,"");r!==s&&(r?o.content=r:i.pop())}break}}function Tge(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function cm(e,t,n){const i=e[t],o=[],s=lf(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&Ii(c,e[r],n),o.push(c),r=u+1}else r+=1;const l={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const a=i.attrs.find(u=>u[0]==="start");if(a){const u=Number(a[1]);return Number.isFinite(u)&&u!==0?u:1}}})(),items:o,raw:o.map(a=>a.raw).join(` +`)};return n?.includeSourceMap&&Ii(l,i,n),[l,r+1]}function Ege(e,t,n,i){const o=String(n[1]??"note"),s=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=lf(i,!0);let a=t+1;for(;au.raw).join(` +`)} +:::`},a+1]}const Lge=new Set(["warning","info","note","tip","danger","caution"]);function Nge(e){let t=0;for(;t=0;g--){const v=f[g];if(v.type==="text"&&/:+/.test(v.content)){h=g;break}}const m={type:"paragraph",children:Lo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&Ii(m,e[u],n),l.push(m),a.remember(m.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[d,f]=cm(e,u,a.options());n?.includeSourceMap&&Ii(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else if(e[u].type==="blockquote_open"){const[d,f]=dm(e,u,a.options());n?.includeSourceMap&&Ii(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else{const d=Zb(e,u,a.options());d?(l.push(d[0]),a.remember(d[0].raw),u=d[1]):u++}return[{type:"admonition",kind:o,title:s,children:l,raw:`:::${o} ${s} +${l.map(d=>d.raw).join(` +`)} +:::`},u+1]}const Fge=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function Bge(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const o=Fge.exec(String(i.info??""));return o?Ege(e,t,o,n):null}const _7={parseContainer:(e,t,n)=>Dge(e,t,n),matchAdmonition:Bge};function dm(e,t,n){const i=[],o=lf(n,!0);let s=t+1;for(;sl.raw).join(` +`)};return n?.includeSourceMap&&Ii(r,e[t],n),[r,s+1]}function Rge(e){if(e.info?.startsWith("diff"))return A7(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let i=t;n?.[1]&&(i=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:i,raw:i,loading:!o}}function Oge(e,t,n){const i=[];let o=t+1,s=[],r=[];const l=lf(n,!0);for(;ou.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a0&&(i.push({type:"definition_item",term:s,definition:r,raw:`${s.map(u=>u.raw).join("")}: ${r.map(u=>u.raw).join(` +`)}`}),s=[]),o=a+1}else o++;return[{type:"definition_list",items:i,raw:i.map(a=>a.raw).join(` +`)},o+1]}function $ge(e,t,n){const i=e[t].meta??{},o=String(i?.label??"0"),s=[],r=lf(n,!0);let l=t+1;for(;la.raw).join(` +`)}`},l+1]}function Pge(e,t,n){const i=e[t],o=i.attrs,s=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(c=>Array.isArray(c)&&c.length>=1&&c[0]).map(([c,d])=>[String(c),d==null||d===""?!0:String(d)])):void 0,r=String(i.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],u=String(a.content??"");return{type:"heading",level:l,text:u,...s?{attrs:s}:{},children:Lo(a.children||[],u,void 0,n),raw:u}}function zge(e,t,n){const i=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${i}(?=\s|>|/)`,"i"),s=new RegExp(String.raw`^<\s*\/\s*${i}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l$/.test(d)||r++,l=a+c+1;continue}l=a+1}return-1}function lH(e){const t=String(e.content??"");if(/^\s*");else if(a)a=!v.includes(">");else if(u)u=!v.includes("?>");else if(v.startsWith("");else if(v.startsWith("");else if(v.startsWith("");else{const y=o(v);if(y)if(y.closing){for(let b=r.length-1;b>=0;b--)if(r[b]===y.tag){r.length=b;break}}else y.selfClosing||s(y.after,y.tag)||r.push(y.tag)}}if(d===-1||d>=t)break;c=d+1}return l||a||u||r.length>0}function S0e(e,t,n){if(!n?.length)return!1;const i=new Set(Yh(n));if(!i.size)return!1;const o=c=>{const d=c.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||c==="_"||c==="-"||c===":"},s=c=>c===" "||c===" ",r=c=>{if(c[0]!=="<")return null;let d=1;for(;d"&&g!=="/")return null;const v=c.indexOf(">",d);if(v===-1)return null;let y=v-1;for(;y>=0&&s(c[y]);)y--;return{closing:f,tag:m,selfClosing:!f&&c[y]==="/",after:c.slice(v+1)}},l=(c,d)=>{const f=c.toLowerCase();let h=0;for(;h")return!0}}return!1},a=[];let u=0;for(;u=t?t:c,f=e.slice(u,d),h=f.endsWith("\r")?f.slice(0,-1):f,m=fm(h);if(m){const g=r(h.slice(m.index));if(g)if(g.closing){for(let v=a.length-1;v>=0;v--)if(a[v]===g.tag){a.length=v;break}}else g.selfClosing||l(g.after,g.tag)||a.push(g.tag)}if(c===-1||c>=t)break;u=c+1}return a.length>0}function _0e(e,t){const n=n0e.exec(e);if(!n)return null;const i=n[1]??"",o=n.index+i.length,s=e.indexOf(` +`,o),r=e.slice(o,s===-1?e.length:s);return!fm(r.endsWith("\r")?r.slice(0,-1):r)||vH(e,o)||x0e(e,o)||S0e(e,o,t)?null:`${e.slice(0,n.index)}${i}`}function D7(e,t,n){let i=t;for(;ii&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,s+=2;continue}s++;continue}if(t.inDollarMath){if(e.startsWith("$$",s)&&!Au(e,l)){i!=null&&o&&n+s+2>i&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,s+=2;continue}s++;continue}if(e[s]==="`"&&!Au(e,l)){const a=D7(e,s,"`"),u=yH(e,s+a,a);if(u===-1)break;s=u+a;continue}if(e.startsWith("\\[",s)&&!Au(e,l)){t.inMath=!0,t.mathOpenOffset=n+s,s+=2;continue}if(e.startsWith("$$",s)&&!Au(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+s,s+=2;continue}s++}return r}function M0e(e,t){if(!w7(t))return e;const n=t,i=rL.get(n),o=i?.source===e?i.state:i&&e.startsWith(i.source)?kH(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:Qb(e).state;rL.set(n,{source:e,state:o});const{context:s}=o,r=s.inMath?s.mathOpenOffset:s.inDollarMath?s.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(` +`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const u=l.trim(),c=/^(?:[a-z]|pi)$/i.test(u);return fd(l)&&!c?e:e.slice(0,r)}function I0e(e,t,n,i,o){const s=T7(e),r=E7(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&L7(e)==null&&A8(t),t.inFence&&t.fenceInList&&e.trim()&&s.column=t.fenceLen&&/^\s*$/.test(l.rest)&&A8(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&s.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return cL(e,t,n,i,o)}else return cL(e,t,n,i,o);return!1}function Qb(e,t=k0e(),n=null,i=!1,o=0){const s=i0(t);let r=i0(t),l="",a=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,h=e.slice(u,f);I0e(h,s,o+u,n,i)&&(a=!0),d?(r=i0(s),l=""):l=h,u=d?c+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:s,lineBuffer:l}}}function kH(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:i0(e.committedContext),context:i0(e.context),lineBuffer:e.lineBuffer+t}}:Qb(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function T0e(e,t){if(!w7(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,o=Gb.get(i);if(o?.source===t)return;const s=o?t.startsWith(o.source):!1,r=s&&o?t.slice(o.source.length):"",l=s&&o?kH(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):Qb(t),a=l.state,u=s&&o?l.closedOpenMath:!1;if(o&&s&&o.key===null&&o.pendingCandidate===!1&&!u&&!A0e(o.source,r)&&!w0e(t)){o.source=t,o.explicitBracketMath=a;return}const c=cme(t);(o&&(o&&!s||o.key!==c||u)||!o&&c)&&n.reset(),b0e(e,t,c,a)}function E0e(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function bH(e,t){const n=e?.map,i=t?.map;return n===i?!0:!Array.isArray(n)||!Array.isArray(i)?!1:n.length===i.length&&n.every((o,s)=>o===i[s])}function L0e(e,t){const n=e?.attrs,i=t?.attrs;if(n===i)return!0;if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length)return!1;for(let o=0;o":""}function pL(e){return{type:"paragraph",children:e,raw:e.map(B0e).join("")}}function mL(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function gL(e,t){if(e.type!=="paragraph")return null;const n=e.children,i=Array.isArray(n)?n:[];if(i.length===0)return null;const o=p0e(t);if(!o?.size)return null;let s=-1;for(let c=0;ch?.type==="hardbreak")){s=c;break}}if(s===-1)return null;const r=i.slice(0,s),l=i[s];if(!l)return null;const a=[];r.length&&a.push(pL(r)),a.push(l);const u=i.slice(s+1);return u.length&&a.push(pL(u)),a}function R0e(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),i=/<\/html>\s*$/i.test(t);return!n||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function o0(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function O0e(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Ga(t)}\s*>\s*$`,"i").test(n)}const S8=new Set(["iframe","script","style","textarea","title"]);function Rv(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=f=>{if(e.startsWith("",f+4);return{closing:!1,end:C===-1?e.length:C+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:C===-1?e.length:C+3,selfClosing:!1,tag:""}}const h=qo(e.slice(f));if(h===-1)return null;const m=f+h+1,g=e.slice(f,m);if(/^<\s*[!?]/.test(g))return{closing:!1,end:m,selfClosing:!1,tag:""};let v=g.slice(1).trimStart();const y=v.startsWith("/");y&&(v=v.slice(1).trimStart());const b=v.match(/^([A-Z][\w:-]*)/i);return b?.[1]?{closing:y,end:m,selfClosing:/\/\s*>$/.test(g),tag:b[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},s=(f,h)=>{const m=new RegExp(String.raw`<\s*\/\s*${Ga(f)}(?=\s|>)`,"gi");m.lastIndex=h;const g=m.exec(e);if(!g||g.index==null)return null;const v=o(g.index);return v?{start:g.index,end:v.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a$/.test(u))return{raw:u,start:r,end:l+1,closed:!0};if(S8.has(i)){const f=s(i,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let c=1,d=l+1;for(;d]*$/,"")} +`}function vL(e){return e.replace(/\r\n/g,` +`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function z0e(e,t,n){return n?e.includes(n,t)?!0:vL(e.slice(Math.max(0,t))).includes(vL(n)):!1}function j0e(e,t){let n=Math.max(0,t);for(;n)`,"gi");let i=-1,o;for(;(o=n.exec(e))!==null;)i=o.index;return i}function CH(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const W0e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),q0e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function U0e(e){return/\n\s*\n/.test(e)||q0e.test(e)}function V0e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>W0e.has(String(i?.type??"").toLowerCase()))||t.some(i=>{if(i?.type!=="html_block")return!1;const o=i;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!U0e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function K0e(e){const t=[];let n=0;for(;n=e.length)break;const i=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!i?.[1])return null;const o=Rv(e,i[1],n);if(!o||o.start!==n)return null;t.push(o.raw),n=o.end}return t.length>1?t:null}function Z0e(e,t,n,i){const o=n.customHtmlTags?.join("\0")??"",s=t,r=sL.get(s),l=r&&r.final===i&&r.customHtmlTags===o&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((u,c)=>l&&r.blocks[c]===u?r.children[c]:y1(u,t,n));return sL.set(s,{blocks:e,children:a,customHtmlTags:o,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function G0e(e,t,n,i){return e.map(o=>{if(o?.type!=="html_block")return o;const s=o,r=String(s.tag??"").toLowerCase();if(!r||r==="details"||wj.has(r)||Array.isArray(s.children))return o;const l=String(o.raw??s.content??"");if(!l)return o;const a=qo(l);if(a===-1)return o;const u=Rv(l,r,0),c=u?.closeStart??-1,d=u?.closed===!0&&c>=a+1,f=d?l.slice(a+1,c):l.slice(a+1);if(!f.trim())return o;const h=CH(n,i),m=d?null:K0e(f),g=m?Z0e(m,t,h,i):y1(f,t,h);return V0e(f,g)?{...o,children:g}:o})}function Q0e(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function y1(e,t,n){return e.trim()?xH(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function Y0e(e,t,n){const i=y1(e,t,n),o=i[0];return i.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:i}function J0e(e,t,n){const i=lH({content:e}),o=qo(e),s=wH(e,"summary");if(o!==-1&&s!==-1&&s>=o+1){const r=Y0e(e.slice(o+1,s),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function X0e(e,t,n){const i=qo(e);if(i===-1)return[];const o=e.slice(i+1);if(!o.trim())return[];const s=Rv(o,"summary",0);if(!s)return y1(o,t,n);const r=o.slice(0,s.start),l=o.slice(s.end);return[...y1(r,t,n),J0e(s.raw,t,n),...y1(l,t,n)]}function AH(e,t,n,i,o,s=0){const r=[];let l=s;for(let a=0;a{const j=wH(f,"details");return j!==-1?f.slice(0,j):f})():f,[C]=AH(y?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,i,o,h+f.length),A=X0e(b,n,CH(i,o)),T=g===-1?"":String(e[g].raw??o0(e[g])??""),N=y||g!==-1&&v?.closed===!0,_=T.replace(/[\t\r\n ]+$/,""),w=N?(()=>{const j=(v?.raw??"").lastIndexOf(_);return j===-1?t.length:h+j})():t.length,M=qo(f),x=y&&M!==-1?h+M+1:h+f.length,E=t.slice(x,w===-1?t.length:w),I=n.parse(E,{__markstreamFinal:o}),F=n.renderer.render(I,n.options,{__markstreamFinal:o}),W=w+_.length,P=N?Math.max(w+T.length,j0e(t,W)):t.length,O=N?t.slice(w,P):T,R=N?t.slice(h,P):t.slice(h),z=y&&M!==-1?f.slice(0,M+1):f,H={...u,tag:"details",attrs:Kb(f.slice(0,M+1)),raw:R,content:`${z}${F}${O}`,children:[...A,...C],loading:!o&&!N};if(i.includeSourceMap&&(H.sourceMap=G0(t,h,N?P:t.length,i)),r.push(H),l=N?P:t.length,g===-1&&!y)break;g!==-1&&(a=g)}return[r,l]}function eve(e,t,n,i){if(!n)return e;const o=e.slice();let s=0;for(let r=0;r=d.start&&M.end<=d.end){o.splice(N,1);continue}break}T=w+_.length,o.splice(N,1)}}return o}function tve(e){const t=l=>l===" "||l===" "||l===` +`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a{const v=g.charCodeAt(0);return v>=65&&v<=90||v>=97&&v<=122},c=g=>{const v=g.charCodeAt(0);return v>=48&&v<=57},d=g=>g==="!"||u(g),f=g=>u(g)||c(g)||g===":"||g==="-",h=g=>u(g)||c(g)||g==="_"||g==="."||g===":"||g==="-",m=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a=l.length)return!0;if(l[a]==="/"){for(a++;a=l.length}if(!h(l[a]))return!1;for(a++;a=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a=l.length)return!0;a++}else{for(;a"||v==='"'||v==="'"||v==="`")break;a++}if(a>=l.length)return!0}}}return!0},i=(l,a)=>vH(l,a),o=String(e??""),s=o.lastIndexOf("<");if(s===-1||i(o,s))return o;if(s>0){const l=o[s-1],a=l===" "||l===" "||l===` +`||l==="\r",u=o[s-2];if(!a&&!((l==="n"||l==="r")&&u==="\\"))return o}const r=o.slice(s);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===` +`||r[1]==="\r")||!n(r)?o:o.slice(0,s)}function kL(e,t){if(e===t)return;const n=e.split(/\r?\n/),i=t.split(/\r?\n/),o=[];let s=0;for(let r=0;r{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(lString(m??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const i=m=>m===" "||m===" ",o=m=>{const g=m.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||m==="_"||m==="-"||m===":"},s=m=>{if(!m)return!1;if(m[0]===" ")return!0;let g=0;for(let v=0;v=4)return!0;continue}if(y===" ")return!0;break}return!1},r=m=>{let g=!1,v=!1;for(let y=0;y")return y}return-1},l=m=>{let g=0;for(;g{if(s(m))return-1;const v=m.replace(/^[ \t]+/,"");if(!v||v.startsWith(">")||v.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(v))return-1;let y=!1,b=0;for(;b=T.length){y=!0,b++;continue}const _=T[N];if(_==="!"||_==="?"){y=!0,b+=A+1;continue}if(_==="/"){y=!0,b+=A+1;continue}const w=N;for(;N"&&x!=="/"){y=!0,b++;continue}const E=new RegExp(String.raw`<\s*\/\s*${M}\s*>`,"i"),I=/\/\s*>$/.test(T),F=E.test(m.slice(b+A+1)),W=E.test(e.slice(g+b+A+1)),P=/[\r\n]/.test(e.slice(g+b+A+1));if(y&&n.has(M)&&!I&&!F&&(W||P))return b;y=!0,b+=A+1}return-1};let u=!1,c="",d=0,f="",h=0;for(;hh&&e[m-1]==="\r",y=g?v?m-1:m:e.length,b=e.slice(h,y),C=g?v?`\r +`:` +`:"",A=l(b);let T=b;if(!u&&!A){const N=a(b,h);if(N!==-1){const _=C||` +`;T=`${b.slice(0,N).replace(/[ \t]+$/,"")}${_}${_}${b.slice(N).replace(/^[ \t]+/,"")}`}}f+=T,f+=C,A&&(u?A.markerChar===c&&A.markerLen>=d&&/^\s*$/.test(A.rest)&&(u=!1,c="",d=0):(u=!0,c=A.markerChar,d=A.markerLen)),h=g?m+1:e.length}return f}function ive(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const i=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},s=d=>{let f=0;for(;f{let f=!1,h=!1;for(let m=0;m")return m}return-1},l=(d,f,h)=>{const m=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let v=g+1;for(;v=d.length||d[v]!=="/"){g=d.indexOf("<",g+1);continue}for(v++;vd.length){g=d.indexOf("<",g+1);continue}let y=!0;for(let C=0;C="A"&&A<="Z"?String.fromCharCode(A.charCodeAt(0)+32):A)!==m[C]){y=!1;break}}if(!y){g=d.indexOf("<",g+1);continue}let b=v+m.length;if(b")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const h=f;for(;fc&&e[d-1]==="\r",h=f?d-1:d,m=e.slice(c,h);u+=a(m),u+=f?`\r +`:` +`,c=d+1}return u}function ove(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const i=f=>f===" "||f===" ",o=f=>{let h=0,m=!1,g=0;for(;h=f.length||f[h]!==">")break;for(m=!0,h++;h{let h=0;for(;hnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",u=0,c="",d=0;for(;dd&&e[f-1]==="\r",g=h?m?f-1:f:e.length,v=e.slice(d,g),y=h?m?`\r +`:` +`:"",b=o(v),C=b?.prefix??"",A=b?.content??v,T=s(A);T&&(l?T.markerChar===a&&T.markerLen>=u&&/^\s*$/.test(T.rest)&&(l=!1,a="",u=0):(l=!0,a=T.markerChar,u=T.markerLen));let N=A;if(!l&&N.includes("{if(E.replace(/^[\t ]+/,"").startsWith("|"))return w;const I=E.slice(0,x).replace(/^[\t ]+/,"");if(I.length>0){const F=M.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",W=I.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!F||!W||F!==W)return w}return`${M} + +`});if(C){const _=C+N.split(` +`).join(` +${C}`);c+=_}else c+=N;c+=y,d=h?f+1:e.length}return c}function sve(e,t){if(!e||!t.length)return e;const n=new Set(t.map(I=>String(I??"").toLowerCase()));if(!n.size)return e;const i=I=>I===" "||I===" ",o=I=>{if(!I)return!1;if(I[0]===" ")return!0;let F=0;for(let W=0;W=4)return!0;continue}if(P===" ")return!0;break}return!1},s=I=>{const F=I.charCodeAt(0);return F>=65&&F<=90||F>=97&&F<=122||F>=48&&F<=57||I==="_"||I==="-"||I===":"},r=I=>{let F=0;for(;F{let F=0,W=!1,P=0;for(;F=I.length||I[F]!==">")break;for(W=!0,F++;Fr(I).startsWith("<"),u=I=>{for(let F=0;F{if(o(I))return"";const F=r(I);if(!F.startsWith("<"))return"";let W=1;for(;W=F.length||F[W]==="/"||F[W]==="!"||F[W]==="?")return"";const P=W;for(;W"&&R!=="/"?"":O},d=I=>{if(o(I))return null;const F=r(I);if(!F.startsWith("<"))return null;let W=1;for(;W=F.length)return null;const P=F[W]==="/";if(P)for(W++;W"&&H!=="/")return null;if(P)return{type:"close",name:z};if(/\/\s*>\s*$/.test(F))return{type:"open",name:z,complete:!0};const j=F.indexOf(">",W);if(j!==-1){const K=F.slice(j+1);if(new RegExp(`<\\s*\\/\\s*${z}\\s*>`,"i").test(K))return{type:"open",name:z,complete:!0}}return{type:"open",name:z,complete:!1}},f=I=>{if(o(I))return null;const F=r(I).replace(/[ \t]+$/,"");if(!F.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(F))return null;const W=F.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(W?.[1])return W[1].toLowerCase();const P=F.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!P?.[1]||!P[2])return null;const O=P[1].toLowerCase();return O===P[2].toLowerCase()?O:null};let h=!1,m="",g=0;const v=I=>{let F=0;for(;Fv(I),b=I=>{const F=r(I);return F?o(I)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(F):!1},C=(I,F,W)=>{let P=I,O=0;for(;PP&&e[R-1]==="\r",j=z?H?R-1:R:e.length,K=e.slice(P,j),re=l(K),q=re?.key??"";if(O>0&&F&&q!==F)break;const Q=re?.content??K,ne=d(Q);if(ne?.name===W){if(ne.type==="open")ne.complete||O++;else if(O>0&&(O--,O===0))return!1}else if(O>0&&(u(Q)||b(Q)))return!0;if(z)P=R+1;else break}return!1};let A="",T=0,N=!0,_=!1,w=!1,M=` +`;const x=[];let E="";for(;TT&&e[I-1]==="\r",P=F?W?I-1:I:e.length,O=e.slice(T,P),R=F?W?`\r +`:` +`:"",z=l(O),H=z?.key??"",j=z?.content??O,K=y(j);K&&(h?K.markerChar===m&&K.markerLen>=g&&/^\s*$/.test(K.rest)&&(h=!1,m="",g=0):(h=!0,m=K.markerChar,g=K.markerLen));const re=x.length>0;if(!h&&!re){const Q=c(j),ne=!!Q&&!N&&_&&w&&C(T,H,Q);Q&&!N&&(!_||ne)&&(H&&E&&H===E?A+=`${H}${M}`:H||(A+=M))}if(A+=O,A+=R,R&&(M=R),!h){const Q=d(j);if(Q){if(Q.type==="open")Q.complete||x.push(Q.name);else for(let ne=x.length-1;ne>=0;ne--)if(x[ne]===Q.name){x.length=ne;break}}}const q=u(j);N=q,_=!q&&a(j),w=!q&&!!f(j),E=H,T=F?I+1:e.length}return A}function rve(e){let t=!1,n="",i=0,o=!1,s=!1,r=!1,l=0;const a=(c,d)=>{const f=N7(c);if(f){t?f.markerChar===n&&f.markerLen>=i&&/^\s*$/.test(f.rest)&&(t=!1,n="",i=0):(t=!0,n=f.markerChar,i=f.markerLen);return}if(t)return;let h=0;for(;h{for(;l=c?c:d,h=f>l&&e[f-1]==="\r"?f-1:f;if(a(e.slice(l,h)),d===-1||d>=c){l=c;break}r=!1,l=d+1}},inMath:()=>o||s||r}}function _8(e,t,n,i){let o=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const s=rve(o);if(o=o.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(r,l,a,u)=>{s.scanTo(u+1);const c=s.inMath();return s.scanTo(u+r.length),c?`${l}\\n${a}`:r}),t||(o.endsWith("- *")&&(o=o.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*-\s*$/,r=>r.startsWith(` +`)?` +`:""):/(?:^|\n)\s*--\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*--\s*$/,r=>r.startsWith(` +`)?` +`:""):/(?:^|\n)\s*>\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*>\s*$/,r=>r.startsWith(` +`)?` +`:""):/\n\s*[*+]\s*$/.test(o)?o=o.replace(/\n\s*[*+]\s*$/,` +`):/(?:^|\n)\s*\d+\s*$/.test(o)?/^\d+$/.test(o.trim())||(o=o.replace(/(?:^|\n)\s*\d+\s*$/,r=>r.startsWith(` +`)?` +`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(o)?o=o.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(r,l,a)=>`${l}${a.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*\d+[.)]\s*$/,r=>r.startsWith(` +`)?` +`:""):/\n[[(]\n*$/.test(o)&&(o=o.replace(/(\n\[|\n\()+\n*$/g,` +`)),o=_0e(o,i.customHtmlTags)??o),i.customHtmlTags?.length&&o.includes("<")){const r=Yh(i.customHtmlTags);if(r.length&&(o=nve(o,r),o=ive(o,r),o=sve(o,r),o=ove(o,r),o.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");o=o.replace(a,"$1$2$2")}}return t||(o=tve(o)),o}function lve(e,t,n,i){const o=e,s=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=LC.get(o);let l;if(!n&&!i.customHtmlTags?.length&&r&&r.mode===s&&t.length>=r.source.length&&t.startsWith(r.source)){const a=Math.max(0,r.source.length-i0e-o0e),u=_8(t.slice(a),n,e,i),c=r.source.length-a;l=u.length>=c&&u.slice(0,c)===r.safeMarkdown.slice(-c)?r.safeMarkdown.slice(0,r.safeMarkdown.length-c)+u:_8(t,n,e,i)}else l=_8(t,n,e,i);return n||(l=M0e(l,e)),LC.set(o,{source:t,safeMarkdown:l,mode:s}),l}function xH(e,t,n={}){const i=dH(n),o=i?Ba():0,s=!!n.final,r=(e??"").toString();v0e(t,n)&&(t.stream.reset(),y0e(t),LC.delete(t));const l=lve(t,r,s,n);i&&_d(i,"safeMarkdownMs",Ba()-o);const a=R0e(l);if(a){if(n.includeSourceMap){const T={...n,__sourceLineMapper:kL(r,l)};a[0].sourceMap=G0(l,0,l.length,T)}const C=n.preTransformTokens,A=n.postTransformTokens;if(I7(t,n)||typeof C=="function"||typeof A=="function"){const T=hL(t,l,{__markstreamFinal:s},n),N=typeof C=="function"&&C(T)||T;typeof A=="function"&&A(N)}return lL(a,n,i,o)}const u=i?Ba():0,c=hL(t,l,{__markstreamFinal:s},n);if(i&&_d(i,"tokenizeMs",Ba()-u),!c||!Array.isArray(c))return lL([],n,i,o);const d=n.preTransformTokens,f=n.postTransformTokens;let h=c;d&&typeof d=="function"&&(h=d(h)||h);const m=t,g=typeof m.validateLink=="function"&&m.__markstreamOriginalValidateLink&&m.validateLink!==m.__markstreamOriginalValidateLink?m.validateLink:void 0,v=n.validateLink??g??m.options?.validateLink??(typeof m.validateLink=="function"?m.validateLink:void 0),y={...n,validateLink:v,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?kL(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let b=h0e(t,l,h,y,i);if(f&&typeof f=="function"){const C=f(h);if(Array.isArray(C)){const A=C[0],T=A?.type;A&&typeof T=="string"?b=Pp(C,{...y,__customHtmlBlockCursor:0},i):b=C}}if(Q0e(b)){const C=i?Ba():0;b=eve(b,s,l,y),b=AH(b,l,t,y,s)[0],b=G0e(b,t,y,s),i&&_d(i,"htmlBlockPassesMs",Ba()-C)}if(s){const C=new WeakSet,A=T=>{if(!T||typeof T!="object"||C.has(T))return;if(C.add(T),Array.isArray(T)){for(const _ of T)A(_);return}const N=T;N.type==="html_block"&&N.loading===!0&&(N.loading=!1);for(const _ of Object.values(N))A(_)};A(b)}return b=hH(b,n),n.debug&&console.log("Parsed Markdown Tree Structure:",b),fH(b,i,o)}function bL(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=lf(t),o=t?.__linkifyDemotionSeed;if(Array.isArray(o)&&o.length)for(const l of o)i.remember(String(l??""));const s=t?.includeSourceMap===!0;let r=0;for(;rd.type==="html_block")){if(s)for(const d of c)Ii(d,a,t);for(const d of c)cu(d,a,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};s&&Ii(d,a,t);const f=gL(d,t);if(f){s&&mL(f,d);for(const h of f)cu(h,a,t);n.push(...f)}else cu(d,a,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const ave=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,s0=/\d/u,uve=/[,.!?;:,。;、!?:]/u,cve=/\d\p{Script=Han}{1,3}$/u;function dve(e){return e.pos>0&&e.pos+1{const u=l,c=u.posMax,d=u.pos;if(u.src.charCodeAt(d)!==r||a||s.refuseDigitRange&&dve(u))return!1;u.pos=d+1;let f=!1;for(;u.pos]|$)/i,mve=new Set([...Dv,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),gve=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function wL(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function vve(e){return typeof e=="string"?e:e==null?"":String(e)}function SH(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function hd(e){return vve(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function _H(e){return hd(e).replace(/`/g,"`")}function Jb(e){return String(e??"").trim().toLowerCase()}function F7(e,t="safe"){const n=Jb(e);return n?t==="escape"?!0:t==="trusted"?Dv.has(n):!gve.has(n):!1}function MH(e,t="safe"){const n=Jb(e);return n?t==="escape"?!0:t==="trusted"?Dv.has(n):mve.has(n):!1}function CL(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${_H(i)}"`).join("")}function IH(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(pve);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function yve(e,t){const n=e.split(",").map(i=>i.trim()).filter(Boolean);return n.length===0?!1:n.some(i=>{const o=i.split(/\s+/,1)[0]??"";return!o||yh(o,{tagName:t,attrName:"srcset"})})}function TH(e,t,n,i){return epe.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?yve(t,i):!!(tpe.has(e)&&t&&yh(t,{tagName:i,attrName:e}))}function Qf(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function EH(e,t,n,i=!1){if(t!=="safe"||Jb(n)!=="a")return e;const o=Qf(e,"href");if(i&&(!o||!e[o])){const a=Qf(e,"target"),u=Qf(e,"rel");return a&&delete e[a],u&&delete e[u],e}const s=Qf(e,"target");if((s?String(e[s]).trim():"").toLowerCase()!=="_blank")return e;const r=Qf(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function AL(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!SH(r)||TH(l,s,t,n)||(i[r]=s)}return EH(i,t,n,!!Qf(e,"href"))}function LH(e,t){const n=e.toLowerCase();return bj.has(n)?!1:wL(t,n)||wL(t,e)}function B7(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!SH(r)||TH(l,s,t,n)||(i[r]=s)}return EH(i,t,n,!!Qf(e,"href"))}function r0(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,i]of e)n&&(t[String(n)]=i==null?"":String(i));return t}function Yy(e,t="safe",n){const i=B7(r0(e),t,n),o=Object.entries(i).map(([s,r])=>[s,r]);return o.length>0?o:void 0}function kve(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const i=Number(e);if(e!==""&&!Number.isNaN(i))return i}return e}function bve(e){const t={};for(const[n,i]of Object.entries(e))t[n]=kve(i,n);return t}function M8(e){return e.trim().length>0}function NH(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const i=e.indexOf("<",n);if(i===-1){if(nn){const r=e.slice(n,i);M8(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",i+1)){const r=e.indexOf("]]>",i);if(r!==-1){t.push({type:"text",content:e.slice(i,r+3)}),n=r+3;continue}break}if(e.startsWith("!",i+1)){const r=e.indexOf(">",i);if(r!==-1){n=r+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=IH(e.slice(i+1,o));if(!s){const r=e.slice(i,o+1);M8(r)&&t.push({type:"text",content:r}),n=o+1;continue}if(s.isClosing)t.push({type:"tag_close",tagName:s.tagName});else{const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||jd.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r})}n=o+1}return t}function wve(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const i=e.indexOf("<",n);if(i===-1){nn&&t.push({type:"text",content:e.slice(n,i)}),e.startsWith("![CDATA[",i+1)){const l=e.indexOf("]]>",i);if(l!==-1){t.push({type:"text",content:e.slice(i,l+3)}),n=l+3;continue}break}if(e.startsWith("!",i+1)){const l=e.indexOf(">",i);if(l!==-1){n=l+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=IH(e.slice(i+1,o));if(!s){t.push({type:"text",content:e.slice(i,o+1)}),n=o+1;continue}if(s.isClosing){t.push({type:"tag_close",tagName:s.tagName}),n=o+1;continue}const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||jd.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r}),n=o+1}return t}function Cve(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${hd(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,o])=>o===""?` ${hd(i)}`:` ${hd(i)}="${_H(o)}"`).join("");return e.type==="self_closing"?`<${hd(t)}${n} />`:`<${hd(t)}${n}>`}function Ave(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of NH(e))if((n.type==="tag_open"||n.type==="self_closing")&&LH(n.tagName??"",t))return!0;return!1}function k1(e,t="safe"){if(!e)return"";if(t==="escape")return hd(e);const n=wve(e),i=[],o=[],s=[];for(const r of n){if(r.type==="text"){s.length===0&&o.push(hd(r.content??""));continue}const l=Jb(r.tagName);if(!l)continue;if(MH(l,t)){r.type==="tag_open"?s.push(l):r.type==="tag_close"&&s[s.length-1]===l&&s.pop();continue}if(s.length>0)continue;if(t==="safe"&&F7(l,t)){o.push(Cve(r));continue}if(r.type==="self_closing"){o.push(`<${l}${CL(AL(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${CL(AL(r.attrs??{},t,l))}>`),jd.has(l)||i.push(l);continue}const a=i.lastIndexOf(l);if(a===-1)continue;for(;i.length>a+1;){const c=i.pop();c&&o.push(``)}const u=i.pop();u&&o.push(``)}for(;i.length>0;){const r=i.pop();r&&o.push(``)}return o.join("")}const xve=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],xL="http://www.w3.org/2000/svg",Sve=new Set(["script","style","iframe","object","embed","link","meta"]),_ve=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),Mve=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Ive=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Tve=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Eve(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Lve(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Nve(e){const t=e.nodeName.toLowerCase();return t==="use"?Eve(e):t==="image"?Lve(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Tve.has(t)}function Dve(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function Fve(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),s=String(n??"").trim();return s?(i==="use"||i==="marker"||i==="clippath"||i==="mask")&&(o==="href"||o==="xlink:href")?s.startsWith("#")?s:"":i==="a"&&(o==="href"||o==="xlink:href")?yh(s,{tagName:"a",attrName:"href"})?"":s:i==="image"&&(o==="href"||o==="xlink:href"||o==="src")?yh(s,{tagName:"img",attrName:"src"})?"":s:o==="href"||o==="xlink:href"?s.startsWith("#")?s:"":yh(s,{tagName:i,attrName:o})?"":s:""}function Bve(e,t){let n=t+4;for(;n{const i=n.trim();if(/^[0-9a-f]+$/i.test(i)){const o=Number.parseInt(i,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function FH(e){const t=DH(e),n=t.toLowerCase();let i=0;for(;in.test(t))||FH(t)}function Rve(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function Y2(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function BH(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,i=n.tagName.toLowerCase();if(!Sve.has(i)){if(i==="br"){t.push(` +`);return}for(const o of Array.from(n.childNodes))BH(o,t)}}function Ove(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];BH(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const o=Y2(t.getAttribute("width")),s=Y2(t.getAttribute("height")),r=Y2(t.getAttribute("x")),l=Y2(t.getAttribute("y")),a=e.ownerDocument.createElementNS(xL,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+s/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const u=t.querySelector(".nodeLabel");if(u?.getAttribute("class")&&a.setAttribute("class",u.getAttribute("class")),i.length===1)a.textContent=i[0];else{const c=-.6*(i.length-1);for(const[d,f]of i.entries()){const h=e.ownerDocument.createElementNS(xL,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${c}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function $ve(e){Ove(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!_ve.has(i)){n.remove();continue}if(i==="style"&&SL(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const s of o){const r=s.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(s.name);continue}if(r==="style"&&s.value&&SL(s.value)){n.removeAttribute(s.name);continue}if(r==="srcdoc"){n.removeAttribute(s.name);continue}if(Mve.has(r)&&s.value){const l=Fve(i,r,s.value);if(!l){n.removeAttribute(s.name);continue}l!==s.value&&n.setAttribute(s.name,l);continue}if(Ive.has(r)&&s.value&&FH(s.value)){n.removeAttribute(s.name);continue}if(s.value){const l=Dve(s.value);l!==s.value&&n.setAttribute(s.name,l)}}Rve(n)}}function Q9t(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return $ve(n),Pve(n)?null:n}catch{return null}}function Pve(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const s=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(s)||!Number.isFinite(r)||s<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let i=!1;for(const o of n){Nve(o)&&(i=!0);for(const s of Array.from(o.attributes))if(/\bNaN\b/i.test(s.value)||s.name==="style"&&/max-width:\s*0(?:px)?/i.test(s.value))return!0}return!i}const J2=[];function I8(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function zve(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function jve(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function _L(e=`editor-${Date.now()}`,t={}){const n=kme(t),i=n;i.__markstreamRegisteredPluginCount=J2.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||J2.length);const o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;s=m=>h[m]??o[m]??m}else s=h=>o[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[g,...v]=m;typeof g=="function"&&n.use(g,...v)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(J2.length)for(const h of J2)if(Array.isArray(h)){const[m,...g]=h;typeof m=="function"&&n.use(m,...g)}else typeof h=="function"&&n.use(h);n.use(hve),n.use(Pue),n.use(Rue);const r=Jue,l=r.default??r;n.use(l),n.use(Bue),n.use(Fue),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,g=m.src,v=!!m.env?.__markstreamFinal,y=g.split(/\r?\n/);for(const b of m.tokens){if(b.type!=="fence"||!b.map||!b.markup)continue;const C=b.map[0],A=b.map[1],T=b.markup,N=T[0],_=T.length,w=y[Math.max(0,A-1)]??"";let M=0;for(;MC+1&&x>=_&&E===w.length,F=b;F.meta=F.meta??{},F.meta.unclosed=!I,F.meta.closed=!!I}}),n.renderer.rules.fence=(h,m)=>{const g=h[m],v=String(g.info??"").trim(),y=String(g.content??""),b=btoa(unescape(encodeURIComponent(y))),C=zve(v),A=I8(C),T=jve(`editor-${e}-${m}-${C}`),N=I8(s("common.copy"));return`
      +
      + ${I8(C.toUpperCase())} + +
      +
      +
      `};const a=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=h=>{if(!h.startsWith("["))return!1;const m=u.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const g=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(g)},d=(h,m)=>{const g=h;if(g.src[g.pos]!=="[")return!1;const v=a.exec(g.src.slice(g.pos));if(!v)return!1;const y=g.src.slice(Math.max(0,g.pos-120),g.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(y))return!1;const b=g.src.slice(g.pos+v[0].length);if(b.startsWith("](")||b.startsWith("(")||c(b))return!1;if(!m){const C=v[1],A=g.push("reference","span",0);A.content=C,A.markup=v[0],A.raw=v[0]}return g.pos+=v[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const v=String(h[m].content??"");return`${v}`};const f=n.use.bind(n);return n.use=((...h)=>(i.__markstreamHasCustomParserExtensions=!0,f(...h))),n}const Hve="modulepreload",Wve=function(e){return"/"+e},ML={},es=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let r=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(u=>{if(u=Wve(u),u in ML)return;ML[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":Hve,c||(f.as="script"),f.crossOrigin="",f.href=u,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};function qve({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function RH({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:i,streamRenderVersionChanged:o=!1}){const s=`${n.settledContent}${n.streamedDelta}`;return i?n.streamedDelta&&s===e?o?{settledContent:s,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:qve({nextContent:e,previousContent:t??s,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const Uve={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function Vve(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function OH(e){const t=Vve(e);return Uve[t]??t}function Kve(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>OH(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function Zve(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const i of e){if(typeof i!="string")continue;const o=i.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function Gve(e){return Zve(e)?.join("\0")??""}function Qve(e,t){return`${Gve(e)}\0\0${Kve(t)?.join("\0")??""}`}function Ap(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function IL(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Yve=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const m=TL();this.startedAt=f&&this.hasStarted?m-this.normalizedStartDelayMs:m,this.lastTick=m,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=TL();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,v=t2e(m/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(v-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const y=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),b=e2e(this.source.slice(this.visible.length),y,this.segmenter);b.text&&(this.visible+=b.text,this.charBudget=Math.max(0,this.charBudget-b.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:i=1e3,targetLatencyMs:o=900,catchUpLatencyMs:s=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=Ap(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Ap(i,1e3,1)),this.normalizedTargetLatencyMs=Ap(o,900,1),this.normalizedCatchUpLatencyMs=Ap(s,350,1),this.normalizedCatchUpThreshold=IL(r,600),this.normalizedStartDelayMs=IL(a,80),this.maxCommitFps=Math.trunc(Ap(l,30,1)),this.maxCharsPerCommit=Math.trunc(Ap(u,80,1)),this.flushOnFinish=c,this.segmenter=Xve(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function Jve(e={},t){const n=new Yve(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function Xve(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function e2e(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const s=Array.from(e).slice(0,t);return{text:s.join(""),graphemeCount:s.length}}let i="",o=0;for(const s of n.segment(e)){if(o>=t)break;i+=s.segment,o++}return{text:i,graphemeCount:o}}function TL(){return typeof performance<"u"?performance.now():Date.now()}function t2e(e,t,n){return Math.min(n,Math.max(t,e))}var n2e=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const DC=Symbol.for("markstream-vue:node-lifecycle");function Y9t(){}const R7=new Map;let $H="material";const Qp=new Map,EL=new Map;let FC=null;function i2e(e){R7.set(e.id,e)}function o2e(e){const t=R7.get($H);if(!t)return;const n=t.core[e];if(n)return n;const i=Qp.get(t.id);if(i){const o=i[e];if(o)return o}t.loadExtended&&!Qp.has(t.id)&&r2e(t)}function s2e(){var e,t;return(t=(e=R7.get($H))==null?void 0:e.fallback)!=null?t:""}function r2e(e){return n2e(this,null,function*(){var t,n,i;if(Qp.has(e.id))return(t=Qp.get(e.id))!=null?t:null;let o=EL.get(e.id);return o||(o=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(s=>(Qp.set(e.id,s),FC?.(),s)).catch(()=>(Qp.set(e.id,null),null)),EL.set(e.id,o)),o})}const LL='',NL='',l2e={id:"material",core:{"":NL,plain:'',text:NL,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:LL,csharp:LL,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>es(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},a2e=Ya(0);FC=()=>{a2e.value++},i2e(l2e);const u2e={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Xb(e){var t;const n=(function(i){if(!i)return"";const o=i.trim();if(!o)return"";const[s]=o.split(/\s+/),[r]=s.split(":");return r.toLowerCase()})(e);return(t=u2e[n])!=null?t:n}function J9t(e){const t=Xb(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function X9t(e){return o2e(Xb(e))||s2e()}const DL={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var e4=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});let Hr=null,oh=!1,sh=null,t4=$7;function Ov(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function O7(){try{const e=globalThis;return Ov(e?.katex)}catch{return null}}function $7(){return e4(null,null,function*(){const e=O7();if(e)return e;const t=yield es(()=>import("./katex-DnlPpQZa.js"),[]);try{yield es(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Ov(t)})}function PH(e){const t=Promise.resolve(e).then(n=>{var i;return sh===t&&n?(Hr=(i=Ov(n))!=null?i:n,Hr):null}).catch(()=>null).finally(()=>{sh===t&&(sh=null)});return sh=t,oh=!0,t}function c2e(e){t4=e,Hr=null,oh=!1,sh=null}function d2e(e){c2e($7)}function zH(){return typeof t4=="function"}function ekt(){var e;const t=t4;if(!t||t===$7)return null;if(Hr)return Hr;const n=O7();if(n)return Hr=n,Hr;if(oh)return null;try{const i=t();return i?typeof i?.then=="function"?(PH(i),null):(Hr=(e=Ov(i))!=null?e:i,Hr):null}catch{return null}}function jH(){return e4(this,null,function*(){var e;const t=O7();if(t)return Hr=t,Hr;if(Hr)return Hr;if(sh)return sh;if(oh)return null;const n=t4;if(!n)return oh=!0,null;try{const i=n();if(typeof i?.then=="function")return PH(i);if(i)return Hr=(e=Ov(i))!=null?e:i,oh=!0,Hr}catch{}return oh=!0,null})}function HH(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Jy=null,zf=null;const zr=new Map,pc=new Map;let Q0=5;const bh=new Set;function l0(){if(zr.size{const{id:n,html:i,error:o}=t.data,s=zr.get(n);if(s)if(zr.delete(n),clearTimeout(s.timeoutId),s.cleanup(),l0(),o)s.aborted||s.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(pc.set(a,i),pc.size>200){const u=pc.keys().next().value;pc.delete(u)}}s.aborted||s.resolve(i)}},Jy.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of zr.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));zr.clear(),f2e()}}function p2e(e,t=!0,n=2e3,i){return e4(this,null,function*(){performance.now();const o=HH(e);if(!zH()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(zf)return Promise.reject(zf);const s=`${t?"d":"i"}:${o}`,r=pc.get(s);if(r)return l0(),Promise.resolve(r);const l=Jy||(zf=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),zf.name="WorkerInitError",zf.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(zf);if(zr.size>=Q0){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=zr.size,a.max=Q0,Promise.reject(a)}return new Promise((a,u)=>{if(i?.aborted){const g=new Error("Aborted");return g.name="AbortError",void u(g)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const g=zr.get(c);if(!g)return;zr.delete(c),g.cleanup();const v=new Error("Worker render timed out");v.name="WorkerTimeout",v.code="WORKER_TIMEOUT",g.aborted||g.reject(v),l0()},n);d=()=>{const g=zr.get(c);if(!g||g.aborted)return;g.aborted=!0,g.cleanup();const v=new Error("Aborted");v.name="AbortError",u(v)},i&&i.addEventListener("abort",d,{once:!0});const h=a,m=u;zr.set(c,{resolve:g=>{h(g)},reject:g=>{m(g)},timeoutId:f,aborted:!1,cleanup:()=>{i&&d&&i.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:o,displayMode:t})}catch(g){const v=zr.get(c);zr.delete(c),clearTimeout(f),v?.cleanup(),v?.reject(g),l0()}})})}function tkt(e,t=!0,n){const i=`${t?"d":"i"}:${HH(e)}`;if(pc.set(i,n),pc.size>200){const o=pc.keys().next().value;pc.delete(o)}}const m2e="WORKER_BUSY";function g2e(e=2e3,t){return zr.size{let o,s=!1,r=null,l=()=>{};const a=()=>{o&&globalThis.clearTimeout(o),bh.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{s||(s=!0,a(),n())},bh.add(l),o=globalThis.setTimeout(()=>{if(s)return;s=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",i(u)},e),queueMicrotask(()=>l0()),t&&(r=()=>{if(s)return;s=!0,a();const u=new Error("Aborted");u.name="AbortError",i(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const eg={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function nkt(e){return e4(this,arguments,function*(t,n=!0,i={}){var o,s,r,l;if(!zH()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=i.timeout)!=null?o:eg.timeout,u=(s=i.waitTimeout)!=null?s:eg.waitTimeout,c=(r=i.backoffMs)!=null?r:eg.backoffMs,d=(l=i.maxRetries)!=null?l:eg.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):eg.maxRetries,h=i.signal;let m=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield p2e(t,n,a,h)}catch(g){if(g?.code!==m2e||m>=f)throw g;if(m++,yield g2e(u,h).catch(()=>{}),h?.aborted){const v=new Error("Aborted");throw v.name="AbortError",v}c>0&&(yield new Promise(v=>globalThis.setTimeout(v,c*m)))}}})}function Yp(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function v2e(e){var t;for(const n of e.split(/\r?\n/)){const i=n.trim();if(!i||i.startsWith("%%"))continue;const o=i.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function gk(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),i=v2e(e);return i==="gantt"?220+28*n:i==="sequencediagram"?180+26*n:i==="classdiagram"||i==="statediagram"||i==="erdiagram"?180+24*n:i==="flowchart"||i==="graph"?170+28*n:200+22*n}function vk(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function WH(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function yk(e,t=360,n=500){return WH(e,t,n)}function kk(e,t=360,n=500){return WH(e,t,n)}var y2e=Object.defineProperty,k2e=Object.defineProperties,b2e=Object.getOwnPropertyDescriptors,FL=Object.getOwnPropertySymbols,w2e=Object.prototype.hasOwnProperty,C2e=Object.prototype.propertyIsEnumerable,BL=(e,t,n)=>t in e?y2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qH=(e,t)=>{for(var n in t||(t={}))w2e.call(t,n)&&BL(e,n,t[n]);if(FL)for(var n of FL(t))C2e.call(t,n)&&BL(e,n,t[n]);return e},RL=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const bk=()=>es(()=>import("./mermaid.core-D1bi95DL.js").then(e=>e.bp),__vite__mapDeps([2,3]));let ec=null,Jp=bk,Sg=null,BC=!1,RC=!1,_g=0;function A2e(e){Jp=e,_g++,ec=null,Sg=null,BC=!1,RC=!1}function x2e(e){A2e(bk)}function OL(){return typeof Jp=="function"}function $L(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=qH({},t),i={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:s=>typeof t.initialize=="function"?t.initialize(s):o.initialize?o.initialize(s):void 0},k2e(n,b2e(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function PL(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=qH({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,i):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(i):void 0}}catch{}}function ikt(){return RL(this,null,function*(){if(ec)return ec;const e=(function(){try{const i=globalThis;return $L(i?.mermaid)}catch{return null}})();if(e)return ec=e,PL(ec),ec;const t=Jp,n=_g;return t?t===bk&&BC?null:Sg||(Sg=RL(null,null,function*(){let i;try{i=yield t()}catch(o){if(t===bk)return n===_g&&t===Jp&&(BC=!0,(function(s){RC||(RC=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',s))})(o)),null;throw o}finally{n===_g&&t===Jp&&(Sg=null)}return n!==_g||t!==Jp?null:i?(ec=$L(i),PL(ec),ec):null}),Sg):null})}let pu=null,jf=null;const Ra=new Map,Hf=new Map;function T8(e){for(const t of Ra.values())t.reject(e);Ra.clear(),Hf.clear()}let zL=5,jL=!1;const S2e="WORKER_BUSY",HL="MERMAID_DISABLED";function _2e(e){if(pu&&pu!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",T8(n)}pu=e,jf=null;const t=e;pu.onmessage=n=>{if(pu!==t)return;const{id:i,ok:o,result:s,error:r}=n.data,l=Ra.get(i);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(s))},pu.onerror=n=>{var i,o;if(pu===t)if(Ra.size!==0){try{jL?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}T8(new Error(`Worker error: ${n.message}`))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},pu.onmessageerror=n=>{var i,o;if(pu===t)if(Ra.size!==0){try{jL?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}T8(new Error("Worker messageerror"))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function UH(e,t,n,i){if(!OL()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=HL,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let s=Hf.get(o);return s||(s=(function(r,l,a=1400){if(!OL()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=HL,Promise.reject(c)}if(jf)return Promise.reject(jf);const u=pu||(jf=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),jf.name="WorkerInitError",jf.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(jf);if(Ra.size>=zL){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=S2e,c.inFlight=Ra.size,c.max=zL,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,m=!1;const g=()=>{m||(m=!0,h!=null&&globalThis.clearTimeout(h),Ra.delete(f))},v={resolve:y=>{g(),c(y)},reject:y=>{g(),d(y)}};Ra.set(f,v);try{u.postMessage({id:f,action:r,payload:l})}catch(y){return Ra.delete(f),void d(y)}h=globalThis.setTimeout(()=>{const y=new Error("Worker call timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT";const b=Ra.get(f);b&&b.reject(y)},a)})})(e,t,n),Hf.set(o,s),s.then(()=>{Hf.get(o)===s&&Hf.delete(o)},()=>{Hf.get(o)===s&&Hf.delete(o)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},l.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),u(f)})})})(s,i)}function okt(e,t,n=1400,i){return UH("canParse",{code:e,theme:t},n,i)}function skt(e,t,n=1400,i){return UH("findPrefix",{code:e,theme:t},n,i)}var M2e=Object.defineProperty,I2e=Object.defineProperties,T2e=Object.getOwnPropertyDescriptors,WL=Object.getOwnPropertySymbols,E2e=Object.prototype.hasOwnProperty,L2e=Object.prototype.propertyIsEnumerable,qL=(e,t,n)=>t in e?M2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ot=(e,t)=>{for(var n in t||(t={}))E2e.call(t,n)&&qL(e,n,t[n]);if(WL)for(var n of WL(t))L2e.call(t,n)&&qL(e,n,t[n]);return e},On=(e,t)=>I2e(e,T2e(t)),ao=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const N2e="__global__",E8="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",OC=(()=>{const e=globalThis;if(e[E8])return e[E8];const t={scopedCustomComponents:{},revision:Ya(0)};return e[E8]=t,t})(),UL=OC.revision,D2e=Symbol("markstreamCustomComponents"),F2e=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function $v(e){return F2e.has(String(e).trim().toLowerCase())}function B2e(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function L8(e={}){const t={};for(const[n,i]of Object.entries(e))if(i!=null){t[n]=i;for(const o of new Set([Ca(n),Ca(B2e(n))]))!o||$v(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i)}return t}function xs(e){const t=tn(D2e,null);return D(()=>{var n;return UL.value,(function(i,o={}){return UL.value,Ot(Ot(Ot({},L8(OC.scopedCustomComponents[N2e]||{})),L8(o)),L8((function(s){return s&&OC.scopedCustomComponents[s]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const R2e=["aria-label"],O2e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},$2e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},$i=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},zl=$i(ct({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(k(),L("svg",$2e,[...n[1]||(n[1]=[S("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),S("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(k(),L("svg",O2e,[...n[0]||(n[0]=[S("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,R2e))}),[["__scopeId","data-v-be21ab83"]]);zl.install=e=>{e.component(zl.__name,zl)};const P2e={class:"emoji-node"},pl=$i(ct({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",P2e,B(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);pl.install=e=>{e.component(pl.__name,pl)};const z2e=["id"],j2e=["title"],jl=$i(ct({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const i=document.querySelector(t);i?i.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(i,o)=>(k(),L("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[S("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+B(e.node.id)+"]",9,j2e)],8,z2e))}}),[["__scopeId","data-v-c1463a29"]]);jl.install=e=>{e.component(jl.__name,jl)};const VH=(()=>{try{return!1}catch{}return!1})();function N8(e){VH&&console.warn(e)}function VL(e,t="safe",n){return B7(e,t,n)}function KH(e){return bve(e)}function D8(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function P7(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=Yy((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),D8(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),D8(r.value)]):Object.entries(o).map(([r,l])=>[r,D8(l)]):null,t,n);var o;if(!i)return;const s=KH(r0(i));return Object.keys(s).length>0?s:void 0}function KL(e,t,n=!1){const i=Object.entries(t??{}),o=i.length>0?i.map(([s,r])=>r===""?` ${s}`:` ${s}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function tg(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function F8(e,t,n,i,o,s,r=!1){const l=(function(d,f){return LH(d,f)})(e,i);if(Dv.has(e.toLowerCase())||!l&&MH(e,s))return null;if(!l&&F7(e,s))return r?[KL(e,t,!0)]:[KL(e,t),...n,``];const a=B7(t,s,e),u=a.key,c=u!=null&&u!==""?u:o;if(l){const d=i[e]||i[e.toLowerCase()],f=KH(a);return Fn(d,On(Ot({},f),{key:c}),n.length>0?n:void 0)}return Fn(e,On(Ot({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function ZH(e,t){return Ave(e,t)}function wk(e,t,n="safe"){if(!e)return[];try{return(function(s,r,l="safe"){let a=0;const u=[],c=[];for(const d of s)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=F8(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);tg(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===f){h=m;break}if(h!==-1)for(;u.length>h;){const m=u.pop(),g=F8(m.tagName,m.attrs||{},m.children,r,m.autoKey,l);u.length>0?tg(u[u.length-1].children,g):tg(c,g),m.tagName.toLowerCase()!==f&&u.length>h&&N8(`Auto-closing unclosed tag: <${m.tagName}>`)}else N8(`Ignoring closing tag with no matching opening tag: `)}for(;u.length>0;){const d=u.pop(),f=F8(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?tg(u[u.length-1].children,f):tg(c,f),N8(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(NH(e),t,n)}catch(o){return i=o,VH&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const H2e=["innerHTML"],Hl=$i(ct({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=tn("markstreamHtmlPolicy",void 0),i=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=xs(()=>t.customId),s=ct({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(i.value==="escape")return{mode:"html",content:k1(l,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=wk(l,o.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!ZH(l,o.value))return{mode:"html",content:k1(l,i.value)};const a=wk(l,o.value,i.value);return a===null?{mode:"html",content:k1(l,i.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(k(),L("span",{key:0,class:$e(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[V(p(s),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(k(),L("span",{key:1,class:$e(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},B(r.value.content),3)):(k(),L("span",{key:2,class:$e(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,H2e))}}),[["__scopeId","data-v-d17f12b0"]]);Hl.install=e=>{e.component(Hl.__name,Hl)};const W2e={class:"inline-code"},q2e={key:0},Mr=$i(ct({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=sm(),i=tn("markstreamFade",void 0),o=tn("markstreamTextStreamState",void 0),s=tn("markstreamStreamVersion",void 0),r=D(()=>{const b=n.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var b;return String((b=t.node.code)!=null?b:"")}),u=D(()=>!l.value),c=D(()=>{var b;const C=(b=n["index-key"])!=null?b:n.indexKey;return C==null||C===""?"":String(C)}),d=U(t.node.code),f=U(""),h=U(0);let m;function g(){m?.(),m=void 0}function v(){g(),f.value&&(d.value=d.value+f.value,f.value="")}qe([()=>t.node.code,c,l],([b])=>{const C=String(b??""),A=c.value,T=RH({nextContent:C,persistedContent:A?o?.get(A):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=T.settledContent,f.value=T.streamedDelta,T.appended?(h.value+=1,(function(){if(!f.value||m||!s)return;const N=s.value;m=qe(()=>s.value,_=>{_!==N&&v()},{flush:"sync"})})()):f.value||g(),A&&o?.set(A,C)},{immediate:!0}),Jd(g);const y=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(b,C)=>(k(),L("code",W2e,[u.value?(k(),L(Be,{key:0},[Pe(B(a.value),1)],64)):(k(),L(Be,{key:1},[d.value?(k(),L("span",q2e,B(d.value),1)):ee("",!0),f.value?(k(),L("span",{key:1,class:$e(["inline-code-stream-delta",[y.value]]),onAnimationend:v},B(f.value),35)):ee("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);Mr.install=e=>{e.component(Mr.__name,Mr)};const $C=U(!1),ZL=U(""),GL=U("top"),a0=U(null),u0=U(null),PC=U(null),zC=U(null),QL=U(null);let Xy=null,e9=null,jC=0;function GH(){Xy&&(clearTimeout(Xy),Xy=null),e9&&(clearTimeout(e9),e9=null)}let X2=!1,ey=null,YL=!1;function U2e(e,t,n="top",i=!1,o,s){if(!e)return;const r=++jC;GH();const l=()=>ao(null,null,function*(){var a,u;if(yield(function(){return ao(this,null,function*(){if(!X2&&!YL&&typeof document<"u"){ey!=null||(ey=ao(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([es(()=>import("./vue.runtime.esm-bundler-g_Y84vG0.js"),[]),es(()=>import("./Tooltip-B_XKKsoo.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:$C.value,"anchor-el":a0.value,content:ZL.value,placement:GL.value,id:u0.value,originX:PC.value,originY:zC.value,isDark:(m=QL.value)!=null?m:void 0})}}).mount(h),X2=!0}));try{yield ey}catch(c){X2=!1,ey=null,YL=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),X2&&r===jC){u0.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,a0.value=e,ZL.value=t,GL.value=n,PC.value=(a=o?.x)!=null?a:null,zC.value=(u=o?.y)!=null?u:null,QL.value=typeof s=="boolean"?s:null,$C.value=!0;try{e.setAttribute("aria-describedby",u0.value)}catch{}}});i?l():Xy=setTimeout(l,80)}function V2e(e=!1){jC+=1,GH();const t=()=>{if(a0.value&&u0.value)try{a0.value.removeAttribute("aria-describedby")}catch{}$C.value=!1,a0.value=null,u0.value=null,PC.value=null,zC.value=null};e?t():e9=setTimeout(t,120)}const K2e={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},Z2e=Symbol("markstreamI18nFallback");function QH(e,t){var n;return(n=t?.[e])!=null?n:K2e[e]}const HC=(e,t)=>{var n;return(n=QH(e,t))!=null?n:(function(i){return(i.split(".").pop()||i).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function JL(e,t){return{t(n){const i=QH(n,t);if(e.te&&i!=null&&!e.te(n))return HC(n,t);const o=e.t(n);return o===n&&i!=null?HC(n,t):o}}}function G2e(){const e=(function(){var n,i,o;try{const s=As(),r=Z2e,l=s?.provides,a=(n=s?.appContext)==null?void 0:n.provides;return(o=(i=l?.[r])!=null?i:a?.[r])!=null?o:null}catch{}return null})(),t=(function(){var n,i;try{const o=As(),s=o?.proxy,r=s?.$t;if(typeof r=="function"){const u=s?.$te;return{t:r.bind(s),te:typeof u=="function"?u.bind(s):void 0}}const l=(i=(n=o?.appContext)==null?void 0:n.config)==null?void 0:i.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return JL(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return JL({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>HC(n,e)}}const YH=Symbol("ViewportPriority"),JH=Symbol("ViewportPriorityOptions"),XH=Symbol("OffscreenHeavyNodeDeferral"),Q2e=D(()=>!1),Fh="400px";function z7(){return tn(JH,void 0)}function j7(){return tn(XH,Q2e)}function Y2e(e,t){var n,i;const o=typeof window<"u"&&typeof document<"u",s=typeof t=="boolean"?U(t):t,r=o?(n=window.requestIdleCallback)!=null?n:_=>window.setTimeout(()=>_({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(i=window.cancelIdleCallback)!=null?i:_=>window.clearTimeout(_):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function g(_){if(!_)return"viewport";let w=a.get(_);return w||(w=u++,a.set(_,w)),String(w)}function v(){if(h!=null){try{l?.(h)}catch{}h=null}}function y(_){if(_){const w=c.get(_);if(w&&!w.targets.size){try{w.io.disconnect()}catch{}c.delete(_)}}d.size||f.size||v()}function b(_){const w=d.get(_);if(!w)return;const M=c.get(w.bucketKey);if(!w.visible.value){w.visible.value=!0;try{w.resolve()}catch{}}try{M?.io.unobserve(_)}catch{}M?.targets.delete(_),d.delete(_),f.delete(_),y(w.bucketKey)}function C(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const _=f.values().next().value;_&&(f.delete(_),b(_),f.size&&C())},{timeout:1200}))}function A(_,w){if(!o||typeof IntersectionObserver>"u")return null;const M=(function(P,O){var R,z,H;return{root:(R=e?.(P??null))!=null?R:null,rootMargin:(z=O?.rootMargin)!=null?z:Fh,threshold:(H=O?.threshold)!=null?H:0}})(_,w),x=[g((E=M).root),E.rootMargin,E.threshold].join("\0");var E;const I=c.get(x);if(I)return{key:x,bucket:I};let F;try{F=new IntersectionObserver(P=>{for(const O of P)(O.isIntersecting||O.intersectionRatio>0)&&b(O.target)},{root:M.root,rootMargin:M.rootMargin,threshold:M.threshold})}catch{return null}const W={io:F,targets:new Map};return c.set(x,W),{key:x,bucket:W}}function T(){if(o&&s.value)for(const[_,w]of Array.from(d.entries())){const M=A(_,w.opts);if(!M){b(_);continue}if(M.key===w.bucketKey)continue;const x=w.bucketKey,E=c.get(x);try{E?.io.unobserve(_)}catch{}E?.targets.delete(_),w.bucketKey=M.key,M.bucket.targets.set(_,w),M.bucket.io.observe(_),y(x)}}qe(s,_=>{if(!_){for(const w of Array.from(d.keys()))b(w);v()}},{flush:"sync"});const N=(_,w)=>{const M=U(!1);let x,E=!1;const I=new Promise(O=>{x=()=>{E||(E=!0,O())}}),F=()=>{const O=d.get(_);if(!O)return f.delete(_),void y();const R=c.get(O.bucketKey);try{R?.io.unobserve(_)}catch{}R?.targets.delete(_),d.delete(_),f.delete(_),y(O.bucketKey)};if(!o||!s.value)return M.value=!0,x(),{isVisible:M,whenVisible:I,destroy:F};const W=A(_,w);if(!W)return M.value=!0,x(),{isVisible:M,whenVisible:I,destroy:F};const P={resolve:x,visible:M,bucketKey:W.key,opts:w};return d.set(_,P),W.bucket.targets.set(_,P),W.bucket.io.observe(_),o&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,T()})),w?.allowIdle!==!1&&(f.add(_),C()),{isVisible:M,whenVisible:I,destroy:F}};return N.refresh=T,ri(YH,N),N}function H7(){var e,t;const n=tn(YH,void 0);if(n)return n;const i=new WeakMap,o=new Map,s=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=h=>{if(!h)return;const m=o.get(h);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}o.delete(h)}},d=h=>{const m=i.get(h);if(!m)return;const g=o.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{g?.io.unobserve(h)}catch{}i.delete(h),g?.targets.delete(h),s.delete(h),c(m.bucketKey),s.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&s.size&&(r=l(()=>{r=null;const h=s.values().next().value;h&&(s.delete(h),d(h),s.size&&f())},{timeout:1200}))};return(h,m)=>{const g=U(!1);let v,y=!1;const b=new Promise(T=>{v=()=>{y||(y=!0,T())}}),C=()=>{const T=i.get(h);if(!T)return s.delete(h),void(s.size||u());const N=o.get(T.bucketKey);try{N?.io.unobserve(h)}catch{}i.delete(h),N?.targets.delete(h),s.delete(h),c(T.bucketKey),s.size||u()},A=(T=>{var N,_;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const w=(F=>{var W,P;return[(W=F?.rootMargin)!=null?W:Fh,(P=F?.threshold)!=null?P:0].join("\0")})(T),M=o.get(w);if(M)return{key:w,bucket:M};const x=(N=T?.rootMargin)!=null?N:Fh;let E;try{E=new IntersectionObserver(F=>{for(const W of F)(W.isIntersecting||W.intersectionRatio>0)&&d(W.target)},{root:null,rootMargin:x,threshold:(_=T?.threshold)!=null?_:0})}catch{return null}const I={io:E,targets:new Set};return o.set(w,I),{key:w,bucket:I}})(m);return A?(i.set(h,{resolve:v,visible:g,bucketKey:A.key}),A.bucket.targets.add(h),A.bucket.io.observe(h),m?.allowIdle!==!1&&(s.add(h),f()),{isVisible:g,whenVisible:b,destroy:C}):(g.value=!0,v(),{isVisible:g,whenVisible:b,destroy:C})}}function J2e(e,t){var n,i;const o=(i=(n=e.indexKey)!=null?n:t["index-key"])!=null?i:t.indexKey;return o==null||o===""?"":String(o)}const X2e=["data-markstream-viewport-pending"],eye=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],tye={key:1,class:"image-placeholder"},nye={key:1,class:"image-node__raw-text"},iye={key:2,class:"image-shimmer-overlay"},oye={key:1,class:"image-node__raw-text"},sye={key:3,class:"image-error"},Md=$i(ct({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,i,o;const s=e,r=t,l=U(!1),a=U(!1),u=U(""),c=U("primary"),d=U(null),f=sm(),h=tn(DC,null),m=H7(),g=z7(),v=j7(),y=D(()=>bE(s.node.src)),b=D(()=>bE(s.fallbackSrc)),C=(o=(i=(n=As())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:o.call(i,"img"),A=typeof window<"u"&&C?.getAttribute("src")===(y.value||b.value),T=U(typeof window>"u"||A||!v.value),N=Ya(null);let _="",w=null;const M=D(()=>u.value),x=D(()=>!s.lazy),E=D(()=>typeof window<"u"&&v.value&&!A),I=D(()=>!E.value||T.value),F=D(()=>I.value?M.value:""),W=D(()=>{var Ae,me;return(me=(Ae=g?.value.heavyBlockMargin)!=null?Ae:g?.value.rootMargin)!=null?me:Fh}),P=D(()=>!s.node.loading&&c.value!=="failed"&&u.value.length>0),O=D(()=>c.value==="failed"),R=D(()=>(!x.value||E.value&&!T.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),z=D(()=>J2e(s,f));function H(Ae=z.value){Ae&&d.value&&h?.reportHeight(Ae,d.value.offsetHeight)}function j(Ae=z.value){Ae&&vt(()=>{H(Ae)})}function K(){w&&(clearTimeout(w),w=null)}function re(){const Ae=z.value;Ae&&_!==Ae&&(_&&h?.markSettled(_),K(),_=Ae,h?.markPending(Ae),typeof window<"u"&&(w=window.setTimeout(()=>{_===Ae&&(j(Ae),q())},8e3)))}function q(){return ao(this,null,function*(){const Ae=_;Ae&&(K(),_="",yield vt(),H(Ae),h?.markSettled(Ae))})}function Q(){if(c.value==="primary"&&b.value&&b.value!==u.value)return c.value="fallback",u.value=b.value,l.value=!1,a.value=!1,void j();c.value="failed",a.value=!0,r("error",u.value),j()}function ne(){l.value=!0,a.value=!1,r("load",M.value),j()}function te(Ae){Ae.preventDefault(),l.value&&!a.value&&r("click",[Ae,M.value])}const{t:ge}=G2e();return qe([y,b,()=>s.node.loading],()=>(l.value=!1,a.value=!1,s.node.loading||y.value?(u.value=y.value,void(c.value="primary")):b.value?(u.value=b.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&qe([d,E],([Ae,me],de,Y)=>{var ue;if((ue=N.value)==null||ue.destroy(),N.value=null,!me||T.value)return void(T.value=!0);if(!Ae)return void(T.value=!1);let Z=!0;const se=m(Ae,{rootMargin:W.value,allowIdle:!1});N.value=se,T.value=se.isVisible.value,se.whenVisible.then(()=>{Z&&N.value===se&&(T.value=!0)}),Y(()=>{Z=!1,se.destroy(),N.value===se&&(N.value=null)})},{immediate:!0}),qe([P,l,a,M,()=>s.lazy,I],([Ae,me,de,Y,ue,Z])=>Ae&&Y&&!de&&Z?me?(q(),void j()):ue?(re(),void j()):void(me||de||re()):(q(),void j()),{flush:"post",immediate:!0}),si(()=>{var Ae;(Ae=N.value)==null||Ae.destroy(),N.value=null,(function(){const me=_;me&&(K(),_="",h?.markSettled(me))})()}),(Ae,me)=>{var de,Y,ue,Z,se;return k(),L("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":E.value&&!T.value?"true":void 0},[P.value?(k(),L("img",{key:0,src:F.value||void 0,alt:String((Y=(de=s.node.alt)!=null?de:s.node.title)!=null?Y:""),title:String((Z=(ue=s.node.title)!=null?ue:s.node.alt)!=null?Z:""),class:$e(["image-node__img",{"is-loading":!x.value&&!l.value,"is-loaded":x.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:s.lazy?"lazy":void 0,fetchpriority:x.value?"high":void 0,decoding:x.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(se=s.node.alt)!=null?se:p(ge)("image.preview"),onError:Q,onLoad:ne,onClick:te},null,42,eye)):ee("",!0),e.node.loading&&!a.value?(k(),L("span",tye,[s.usePlaceholder?Yn(Ae.$slots,"placeholder",{key:0,node:s.node,displaySrc:M.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[me[0]||(me[0]=S("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",nye,B(e.node.raw),1))])):ee("",!0),R.value&&!e.node.loading?(k(),L("span",iye,[s.usePlaceholder?Yn(Ae.$slots,"placeholder",{key:0,node:s.node,displaySrc:M.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[me[1]||(me[1]=S("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",oye,B(e.node.raw),1))])):ee("",!0),O.value?(k(),L("span",sye,[Yn(Ae.$slots,"error",{node:s.node,displaySrc:M.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[me[2]||(me[2]=S("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[S("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),S("span",null,B(p(ge)("image.loadError")),1)],!0)])):ee("",!0)],8,X2e)}}}),[["__scopeId","data-v-046e82ac"]]);Md.install=e=>{e.component(Md.__name,Md)};const rye={key:2},qu=ct({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=xs(()=>t.customId),i=tn("markstreamHtmlPolicy",void 0),o=tn("markstreamNestedRendererProps",void 0),s=D(()=>{var m;return(m=i?.value)!=null?m:"safe"}),r=D(()=>{var m,g;const v=(m=o?.value)!=null?m:{};return On(Ot({},v),{customId:(g=t.customId)!=null?g:v.customId,htmlPolicy:s.value})}),l=_u({loader:()=>Promise.resolve().then(()=>X7),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),u=D(()=>!!(a.value&&n.value[t.node.type]&&!$v(String(t.node.type)))),c=D(()=>u.value?P7(t.node,s.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var m;return String((m=t.node.content)!=null?m:"")}),h=D(()=>{var m,g;return String((g=(m=t.node.content)!=null?m:t.node.raw)!=null?g:"")});return(m,g)=>a.value&&u.value?(k(),ce(jo(a.value),fi({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:ae(()=>[d.value?(k(),ce(p(l),fi({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(k(),ce(p(l),fi({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(k(),ce(jo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(k(),L("span",rye,B(h.value),1)):ee("",!0)}}),XL=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function lye(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return On(Ot(Ot({},XL),n),{enabled:(t=n.enabled)==null||t})}return Ot({},XL)}function W7(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,i=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=i}function eW(e){var t,n;const i=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(i.length<3)return"";const o=i[0];if(o!=="`"&&o!=="~"||i[1]!==o||i[2]!==o)return"";let s=3;for(;i[s]===o;)s+=1;return i.slice(s).trim()}function eN(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function aye(e){var t;return e.diff===!0||eN(e.language)||eN(eW(String((t=e.raw)!=null?t:"")))}function uye(e,t,n){const i=(function(o){const s=eW(o);if(!s)return"";const r=s.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:i||t,caption:i?n?`Diff / ${t}`:t:""}}const cye=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],dye={key:0,translate:"no",class:"markstream-pre__diff-code"},fye={class:"markstream-pre__diff-pane-content"},hye={class:"markstream-pre__diff-number","aria-hidden":"true"},pye={class:"markstream-pre__diff-content"},mye={class:"markstream-pre__diff-content-inner"},gye={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},vye=["textContent"],yye=["textContent"],al=ct({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(te,ge){const Ae=String(te??"");return ge?Ae:Ae.replace(/\r\n$|\n$|\r$/,"")}const i=D(()=>{var te,ge,Ae;const me=String((ge=(te=t.node)==null?void 0:te.language)!=null?ge:"");return String((Ae=String(me).split(/\s+/g)[0])!=null?Ae:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=D(()=>`language-${i.value}`),s=D(()=>{var te;return t.loading===!0||((te=t.node)==null?void 0:te.loading)===!0}),r=D(()=>{var te;return n((te=t.node)==null?void 0:te.code,s.value)});let l="",a=1;const u=D(()=>(function(te){let ge=0,Ae=1;te.startsWith(l)&&(ge=l.length,Ae=a,ge>0&&te[ge-1]==="\r"&&te[ge]===` +`&&ge++);for(let me=ge;mer.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const te=u.value;te{var te;return t.showLineNumbers===!0&&((te=t.node)==null?void 0:te.diff)===!0}),g=D(()=>m.value&&t.diffInline===!0),v=D(()=>{const te=Number(t.reservedHeightPx);if(!Number.isFinite(te)||te<=0)return;const ge=`${Math.ceil(te)}px`;return s.value?{maxHeight:ge,overflow:"auto"}:{height:ge,minHeight:ge,maxHeight:ge,overflow:"auto"}}),y=["diff ","index ","--- ","+++ ","@@ "];function b(te){return String(te??"").trim().length===0}function C(te,ge="context",Ae={}){const me=b(te);return{code:te,kind:me&&ge!=="hunk"&&ge!=="spacer"&&!Ae.preserveBlankKind?"context":ge,empty:me}}function A(te){const ge=n(te,s.value);return ge?ge.split(/\r\n|\n|\r/):[]}function T(te,ge){return!b(te[ge])||gey.some(Ae=>ge.startsWith(Ae)))}function M(te,ge){return ge||!te.startsWith(" ")||te.startsWith(" ")?te:` ${te}`}function x(te,ge){const Ae=te.length,me=ge.length,de=[];let Y=0;for(;Y=Y&&se>=Y&&te[Z]===ge[se];)ue.unshift({originalIndex:Z,modifiedIndex:se}),Z--,se--;const ke=Z-Y+1,be=se-Y+1;if(ke<=0||be<=0||s.value||(ke+1)*(be+1)>15e5)return de.concat(ue);const we=be+1,oe=new Uint32Array((ke+1)*(be+1));for(let Ce=ke-1;Ce>=0;Ce--)for(let le=be-1;le>=0;le--){const ie=Ce*we+le;if(te[Y+Ce]===ge[Y+le])oe[ie]=oe[(Ce+1)*we+le+1]+1;else{const Ee=oe[(Ce+1)*we+le],Ke=oe[Ce*we+le+1];oe[ie]=Ee>=Ke?Ee:Ke}}const J=[];let fe=0,ve=0;for(;fe=oe[fe*we+ve+1]?fe++:ve++;return de.concat(J,ue)}function E(te){var ge;const Ae=(function(){var se,ke;const be=t.diffHideUnchangedRegions;if(be==null||be===!1)return null;const we=be===!0?{}:be;return we.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((se=we.contextLineCount)!=null?se:2)),minimumLineCount:Math.max(1,Math.floor((ke=we.minimumLineCount)!=null?ke:4))}})();if(!Ae||te.length<1||te.length>2||te.length===2&&te[0].lines.length!==te[1].lines.length)return te;const me=te[0].lines,de=(ge=te[1])==null?void 0:ge.lines,Y=se=>me[se].kind==="context"&&(de===void 0||de[se].kind==="context"&&me[se].code===de[se].code),ue=[];let Z=0;for(;Z=Ae.minimumLineCount){const be=se+(se===0?0:Ae.contextLineCount),we=ke-(ke===me.length?0:Ae.contextLineCount);we-be>=Ae.minimumLineCount&&ue.push({start:be,end:we})}Z===se&&Z++}return ue.length?te.map((se,ke)=>{const be=[];let we=0;for(const oe of ue)be.push(...se.lines.slice(we,oe.start)),be.push({code:ke===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${se.key}-collapsed-${oe.start}-${oe.end}`,number:""}),we=oe.end;return be.push(...se.lines.slice(we)),On(Ot({},se),{lines:be})}):te}const I=D(()=>{var te,ge,Ae,me;if(!m.value)return[];const de=(function(ke){const be=ke.some(oe=>N(oe)),we=ke.some(oe=>_(oe));return be&&we||(function(){var oe,J,fe,ve;if(i.value==="diff")return!0;const Ce=(ve=(fe=String((J=(oe=t.node)==null?void 0:oe.raw)!=null?J:"").split(/\r?\n/,1)[0])==null?void 0:fe.trim())!=null?ve:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ce)})()&&(be||we)})(c.value),Y=(function(){var ke,be;return((ke=t.node)==null?void 0:ke.originalCode)!=null||((be=t.node)==null?void 0:be.updatedCode)!=null})();if(g.value){const ke=Y?(function(be,we){const oe=A(be),J=A(we),fe=x(oe,J);if(fe.length>0){const Ke=[];let Ue=0,at=0;for(const bt of fe){for(;Ue=Ce&&ie>=Ce&&oe[le]===J[ie];)Ee.unshift(On(Ot({},C(J[ie])),{key:`inline-suffix-${ie}`,number:ie+1})),le--,ie--;for(let Ke=Ce;Ke<=le;Ke++)ve.push(On(Ot({},C(oe[Ke],"removed",{preserveBlankKind:T(oe,Ke)})),{key:`inline-removed-source-${Ke}`,number:Ke+1}));for(let Ke=Ce;Ke<=ie;Ke++)ve.push(On(Ot({},C(J[Ke],"added",{preserveBlankKind:T(J,Ke)})),{key:`inline-added-source-${Ke}`,number:Ke+1}));return ve.concat(Ee)})((te=t.node)==null?void 0:te.originalCode,(ge=t.node)==null?void 0:ge.updatedCode):(function(be){const we=[];let oe=1,J=1;const fe=w(be);for(const[ve,Ce]of be.entries())if(Ce.startsWith("@@")){const le=Ce.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);le&&(oe=Number(le[1]),J=Number(le[2])),we.push(On(Ot({},C(Ce,"hunk")),{key:`inline-hunk-${ve}`,number:""}))}else if(N(Ce))we.push(On(Ot({},C(M(Ce.slice(1),fe),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ve}`,number:oe++}));else if(_(Ce))we.push(On(Ot({},C(M(Ce.slice(1),fe),"added",{preserveBlankKind:!0})),{key:`inline-added-${ve}`,number:J++}));else{const le=fe&&Ce.startsWith(" ")?Ce.slice(1):Ce;we.push(On(Ot({},C(le)),{key:`inline-context-${ve}`,number:J})),oe++,J++}return we})(c.value);return E([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:ke}])}if(!de&&Y)return(function(ke,be){const we=A(ke),oe=A(be),J=x(we,oe),fe=[],ve=[];let Ce=0,le=0,ie=0;const Ee=(Ke,Ue)=>{const at=Math.max(Ke-Ce,Ue-le);for(let bt=0;btOn(Ot({},ke),{key:`original-${be}`,number:be+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Z.map((ke,be)=>On(Ot({},ke),{key:`modified-${be}`,number:be+1}))}])}),F=D(()=>{var te,ge;if(t.showLineNumbers!==!0)return;let Ae=m.value?1:u.value;if(m.value){Ae=Math.max(Ae,A((te=t.node)==null?void 0:te.originalCode).length,A((ge=t.node)==null?void 0:ge.updatedCode).length);for(const de of I.value)for(const Y of de.lines)typeof Y.number=="number"&&(Ae=Math.max(Ae,Y.number))}const me=`${Math.max(2,String(Ae).length)}ch`;return{"--markstream-pre-line-number-width":me,"--markstream-pre-diff-line-number-width":me,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),W=D(()=>I.value.some(te=>te.lines.some(ge=>ge.kind==="collapsed"))),P=D(()=>{const te=i.value;return te?`Code block: ${te}`:"Code block"}),O=U(null),R=U([]);let z=null,H=!1,j=null;function K(te){const ge=Number.parseFloat(String(te??""));return Number.isFinite(ge)&&ge>0?ge:0}function re(te,ge){var Ae;if(!te)return ge;if(te.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const me=te.querySelector(".markstream-pre__diff-content"),de=me?.getBoundingClientRect(),Y=(Ae=de?.height)!=null?Ae:0;return Math.max(ge,Math.ceil(Y))}function q(){H||typeof window>"u"||(z!=null&&window.cancelAnimationFrame(z),z=window.requestAnimationFrame(()=>{z=null,H||(function(){var te,ge;z=null;const Ae=O.value;if(!Ae||!m.value||g.value||!Ae.classList.contains("is-wrap"))return void(R.value.length&&(R.value=[]));const me=(function(be){const we=window.getComputedStyle(be),oe=K(we.getPropertyValue("--markstream-pre-diff-line-height"));if(oe>0)return oe;const J=K(we.lineHeight);return J>0?J:18})(Ae),de=Array.from(Ae.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),Y=Array.from(Ae.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),ue=Math.max(de.length,Y.length),Z=[];for(let be=0;be{const oe=ke[we];return oe&&Math.abs(be.rowHeight-oe.rowHeight)<=.5&&Math.abs(be.originalHeight-oe.originalHeight)<=.5&&Math.abs(be.modifiedHeight-oe.modifiedHeight)<=.5})||(R.value=Z)})()}))}function Q(te){j?.disconnect(),j=null,te&&m.value&&!g.value&&typeof ResizeObserver<"u"&&(j=new ResizeObserver(()=>{q()}),j.observe(te))}function ne(te,ge){const Ae=R.value[te];if(!Ae)return;const me=ge==="original"?Ae.originalHeight:Ae.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(Ae.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(me)}px`}}return qe(O,te=>{Q(te),vt(()=>q())},{flush:"post"}),qe([m,g,I],()=>{Q(O.value),vt(()=>q())},{flush:"post",immediate:!0}),si(()=>{H=!0,z!=null&&(window.cancelAnimationFrame(z),z=null),j?.disconnect(),j=null}),(te,ge)=>(k(),L("pre",{ref_key:"preRef",ref:O,style:sn([v.value,F.value]),class:$e([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":g.value,"markstream-pre--diff-collapsed":W.value}]),"aria-busy":s.value,"aria-label":P.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(k(),L("code",dye,[(k(!0),L(Be,null,xt(I.value,Ae=>(k(),L("span",{key:Ae.key,class:$e(["markstream-pre__diff-pane",Ae.className])},[S("span",fye,[(k(!0),L(Be,null,xt(Ae.lines,(me,de)=>(k(),L("span",{key:me.key,class:$e(["markstream-pre__diff-line",[`markstream-pre__diff-line--${me.kind}`,{"markstream-pre__diff-line--empty":me.empty}]]),style:sn(ne(de,Ae.key))},[ge[0]||(ge[0]=S("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),S("span",hye,B(me.number),1),S("span",pye,[S("span",mye,B(me.code),1)])],6))),128))])],2))),128))])):(k(),L(Be,{key:1},[t.showLineNumbers?(k(),L("span",gye,[S("span",{class:"markstream-pre__line-numbers-text",textContent:B(h.value)},null,8,vye)])):ee("",!0),S("code",{translate:"no",class:"markstream-pre__code",textContent:B(r.value)},null,8,yye)],64))],14,cye))}});al.install=e=>{e.component(al.__name,al)};const Uo=$i(ct({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=sm(),i=tn("markstreamFade",void 0),o=tn("markstreamTextStreamState",void 0),s=tn("markstreamStreamVersion",void 0),r=D(()=>{const T=n.fade;return T===""||T===!0||T==="true"||T!==!1&&T!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var T;const N=(T=n["index-key"])!=null?T:n.indexKey;return N==null||N===""?"":String(N)}),u=U(t.node.content),c=U(""),d=U(0),f=U(t.node.content);let h;const m=U(null),g=U(null);let v="",y=null;function b(){h?.(),h=void 0}function C(){b(),c.value&&(u.value=u.value+c.value,c.value="")}qe([u,m,g],function(){var T,N;const _=m.value;if(!_)return;const w=String((T=u.value)!=null?T:""),M=g.value;return y||(y=_.firstChild,v=(N=y?.data)!=null?N:""),w.startsWith(v)?!y&&w?(_.textContent=w,y=_.firstChild,void(v=w)):void(w.length>v.length&&M&&(M.appendChild(document.createTextNode(w.slice(v.length))),v=w)):(_.textContent=w,y=_.firstChild,M&&(M.textContent=""),void(v=w))},{immediate:!0}),qe([()=>t.node.content,a,l],([T])=>{const N=String(T??""),_=a.value,w=RH({nextContent:N,persistedContent:_?o?.get(_):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=w.settledContent,c.value=w.streamedDelta,w.appended?(d.value+=1,(function(){if(!c.value||h||!s)return;const M=s.value;h=qe(()=>s.value,x=>{x!==M&&C()},{flush:"sync"})})()):c.value||b(),_&&o?.set(_,N)},{immediate:!0}),Jd(b);const A=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(T,N)=>(k(),L("span",{class:$e([[e.node.center?"text-node-center":""],"text-node"])},[hi(S("span",{ref_key:"settledTextEl",ref:m},B(f.value),513),[[Jo,u.value!==""]]),hi(S("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[Jo,u.value!==""]]),c.value?(k(),L("span",{key:0,class:$e(["text-node-stream-delta",[A.value]]),onAnimationend:C},B(c.value),35)):ee("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function Mg(e,t,n){return ct({name:e,inheritAttrs:!1,setup(i,{attrs:o,slots:s}){var r,l;const a=H7(),u=z7(),c=j7(),d=typeof window<"u"&&((l=(r=As())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=U(typeof window>"u"||d||!c.value),h=Ya(null);let m=null;function g(v){const y=v&&"$el"in v?v.$el:v;h.value=y instanceof HTMLElement?y:null}return typeof window<"u"&&qe([h,c],([v,y],b,C)=>{if(m?.destroy(),m=null,!y||f.value)return void(f.value=!0);if(!v)return;let A=!0;const T=a(v,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=T,f.value=T.isVisible.value,T.whenVisible.then(()=>{A&&m===T&&(f.value=!0)}),C(()=>{A=!1,T.destroy(),m===T&&(m=null)})},{immediate:!0}),si(()=>{m?.destroy(),m=null}),()=>Fn(f.value?t:n,On(Ot({},o),{ref:g}),s)}})}Uo.install=e=>{e.component(Uo.__name,Uo)};const Ck=ct({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var i,o,s,r,l,a,u;const c=Xb(String((o=(i=n.node)==null?void 0:i.language)!=null?o:"")),d=DL[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):DL[""]),f=aye(n.node),h=uye(String((r=(s=n.node)==null?void 0:s.raw)!=null?r:""),d,f),m=n.monacoOptions,g=f&&((l=n.estimatedDiffInline)!=null?l:W7(m??{},typeof window>"u"?0:window.innerWidth)),v=m?.diffAppearance,y=v==="dark"||v!=="light"&&n.isDark===!0,b=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,C=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:b===12?18:Math.max(12,Math.round(1.5*b)),A=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,T=f?0:8,N=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:T,_=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:T,w=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",M=Ot(Ot({fontSize:`${b}px`,lineHeight:`${C}px`,tabSize:A,paddingTop:`${N}px`,paddingBottom:`${_}px`,"--markstream-pre-line-number-top":`${N}px`},f?{"--markstream-pre-diff-line-height":`${C}px`}:{}),w?{"--markstream-code-font-family":w}:{}),x=()=>Fn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[Fn("svg",{class:"action-icon",width:"14",height:"14"})]),E=n.isShowPreview!==!1&&(c==="html"||c==="svg"),I=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||E&&n.showPreviewButton!==!1,F=P=>{if(P!=null)return typeof P=="number"?`${P}px`:String(P)},W=Ot(Ot(Ot({"--markstream-code-layout-character-width":"1ch"},F(n.minWidth)?{minWidth:F(n.minWidth)}:{}),F(n.maxWidth)?{maxWidth:F(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--markstream-code-fallback-bg, var(--code-bg, #fff))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return Fn("div",On(Ot({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":y,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[W,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:Fn("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[Fn("div",{class:"code-header-main",style:{minWidth:0,flex:"1 1 auto",display:"flex",alignItems:"center",gap:"var(--ms-gap-header-main, 0.625rem)",overflow:"hidden"}},[Fn("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",style:{display:"inline-flex",width:"1rem",height:"1rem",flex:"0 0 auto"}}),Fn("div",{class:"code-header-copy",style:{minWidth:0,display:"grid",gap:"2px"}},[Fn("div",{class:"code-header-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--ms-text-label, 0.75rem)",fontWeight:"500",color:"var(--code-action-fg)"}},h.title),h.caption?Fn("div",{class:"code-header-caption",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.75rem",color:"var(--code-line-number)"}},h.caption):null])]),Fn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?Fn("div",{class:"code-diff-stats","aria-hidden":"true"},[Fn("span",{class:"code-diff-stat removed"},"-0"),Fn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:x(),n.showCollapseButton===!1?null:x(),I?Fn("div",{class:"relative"},[x()]):null])]),Fn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Fn(al,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:g,diffHideUnchangedRegions:f?lye(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:M,"data-markstream-code-loading":"1"})]),Fn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Fn("div",{class:"loading-skeleton"},[Fn("div",{class:"skeleton-line"}),Fn("div",{class:"skeleton-line"}),Fn("div",{class:"skeleton-line short"})])]),Fn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),B8=Mg("ViewportDeferredCodeBlockNode",_u({loader:()=>ao(null,null,function*(){try{return(yield es(()=>import("./CodeBlockNode-CuI0kUU2.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer (or "stream-monaco" as a fallback).',e),al}}),loadingComponent:Ck,delay:0,suspensible:!1}),Ck),Ja=_u(()=>ao(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,i,o,s;return Fn(Uo,On(Ot({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))};try{return yield jH(),(yield es(()=>import("./index7-DiAQ7wTz.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,i,o,s;return Fn(Uo,On(Ot({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))}})),tW=_u(()=>ao(null,null,function*(){try{return yield jH(),(yield es(()=>import("./index6-3HBp-5pe.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,i,o;return Fn(Uo,On(Ot({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(i=e.node.content)!=null?i:""}$$`}}))}})),Ur=$i(ct({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(k(),L("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=i=>t.$emit("click",i,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=i=>t.$emit("mouseEnter",i,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=i=>t.$emit("mouseLeave",i,e.node.id,e.messageId,e.threadId))},B(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Ur.install=e=>{e.component(Ur.__name,Ur)};const kye={class:"superscript-node"},ml=$i(ct({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,strong:Vr,emphasis:Gr,footnote_reference:jl,strikethrough:Kr,highlight:Wl,insert:vl,subscript:gl,emoji:pl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("sup",kye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"superscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);ml.install=e=>{e.component(ml.__name,ml)};const bye={class:"subscript-node"},gl=$i(ct({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,strong:Vr,emphasis:Gr,footnote_reference:jl,strikethrough:Kr,highlight:Wl,insert:vl,superscript:ml,emoji:pl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("sub",bye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"subscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);gl.install=e=>{e.component(gl.__name,gl)};const wye={class:"strong-node"},Vr=$i(ct({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,emphasis:Gr,strikethrough:Kr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("strong",wye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"strong"}-${l}`,components:i.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Vr.install=e=>{e.component(Vr.__name,Vr)};const Cye={class:"strikethrough-node"},Kr=$i(ct({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,strong:Vr,emphasis:Gr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("del",Cye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"strikethrough"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);Kr.install=e=>{e.component(Kr.__name,Kr)};const Aye=["href","title","aria-label","aria-hidden","target","rel"],xye=["aria-hidden"],Sye={class:"link-text-wrapper relative inline-flex"},_ye={class:"leading-[normal] link-text"},Zr=$i(ct({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=tn("markstreamShowTooltips",void 0),i=D(()=>{const y=n?.value;return typeof y=="boolean"?y:t.showTooltip}),o=D(()=>{var y,b,C,A,T;const N=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",_=(y=t.animationOpacity)!=null?y:.35,w=Math.max(.12,Math.min(.5*_,_)),M={"--underline-height":`${(b=t.underlineHeight)!=null?b:2}px`,"--underline-bottom":N,"--underline-opacity":String(_),"--underline-rest-opacity":String(w),"--underline-duration":`${(C=t.animationDuration)!=null?C:1.6}s`,"--underline-timing":(A=t.animationTiming)!=null?A:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(T=t.animationIteration)!=null?T:"infinite"};return t.color&&(M["--link-color"]=t.color),M}),s=xs(()=>t.customId),r=D(()=>Ot({text:Uo,strong:Vr,strikethrough:Kr,emphasis:Gr,image:Md,html_inline:Hl,inline_code:Mr},s.value)),l=sm(),a=D(()=>{var y,b;const C=(y=t.node)==null?void 0:y.attrs;if(!C||typeof C!="object")return{};const A={};if(Array.isArray(C))for(const T of C)Array.isArray(T)&&T[0]&&(A[String(T[0])]=String((b=T[1])!=null?b:""));else for(const[T,N]of Object.entries(C))T&&N!=null&&N!==!1&&(A[T]=N===!0?"":String(N));return VL(A,"safe","a")}),u=D(()=>Ot(Ot({},l),a.value)),c=D(()=>{var y,b;return VL({href:String((b=(y=t.node)==null?void 0:y.href)!=null?b:"")},"safe","a").href}),d=D(()=>{if(!c.value)return;const y=u.value.target;return(typeof y=="string"?y.trim():String(y??"").trim())||(ape(c.value)?"_blank":void 0)}),f=D(()=>{var y;return String((y=d.value)!=null?y:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!c.value)return;const y=u.value.rel,b=new Set((typeof y=="string"?y:String(y??"")).split(/\s+/).filter(Boolean)),C=new Set(Array.from(b).filter(A=>A.toLowerCase()!=="opener"));return f.value&&(C.add("noopener"),C.add("noreferrer")),C.size>0?Array.from(C).join(" "):void 0}),m=D(()=>{const y=Ot({},u.value);return delete y.title,delete y.href,delete y.target,delete y.rel,y});function g(){i.value&&V2e()}const v=D(()=>{var y,b;const C=(y=t.node)==null?void 0:y.title;return typeof C=="string"&&C.trim().length>0?C:String((b=c.value)!=null?b:"")});return(y,b)=>{var C,A;return e.node.loading?(k(),L("span",fi({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:o.value}),[S("span",Sye,[S("span",_ye,[V(p(Uo),{class:"leading-[normal] link-text",node:{type:"text",content:String((C=e.node.text)!=null?C:""),raw:String((A=e.node.text)!=null?A:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),b[1]||(b[1]=S("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,xye)):(k(),L("a",fi({key:0,class:"link-node",href:c.value,title:i.value?"":v.value,"aria-label":`Link: ${v.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:o.value,onMouseenter:b[0]||(b[0]=T=>(function(N){var _,w,M,x;if(!i.value)return;const E=N,I=E?.clientX!=null&&E?.clientY!=null?{x:E.clientX,y:E.clientY}:void 0,F=((_=t.node)==null?void 0:_.title)||((w=c.value)!=null&&w.includes("xn--")&&((x=(M=t.node)==null?void 0:M.text)!=null&&x.includes("://"))?t.node.text:c.value)||"";U2e(N.currentTarget,F,"top",!1,I)})(T)),onMouseleave:g}),[(k(!0),L(Be,null,xt(e.node.children,(T,N)=>(k(),ce(p(qu),{key:`${e.indexKey||"emphasis"}-${N}`,components:r.value,node:T,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${N}`},null,8,["components","node","custom-id","index-key"]))),128))],16,Aye))}}}),[["__scopeId","data-v-367e6ca4"]]);Zr.install=e=>{e.component(Zr.__name,Zr)};const Mye={class:"insert-node"},vl=$i(ct({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,strong:Vr,emphasis:Gr,strikethrough:Kr,highlight:Wl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("ins",Mye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"insert"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);vl.install=e=>{e.component(vl.__name,vl)};const Iye={class:"highlight-node"},Wl=$i(ct({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,strong:Vr,emphasis:Gr,strikethrough:Kr,insert:vl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("mark",Iye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"highlight"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Wl.install=e=>{e.component(Wl.__name,Wl)};const Tye={class:"emphasis-node"},Gr=$i(ct({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,html_inline:Hl,strong:Vr,strikethrough:Kr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Ja,reference:Ur},n.value));return(o,s)=>(k(),L("em",Tye,[(k(!0),L(Be,null,xt(e.node.children,(r,l)=>(k(),ce(p(qu),{key:`${e.indexKey||"emphasis"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Gr.install=e=>{e.component(Gr.__name,Gr)};const Eye={class:"hard-break"},Id=$i(ct({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("br",Eye))}),[["__scopeId","data-v-50c58f70"]]);Id.install=e=>{e.component(Id.__name,Id)};const Y0=ct({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ft({checkbox:zl,checkbox_input:zl,emoji:pl,emphasis:Gr,hardbreak:Id,highlight:Wl,inline_code:Mr,insert:vl,link:Zr,reference:Ur,strikethrough:Kr,strong:Vr,subscript:gl,superscript:ml,text:Uo}),i=xs(()=>t.customId),o=D(()=>{const s=i.value;return Object.keys(s).length>0?Ot(Ot({},n),s):n});return(s,r)=>(k(!0),L(Be,null,xt(e.nodes,(l,a)=>(k(),ce(p(qu),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function WC(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(WC)}function Ak(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(WC))return e;if(!t||e.length!==1)return null;const i=e[0];if(i?.type!=="paragraph"||!Array.isArray(i.children))return null;const o=i.children;return(n||o.length>0)&&o.every(WC)?o:null}function Bh(e){var t,n;if(!e?.length)return null;let i="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;i+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return i}const Lye=["cite"],Nye={key:0,dir:"auto",class:"paragraph-node"},Dye=["custom-id"],t9=$i(ct({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=xs(()=>t.customId),i=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),s=D(()=>Ak(t.node.children,!i.value)),r=D(()=>t.fade!==!1||o.value?null:Bh(s.value));return ri("markstreamShowTooltips",D(()=>t.showTooltips)),ri("markstreamFade",D(()=>t.fade)),(l,a)=>(k(),L("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[s.value?(k(),L("p",Nye,[r.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(r.value),9,Dye)):(k(),ce(p(Y0),{key:1,nodes:s.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(k(),ce(p(yl),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,Lye))}}),[["__scopeId","data-v-abfecebc"]]);t9.install=e=>{e.component(t9.__name,t9)};const Fye={class:"definition-list"},Bye={class:"definition-term"},Rye={class:"definition-desc"},n9=$i(ct({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("dl",Fye,[(k(!0),L(Be,null,xt(t.node.items,(o,s)=>(k(),L(Be,{key:s},[S("dt",Bye,[V(p(yl),{"index-key":`definition-term-${t.indexKey}-${s}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),S("dd",Rye,[V(p(yl),{"index-key":`definition-desc-${t.indexKey}-${s}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[1]||(i[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);n9.install=e=>{e.component(n9.__name,n9)};const Oye=["href","title"],c0=$i(ct({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(i){var o;if(i.preventDefault(),typeof document>"u")return;const s=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(s);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(i,o)=>(k(),L("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,Oye))}}),[["__scopeId","data-v-e1eb37b6"]]);c0.install=e=>{e.component(c0.__name,c0)};const $ye=["id"],Pye={class:"flex-1"},i9=ct({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[S("div",Pye,[V(p(yl),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,$ye))}});i9.install=e=>{e.component(i9.__name,i9)};const zye=["custom-id"],qC=$i(ct({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=xs(()=>t.customId),i=tn("markstreamFade",void 0),o=D(()=>i?.value!==!1||n.value.text?null:Bh(t.node.children)),s=D(()=>Ot({text:Uo,inline_code:Mr,link:Zr,image:Md,strong:Vr,emphasis:Gr,strikethrough:Kr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,checkbox:zl,checkbox_input:zl,footnote_reference:jl,hardbreak:Id,math_inline:Ja,reference:Ur},n.value));return(r,l)=>(k(),ce(jo(`h${e.node.level}`),fi({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:ae(()=>[o.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(o.value),9,zye)):(k(!0),L(Be,{key:1},xt(e.node.children,(a,u)=>(k(),ce(p(qu),{key:u,components:s.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),n4=qC;n4.install=e=>{e.component(qC.__name,qC)};const jye={key:0,dir:"auto",class:"paragraph-node"},Hye=["custom-id"],Wye={dir:"auto",class:"paragraph-node"},qye=["custom-id"],b1=$i(ct({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),i=xs(()=>t.customId),o=D(()=>!!i.value.paragraph),s=D(()=>!!i.value.text),r=D(()=>{var h;return Ak((h=n.value)==null?void 0:h.children,!o.value)}),l=D(()=>{var h;if(o.value)return null;const m=(h=n.value)==null?void 0:h.children;if(!Array.isArray(m)||m.length<2)return null;const g=m[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const v=m.slice(1);if(!v.every(b=>b?.type==="list"))return null;const y=Ak([g]);return y?{paragraphChildren:y,nestedLists:v}:null});function a(){return t.fade===!1&&!s.value}const u=D(()=>a()?Bh(r.value):null),c=D(()=>{var h;return a()?Bh((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return ri("markstreamShowTooltips",D(()=>t.showTooltips)),ri("markstreamFade",D(()=>t.fade)),(h,m)=>{var g,v;return k(),L("li",fi({class:"list-item",dir:"auto"},f.value),[r.value?(k(),L("p",jye,[u.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(u.value),9,Hye)):(k(),ce(p(Y0),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(k(),L(Be,{key:1},[S("p",Wye,[c.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(c.value),9,qye)):(k(),ce(p(Y0),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(k(!0),L(Be,null,xt(l.value.nestedLists,(y,b)=>(k(),ce(p(yl),{key:b,nodes:[y],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${b}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:m[0]||(m[0]=C=>h.$emit("copy",C))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(k(),ce(p(yl),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(v=(g=n.value)==null?void 0:g.children)!=null?v:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=y=>h.$emit("copy",y))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);b1.install=e=>{e.component(b1.__name,b1)};const w1=$i(ct({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=xs(()=>e.customId),n=D(()=>t.value.list_item||b1);return(i,o)=>(k(),ce(jo(e.node.ordered?"ol":"ul"),{class:$e(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:ae(()=>[(k(!0),L(Be,null,xt(e.node.items,(s,r)=>{var l;return k(),ce(jo(n.value),fi({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:s,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>i.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);w1.install=e=>{e.component(w1.__name,w1)};const Uye={key:2,class:"html-block-node__raw"},Vye=["innerHTML"],Kye={key:1,class:"html-block-node__placeholder"},d0=$i(ct({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=tn("markstreamHtmlPolicy",void 0),i=tn("markstreamNestedRendererProps",void 0),o=D(()=>{var I,F;return(F=(I=t.htmlPolicy)!=null?I:n?.value)!=null?F:"safe"}),s=D(()=>{var I,F;const W=(I=i?.value)!=null?I:{};return On(Ot({},W),{customId:(F=t.customId)!=null?F:W.customId,htmlPolicy:o.value})}),r=_u({loader:()=>Promise.resolve().then(()=>X7),suspensible:!1}),l=D(()=>{const I=Yy(t.node.attrs,o.value);if(!I)return;const F=r0(I);return Object.keys(F).length>0?F:void 0}),a=D(()=>{const I=String(t.node.tag||"").trim(),F=Yy(t.node.attrs,o.value,I);if(!F)return;const W=r0(F);return Object.keys(W).length>0?W:void 0}),u=xs(()=>t.customId),c=ct({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=U(null),f=U(typeof window>"u"),h=U(t.node.content),m=D(()=>Array.isArray(t.node.children)?t.node.children:[]),g=D(()=>String(t.node.tag||"div")),v=D(()=>{var I;if(g.value.trim().toLowerCase()!=="details"||(I=t.node.attrs)!=null&&I.some(([W])=>String(W).toLowerCase()==="open"))return null;const F=m.value[0];return F?.type==="html_block"&&String(F.tag||"").toLowerCase()==="summary"?F:null}),y=D(()=>{var I;return Bh((I=v.value)==null?void 0:I.children)}),b=D(()=>{const I=v.value;if(!I)return;const F=Yy(I.attrs,o.value,"summary");if(!F)return;const W=r0(F);return Object.keys(W).length>0?W:void 0}),C=D(()=>y.value==null?m.value:m.value.slice(1)),A=D(()=>{const I=g.value.trim().toLowerCase();return wj.has(I)||F7(I,o.value)}),T=D(()=>m.value.length>0&&!!t.node.tag&&!A.value),N=D(()=>{var I,F,W;if(T.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(I=h.value)!=null?I:""};const P=(F=h.value)!=null?F:t.node.content;if(!P)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:k1(P,o.value)};if(t.node.loading){const R=wk(P,u.value,o.value);return R===null?{mode:"text",content:(W=t.node.raw)!=null?W:P}:{mode:"dynamic",nodes:R}}if(!ZH(P,u.value))return{mode:"html",content:k1(P,o.value)};const O=wk(P,u.value,o.value);return O===null?{mode:"html",content:k1(P,o.value)}:{mode:"dynamic",nodes:O}}),_=H7(),w=z7(),M=j7(),x=Ya(null),E=!!t.node.loading;return typeof window<"u"?(qe([()=>d.value,()=>w?.value.heavyBlockMargin,()=>w?.value.rootMargin],([I],F,W)=>{var P,O,R,z;if((O=(P=x.value)==null?void 0:P.destroy)==null||O.call(P),x.value=null,!E)return f.value=!0,void(h.value=t.node.content);if(!I)return void(f.value=!1);let H=!0;const j=(z=(R=w?.value.heavyBlockMargin)!=null?R:w?.value.rootMargin)!=null?z:Fh,K=_(I,{rootMargin:j,allowIdle:!M.value});x.value=K,f.value=f.value||K.isVisible.value,K.whenVisible.then(()=>{H&&x.value===K&&(f.value=!0)}),W(()=>{H=!1,K.destroy(),x.value===K&&(x.value=null)})},{immediate:!0}),qe(()=>t.node.content,I=>{E&&!f.value||(h.value=I)})):f.value=!0,si(()=>{var I,F;(F=(I=x.value)==null?void 0:I.destroy)==null||F.call(I),x.value=null}),(I,F)=>(k(),ce(jo(T.value?g.value:"div"),fi({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(M)&&!f.value?"true":void 0},T.value?a.value:void 0),{default:ae(()=>[f.value?(k(),L(Be,{key:0},[N.value.mode==="structured"?(k(),L(Be,{key:0},[y.value!==null?(k(),L(Be,{key:0},[S("summary",AQ(i$(b.value)),B(y.value),17),C.value.length?(k(),ce(p(r),fi({key:0},s.value,{nodes:C.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ee("",!0)],64)):(k(),ce(p(r),fi({key:1},s.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):N.value.mode==="dynamic"?(k(),ce(p(c),{key:1,nodes:N.value.nodes},null,8,["nodes"])):N.value.mode==="text"?(k(),L("pre",Uye,B(N.value.content),1)):(k(),L("div",fi({key:3},l.value,{innerHTML:N.value.content}),null,16,Vye))],64)):(k(),L("div",Kye,[Yn(I.$slots,"placeholder",{node:e.node},()=>[F[0]||(F[0]=S("span",{class:"html-block-node__placeholder-bar"},null,-1)),F[1]||(F[1]=S("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),F[2]||(F[2]=S("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);d0.install=e=>{e.component(d0.__name,d0)};const Zye={dir:"auto",class:"paragraph-node"},Gye=["custom-id"],wh=$i(ct({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=xs(()=>t.customId),i=tn("markstreamHtmlPolicy",void 0),o=tn("markstreamFade",void 0),s=tn("markstreamParseOptions",void 0),r=tn("markstreamCustomMarkdownIt",void 0),l=tn("markstreamNestedRendererProps",void 0),a=D(()=>{var w;return(w=i?.value)!=null?w:"safe"}),u=D(()=>{var w;return(w=t.parseOptions)!=null?w:s?.value}),c=D(()=>{var w;return(w=t.customMarkdownIt)!=null?w:r?.value}),d=D(()=>{var w,M;return(M=t.customHtmlTags)!=null?M:(w=l?.value)==null?void 0:w.customHtmlTags}),f=D(()=>{var w,M;const x=(w=l?.value)!=null?w:{};return On(Ot({},x),{customId:(M=t.customId)!=null?M:x.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=_u({loader:()=>Promise.resolve().then(()=>X7),suspensible:!1});function m(w){var M;return w.type==="text"&&String((M=w.content)!=null?M:"").trim()===""}const g=D(()=>t.node.children.filter(w=>!m(w))),v=D(()=>g.value.length>0&&g.value.every(w=>w.type==="image"||(function(M){var x;const E=(function(I){return I.type==="link"&&Array.isArray(I.children)?I.children.filter(F=>!m(F)):[]})(M);return E.length===1&&((x=E[0])==null?void 0:x.type)==="image"})(w))),y=D(()=>new Set(Yh(d.value))),b=D(()=>{if(!v.value||g.value.length<=1)return t.node.children;const w=[];for(let M=0;M0,I=t.node.children.slice(M+1).some(F=>!m(F));E&&I&&w.push(On(Ot({},x),{content:" ",raw:" "}))}return w}),C=D(()=>o?.value===!1&&!n.value.text),A=D(()=>C.value?Bh(b.value):null);function T(w,M){return{node:w,"index-key":`${t.indexKey}-${M}`,"custom-id":t.customId,"custom-html-tags":d.value}}const N=D(()=>Ot({inline_code:Mr,image:Md,link:Zr,hardbreak:Id,emphasis:Gr,strong:Vr,strikethrough:Kr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,html_inline:Hl,html_block:d0,emoji:pl,checkbox:zl,math_inline:Ja,checkbox_input:zl,reference:Ur,footnote_anchor:c0,footnote_reference:jl,text:Uo},n.value)),_=D(()=>b.value.map((w,M)=>{var x;const E=(function(I){var F,W,P,O;if(I.type==="html_block"||I.type==="html_inline"){const R=String((F=I.tag)!=null?F:"").trim().toLowerCase()||_j(I.content);if(R&&!y.value.has(R)&&Mj((W=I.content)!=null?W:I.raw,R)){const z=String((O=(P=I.content)!=null?P:I.raw)!=null?O:"");return{child:{type:"text",content:z,raw:z},component:Uo,isCustomComponent:!1}}}return{child:I,component:N.value[I.type],isCustomComponent:!!(n.value[I.type]&&!$v(String(I.type)))}})(w);return On(Ot({},E),{index:M,key:`${t.indexKey||"paragraph"}-${M}`,customAttrs:E.isCustomComponent?P7(E.child,a.value):void 0,hasSlotChildren:Array.isArray(E.child.children)&&E.child.children.length>0,slotContent:String((x=E.child.content)!=null?x:""),originalChild:w})}));return(w,M)=>(k(),L("p",Zye,[A.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(A.value),9,Gye)):(k(!0),L(Be,{key:1},xt(_.value,x=>{return k(),L(Be,{key:x.key},[v.value&&m(x.originalChild)?(k(),L(Be,{key:0},[Pe(B((E=x.originalChild,String((I=E.content)!=null?I:""))),1)],64)):x.isCustomComponent?(k(),ce(jo(x.component),fi({key:1,ref_for:!0},x.customAttrs,{node:x.child,loading:x.child.loading,"index-key":x.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:ae(()=>[x.hasSlotChildren?(k(),ce(p(h),fi({key:0,ref_for:!0},f.value,{nodes:x.child.children,"index-key":x.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):x.slotContent?(k(),ce(p(h),fi({key:1,ref_for:!0},f.value,{content:x.slotContent,final:!x.child.loading,"index-key":`${x.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(k(),ce(jo(x.component),fi({key:2,ref_for:!0},T(x.child,x.index)),null,16))],64);var E,I}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);wh.install=e=>{e.component(wh.__name,wh)};const Qye={class:"table-node-wrapper"},Yye=["aria-busy"],Jye={key:0},Xye=["custom-id"],e9e=["aria-label","onPointerdown"],t9e=["custom-id"],n9e={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},f0=$i(ct({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var y;return(y=t.node.loading)!=null&&y}),i=D(()=>{var y;return(y=t.node.rows)!=null?y:[]}),o=U(null),s=U([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>s.value.some(y=>Number.isFinite(y)&&y>0)),u=D(()=>a.value?s.value.map(y=>y>0?{width:`${y}px`}:void 0):[]);ri("markstreamShowTooltips",D(()=>t.showTooltips)),ri("markstreamFade",D(()=>t.fade));const c=xs(()=>t.customId),d=D(()=>!!c.value.text),f=D(()=>!!c.value.paragraph),h=new WeakMap;function m(y){const b=t.fade===!1&&!d.value,C=!f.value,A=h.get(y);if(A?.children===y.children&&A.textFastPath===b&&A.paragraphFastPath===C)return A.info;const T=Ak(y.children,C,!0),N={simpleChildren:T,plainText:T&&b?Bh(T):null};return h.set(y,{children:y.children,textFastPath:b,paragraphFastPath:C,info:N}),N}function g(y){if(!r)return;y.preventDefault();const b=r.startWidth+r.nextStartWidth,C=Math.min(48,Math.floor(b/2)),A=Math.max(C,Math.min(b-C,Math.round(r.startWidth+y.clientX-r.startX))),T=[...r.widths];T[r.index]=A,T[r.index+1]=b-A,s.value=T}function v(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),r=null)}return qe(l,()=>{v(),s.value=[]}),si(v),(y,b)=>(k(),L("div",Qye,[S("table",{ref_key:"tableRef",ref:o,class:$e(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(k(),L("colgroup",Jye,[(k(!0),L(Be,null,xt(e.node.header.cells,(C,A)=>(k(),L("col",{key:A,style:sn(u.value[A])},null,4))),128))])):ee("",!0),S("thead",null,[S("tr",null,[(k(!0),L(Be,null,xt(e.node.header.cells,(C,A)=>(k(),L("th",{key:A,dir:"auto",class:$e([C.align==="right"?"text-right":C.align==="center"?"text-center":"text-left"])},[m(C).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(m(C).plainText),9,Xye)):m(C).simpleChildren?(k(),ce(p(Y0),{key:1,nodes:m(C).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${A}`},null,8,["nodes","custom-id","index-key"])):(k(),ce(p(yl),{key:2,nodes:C.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[0]||(b[0]=T=>y.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),A(function(N,_){if(_.button!==0)return;const w=(function(){var E;const I=(E=o.value)==null?void 0:E.querySelectorAll("thead th");return Array.from(I??[],F=>Math.round(F.getBoundingClientRect().width))})(),M=w[N],x=w[N+1];M&&x&&(_.preventDefault(),r={index:N,startX:_.clientX,startWidth:M,nextStartWidth:x,widths:w},s.value=w,window.addEventListener("pointermove",g),window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v))})(A,T)},null,40,e9e)):ee("",!0)],2))),128))])]),S("tbody",null,[(k(!0),L(Be,null,xt(i.value,(C,A)=>(k(),L("tr",{key:A},[(k(!0),L(Be,null,xt(C.cells,(T,N)=>(k(),L("td",{key:N,class:$e([T.align==="right"?"text-right":T.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(T).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(m(T).plainText),9,t9e)):m(T).simpleChildren?(k(),ce(p(Y0),{key:1,nodes:m(T).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${A}-${N}`},null,8,["nodes","custom-id","index-key"])):(k(),ce(p(yl),{key:2,nodes:T.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[1]||(b[1]=_=>y.$emit("copy",_))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,Yye),V(mo,{name:"table-node-fade"},{default:ae(()=>[n.value?(k(),L("div",n9e,[Yn(y.$slots,"loading",{isLoading:n.value},()=>[b[2]||(b[2]=S("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),b[3]||(b[3]=S("span",{class:"sr-only"},"Loading",-1))],!0)])):ee("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);f0.install=e=>{e.component(f0.__name,f0)};const i9e={class:"hr-node"},o9=$i({},[["render",function(e,t){return k(),L("hr",i9e)}],["__scopeId","data-v-39b2349c"]]);o9.install=e=>{e.component(o9.__name,o9)};const o9e={class:"unknown-node"},UC=ct({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(k(),L("div",o9e,B(e.node.raw),1))}),s9=$i(ct({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),i=xs(()=>t.customId),o=D(()=>Ot({text:Uo,paragraph:wh,heading:n4,inline_code:Mr,link:Zr,image:Md,strong:Vr,emphasis:Gr,strikethrough:Kr,insert:vl,subscript:gl,superscript:ml,checkbox:zl,checkbox_input:zl,hardbreak:Id,math_inline:Ja,reference:Ur,list:w1,math_block:tW,table:f0},i.value));return(s,r)=>(k(),L("div",fi({class:n.value},e.node.attrs),[(k(!0),L(Be,null,xt(e.node.children,(l,a)=>{return k(),ce(jo((u=l.type,o.value[u]||UC)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);s9.install=e=>{e.component(s9.__name,s9)};const s9e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],tN=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function r9e(e){if(e<=255)return s9e[e];let t=0,n=tN.length-1;for(;t<=n;){const i=t+n>>1,o=tN[i];if(eo[1]))return o[2];t=i+1}}return"L"}const l9e=/[ \t\n\r\f]+/g,a9e=/[\t\n\r\f]| {2,}|^ | $/;let R8=null;const u9e=new RegExp("\\p{Script=Arabic}","u"),qd=new RegExp("\\p{M}","u"),q7=new RegExp("\\p{Nd}","u");function nN(e){return u9e.test(e)}function iN(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function Iu(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(iN(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(iN(n))return!0}}return!1}const c9e=new Set([" "," ","⁠","\uFEFF"]),d9e=new Set(["-","‐","–","—"]);function nW(e,t){return!((function(n){const i=h0(n);return i!==null&&c9e.has(i)})(e)||t&&((function(n){const i=h0(n);return i!==null&&(U7.has(i)||Rh.has(i))})(e)||(function(n){const i=h0(n);return i!==null&&d9e.has(i)})(e)))}const U7=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),i4=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),V7=new Set(["'","’"]),Rh=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),f9e=new Set([":",".","،","؛"]),h9e=new Set(["၏"]),p9e=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function m9e(e){if(K7(e))return!0;let t=!1;for(const n of e)if(Rh.has(n)||Sk(n))t=!0;else if(!t||!qd.test(n))return!1;return t}function g9e(e){for(const t of e)if(!U7.has(t)&&!Rh.has(t))return!1;return e.length>0}function v9e(e){if(K7(e))return!0;for(const t of e)if(!(i4.has(t)||V7.has(t)||qd.test(t)||Sk(t)))return!1;return e.length>0}function K7(e){let t=!1;for(const n of e)if(n!=="\\"&&!qd.test(n)){if(!(i4.has(n)||Rh.has(n)||V7.has(n)))return!1;t=!0}return t}function xk(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function h0(e){if(e.length===0)return null;const t=xk(e,e.length);return e.slice(t)}const y9e=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Sk(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,i){for(let o=0;o=i[o]&&n<=i[o+1])return!0;return!1})(t,y9e)}function k9e(e){const t=(function(n){for(const i of n)if(!qd.test(i))return i;return null})(e);return t!==null&&q7.test(t)}function b9e(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(qd.test(i))n--;else{if(!i4.has(i)&&!V7.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function w9e(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function oN(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const l=o.repeat(r);return e[i]=l,l}function sN(e,t){return e&&t!==null&&f9e.has(t)}function C9e(e){const t=h0(e);return t!==null&&h9e.has(t)}function A9e(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function VC(e){let t=e.length;for(;t>0;){const n=xk(e,t),i=e.slice(n,t);if(p9e.has(i))return!0;if(!Rh.has(i))return!1;t=n}return!1}function x9e(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` +`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const S9e=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Da(e){return e.length===1?e[0]:e.join("")}function _9e(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Da(n)}function M9e(e,t,n,i){if(!S9e.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=x9e(c,i),f=d==="text"&&t;s===null||d!==s||f!==a?(s!==null&&o.push({text:Da(r),isWordLike:a,kind:s,start:l}),s=d,r=[c],l=n+u,a=f,u+=c.length):(r.push(c),u+=c.length)}return s!==null&&o.push({text:Da(r),isWordLike:a,kind:s,start:l}),o}function O8(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const I9e=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function T9e(e,t){const n=e.texts[t];return!!n.startsWith("www.")||I9e.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!F9e.has(e)&&!D9e.test(e)&&N9e.test(e)}function rN(e){let t=!1;for(const n of e)if(!qd.test(n)){if(!iW(n))return!1;t=!0}return t}function B9e(e,t,n,i){const o=!t&&rN(e),s=!i&&rN(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const f=xk(c,d),h=c.slice(f,d);if(!qd.test(h))return h;d=f}return null})(a);return u!==null&&Sk(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=xk(a,u),d=a.slice(c,u);if(!qd.test(d))return iW(d)||Sk(d);u=c}return!1})(e);return!!(o||s||l)&&!Iu(e)&&!Iu(n)&&(t||o||r)&&(i||s)}function lN(e){for(const t of e)if(q7.test(t))return!0;return!1}function r9(e){if(e.length===0)return!1;for(const t of e)if(!q7.test(t)&&!L9e.has(t))return!1;return!0}function R9e(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let i=0;for(let o=0;o0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,u,c){var d,f,h;const m=(R8===null&&(R8=new Intl.Segmenter(void 0,{granularity:"word"})),R8);let g=0;const v=[],y=[],b=[],C=[],A=[],T=[],N=[],_=[],w=[],M=[],x=[],E=[];for(const O of m.segment(a))for(const R of M9e(O.segment,(d=O.isWordLike)!=null&&d,O.index,c)){let z=function(){T[te]!==null&&(y[te]=[oN(v,T,N,te)],T[te]=null),y[te].push(R.text),b[te]=b[te]||R.isWordLike,_[te]=_[te]||K,w[te]=w[te]||re,M[te]=Q,x[te]=ne,E[te]=sN(w[te],q)};const H=R.kind==="text",j=w9e(R.text,R.isWordLike,R.kind),K=Iu(R.text),re=nN(R.text),q=h0(R.text),Q=VC(R.text),ne=C9e(R.text),te=g-1;u.carryCJKAfterClosingQuote&&H&&g>0&&C[te]==="text"&&K&&_[te]&&M[te]||H&&g>0&&C[te]==="text"&&g9e(R.text)&&_[te]||H&&g>0&&C[te]==="text"&&x[te]?z():H&&g>0&&C[te]==="text"&&R.isWordLike&&re&&E[te]?(z(),b[te]=!0):j!==null&&g>0&&C[te]==="text"&&T[te]===j?N[te]=((f=N[te])!=null?f:1)+1:H&&!R.isWordLike&&g>0&&C[te]==="text"&&!_[te]&&(m9e(R.text)||R.text==="-"&&b[te])?z():(v[g]=R.text,y[g]=[R.text],b[g]=R.isWordLike,C[g]=R.kind,A[g]=R.start,T[g]=j,N[g]=j===null?0:1,_[g]=K,w[g]=re,M[g]=Q,x[g]=ne,E[g]=sN(re,q),g++)}for(let O=0;Onull);let F=-1;for(let O=g-1;O>=0;O--){const R=v[O];if(R.length!==0){if(C[O]==="text"&&!b[O]&&F>=0&&C[F]==="text"&&(v9e(R)||R==="-"&&k9e(v[F]))){const z=(h=I[F])!=null?h:[];z.push(R),I[F]=z,A[F]=A[O],v[O]="";continue}F=O}}for(let O=0;OK+1){R.push(Da(ne)),z.push(ge),H.push("text"),j.push(O.starts[K]),K=te;continue}}R.push(re),z.push(Q),H.push(q),j.push(O.starts[K]),K++}return{len:R.length,texts:R,isWordLike:z,kinds:H,starts:j}})((function(O){const R=[],z=[],H=[],j=[];for(let K=0;K1;for(let ne=0;ne=O.len||O8(O.kinds[q]))continue;const Q=[],ne=O.starts[q];let te=q;for(;te0&&(R.push(Da(Q)),z.push(!0),H.push("text"),j.push(ne),K=te-1)}return{len:R.length,texts:R,isWordLike:z,kinds:H,starts:j}})((function(O){const R=O.texts.slice(),z=O.isWordLike.slice(),H=O.kinds.slice(),j=O.starts.slice();for(let re=0;re=0&&!nW(u.texts[C-1],c)&&b(C),g<0&&(g=C),v=v||Iu(A))}return b(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:m}})(s,r,t.breakKeepAllAfterPunctuation):r;return Ot({normalized:s,chunks:R9e(l,o)},l)}let xp=null;const aN=new Map;let Sp=null;const $9e=new RegExp("\\p{Emoji_Presentation}","u"),P9e=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let $8=null;const uN=new Map;function KC(){if(xp!==null)return xp;if(typeof OffscreenCanvas<"u")return xp=new OffscreenCanvas(1,1).getContext("2d"),xp;if(typeof document<"u")return xp=document.createElement("canvas").getContext("2d"),xp;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Zc(e,t){let n=t.get(e);return n===void 0&&(n={width:KC().measureText(e).width,containsCJK:Iu(e)},t.set(e,n)),n}function _k(){if(Sp!==null)return Sp;if(typeof navigator>"u")return Sp={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Sp;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Sp={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Sp}function oW(){return $8===null&&($8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),$8}function z9e(e){return $9e.test(e)||e.includes("️")}function Df(e,t,n){return n===0?t.width:t.width-(function(i,o){return o.emojiCount===void 0&&(o.emojiCount=(function(s){let r=0;const l=oW();for(const a of l.segment(s))z9e(a.segment)&&r++;return r})(i)),o.emojiCount})(e,t)*n}function j9e(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function cN(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function dN(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function Z7(e,t){return t===0?0:e+t}function q9e(e,t,n,i,o){return Z7(i,t==="tab"?o+(function(s,r){return s.letterSpacing!==0&&s.spacingGraphemeCounts[r]>0?s.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function fN(e,t,n,i){return Z7(i,t==="tab"?0:e.lineEndFitAdvances[n])}function hN(e,t,n,i,o){return Z7(i,t==="tab"?o:e.lineEndPaintAdvances[n])}function U9e(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function V9e(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function ty(e,t,n){let i=t;for(;iz){if(be!==null&&oe>Z){te(ue,oe,J),fe=oe,we=ty(be,we,fe+1),oe=-1,J=0;continue}te(),Ae(ue,fe,ve)}else j+=ve,re=ue,q=fe+1;else Ae(ue,fe,ve);const Ce=fe+1;be!==null&&be[we]===Ce&&(oe=Ce,J=j,we++),fe++}K&&re===ue&&q===ke.length&&(re=ue+1,q=0)}let Y=0;for(;Y=W.length)));){const ue=W[Y],Z=cN(P[Y]);if(K)if(j+ue>z){if(Z){me(Y,ue),te(Y+1,0,j-ue),Y++;continue}if(Q>=0){if(re>Q||re===Q&&q>0){te();continue}te(Q,0,ne);continue}if(ue>z&&O[Y]!==null){te(),de(Y,0),Y++;continue}te()}else me(Y,ue),Z&&(Q=Y+1,ne=j-ue),Y++;else ue>z&&O[Y]!==null?de(Y,0):ge(Y,ue),Z&&(Q=Y+1,ne=j-ue),Y++}return K&&te(),H})(n,i);const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:u}=n;if(o.length===0||u.length===0)return 0;const c=_k(),d=i+c.lineFitEpsilon;let f=0,h=0,m=!1,g=0,v=0,y=-1,b=0,C=null;function A(){y=-1,b=0,C=null}function T(I=g,F=v,W){f++,h=0,m=!1,A()}function N(I,F){m=!0,g=I+1,v=0,h=F}function _(I,F,W){m=!0,g=I,v=F+1,h=W}function w(I,F){m?(h+=F,g=I+1,v=0):N(I,F)}function M(I,F,W,P,O,R){if(!F)return;const z=fN(n,I,W,O);hN(n,I,W,O,P),y=W+1,b=h-R+z,C=I}function x(I,F){var W;const P=r[I],O=(W=l[I])!=null?W:null;let R=O===null?-1:ty(O,0,F+1),z=-1,H=F;for(;Hd){if(O!==null&&z>F){T(I,z),H=z,R=ty(O,R,H+1),z=-1;continue}T(),_(I,H,j)}else h=q,g=I,v=H+1}else _(I,H,j);const K=H+1;O!==null&&O[R]===K&&(z=K,R++),H++}m&&g===I&&v===P.length&&(g=I+1,v=0)}function E(I){f++,A()}for(let I=0;I=F.endSegmentIndex)));){const P=s[W],O=cN(P),R=W9e(n,m,W),z=P==="tab"?H9e(h+R,n.tabStopAdvance):o[W],H=R+z,j=q9e(n,P,W,R,z);if(P!=="soft-hyphen")if(m){if(h+j>d){const K=h+fN(n,P,W,R);if(hN(n,P,W,R,z),C==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){T(y,0);continue}if(O&&K<=d){w(W,H),T(W+1,0),W++;continue}if(y>=0&&b<=d){if(g>y||g===y&&v>0){T();continue}const re=y;T(re,0),W=re;continue}if(j>d&&r[W]!==null){T(),x(W,0),W++;continue}T();continue}w(W,H),M(P,O,W,z,R,H),W++}else j>d&&r[W]!==null?x(W,0):N(W,z),M(P,O,W,z,R,H),W++;else m&&(g=W+1,v=0,y=W+1,b=h+a,C=P),W++}m&&(F.consumedEndSegmentIndex,T(F.consumedEndSegmentIndex,0))}return f})(e,t)}let P8=null;function G7(){return P8===null&&(P8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),P8}function Z9e(e,t){const n=[];let i=[],o=0,s=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,l=!1)}function u(d,f,h){i=[d],o=f,s=h,r=VC(d),l=i4.has(d)}function c(d,f){i.push(d),s=s||f;const h=VC(d);r=d.length===1&&Rh.has(d)&&r||h,l=!1}for(const d of G7().segment(e)){const f=d.segment,h=Iu(f);i.length!==0?l||U7.has(f)||Rh.has(f)||t.carryCJKAfterClosingQuote&&h&&r?c(f,h):s||h?(a(),u(f,d.index,h)):c(f,h):u(f,d.index,h)}return a(),n}function G9e(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(l){if(!(o<0)){if(s)o+1===l?i.push(t[o]):(function(a,u){const c=t[a].start,d=u=0&&!nW(t[l-1].text,n)&&r(l),o<0&&(o=l),s=s||Iu(a.text)}return r(t.length),i}function pN(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=G7();for(const o of i.segment(e))n++;return n}function Q9e(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Y9e(e,t,n,i,o){const s=_k(),{cache:r,emojiCorrection:l}=(function(E,I){KC().font=E;const F=(function(O){let R=aN.get(O);return R||(R=new Map,aN.set(O,R)),R})(E),W=(function(O){const R=O.match(/(\d+(?:\.\d+)?)\s*px/);return R?parseFloat(R[1]):16})(E),P=I?(function(O,R){let z=uN.get(O);if(z!==void 0)return z;const H=KC();H.font=O;const j=H.measureText("😀").width;if(z=0,j>R+.5&&typeof document<"u"&&document.body!==null){const K=document.createElement("span");K.style.font=O,K.style.display="inline-block",K.style.visibility="hidden",K.style.position="absolute",K.textContent="😀",document.body.appendChild(K);const re=K.getBoundingClientRect().width;document.body.removeChild(K),j-re>.5&&(z=j-re)}return uN.set(O,z),z})(E,W):0;return{cache:F,fontSize:W,emojiCorrection:P}})(t,(a=e.normalized,P9e.test(a)));var a;const u=Df("-",Zc("-",r),l)+(o===0?0:2*o),c=8*Df(" ",Zc(" ",r),l),d=o!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],m=[],g=[];let v=e.chunks.length<=1&&!d;const y=null,b=[],C=[],A=[],T=null,N=Array.from({length:e.len});function _(E,I,F,W,P,O,R,z,H){P!=="text"&&P!=="space"&&P!=="zero-width-break"&&(v=!1),f.push(I),h.push(F),m.push(W),g.push(P),b.push(R),C.push(z),d&&A.push(H)}function w(E,I,F,W,P){const O=Zc(E,r),R=d?pN(E,I):0,z=(function(re,q,Q){return q>1?re+(q-1)*Q:re})(Df(E,O,l),R,o),H=I==="space"||I==="preserved-space"||I==="zero-width-break"?0:z,j=H===0?0:H+(R>0?o:0),K=I==="space"||I==="zero-width-break"?0:z;if(P&&W&&E.length>1){let re="sum-graphemes";o!==0?re="segment-prefixes":r9(E)?re="pair-context":s.preferPrefixWidthsForBreakableRuns&&(re="segment-prefixes");const q=(function(ne,te,ge,Ae,me){if(te.breakableFitAdvances!==void 0&&te.breakableFitMode===me)return te.breakableFitAdvances;te.breakableFitMode=me;const de=oW(),Y=[];for(const ke of de.segment(ne))Y.push(ke.segment);if(Y.length<=1)return te.breakableFitAdvances=null,te.breakableFitAdvances;if(me==="sum-graphemes"){const ke=[];for(const be of Y){const we=Zc(be,ge);ke.push(Df(be,we,Ae))}return te.breakableFitAdvances=ke,te.breakableFitAdvances}if(me==="pair-context"||Y.length>96){const ke=[];let be=null,we=0;for(const oe of Y){const J=Df(oe,Zc(oe,ge),Ae);if(be===null)ke.push(J);else{const fe=be+oe,ve=Zc(fe,ge);ke.push(Df(fe,ve,Ae)-we)}be=oe,we=J}return te.breakableFitAdvances=ke,te.breakableFitAdvances}const ue=[];let Z="",se=0;for(const ke of Y){Z+=ke;const be=Df(Z,Zc(Z,ge),Ae);ue.push(be-se),se=be}return te.breakableFitAdvances=ue,te.breakableFitAdvances})(E,O,r,l,re),Q=q===null||i==="keep-all"?null:(function(ne){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(ne))return null;const te=[];let ge=0;for(const Ae of G7().segment(ne))ge++,Q9e(Ae.segment)&&te.push(ge);return te.length===0?null:te})(E);return void _(E,z,j,K,I,F,q,Q,R)}_(E,z,j,K,I,F,null,null,R)}for(let E=0;E=55296&&ne<=56319&&Q+1=56320&&me<=57343&&(te=me-56320+(ne-55296<<10)+65536,ge=2)}const Ae=r9e(te);Ae!=="R"&&Ae!=="AL"&&Ae!=="AN"||(z=!0);for(let me=0;me=0&&R[ne]==="ET";ne--)R[ne]="EN";for(ne=Q+1;ne0?R[Q-1]:re)!=="L"?"R":"L";if(te===((ne{const e=globalThis;if(e[z8])return e[z8];const t={configs:{},controllers:{},revision:Ya(0),preparedCache:new Map,blockEstimateCache:new Map};return e[z8]=t,t})();let ng=null;const j8=Ms.revision;function mN(e){var t;return e&&(t=Ms.configs[e])!=null?t:null}function gN(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function X9e(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function H8(e){var t,n,i;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const s of e){if(!X9e(s))return null;s.type==="text"?o+=String((t=s.content)!=null?t:""):s.type==="emoji"?o+=String((i=(n=s.name)!=null?n:s.raw)!=null?i:""):s.type==="hardbreak"&&(o+=` +`)}return o.length>0?o:null}function W8(e,t,n){var i,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var s;if(ng!=null)return ng;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return ng=!!((s=r.getContext)!=null&&s.call(r,"2d")),ng}catch{return ng=!1,!1}})())return null;try{const s=Math.round(100*t)/100,r=[(i=n.whiteSpace)!=null?i:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,s,e].join("\0"),l=Ms.blockEstimateCache.get(r);if(l)return Ms.blockEstimateCache.delete(r),Ms.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",u=(function(h,m,g){const v=`${g}\0${m}\0${h}`,y=Ms.preparedCache.get(v);if(y)return Ms.preparedCache.delete(v),Ms.preparedCache.set(v,y),y.prepared;const b=(function(C,A,T){return(function(N,_,w,M){var x,E;const I=(x=M?.wordBreak)!=null?x:"normal",F=(E=M?.letterSpacing)!=null?E:0;return Y9e(O9e(N,_k(),M?.whiteSpace,I),_,!1,I,F)})(C,A,0,T)})(h,m,{whiteSpace:g});for(Ms.preparedCache.set(v,{prepared:b});Ms.preparedCache.size>240;){const C=Ms.preparedCache.keys().next().value;if(!C)break;Ms.preparedCache.delete(C)}return b})(e,n.font,a),c=(function(h,m,g){const v=K9e(h,m);return{lineCount:v,height:v*g}})(u,Math.max(24,s-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,c.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Ms.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Ms.blockEstimateCache.size>4e3;){const h=Ms.blockEstimateCache.keys().next().value;if(!h)break;Ms.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function sW(e,t,n){var i,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const s=H8(e.children);return s&&n.paragraph?W8(s,t,n.paragraph):null}if(e.type==="heading"){const s=Number(e.level||0),r=H8(e.children),l=n.headings[s];return r&&l?W8(r,t,l):null}if(e.type==="list_item"){const s=Array.isArray(e.children)?e.children:[];if(s.length!==1||((i=s[0])==null?void 0:i.type)!=="paragraph"||!n.listItem)return null;const r=H8((o=s[0])==null?void 0:o.children);return r?W8(r,t,n.listItem):null}if(e.type==="list"){const s=Array.isArray(e.items)?e.items:[];if(!s.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of s){const a=sW(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function ig(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function Ff(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function q8(e,t,n=0){return e.diff?W7(t??{},n)?(function(i){const o=Ff(i.raw);if(o){const s=o.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,s.filter(r=>!J9e.some(l=>r.startsWith(l))).length):Math.max(1,s.length)}return ig(Ff(i.originalCode))+ig(Ff(i.updatedCode))})(e):(function(i){const o=i.originalCode,s=i.updatedCode;if(o!=null||s!=null)return Math.max(ig(Ff(o)),ig(Ff(s)));const r=Ff(i.code).split(/\r?\n/);let l=0,a=0;for(const u of r)u.startsWith("+")&&!u.startsWith("+++")?a++:u.startsWith("-")&&!u.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):ig(Ff(e.code,e.loading===!0))}function eke(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function U8(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const i=window.getComputedStyle(t),o=e.offsetHeight,s=gN(i.lineHeight,1.5*gN(i.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:eke(i),lineHeight:s,wrapperOverhead:Math.max(0,o-s),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const tke=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function vN(e,t={}){var n;const i={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return i;const s=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(s))tke.has(r)||o.has(r)||l.enumerable&&"value"in l&&(i[r]=l.value);return i}function yN(e,t,n,i){var o;const s=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,s);if(!i.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,s-r),a=[-l,l];let u=a[0],c=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=i.getNormalizedScrollTop(e,t,!1),m=Math.abs(h-r);md&&(e.scrollTop=u)}function kN(e,t){let n=0,i=null,o=null;const s=()=>{const r=o;o=null,i=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);o=r,a<=0?(i&&(clearTimeout(i),i=null),n=l,o=null,e(...r)):i||(i=setTimeout(s,a))}}function bN(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const rW=Symbol("MarkstreamMathBlockMinHeightCache");function rkt(){return tn(rW,null)}const nke=new Set(["text","inline_code","emoji","footnote_reference"]),ike=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function og(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function Bf(e,t,n,i=22){const o=String(e??"");if(!o)return n;const s=Math.max(18,Math.floor(Math.max(320,t)/8)),r=o.split(/\r?\n/).length,l=Math.ceil(o.length/s),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*i+12))}function lW(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(nke.has(i))return!0;if(!ike.has(i))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(lW)}function ZC(e){var t,n,i,o,s,r,l,a;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((i=(n=u.content)!=null?n:u.raw)!=null?i:"");if(c==="inline_code")return String((r=(s=(o=u.code)!=null?o:u.content)!=null?s:u.raw)!=null?r:"");if(c==="emoji")return String((a=(l=u.name)!=null?l:u.raw)!=null?a:"");if(typeof u.text=="string")return u.text;const d=[];for(const f of["children","items","cells","rows"]){const h=u[f];if(Array.isArray(h)){const m=h.map(ZC).filter(Boolean).join(" ");m&&d.push(m)}}return d.join(" ").replace(/\s+/g," ").trim()}function aW(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const i=t[n];return Array.isArray(i)&&i.some(aW)})}function oke(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),i=e.split(/\r?\n/).length,o=Math.ceil(e.length/n),s=Math.max(1,i,o);return 30+26*Math.max(0,s-1)}function ske(e,t){var n,i,o,s,r,l,a,u,c,d,f,h,m,g;if(!e||typeof e!="object")return 32;const v=e,y=String((n=v.type)!=null?n:""),b=Number.isFinite(t)&&t>0?t:640;switch(y){case"heading":return(function(C){var A;const T=Number((A=C.level)!=null?A:C.depth);return T>=4?20:T===3?30:T===2?32:44})(v);case"paragraph":return(function(C,A){const T=String(C??"");if(!T)return 28;const N=Math.max(18,Math.floor(Math.max(320,A)/8)),_=T.split(/\r?\n/).length,w=Math.ceil(T.length/N);return Math.max(1,_,w)<=1?28:Bf(T,A,34)})(String((o=(i=v.raw)!=null?i:v.content)!=null?o:""),b);case"list":return(function(C,A){var T;const N=Array.isArray(C.items)?C.items:[];if(!N.length)return 48;const _=Math.max(48,30*N.length+12);let w=12;for(const E of N)w+=oke(ZC(E)||String((T=E.raw)!=null?T:""),A);const M=Math.max(0,w-_);if(N.length>20){const E=Math.round(2.4*N.length);return Math.round(_+Math.max(E,Math.min(M,3*N.length)))}if(M<=0)return _;const x=N.length>8?8*N.length:M;return Math.round(_+Math.min(M,x))})(v,b);case"list_item":return Bf(String((r=(s=v.raw)!=null?s:v.content)!=null?r:""),b,34);case"blockquote":return Bf(String((a=(l=v.raw)!=null?l:v.content)!=null?a:""),b,56);case"table":return(function(C,A){const T=[...C.header?[C.header]:[],...Array.isArray(C.rows)?C.rows:[]];if(!T.length){const N=Array.isArray(C.children)?C.children.length:3;return Math.max(120,38*N+48)}return Math.max(120,Math.round(4+T.reduce((N,_)=>N+(function(w,M){const x=Math.max(1,w.length),E=Math.max(80,(M-32)/x),I=Math.max(10,Math.floor(E/8)),F=Math.max(1,...w.map(W=>{var P;const O=ZC(W)||String((P=W?.raw)!=null?P:"");return Math.ceil(O.length/I)||1}));return 54+34*Math.max(0,F-1)+(x<=3&&w.some(aW)?14:0)})((function(w){var M;return Array.isArray(w?.cells)&&(M=w.cells)!=null?M:[]})(_),A),0)))})(v,b);case"code_block":{const C=String((u=v.language)!=null?u:"").trim().toLowerCase(),A=String((d=(c=v.code)!=null?c:v.raw)!=null?d:"");return C==="mermaid"?yk(gk(A)):C==="infographic"?kk(vk(A)):Bf(A,b,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(C,A){var T,N,_;const w=C.match(/^\s*]*)>/i);return w&&!/(?:^|\s)open(?:\s|=|$)/i.test((T=w[1])!=null?T:"")?Bf(((_=(N=C.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:N[1])==null?void 0:_.replace(/<[^>]*>/g,"").trim())||"Details",A,28,28):Bf(C,A,96)})(String((h=(f=v.raw)!=null?f:v.content)!=null?h:""),b);case"thematic_break":return 24;default:return Bf(String((g=(m=v.raw)!=null?m:v.content)!=null?g:""),b,40)}}function wN(e,t,n){return Math.min(Math.max(e,t),n)}const rke=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],lke=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],ake=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),uW=["raw","content","code","originalCode","updatedCode"],CN=new WeakMap,AN=new WeakMap;let uke=1;function Na(){return typeof performance<"u"?performance.now():Date.now()}function xN(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Bl(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=CN.get(t);return n||(n=uke++,CN.set(t,n)),String(n)}function SN(e,t,n,i={}){var o,s;const r=i.includeFinal!==!1,l={md:Bl(t),customMarkdownIt:Bl(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(s=e.streamParse)!=null?s:"auto",validateLink:Bl(e.validateLink),preTransformTokens:Bl(e.preTransformTokens),postTransformTokens:Bl(e.postTransformTokens),postTransformNodes:Bl(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function _N(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` +`,t-1)+1;return e.slice(n,t).trim()}function MN(e){const t=cW(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function cW(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function dW(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function Q7(e){const t=String(e??"");return`${t.length}:${dW(t)}`}function GC(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?Q7(r):`${r.length}:${dW(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Bl(e)}`;if(typeof e!="object")return typeof e;const i=e,o=t.get(i);if(o)return`cycle:${o}`;if(n>=6)return`object:${Bl(i)}`;const s=Bl(i);if(t.set(i,s),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>GC(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(u=>`${u}:${GC(r[u],t,n+1)}`).join(";")}`}return typeof e}function Mk(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function fW(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>Mk(i)?Ud(i,t,n+1):fW(i,t,n+1)).join(",")}`:Mk(e)?Ud(e,t,n):GC(e,t,n)}function cke(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!uW.includes(i)).map(i=>{const o=e[i];return typeof o=="string"?`${i}=s:${Q7(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${i}=${String(o)}`:typeof o=="function"?`${i}=fn:${Bl(o)}`:ake.has(i)&&(Array.isArray(o)||typeof o=="object")?`${i}=${fW(o,t,n+1)}`:o&&typeof o=="object"?`${i}=object:${Bl(o)}`:""}).filter(Boolean).join(";")}function dke(e){return uW.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Q7(n)}`:""}).filter(Boolean).join(";")}function Ud(e,t=new WeakMap,n=0){const i=AN.get(e);if(i)return i;const o=e,s=t.get(o);if(s)return`node-cycle:${s}`;if(n>=6)return`node:${e.type}:${Bl(o)}`;const r=Bl(o);t.set(o,r);const l=(function(a,u,c){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(m=>Ud(m,u,c+1)).join("|"):"";return[a.type,dke(d),cke(d,u,c),f.length,h].join(":")})(e,t,n);return AN.set(o,l),l}function hW(e,t){return Ud(e)===Ud(t)}function Y7(e,t,n){const i=Na(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Na()-i,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function IN(e,t,n){return Y7(t,n,()=>Ud(e))}function pW(e,t,n){return IN(e,n,"stabilizeSignatureMs")===IN(t,n,"stabilizeSignatureMs")}function ny(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function TN(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function EN(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function fke(e,t){return e.length===t.length&&e===t}function J7(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const i=e,o=t,s=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(o).filter(c=>c!=="type"&&c!=="children").sort();if(s.length!==r.length)return!1;for(let c=0;c{i=J7(e,t)}),i??pW(e,t,n)}function mke(e,t){const n={};for(const i of rke){const o=e[i],s=t?.[i];typeof o=="number"&&(n[i]=o-(typeof s=="number"?s:0))}return n}function gke(e,t){var n;const i=_L(t.instanceMsgId),o=new Map,s=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=U(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const f=(function(){let W="",P=0,O=!1,R=!1,z=!1,H=!1;function j(){W="",P=0,O=!1,R=!1,z=!1,H=!1}function K(re){let q=!1;for(let Q=0;Q{if(!re||!q.startsWith(re)||q.length<=re.length)return j(),[!0,0];let Q=0;W!==re&&(j(),K(re),Q=re.length);const ne=q.slice(re.length),te=K(ne);return W=q,[te,Q+ne.length]}})();let h,m=0,g=0,v=Na(),y=-1,b=0;function C(W){y=Number.isInteger(W)?W:0,b+=1}function A(){h&&(clearTimeout(h),h=void 0)}function T(){A();const W=t.renderContent.value;r.value!==W&&(r.value=W),v=Na()}qe([t.renderContent,t.effectiveFinal,s],([W,P,O])=>{r.value!==W&&(!O||P||(function(R,z){if(!R&&z||z.length<=80||z.length\s*|`{3,}|~{3,})/.test(H))||H.endsWith(` +`)&&!(function(j){const K=_N(j);if(MN(K))return!1;const re=cW(K);return re.length>=2&&re.some(q=>q.trim())})(z))})(r.value,W)?T():(function(){if(g+=1,h)return;const R=Math.max(0,(function(z){const H=z.parseCoalesceMs;return typeof H=="number"&&Number.isFinite(H)&&H>=0?H:80})(e)-(Na()-v));R<=0?T():h=setTimeout(T,R)})())},{flush:"sync",immediate:!0}),Jd(A);const N=D(()=>{var W,P,O,R;return ppe(e.customHtmlTags,(W=e.parseOptions)==null?void 0:W.customHtmlTags,(R=(O=(P=t.customComponentsMap)==null?void 0:P.value)!=null?O:{},Object.entries(R).map(([z,H])=>{const j=Ca(z);return H==null||!j||$v(j)||bj.has(j)||Dv.has(j)?"":j}).filter(Boolean)))}),_=D(()=>{const{key:W,tags:P}=mpe(N.value);if(!W)return i;const O=o.get(W);if(O)return O;const R=_L(t.instanceMsgId,{customHtmlTags:P});return o.set(W,R),R}),w=D(()=>{const W=_.value;if(!e.customMarkdownIt)return W;const P=e.customMarkdownIt(W);return W.__markstreamHasCustomParserExtensions=!0,P.__markstreamHasCustomParserExtensions=!0,P}),M=D(()=>{var W,P;const O=(W=e.parseOptions)!=null?W:{},R=t.effectiveFinal.value,z=N.value,H=R!=null,j=z.length>0;return H||j||O.streamParse==null?Ot(Ot(On(Ot({},O),{streamParse:(P=O.streamParse)==null||P}),H?{final:R}:{}),j?{customHtmlTags:z}:{}):O}),x=D(()=>{var W;return new Set(((W=M.value.customHtmlTags)!=null?W:[]).map(P=>String(P).trim().toLowerCase()).filter(Boolean))}),E=D(()=>SN(M.value,w.value,e.customMarkdownIt,{includeFinal:!0})),I=D(()=>SN(M.value,w.value,e.customMarkdownIt,{includeFinal:!1}));qe([E,I],([W,P],[O,R])=>{O&&(W===O&&P===R||(T(),P!==R&&(l=[],c="")))},{flush:"sync"});const F=D(()=>{var W,P,O,R,z,H,j,K,re,q,Q;if((W=e.nodes)!=null&&W.length)return l=[],c="",C(0),Ft(e.nodes.slice());const ne=r.value;if(!ne)return l=[],c="",C(-1),[];const te=t.debugPerformanceEnabled.value,ge=te?Na():0,Ae=w.value,me=E.value,de=I.value;a&&me!==a&&(function(Ue){var at,bt;(bt=(at=Ue.stream)==null?void 0:at.reset)==null||bt.call(at)})(Ae),u&&de!==u&&(l=[],c="");const Y=Object.keys((O=(P=t.customComponentsMap)==null?void 0:P.value)!=null?O:{}).length>0||typeof M.value.postTransformNodes=="function";Y!==d&&(l=[],c="");const ue=!Y&&l.length>0&&ne.startsWith(c)&&de===u,Z=te?xN(Ae):null,se=te?{}:void 0,ke=EN(Ae),be=!ke&&!Y,we=Ot(Ot(On(Ot({},M.value),{__reuseStableTopLevelNodes:be}),ke?{__disableStreamParse:!0}:{}),se?{__timing:se}:{}),oe=xH(ne,Ae,we),J=te?Na():0,fe=te?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let ve,Ce=te?ny(oe.length):void 0,le=0,ie=0,Ee=0;if(ue){const Ue=te?Na():0,[at,bt]=(function(Pt){var Zt,Ut;const[Le,Re]=Pt.scanGlobalReferenceAppend(Pt.previousContent,Pt.content),Ze=Pt.parseOptions;return[Pt.previousDirtyStartIndex>0&&Ze.final!==!0&&!Pt.customMarkdownIt&&!EN(Pt.md)&&!Le&&typeof Ze.preTransformTokens!="function"&&typeof Ze.postTransformTokens!="function"&&typeof Ze.postTransformNodes!="function"&&((Ut=(Zt=Ze.customHtmlTags)==null?void 0:Zt.length)!=null?Ut:0)===0?Pt.previousDirtyStartIndex:0,Re]})({content:ne,previousContent:c,previousDirtyStartIndex:y,parseOptions:M.value,customMarkdownIt:e.customMarkdownIt,md:Ae,scanGlobalReferenceAppend:f});Ee=bt;const It=at<=0;if(fe){const Pt=(function(Zt,Ut,Le,Re={}){var Ze;if(!Ut.length)return{nodes:Zt,metrics:ny(Zt.length)};const st=(Ze=Re.scanStartIndex)!=null?Ze:0,Bt=Re.reuseDirtyTail!==!1,Nt=(function(ft,Fe,Ve,mt=0){const qt=Math.min(ft.length,Fe.length);for(let jt=Math.min(qt,Math.max(0,mt));jtUd(Ue[It]))})(ve,fe,ie):(function(Ue,at=0){for(let bt=Math.max(0,at);bt((z=Z?.total)!=null?z:0);t.logPerf(at?"parse(stream)":"parse(sync)",Ot(Ot(Ot({rendererId:t.instanceMsgId,ms:Math.round(Na()-ge),nodes:ve.length,contentLength:ne.length,parseCommitCount:m,parseCoalescedCount:g,nodeReuseMs:Ke,referenceDefinitionScanChars:Ee,signatureMs:(H=fe?.signatureMs)!=null?H:0,stabilizeSignatureMs:(j=fe?.stabilizeSignatureMs)!=null?j:0,primeSignatureMs:(K=fe?.primeSignatureMs)!=null?K:0,signatureCallCount:(re=fe?.signatureCallCount)!=null?re:0,stabilizeSignatureCallCount:(q=fe?.stabilizeSignatureCallCount)!=null?q:0,primeSignatureCallCount:(Q=fe?.primeSignatureCallCount)!=null?Q:0,stabilizeMs:le},Ce??{}),se?Object.fromEntries(lke.map(bt=>{var It;return[bt,(It=se[bt])!=null?It:0]})):{}),Ue?{streamMode:Ue.lastMode,streamDelta:mke(Ue,Z),streamStats:Ue}:{}))}return Ft(ve)});return{effectiveCustomHtmlTags:N,effectiveCustomHtmlTagsSet:x,mdBase:_,mdInstance:w,mergedParseOptions:M,getParsedNodesDirtyStartIndex:()=>y,getParsedNodesRevision:()=>b,parsedNodes:F}}function vke(e){const{isClient:t}=e,n=U(new Set),i=new Map,o=new Map,s=new Map;function r(u){if(!t)return;const c=s.get(u);c!=null&&(window.clearTimeout(c),s.delete(u))}function l(){if(t)for(const u of s.values())window.clearTimeout(u);s.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:i,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:s,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((g=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!g)return;var m,g;const v=n.value,y=v.has(f);if(h){if(y)return;const C=new Set(v);return C.add(f),void(n.value=C)}if(!y)return;const b=new Set(v);b.delete(f),n.value=b})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f{const c=o.getSnapshot();t.value=c.source,n.value=c.visible,i.value=c.done},r=o.subscribe(s);s();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),u=D(()=>i.value&&a.value);return Av()&&Jd(()=>{r(),o.destroy()}),{source:t,visible:n,done:i,final:u,caughtUp:a,pendingChars:l,enqueue:c=>o.enqueue(c),finish:c=>o.finish(c),flush:()=>o.flush(),reset:c=>o.reset(c),pause:()=>o.pause(),resume:()=>o.resume()}}const kke={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},LN=/auto|scroll|overlay/i;function bke(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return LN.test(t)||LN.test(n)}function wke(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const Cke={class:"m-0 p-0"},Ake=["data-probe"],xke=$i(ct(On(Ot({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(i){var o,s;return(s=(o=t.headingNodes)==null?void 0:o[i])!=null?s:null}return(i,o)=>(k(),L("div",{class:"height-estimation-probes",style:sn({width:`${e.width}px`}),"aria-hidden":"true"},[S("div",{ref:s=>e.setParagraphWrapper(s),class:$e(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[V(p(wh),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),S("div",{ref:s=>e.setListItemWrapper(s),class:$e(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[S("ul",Cke,[V(p(b1),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),S("div",{ref:s=>e.setListWrapper(s),class:$e(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[V(p(w1),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(k(),L(Be,null,xt(6,s=>S("div",{key:`probe-heading-${s}`,ref_for:!0,ref:r=>e.setHeadingWrapper(s,r),class:$e(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${s}`},[V(p(n4),{node:n(s),"index-key":`probe-heading-${s}`},null,8,["node","index-key"])],10,Ake)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),NN=ct({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return kk((i=Yp(e.estimatedPreviewHeightPx))!=null?i:vk(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Fn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?Fn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[Fn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Fn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Fn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Fn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>Fn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,Fn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Fn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Fn("div",{class:"absolute inset-0"},[Fn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),DN=ct({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return yk((i=Yp(e.estimatedPreviewHeightPx))!=null?i:gk(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Fn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?Fn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[Fn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Fn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Fn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>Fn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Fn("span",{class:"action-icon block"})])))]):null,Fn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Fn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Fn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),Ske={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Ps(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const _ke=["data-custom-id"],Mke=["data-node-index","data-node-type"],FN="typewriter-simple-cursor-target",mW=$i(ct(On(Ot({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const i=e,o=n;function s($){if(!(typeof Event<"u"&&$ instanceof Event))return typeof $=="string"&&o("copy-code",$),void o("copy",$)}const r=As(),l=tn("markstreamNestedRendererProps",void 0);function a($){const X=r?.vnode.props;return!!X&&(Object.prototype.hasOwnProperty.call(X,$)||Object.prototype.hasOwnProperty.call(X,String($).replace(/[A-Z]/g,he=>`-${he.toLowerCase()}`)))}function u($){var X,he;const pe=i[$];return a($)?pe:(he=(X=l?.value)==null?void 0:X[$])!=null?he:pe}const c=D(()=>{return($=u("mode"))==="chat"||$==="minimal"||$==="docs"?$:"docs";var $}),d=D(()=>bN(u("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>u("domMode")==="minimal"?"minimal":"full"),m=D(()=>{return($={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":$.codeRenderer==="pre"||$.codeRenderer==="shiki"||$.codeRenderer==="monaco"?$.codeRenderer:$.renderCodeBlocksAsPre===!1||$.mode==="docs"?"monaco":"pre";var $}),g=D(()=>Ske[c.value]),v=D(()=>{var $;return($=u("showTooltips"))!=null?$:g.value.showTooltips}),y=D(()=>{var $;return($=u("fade"))!=null?$:g.value.fade}),b=D(()=>{var $;return($=u("batchRendering"))!=null?$:g.value.batchRendering}),C=D(()=>{var $;return($=u("initialRenderBatchSize"))!=null?$:g.value.initialRenderBatchSize}),A=D(()=>{var $;return($=u("renderBatchSize"))!=null?$:g.value.renderBatchSize}),T=D(()=>{var $;return($=u("renderBatchDelay"))!=null?$:g.value.renderBatchDelay}),N=D(()=>{var $;return($=u("renderBatchBudgetMs"))!=null?$:g.value.renderBatchBudgetMs}),_=D(()=>{var $;return($=u("renderBatchIdleTimeoutMs"))!=null?$:g.value.renderBatchIdleTimeoutMs}),w=D(()=>{var $;return($=u("deferNodesUntilVisible"))!=null?$:g.value.deferNodesUntilVisible}),M=D(()=>{var $;return($=u("maxLiveNodes"))!=null?$:g.value.maxLiveNodes}),x=D(()=>{var $;return($=u("liveNodeBuffer"))!=null?$:g.value.liveNodeBuffer}),E=D(()=>{var $;return($=u("nodeVirtual"))!=null?$:g.value.nodeVirtual}),I={get content(){return i.content},get nodes(){return i.nodes},get final(){return i.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return i.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return v.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return i.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return i.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return y.value},get batchRendering(){return b.value},get initialRenderBatchSize(){return C.value},get renderBatchSize(){return A.value},get renderBatchDelay(){return T.value},get renderBatchBudgetMs(){return N.value},get renderBatchIdleTimeoutMs(){return _.value},get deferNodesUntilVisible(){return w.value},get maxLiveNodes(){return M.value},get liveNodeBuffer(){return x.value},get nodeVirtual(){return E.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function F($){o("height-change",$)}function W($){o("virtual-state-change",$)}function P($){o("anchor-change",$)}const O=U(),R=U(null),z=U(null),H=U(null),j=co({1:null,2:null,3:null,4:null,5:null,6:null}),K=U(!1),re=new Map,q=U(0),Q=U(0),ne=U({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function te($,X){return typeof $!="string"?X:$.trim()||X}function ge($){const X=Number($);return Number.isFinite(X)&&X>0?Math.max(1,Math.trunc(X)):640}const Ae=D(()=>{var $;const X=($=I.viewportPriorityOptions)!=null?$:{},he=te(X.rootMargin,Fh);return{rootMargin:he,heavyBlockMargin:te(X.heavyBlockMargin,he),maxTargets:ge(X.maxTargets)}}),me=D(()=>{var $;return($=Ae.value.rootMargin)!=null?$:Fh}),de=D(()=>{var $;return($=Ae.value.maxTargets)!=null?$:640});function Y(){var $,X;if((($=i.virtualScroll)==null?void 0:$.enabled)!==!0)return null;const he=(X=i.virtualScroll)==null?void 0:X.scrollRoot;return ue(typeof he=="function"?he():he)}function ue($){return $?typeof HTMLElement<"u"&&$ instanceof HTMLElement?$:typeof $=="object"&&"value"in $?ue($.value):typeof $=="object"&&"$el"in $?ue($.$el):null:null}ri(JH,Ae);const{isClient:Z,renderAsFragment:se,debugPerformanceEnabled:ke,resolvedShowTooltips:be,resolvedHtmlPolicy:we,inheritedSmoothStreaming:oe,ownsTypewriterCursor:J}=(function($){const X=typeof window<"u",he=sm(),pe=tn("markstreamHtmlPolicy",void 0),Ne=tn("markstreamTypewriterCursor",void 0),ze=tn("markstreamSmoothStreaming",void 0),tt=D(()=>$.renderAsFragment===!0),ot=D(()=>!!($.debugPerformance&&X&&typeof console<"u")),kt=D(()=>{var yt;if(typeof $.showTooltips=="boolean")return $.showTooltips;const nt=(yt=he.showTooltips)!=null?yt:he["show-tooltips"];return nt===""||nt===!0||nt==="true"||nt!==!1&&nt!=="false"&&void 0}),rt=D(()=>{var yt,nt;return(nt=(yt=$.htmlPolicy)!=null?yt:pe?.value)!=null?nt:"safe"}),ht=D(()=>Ne?.value!==!0);return{isClient:X,renderAsFragment:tt,debugPerformanceEnabled:ot,resolvedShowTooltips:kt,resolvedHtmlPolicy:rt,inheritedSmoothStreaming:ze,inheritedTypewriterCursor:Ne,ownsTypewriterCursor:ht}})(I),{resolveViewportRoot:fe,resolveScrollContainer:ve,isReverseFlexScrollRoot:Ce,getNormalizedScrollTop:le,getOffsetTopWithinRoot:ie}=(function($,X){function he(){var ot,kt;return(kt=(ot=X.scrollRoot)==null?void 0:ot.call(X))!=null?kt:null}function pe(ot){if(typeof window>"u")return null;const kt=he();if(kt)return kt;const rt=ot??$.value;if(!rt)return null;const ht=rt.ownerDocument||document,yt=ht.scrollingElement||ht.documentElement;let nt=rt;for(;nt&&nt!==ht.body&&nt!==yt;){if(bke(window.getComputedStyle(nt))&&wke(nt))return nt;nt=nt.parentElement}return null}function Ne(ot){if(!X.isClient)return!1;try{const kt=window.getComputedStyle(ot);return!!(kt.display||"").toLowerCase().includes("flex")&&(kt.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function ze(ot,kt,rt){var ht,yt;if(rt)return tt(kt);const nt=ot.scrollTop;if(!Ne(ot))return nt;const pt=nt<0?-nt:nt;return Math.max(0,((ht=ot.scrollHeight)!=null?ht:0)-((yt=ot.clientHeight)!=null?yt:0))-pt}function tt(ot){var kt,rt,ht,yt,nt;const pt=Number((kt=ot.scrollingElement)==null?void 0:kt.scrollTop),St=Number((ht=(rt=ot.documentElement)==null?void 0:rt.scrollTop)!=null?ht:0),wt=Number((nt=(yt=ot.body)==null?void 0:yt.scrollTop)!=null?nt:0);return Math.max(0,Number.isFinite(pt)?pt:0,Number.isFinite(St)?St:0,Number.isFinite(wt)?wt:0)}return{resolveViewportRoot:pe,resolveScrollContainer:function(ot){var kt,rt,ht,yt;const nt=he();if(nt)return nt;const pt=pe((kt=ot??$.value)!=null?kt:null);if(pt)return pt;const St=(yt=(ht=ot?.ownerDocument)!=null?ht:(rt=$.value)==null?void 0:rt.ownerDocument)!=null?yt:typeof document<"u"?document:null;return St?.scrollingElement||St?.documentElement||null},isReverseFlexScrollRoot:Ne,getNormalizedScrollTop:ze,getOffsetTopWithinRoot:function(ot,kt){const rt=kt.ownerDocument||ot.ownerDocument||document;if((function(pt,St){return pt===St.documentElement||pt===St.body||pt===St.scrollingElement})(kt,rt))return ot.getBoundingClientRect().top+tt(rt);const ht=kt.getBoundingClientRect(),yt=ot.getBoundingClientRect(),nt=ze(kt,rt,!1);return yt.top-ht.top+nt}}})(O,{isClient:Z,scrollRoot:Y});ri("markstreamShowTooltips",be),ri("markstreamHtmlPolicy",we),ri("markstreamTypewriter",f),ri("markstreamFade",D(()=>I.fade!==!1)),ri("markstreamTypewriterCursor",D(()=>!0)),ri("markstreamTextStreamState",re),ri("markstreamStreamVersion",q),ri("markstreamParseOptions",D(()=>I.parseOptions)),ri("markstreamCustomMarkdownIt",D(()=>I.customMarkdownIt));const{smoothStreamingEnabled:Ee,renderContent:Ke,requestedFinal:Ue,effectiveFinal:at}=(function($,X){const he=yke(Ot(Ot({},kke),$.smoothStreamingOptions)),pe=D(()=>{var nt,pt,St;return $.smoothStreaming!==!1&&!((nt=$.nodes)!=null&&nt.length)&&($.smoothStreaming===!0||!((pt=X.inheritedSmoothStreaming)!=null&&pt.value))&&($.smoothStreaming===!0||bN($.typewriter)!=="off"||((St=$.maxLiveNodes)!=null?St:0)<=0)}),Ne=U(!X.isClient||$.smoothStreaming===!0);vn(()=>{Ne.value=!0});const ze=D(()=>Ne.value&&pe.value),tt=D(()=>{var nt;return ze.value?he.visible.value:(nt=$.content)!=null?nt:""}),ot=D(()=>{var nt,pt;const St=(nt=$.parseOptions)!=null?nt:{};return(pt=$.final)!=null?pt:St.final}),kt=D(()=>{const nt=ot.value;return ze.value&&nt!=null?!!nt&&he.caughtUp.value:nt});let rt=0,ht=!1;function yt(){rt=0,ht=!1}return qe([()=>$.content,()=>$.nodes,ze,ot],([nt,pt,St,wt])=>{if(pt?.length)return yt(),void he.reset("");const Vt=nt??"";if(!St)return yt(),he.reset(Vt),void(wt&&he.finish({flush:!0}));const Dt=he.source.value;if(Vt){if(Vt!==Dt)if(Vt.startsWith(Dt)){const rn=Vt.slice(Dt.length),hn=he.pendingChars.value;rn.length<=8?(rt++,ht||rt>=2&&hn<=8?(ht=!0,he.reset(Vt)):he.enqueue(rn)):(yt(),he.enqueue(rn))}else yt(),he.reset(Vt)}else yt(),he.reset("");wt&&he.finish()},{immediate:!0}),{smoothStream:he,smoothStreamingEligible:pe,smoothStreamingEnabled:ze,renderContent:tt,requestedFinal:ot,effectiveFinal:kt}})(I,{isClient:Z,inheritedSmoothStreaming:oe}),bt=Ue.value===!0;ri("markstreamSmoothStreaming",Ee);const It=U(!1),Pt=U(!1),Zt=U(!1);let Ut="",Le=!1,Re=null;function Ze(){Z&&Re!=null&&(window.clearTimeout(Re),Re=null)}function st(){It.value=!1,Ze()}function Bt($,X){if(!ke.value)return;const he=(function(){if(!ke.value)return null;const pe=Fe(Nt),Ne=Fe(Qt),ze=Math.max(ft,Ne);if(pe<=0&&ze<=0)return null;const tt={total:pe,maxPerFrame:ze,byLabel:(ot=Nt,Object.fromEntries(Array.from(ot.entries()).sort((kt,rt)=>rt[1]-kt[1]||kt[0].localeCompare(rt[0]))))};var ot;return Nt.clear(),Qt.clear(),ft=0,tt})();console.info(`[markstream-vue][perf] ${$}`,he?On(Ot({},X),{layoutReads:he}):X)}qe([()=>I.indexKey,()=>I.customId],()=>{var $,X;st(),Pt.value=!1,Zt.value=!(($=i.nodes)!=null&&$.length)&&Ue.value!==!0&&!!i.content,Ut=(X=Ke.value)!=null?X:"",Le=Ut.length>0},{flush:"sync"}),qe([()=>i.content,()=>i.nodes,Ue],([$,X,he])=>{!X?.length&&he!==!0&&$&&(Zt.value=!0)},{flush:"sync",immediate:!0}),qe([Ke,()=>i.nodes,Ue],([$,X,he])=>{const pe=$??"";return X?.length||he===!0?(st(),Pt.value=!1,Ut=pe,void(Le=!0)):(pe.length>0&&(Zt.value=!0),Le?(Ut&&pe.length>Ut.length&&pe.startsWith(Ut)?(It.value=!0,Pt.value=!0,Z&&(Ze(),Re=window.setTimeout(()=>{var Ne;Re=null,at.value===!0||(Ne=i.nodes)!=null&&Ne.length||(fp(),It.value=!1,Ku())},1200))):(pe.length"u")return null;const ze=window;if(ze.__markstreamLayoutReadPerformance)return ze.__markstreamLayoutReadPerformance;const tt={total:0,maxPerFrame:0,byLabel:{}};return ze.__markstreamLayoutReadPerformance=tt,tt})();Ne&&(Ne.total=Number(Ne.total||0)+1,Ne.byLabel[pe]=Number(Ne.byLabel[pe]||0)+1,Ne.currentFrameTotal=Number(Ne.currentFrameTotal||0)+1,Ne.frameScheduled||(Ne.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>mt(Ne),0):queueMicrotask(()=>mt(Ne)):window.requestAnimationFrame(()=>mt(Ne))))})($),De||(De=!0,Z&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Ve):typeof queueMicrotask!="function"?setTimeout(Ve,0):queueMicrotask(Ve)))}function jt($,X){return qt($),X()}const Sn=I.customId?`renderer-${I.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Rn=(function($){const X=new Map;return{scope:$,cache:X,clear:()=>X.clear()}})(Sn),ho=Sn;ri(rW,Rn);const xi=xs(()=>I.customId),{effectiveCustomHtmlTagsSet:xo,mergedParseOptions:lt,parsedNodes:Qe,getParsedNodesDirtyStartIndex:ut,getParsedNodesRevision:Dn}=gke(I,{instanceMsgId:Sn,renderContent:Ke,effectiveFinal:at,smoothStreamingEnabled:Ee,debugPerformanceEnabled:ke,customComponentsMap:xi,logPerf:Bt});qe(Qe,()=>{It.value||Rn.clear(),q.value+=1},{immediate:!0});const Ct=D(()=>({customId:I.customId,customHtmlTags:lt.value.customHtmlTags,parseOptions:I.parseOptions,customMarkdownIt:I.customMarkdownIt,htmlPolicy:we.value,viewportPriority:I.viewportPriority,viewportPriorityOptions:Ae.value,mode:c.value,domMode:I.domMode,codeRenderer:m.value,codeBlockStream:I.codeBlockStream,codeBlockDarkTheme:I.codeBlockDarkTheme,codeBlockLightTheme:I.codeBlockLightTheme,codeBlockMonacoOptions:I.codeBlockMonacoOptions,renderCodeBlocksAsPre:I.renderCodeBlocksAsPre,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockProps:I.codeBlockProps,mermaidProps:I.mermaidProps,d2Props:I.d2Props,infographicProps:I.infographicProps,showTooltips:be.value,themes:I.themes,langs:I.langs,isDark:I.isDark,typewriter:f.value,smoothStreamingOptions:I.smoothStreamingOptions,parseCoalesceMs:I.parseCoalesceMs,fade:I.fade}));ri("markstreamNestedRendererProps",Ct);const Zn=D(()=>Qe.value),Ss=D(()=>Qe.value.length),po=U(null),Bs=U(null),qs=U(null),Nr=U(null),ts=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),Ji=!ts&&I.customId?mN(I.customId):null,pr=D(()=>Ji?(j8.value,mN(I.customId)):null),bi=D(()=>{var $;return!!(!se.value&&I.customId&&!ts&&(($=pr.value)!=null&&$.enabled))}),Bo=D(()=>!!(Z&&bi.value)),So=D(()=>{var $;return!!(!se.value&&(($=i.virtualScroll)!=null&&$.enabled))}),Rs=D(()=>So.value),Ko=U(!1);vn(()=>{Ko.value=!0});const ei=D(()=>!!(Z&&So.value));ri("markstreamHostScrollManaged",ei);const ns=D(()=>!!(Ko.value&&ei.value)),Pi=D(()=>Bo.value||ei.value),ci=D(()=>Bo.value||ns.value),Ni=D(()=>{var $;return Pi.value&&(($=pr.value)==null?void 0:$.textEstimation)!==!1});function Si(){const $=Q.value||jt("getMeasuredContainerWidth.clientWidth",()=>{var X;return((X=O.value)==null?void 0:X.clientWidth)||0});return Number.isFinite($)&&$>0?$:0}const di=D(()=>{const $=Si();return $>0?Math.max(1,Math.round($)):640}),pi=D(()=>{var $,X;return!(at.value!==!0||So.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||($=i.nodes)!=null&&$.length||Zt.value||!(((X=I.maxLiveNodes)!=null?X:0)<=0))}),no=D(()=>{var $;return pi.value?50:Math.max(1,($=I.maxLiveNodes)!=null?$:320)}),io=D(()=>{var $;return pi.value?16:Math.max(0,($=I.liveNodeBuffer)!=null?$:60)}),En=D(()=>{var $;return!se.value&&I.nodeVirtual!==!1&&!((($=I.maxLiveNodes)!=null?$:0)<=0&&!pi.value)&&(I.nodeVirtual===!0?Qe.value.length>0:Qe.value.length>no.value)}),mr=D(()=>En.value||Bo.value||ei.value),el=D(()=>I.viewportPriority!==!1),Ro=D(()=>!!el.value&&!K.value);var _o;_o=D(()=>el.value),ri(XH,_o);const oo=D(()=>{var $;return!(se.value||I.deferNodesUntilVisible===!1||(($=I.maxLiveNodes)!=null?$:0)<=0||En.value||Qe.value.length>900||I.viewportPriority===!1)}),Xi=Y2e($=>{var X;return fe((X=$??O.value)!=null?X:null)},el),{requestFrame:eo,cancelFrame:Ki,hasIdleCallback:He,isTestEnv:_e}=(function($){const X=$.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,he=$.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,pe=$.isClient&&typeof window.requestIdleCallback=="function",Ne=(function(){var ze;if(typeof globalThis>"u"||!("process"in globalThis))return;const tt=(ze=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:ze.value;return tt?.env})();return{requestFrame:X,cancelFrame:he,hasIdleCallback:pe,isTestEnv:Ne?.NODE_ENV==="test"}})({isClient:Z}),je=D(()=>at.value===!0&&!So.value),{resolvedBatchSize:dn,resolvedInitialBatch:ti,batchingEnabled:oi,incrementalRenderingActive:Zi,renderedCount:Jn,previousRenderContext:Us,adaptiveBatchSize:is,previousBatchConfig:it}=(function($,X){var he;const pe=D(()=>{var yt;const nt=Math.trunc((yt=$.renderBatchSize)!=null?yt:80);return Number.isFinite(nt)?Math.max(0,nt):0}),Ne=D(()=>{var yt;const nt=Math.trunc((yt=$.initialRenderBatchSize)!=null?yt:pe.value);return Number.isFinite(nt)?Math.max(0,nt):pe.value}),ze=D(()=>!X.renderAsFragment.value&&$.batchRendering!==!1&&pe.value>0&&X.isClient&&!X.isTestEnv),tt=U(0),ot=U({key:$.indexKey,total:0}),kt=U(Math.max(1,pe.value||1)),rt=D(()=>{var yt,nt,pt;return ze.value&&!((yt=X.continuousStreaming)!=null&&yt.value)&&!((nt=X.forceFullRenderFinalContent)!=null&&nt.value)&&((pt=$.maxLiveNodes)!=null?pt:0)<=0}),ht=U({batchSize:pe.value,initial:Ne.value,delay:(he=$.renderBatchDelay)!=null?he:16,enabled:rt.value});return{resolvedBatchSize:pe,resolvedInitialBatch:Ne,batchingEnabled:ze,incrementalRenderingActive:rt,renderedCount:tt,previousRenderContext:ot,adaptiveBatchSize:kt,previousBatchConfig:ht}})(I,{isClient:Z,isTestEnv:_e,renderAsFragment:se,forceFullRenderFinalContent:je,continuousStreaming:D(()=>Pt.value&&at.value!==!0)}),Ye=D(()=>{var $;return!se.value&&I.batchRendering!==!1&&dn.value>0&&!_e&&(($=I.maxLiveNodes)!=null?$:0)<=0&&!je.value}),Mt=D(()=>Ye.value),zt=D(()=>Pi.value||Mt.value),Pn=D(()=>{var $;return zt.value&&(($=pr.value)==null?void 0:$.codeBlockEstimation)!==!1}),mi=new Map,Mo=new Map,Zo=new WeakMap;let Oo=null;const Io=new WeakMap,Gn=new Map,Vs=[];let Di=[],Ks=[],Go=-1;const Dr=Ya(Vs),$o=new Set,Ql=U(0);let ss=0;const Yl=U(0),vf=D(()=>(Yl.value,Array.from(mi.entries()).sort(($,X)=>$[0]-X[0]))),Jl=U(null),Qo=U(null);let Os,_l=null,tu=0,Fr=null;function so(){Os.markFallbackHeightPrefixDirty()}function nu($){return Os.getFallbackNodeHeight($)}function Zs($,X){return Os.estimateHeightRange($,X)}function Po($){return Os.estimateIndexForOffset($)}const{activeRestoreAnchor:rs,getRelativeScrollTopWithinContainer:Gs,setRelativeScrollTopWithinContainer:Xl,resolveAnchorOffset:ea,clearRestoreReconcile:Br,scheduleRestoreReconcile:_a,captureRestoreAnchor:iu,restoreAnchor:Ml,getAnchorDrift:Uu}=(function($){const{isClient:X,containerRef:he,parsedNodeCount:pe,requestFrame:Ne,cancelFrame:ze,resolveScrollContainer:tt,getNormalizedScrollTop:ot,getOffsetTopWithinRoot:kt,isReverseFlexScrollRoot:rt,estimateIndexForOffset:ht,estimateHeightRange:yt,getFallbackNodeHeight:nt,clamp:pt}=$,St=U(null);let wt=null,Vt=[];function Dt(){const An=tt(),Kn=he.value;if(!An||!Kn)return null;const ii=An.ownerDocument||Kn.ownerDocument||document;if(An===ii.documentElement||An===ii.body||An===ii.scrollingElement){const Wi=Kn.getBoundingClientRect();return Math.max(0,-Wi.top)}return Math.max(0,ot(An,ii,!1)-kt(Kn,An))}function rn(An){var Kn;const ii=tt(),Wi=he.value;if(!ii||!Wi)return;const er=Math.max(0,An),$s=ii.ownerDocument||Wi.ownerDocument||document,Ea=$s.defaultView||(typeof window<"u"?window:null);if(ii===$s.documentElement||ii===$s.body||ii===$s.scrollingElement){const lu=ot(ii,$s,!0)+Wi.getBoundingClientRect().top;return void((Kn=Ea?.scrollTo)==null||Kn.call(Ea,0,Math.max(0,lu+er)))}yN(ii,$s,kt(Wi,ii)+er,{isReverseFlexScrollRoot:lu=>{var qm;return(qm=rt?.(lu))!=null&&qm},getNormalizedScrollTop:ot})}function hn(An){const Kn=pe.value,ii=pt(An.nodeIndex,0,Math.max(0,Kn-1));return yt(0,ii)+Math.max(0,An.offsetWithinNodePx)}function Cn(){if(wt!=null&&(ze?.(wt),wt=null),X)for(const An of Vt)window.clearTimeout(An);Vt=[]}function kn(An){const Kn=hn(An),ii=Dt();ii!=null&&Math.abs(ii-Kn)<=.5||rn(Kn)}return{activeRestoreAnchor:St,getRelativeScrollTopWithinContainer:Dt,setRelativeScrollTopWithinContainer:rn,resolveAnchorOffset:hn,clearRestoreReconcile:Cn,applyRestoreAnchor:kn,scheduleRestoreReconcile:function(){St.value&&X&&wt==null&&(wt=Ne?Ne(()=>{wt=null,St.value&&kn(St.value)}):null,wt==null&&St.value&&kn(St.value))},captureRestoreAnchor:function(){const An=Dt(),Kn=pe.value;if(An==null||Kn<=0)return null;const ii=pt(ht(An+1),0,Kn-1),Wi=yt(0,ii),er=nt(ii);return{nodeIndex:ii,offsetWithinNodePx:pt(An-Wi,0,Math.max(0,er-1))}},restoreAnchor:function(An){const Kn=pe.value;if(St.value={nodeIndex:pt(An.nodeIndex,0,Math.max(0,Kn-1)),offsetWithinNodePx:Math.max(0,An.offsetWithinNodePx)},Cn(),kn(St.value),X)for(const ii of[0,120,280,480])Vt.push(window.setTimeout(()=>{St.value&&kn(St.value)},ii))},getAnchorDrift:function(An){const Kn=Dt();return Kn==null?null:Kn-hn(An)}}})({isClient:Z,containerRef:O,parsedNodeCount:Ss,requestFrame:eo,cancelFrame:Ki,resolveScrollContainer:()=>Jl.value||ve(),getNormalizedScrollTop:le,getOffsetTopWithinRoot:ie,isReverseFlexScrollRoot:Ce,estimateIndexForOffset:Po,estimateHeightRange:Zs,getFallbackNodeHeight:nu,clamp:Xs}),{nodeHeights:ls,heightStats:as,heightTreeSize:G,heightSumTree:ye,heightKnownTree:Oe,averageNodeHeight:We,resetHeightMeasurements:Ge,pruneHeightMeasurements:Je,rebuildHeightTrees:gt,recordNodeHeight:Rt,removeNodeHeights:en,exportHeightCache:gn,importHeightCache:_n,fenwickRangeSum:Wn}=(function($={}){const X=co({}),he=co({total:0,count:0}),pe=U(0),Ne=U([]),ze=U([]);function tt(){for(const nt of Object.keys(X))delete X[Number(nt)];he.total=0,he.count=0,pe.value=0,Ne.value=[],ze.value=[]}function ot(nt,pt,St){for(let wt=pt+1;wt0;wt-=wt&-wt)St+=nt[wt];return St}function rt(nt){pe.value=nt;const pt=new Array(nt+1).fill(0),St=new Array(nt+1).fill(0);for(const[wt,Vt]of Object.entries(X)){const Dt=Number(wt),rn=Number(Vt);!Number.isFinite(Dt)||Dt<0||Dt>=nt||!Number.isFinite(rn)||rn<=0||(ot(pt,Dt,rn),ot(St,Dt,1))}Ne.value=pt,ze.value=St}function ht(nt){if(!Number.isInteger(nt)||nt<0)return!1;const pt=X[nt];if(!Number.isFinite(pt)||pt<=0)return!1;if(delete X[nt],he.total=Math.max(0,he.total-pt),he.count=Math.max(0,he.count-1),pe.value>nt){const St=Ne.value,wt=ze.value;St.length&&wt.length&&(ot(St,nt,-pt),ot(wt,nt,-1))}return!0}const yt=D(()=>he.count>0?Math.max(12,he.total/he.count):32);return{nodeHeights:X,heightStats:he,heightTreeSize:pe,heightSumTree:Ne,heightKnownTree:ze,averageNodeHeight:yt,resetHeightMeasurements:tt,pruneHeightMeasurements:function(nt){if(nt<=0)return void tt();let pt=0,St=0;for(const[wt,Vt]of Object.entries(X)){const Dt=Number(wt),rn=Number(Vt);!Number.isFinite(Dt)||Dt<0||Dt>=nt||!Number.isFinite(rn)||rn<=0?delete X[Dt]:(pt+=rn,St++)}he.total=pt,he.count=St},rebuildHeightTrees:rt,recordNodeHeight:function(nt,pt,St={}){(function(wt,Vt,Dt={}){var rn;if(!Number.isFinite(Vt)||Vt<=0)return!1;const hn=X[wt];if(hn&&(Dt.allowShrink===!1&&Vtwt){const Cn=Ne.value,kn=ze.value;if(Cn.length&&kn.length)if(hn){const An=Vt-hn;An!==0&&ot(Cn,wt,An)}else ot(Cn,wt,Vt),ot(kn,wt,1)}Dt.notify!==!1&&((rn=$.onHeightRecorded)==null||rn.call($))})(nt,pt,On(Ot({},St),{notify:!0}))},removeNodeHeight:function(nt,pt={}){var St;const wt=ht(nt);return wt&&pt.notify!==!1&&((St=$.onHeightRecorded)==null||St.call($)),wt},removeNodeHeights:function(nt,pt={}){var St;let wt=0;for(const Vt of nt)ht(Number(Vt))&&wt++;return wt>0&&pt.notify!==!1&&((St=$.onHeightRecorded)==null||St.call($)),wt},exportHeightCache:function(){return Object.entries(X).map(([nt,pt])=>({index:Number(nt),height:Number(pt)})).filter(nt=>Number.isFinite(nt.index)&&nt.index>=0&&Number.isFinite(nt.height)&&nt.height>0).sort((nt,pt)=>nt.index-pt.index)},importHeightCache:function(nt,pt={}){var St;if(!Array.isArray(nt))return;const wt=pe.value;let Vt=!1;if(pt.mode!=="merge"){const Dt=Object.keys(X);if(Dt.length>0){for(const rn of Dt)delete X[Number(rn)];Vt=!0}}for(const Dt of nt){const rn=Number(Dt.index),hn=Number(Dt.height);if(!Number.isInteger(rn)||rn<0||wt>0&&rn>=wt||!Number.isFinite(hn)||hn<=0)continue;const Cn=X[rn];Cn&&Math.abs(Cn-hn)<=1||(X[rn]=hn,Vt=!0)}Vt&&((function(){let Dt=0,rn=0;const hn=pe.value;for(const[Cn,kn]of Object.entries(X)){const An=Number(Cn),Kn=Number(kn);!Number.isFinite(An)||An<0||hn>0&&An>=hn||!Number.isFinite(Kn)||Kn<=0?delete X[An]:(Dt+=Kn,rn++)}he.total=Dt,he.count=rn})(),wt>0&&rt(wt),(St=$.onHeightRecorded)==null||St.call($))},fenwickRangeSum:function(nt,pt,St){if(St<=pt)return 0;const wt=kt(nt,St-1);return pt<=0?wt:wt-kt(nt,pt-1)}}})({onHeightRecorded:()=>{so(),ei.value&&$m(),rs.value&&_a(),Qo.value&&up(),ro("node-resize")}});function an($){Number.isInteger($)&&$>=0&&$o.add($)}function Mn($){for(const X of $)an(Number(X))}function Ln($){ss++;let X=!0;try{const he=$();return X=he!==!1,he}finally{ss--,ss===0&&X&&Ql.value++}}function xn(){Di=[],Ks=[],Go=-1,$o.clear(),Dr.value=Vs}function to(){xn(),Ln(()=>Ge()),Gn.clear()}function Qs($){!Number.isInteger($)||$<0||$>=Qe.value.length||Gn.set($,Mm($))}function tl($,X,he={}){const pe=ls[$];an($),Rt($,X,he);const Ne=ls[$];return Object.is(pe,Ne)?($o.delete($),!1):(Ne&&Ne>0?Qs($):pe&&Gn.delete($),!0)}function Ys($,X){const he=jt("getNodeLayoutHeight.slot.offsetHeight",()=>{var pe,Ne;return(Ne=(pe=mi.get($))==null?void 0:pe.offsetHeight)!=null?Ne:0});return he>0?he:jt("getNodeLayoutHeight.content.offsetHeight",()=>X.offsetHeight)}function Me($,X={}){X.mode!=="merge"?xn():Mn($.map(he=>he.index)),Ln(()=>_n($,X)),s3()}const Te=D(()=>oo.value&&Ro.value),Xe=D(()=>{var $;return!se.value&&I.batchRendering!==!1&&dn.value>0&&(($=I.maxLiveNodes)!=null?$:0)<=0}),Tt=D(()=>!se.value&&bt&&at.value===!0&&!En.value&&!So.value&&!bi.value&&!Te.value&&!Xe.value),cn=D(()=>!!Xi&&Te.value),jn=D(()=>En.value||ei.value),{focusIndex:Un,liveRange:zn,updateLiveRange:vo}=(function($,X){const{parsedNodeCount:he,virtualizationEnabled:pe,maxLiveNodesResolved:Ne,liveNodeBufferResolved:ze,clamp:tt}=X,ot=ze??D(()=>{var ht;return Math.max(0,(ht=$.liveNodeBuffer)!=null?ht:60)}),kt=U(0),rt=co({start:0,end:0});return{liveNodeBufferResolved:ot,focusIndex:kt,liveRange:rt,updateLiveRange:function(){const ht=he.value;if(!pe.value||ht===0)return rt.start=0,void(rt.end=ht);const yt=Math.min(Ne.value,ht),nt=ot.value,pt=tt(kt.value-nt,0,Math.max(0,ht-yt));rt.start=pt,rt.end=Math.min(ht,pt+yt)}}})(I,{parsedNodeCount:Ss,virtualizationEnabled:En,maxLiveNodesResolved:no,liveNodeBufferResolved:io,clamp:Xs}),Js=new Map,Il=new Map,Ma=new Map,yf=[],Ia=new Map,Ta=new Set,np=U(0);let ou=!1;const n2=D(()=>(np.value,Ta.size)),us=new Map,ta=new Map,Am=U(0),xm=D(()=>{Am.value;let $=0;for(const X of us.values())$+=Math.max(0,X);return $});let gr=null;const Ie=D(()=>{if(!En.value)return Qe.value.length;const $=io.value,X=Math.max(zn.end+$,ti.value),he=Math.min(Qe.value.length,X);return Math.max(Jn.value,he)});function dt(){ou||(ou=!0,queueMicrotask(()=>{ou=!1,np.value+=1}))}function et($,X,he="node-resize"){if(!Z||typeof window>"u")return null;const pe=window.setTimeout(()=>{Ta.delete(pe)&&dt();try{X()}finally{ro(he)}},Math.max(0,$));return Ta.add(pe),dt(),pe}function At($){Z&&$!=null&&(Ta.delete($)&&dt(),window.clearTimeout($))}function nn(){if(Z&&typeof window<"u")for(const $ of Ta)window.clearTimeout($);Ta.size&&(Ta.clear(),dt()),yf.length=0,Ma.clear()}function yn($){R.value=$}function Bn($){z.value=$}function ni($){H.value=$}const{cancelScheduledFocusSync:In,scheduleFocusSync:yi}=(function($){const{isClient:X,containerRef:he,virtualizationEnabled:pe,requestFrame:Ne,cancelFrame:ze,syncFocusToScroll:tt}=$;let ot=null;function kt(){var ht,yt,nt;return(nt=(yt=(ht=he.value)==null?void 0:ht.ownerDocument)==null?void 0:yt.defaultView)!=null?nt:typeof window<"u"?window:null}function rt(){if(!ot)return;const ht=kt();ot.viaTimeout?ht?ht.clearTimeout(ot.id):clearTimeout(ot.id):ze?.(ot.id),ot=null}return{cancelScheduledFocusSync:rt,scheduleFocusSync:function(ht={}){if(!pe.value)return;if(!X)return void tt(!0);if(ht.immediate)return rt(),void tt(!0);if(ot)return;const yt=()=>{ot=null,tt()};if(Ne)return void(ot={id:Ne(yt),viaTimeout:!1});const nt=kt();ot={id:nt?nt.setTimeout(yt,16):setTimeout(yt,16),viaTimeout:!0}}}})({isClient:Z,containerRef:O,virtualizationEnabled:En,requestFrame:eo,cancelFrame:Ki,syncFocusToScroll:function($=!1){var X;if(!En.value)return;const he=Jl.value||ve();if(!he)return;const pe=he.ownerDocument||((X=O.value)==null?void 0:X.ownerDocument)||document,Ne=pe?.defaultView||(typeof window<"u"?window:null),ze=he===pe?.documentElement||he===pe?.body,tt=Qe.value.length;if(tt<=0)return;if(!ze&&tt>0&&Ce(he)){const wt=jt("syncFocusToScroll.clientHeight",()=>he.clientHeight||0),Vt=jt("syncFocusToScroll.scrollTop",()=>he.scrollTop),Dt=Vt<0?-Vt:Vt;return void i2(Xs((ot=Math.max(0,Dt)+.5*Math.max(0,wt),Os.estimateIndexForOffsetFromEnd(ot)),0,Math.max(0,tt-1)),$)}var ot;const kt=(function(wt,Vt,Dt,rn){const hn=O.value;if(!hn)return null;const Cn=rn?0:jt("syncFocusToScroll.model.root.getBoundingClientRect",()=>wt.getBoundingClientRect().top),kn=jt("syncFocusToScroll.model.container.getBoundingClientRect",()=>hn.getBoundingClientRect().top),An=Math.max(0,Cn-kn),Kn=rn?jt("syncFocusToScroll.model.viewport.clientHeight",()=>{var ii,Wi,er,$s;return($s=(er=(Wi=Dt?.innerHeight)!=null?Wi:(ii=Vt.documentElement)==null?void 0:ii.clientHeight)!=null?er:wt.clientHeight)!=null?$s:0}):jt("syncFocusToScroll.model.root.clientHeight",()=>wt.clientHeight);return Xs(Po(An+.5*Math.max(0,Kn)),0,Math.max(0,Qe.value.length-1))})(he,pe,Ne,ze);if(kt!=null)return void i2(kt,$);const rt=ze?null:jt("syncFocusToScroll.root.getBoundingClientRect",()=>he.getBoundingClientRect()),ht=ze?0:rt.top,yt=ze?jt("syncFocusToScroll.viewport.clientHeight",()=>{var wt,Vt;return(Vt=(wt=Ne?.innerHeight)!=null?wt:he.clientHeight)!=null?Vt:0}):rt.bottom,nt=vf.value;let pt=null,St=null;for(const[wt,Vt]of nt){if(!Vt)continue;const Dt=jt("syncFocusToScroll.slot.getBoundingClientRect",()=>Vt.getBoundingClientRect());Dt.bottom<=ht||Dt.top>=yt||(pt==null&&(pt=wt),St=wt)}if(pt==null||St==null){const wt=O.value;if(!wt)return;const Vt=ze?{top:0}:jt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>he.getBoundingClientRect()),Dt=jt("syncFocusToScroll.fallback.scrollTop",()=>le(he,pe,ze)),rn=ze?(()=>{const Cn=jt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>wt.getBoundingClientRect()),kn=(ze?0:Vt.top)-Cn.top;return Math.max(0,kn)})():(()=>{const Cn=ie(wt,he);return Math.max(0,Dt-Cn)})(),hn=ze?jt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Cn,kn,An,Kn;return(Kn=(An=(kn=Ne?.innerHeight)!=null?kn:(Cn=pe?.documentElement)==null?void 0:Cn.clientHeight)!=null?An:he.clientHeight)!=null?Kn:0}):jt("syncFocusToScroll.fallback.root.clientHeight",()=>he.clientHeight);return void i2(Xs(Po(rn+.5*Math.max(0,hn)),0,Math.max(0,Qe.value.length-1)),!0)}i2(Math.round((pt+St)/2),$)}}),{visibleNodeIndices:vr,nodeVisibilityHandles:_s,nodeVisibilityWatchStops:Tl,nodeVisibilityFallbackTimers:su,clearVisibilityFallback:ru,markNodeVisible:Oc,cleanupNodeVisibility:_G,destroyNodeVisibilityState:R4}=vke({isClient:Z,shouldTrackVisibleNodeIndices:()=>Te.value,shouldCleanupNodeVisibility:()=>En.value,onNodeMarkedVisible:$=>{En.value?yi():Un.value=Xs($,0,Math.max(0,Qe.value.length-1))},onNodeVisibilityCleaned:$=>{mi.delete($)&&b_()}}),{cleanupScrollListener:KS,setupScrollListener:MG}=(function($){const{isClient:X,virtualizationEnabled:he,listenerEnabled:pe,scrollRootElement:Ne,resolveScrollContainer:ze,scheduleFocusSync:tt,onScroll:ot}=$;let kt=null,rt=null;function ht(){kt&&(kt(),kt=null),rt=null,Ne.value=null}function yt(nt){const pt=$.getScrollTop?$.getScrollTop(nt):nt.scrollTop;return Math.max(0,Number.isFinite(pt)?Math.abs(pt):0)}return{cleanupScrollListener:ht,setupScrollListener:function(){if(!X)return;if(!((nt=pe?.value)!=null?nt:he.value))return void ht();var nt;const pt=ze();if(!pt)return void ht();if(Ne.value===pt&&kt)return;ht(),rt=yt(pt);const St=()=>{if(ot?.(),he.value){const wt=(function(Vt){const Dt=yt(Vt),rn=rt;rt=Dt;const hn=Math.max(480,.75*(Vt.clientHeight||0));return rn==null?Dt>hn?{immediate:!0}:void 0:Math.abs(Dt-rn)>hn?{immediate:!0}:void 0})(pt);wt?tt(wt):tt()}};pt.addEventListener("scroll",St,{passive:!0}),Ne.value=pt,kt=()=>{pt.removeEventListener("scroll",St)}}}})({isClient:Z,virtualizationEnabled:En,listenerEnabled:jn,scrollRootElement:Jl,resolveScrollContainer:ve,scheduleFocusSync:yi,onScroll:function(){const $=Qo.value;if(!$)return;const X=_m();if(!X||(function(pe){if(Nm()>=tu)return Fr=null,!1;const Ne=Fr;if(Ne==null)return!0;const ze=Math.abs(pe.scrollTop-Ne)<=2;return ze||(Fr=null),ze})(X))return;const he=a_(X);he!=null?(he<-32||Math.abs(Math.max(0,he)-Math.max(0,$.distanceFromBottomPx))>32)&&ap("restore"):ap("restore")},getScrollTop:$=>{var X;const he=$.ownerDocument||((X=O.value)==null?void 0:X.ownerDocument)||document,pe=$===he.documentElement||$===he.body||$===he.scrollingElement;return jt("scrollListener.getScrollTop",()=>le($,he,pe))}});function i2($,X=!1){const he=Xs($,0,Math.max(0,Qe.value.length-1));!X&&Math.abs(he-Un.value)<=1||(Un.value=he,vo())}function Xs($,X,he){return Math.min(Math.max($,X),he)}function O4($=Qe.value.length){const X=ut();return!Number.isInteger(X)||X<0?$:Xs(X,0,$)}function $4($){return $?.firstElementChild}function ZS($,X){var he;return $?(he=$.matches)!=null&&he.call($,X)?$:$.querySelector(X):null}function IG($,X){$<1||$>6||(j[$]=X)}function GS(){if(!Pi.value)return void(Q.value=0);const $=jt("updateExperimentContainerWidth.clientWidth",()=>{var X,he;return(he=(X=O.value)==null?void 0:X.clientWidth)!=null?he:0});Q.value=$>0?$:0}let Sm=null;function P4(){Sm?.disconnect(),Sm=null}const QS=Mg("ViewportDeferredMarkdownCodeBlockNode",_u({loader:()=>ao(null,null,function*(){return(yield es(()=>import("./index5-Cwvp7yqU.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:Ck,delay:0,suspensible:!1}),Ck);function YS($){return $===QS}const JS=D(()=>m.value==="pre"?al:m.value==="shiki"?QS:B8);function XS(){var $;return(($=I.codeBlockProps)==null?void 0:$.showHeader)!==!1}function e_($,X,he){const pe=ls[X],Ne=typeof pe=="number"&&pe>0;if(Ni.value&&!Ne&&!(function(ze){return!!xi.value.paragraph&&(ze.type==="paragraph"||ze.type==="list_item"||ze.type==="list")})($)){const ze=sW($,he,ne.value);if(ze)return ze}if(Pn.value&&$.type==="code_block"){const ze=(function(tt){if(tt.type!=="code_block")return null;const ot=N_(tt,h2(tt));return YS(ot)?"markdown":ot===al?"pre":ot===JS.value||ot===B8?"monaco":null})($);if(ze==="monaco"||ze==="markdown"||ze==="pre")return(function(tt,ot){var kt,rt,ht;if(!tt||tt.type!=="code_block")return null;const yt=ot.rendererKind,nt=yt!=="pre"&&ot.showHeader!==!1,pt=!!tt.diff;let St=0,wt=500;if(yt==="monaco"){const Dt=(kt=ot.monacoOptions)!=null?kt:{},rn=q8(tt,Dt,ot.width),hn=(function(kn){const An=typeof kn?.fontSize=="number"&&kn.fontSize>0?kn.fontSize:12;return typeof kn?.lineHeight=="number"&&kn.lineHeight>0?kn.lineHeight:Math.round(1.5*An)})(Dt),Cn=(function(kn,An){var Kn,ii;const Wi=typeof((Kn=kn?.padding)==null?void 0:Kn.top)=="number"?kn.padding.top:An?0:8,er=typeof((ii=kn?.padding)==null?void 0:ii.bottom)=="number"?kn.padding.bottom:An?0:8;return Math.max(0,Wi)+Math.max(0,er)})(Dt,pt);wt=typeof Dt.MAX_HEIGHT=="number"&&Dt.MAX_HEIGHT>0?Dt.MAX_HEIGHT:500,St=Math.round(rn*hn+Cn)}else if(yt==="markdown"){const Dt=q8(tt);St=Math.round(21*Dt+32)}else{const Dt=q8(tt);St=Math.round(28*Dt),wt=Number.POSITIVE_INFINITY}const Vt=Math.max(1,Math.min(St,wt));return Ot({kind:"code-block",height:Math.round(Vt+(nt?40:0)),contentHeight:Vt,rendererKind:yt},pt&&yt==="monaco"?{diffInline:W7((rt=ot.monacoOptions)!=null?rt:{},(ht=ot.width)!=null?ht:0)}:{})})($,{rendererKind:ze,monacoOptions:I.codeBlockMonacoOptions,showHeader:XS(),width:he})}return null}c1(()=>{if(Ql.value,ss>0)return;const $=Qe.value,X=Dn();if(!$.length||!zt.value)return Di=[],Ks=[],Go=-1,$o.clear(),void(Dr.value=Vs);const he=Q.value||jt("estimatedNodeHeights.clientWidth",()=>{var rt;return((rt=O.value)==null?void 0:rt.clientWidth)||0});if(!Number.isFinite(he)||he<=0)return Di=[],Ks=[],Go=-1,$o.clear(),void(Dr.value=Vs);const pe=(function(rt){return[Math.round(rt),Ni.value,Pn.value,ne.value,I.codeBlockMonacoOptions,XS(),m.value,xi.value,j8.value]})(he),Ne=Di.length<=$.length&&(tt=pe,(ze=Ks).length===tt.length&&ze.every((rt,ht)=>Object.is(rt,tt[ht])));var ze,tt;const ot=Ne&&Go===X?$.length:Ne?O4($.length):0,kt=Ne?Array.from($o):[];Di.length=$.length;for(let rt=ot;rt<$.length;rt++)Di[rt]=e_($[rt],rt,he);for(const rt of kt)rt>=0&&rt<$.length&&rtDr.value);Os=(function($){let X=!0,he=[0],pe="";function Ne(ht){var yt;const nt=$.nodeHeights[ht];if(Number.isFinite(nt)&&nt>0)return nt;const pt=$.parsedNodes.value[ht],St=pt?.type,wt=!!((yt=$.hasCustomParagraphComponent)!=null&&yt.call($)),Vt=$.estimatedNodeHeights.value[ht],Dt=Vt?.height;if(!(function(hn,Cn,kn){return!!(kn&&Cn?.kind==="simple-text"&&(hn==="paragraph"||hn==="list_item"||hn==="list"))})(St,Vt,wt)&&Number.isFinite(Dt)&&Dt>0)return Dt;const rn=ske(pt,$.getContainerWidth()||640);return St==="heading"||St==="paragraph"&&rn<=28&&(function(hn,Cn){if(Cn)return!1;const kn=hn.children;return!Array.isArray(kn)||!kn.length||kn.every(lW)})(pt,wt)?rn:Math.max($.averageNodeHeight.value,rn)}function ze(){var ht;const yt=$.parsedNodes.value.length,nt=$.getPrefixCacheKeyParts().join(":");if(!X&&pe===nt)return he;const pt=new Array(yt+1);pt[0]=0;for(let St=0;St=((yt=St[pt])!=null?yt:0))return pt-1;let wt=0,Vt=pt-1,Dt=pt-1;for(;wt<=Vt;){const rn=wt+Vt>>1;((nt=St[rn+1])!=null?nt:0)>=ht?(Dt=rn,Vt=rn-1):wt=rn+1}return Dt}function ot(ht,yt){var nt,pt;if(ht>=yt)return 0;if($.heightEstimationActive.value)return(function(Vt,Dt){var rn,hn;const Cn=$.parsedNodes.value.length,kn=wN(Math.trunc(Vt),0,Cn),An=wN(Math.trunc(Dt),kn,Cn);if(kn>=An)return 0;const Kn=ze();return((rn=Kn[An])!=null?rn:0)-((hn=Kn[kn])!=null?hn:0)})(ht,yt);if($.heightTreeSize.value!==$.parsedNodes.value.length){let Vt=0;for(let Dt=ht;Dtkn<=0?0:$.fenwickRangeSum(wt,0,kn)+(kn-$.fenwickRangeSum(Vt,0,kn))*St;let rn=0,hn=nt.length-1,Cn=nt.length-1;for(;rn<=hn;){const kn=rn+hn>>1;Dt(kn+1)>=ht?(Cn=kn,hn=kn-1):rn=kn+1}return Cn}let pt=ht;for(let St=0;St0||ht++}return ht}return{markFallbackHeightPrefixDirty:function(){X=!0},getFallbackNodeHeight:Ne,estimateHeightRange:ot,estimateIndexForOffset:kt,estimateIndexForOffsetFromEnd:function(ht){var yt,nt;const pt=$.parsedNodes.value;if(!pt.length)return 0;if(ht<=0)return Math.max(0,pt.length-1);if($.heightEstimationActive.value){const wt=(yt=ze()[pt.length])!=null?yt:0;return tt(Math.max(0,wt-ht))}if($.heightTreeSize.value===pt.length){const wt=ot(0,pt.length);return kt(Math.max(0,wt-ht))}let St=ht;for(let wt=pt.length-1;wt>=0;wt--){const Vt=(nt=$.nodeHeights[wt])!=null?nt:$.averageNodeHeight.value;if(St<=Vt)return wt;St-=Vt}return 0},getEstimatedNodeHeightCount:rt,buildVirtualHeightSummary:function(ht){var yt;const nt=$.parsedNodes.value.length;return{totalNodes:nt,measuredCount:$.heightStats.count,estimatedCount:rt(),averageNodeHeight:$.averageNodeHeight.value,topSpacerHeight:ht.topSpacerHeight,bottomSpacerHeight:ht.bottomSpacerHeight,estimatedTotalHeight:ot(0,nt),width:(yt=ht.width)!=null?yt:$.getContainerWidth()}}}})({parsedNodes:Qe,nodeHeights:ls,heightStats:as,heightTreeSize:G,heightSumTree:ye,heightKnownTree:Oe,averageNodeHeight:We,heightEstimationActive:Pi,estimatedNodeHeights:ip,getContainerWidth:Si,hasCustomParagraphComponent:()=>!!xi.value.paragraph,getPrefixCacheKeyParts:()=>{var $;const X=og(Q.value||jt("getFallbackHeightPrefix.clientWidth",()=>{var pe;return((pe=O.value)==null?void 0:pe.clientWidth)||0})),he=(($=i.virtualScroll)==null?void 0:$.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[Qe.value.length,as.count,Math.round(as.total),Math.round(100*We.value),he,X,Pi.value?1:0,j8.value,q.value,xi.value.paragraph?1:0]},fenwickRangeSum:Wn}),qe(()=>Qe.value.length,$=>{var X;so(),$<=0?to():($Je(X))),$!==G.value&>($))},{immediate:!0});const TG=D(()=>{if(!En.value)return Qe.value.map((pe,Ne)=>({node:pe,index:Ne}));const $=Qe.value.length,X=Xs(zn.start,0,$),he=Xs(zn.end,X,$);return Qe.value.slice(X,he).map((pe,Ne)=>({node:pe,index:X+Ne}))}),z4=D(()=>En.value?Zs(0,Math.min(zn.start,Qe.value.length)):0),j4=D(()=>{if(!En.value)return 0;const $=Qe.value.length;return Zs(Math.min(zn.end,$),$)});function t_(){return Os.buildVirtualHeightSummary({topSpacerHeight:z4.value,bottomSpacerHeight:j4.value,width:kf()})}function EG(){const $=Qe.value,X=t_();return On(Ot({},X),{probe:{paragraphReady:!!ne.value.paragraph,listItemReady:!!ne.value.listItem,listWrapperOverhead:ne.value.listWrapperOverhead,headingReadyLevels:Object.entries(ne.value.headings).filter(([,he])=>!!he).map(([he])=>Number(he))},nodes:$.map((he,pe)=>{var Ne,ze,tt,ot,kt,rt,ht,yt,nt;return{index:pe,type:he.type,estimateKind:(ze=(Ne=ip.value[pe])==null?void 0:Ne.kind)!=null?ze:null,rendererKind:(ot=(tt=ip.value[pe])==null?void 0:tt.rendererKind)!=null?ot:null,estimatedHeight:(rt=(kt=ip.value[pe])==null?void 0:kt.height)!=null?rt:null,estimatedContentHeight:(yt=(ht=ip.value[pe])==null?void 0:ht.contentHeight)!=null?yt:null,measuredHeight:(nt=ls[pe])!=null?nt:null}})})}function H4(){return i.indexKey!=null?String(i.indexKey):So.value?`virtual-${yo()}`:"markdown-renderer"}function n_($){const X=String($),he=`${H4()}-`;if(!X.startsWith(he))return null;const pe=X.slice(he.length).match(/^(\d+)(?:$|-)/);if(!pe)return null;const Ne=Number(pe[1]);return!Number.isInteger(Ne)||Ne<0||Ne>=Qe.value.length?null:Ne}function yo(){var $,X,he;const pe=($=i.virtualScroll)==null?void 0:$.sessionKey;return String(pe!=null&&pe!==""?pe:(he=(X=i.indexKey)!=null?X:I.customId)!=null?he:Sn)}function cs(){var $;const X=($=i.virtualScroll)==null?void 0:$.threadKey;return X==null||X===""?void 0:String(X)}const LG=D(()=>{var $,X,he;return(he=cs())!=null?he:String((X=($=i.indexKey)!=null?$:I.customId)!=null?X:Sn)});function W4($){var X;return($??"")===((X=cs())!=null?X:"")}function Vu(){var $,X,he;return X=($=i.virtualScroll)==null?void 0:$.measurementKey,he=(function(){const pe=m.value;return(function(Ne){var ze,tt;const ot=Ne.renderer,kt=ot==="monaco"?Ne.codeBlockMonacoOptions:void 0,rt=Ne.codeBlockProps,ht=ot==="shiki";return[Ne.isDark?"dark":"light",ot==="monaco"?"code-rich":ot==="pre"?"code-pre":"code-shiki",Ne.codeBlockStream===!1?"code-static":"code-stream",Ps(Ne.codeBlockMinWidth),Ps(Ne.codeBlockMaxWidth),...ht?[Qve((ze=rt?.themes)!=null?ze:Ne.themes,(tt=rt?.langs)!=null?tt:Ne.langs)]:[],Ps(kt?.fontSize),Ps(kt?.lineHeight),Ps(kt?.fontFamily),Ps(kt?.tabSize),Ps(kt?.MAX_HEIGHT),Ps(kt?.wordWrap),Ps(kt?.wrappingIndent),Ps(kt?.padding),Ps(rt?.showHeader),Ps(rt?.showCopyButton),Ps(rt?.showExpandButton),Ps(rt?.showPreviewButton),Ps(rt?.showCollapseButton),Ps(rt?.showFontSizeButtons)].join("\0")})({renderer:pe,isDark:I.isDark,codeBlockStream:I.codeBlockStream,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockMonacoOptions:pe==="monaco"?I.codeBlockMonacoOptions:void 0,codeBlockProps:I.codeBlockProps,themes:pe==="shiki"?I.themes:void 0,langs:pe==="shiki"?I.langs:void 0})})(),[X==null?"":String(X),he].join("\0")}function kf(){return Si()}const o2=D(()=>og(kf())),El=D(()=>[Vu(),o2.value].join("\0")),NG=D(()=>{var $;return So.value?["virtual",($=cs())!=null?$:"",yo(),El.value].join("\0"):i.indexKey});function op(){Am.value+=1}function q4($){return!(!$||!Number.isInteger($.index)||$.index<0||$.index>=Qe.value.length||$.sessionKey!==yo()||$.threadKey!==cs()||$.layoutEpochKey!==El.value)}function i_($){const X=String($),he=ta.get(X);return he?q4(he)?he.index:null:n_(X)}function o_($="async-node"){(us.size||ta.size)&&(us.clear(),ta.clear(),op(),ro($))}const sp=tn(DC,null),U4={reportHeight($,X){if(!ei.value)return;const he=i_($);if(he==null)return;const pe=Js.get(he);if(!pe)return;const Ne=Number(X),ze=Ys(he,pe);(function(tt,ot,kt={}){Ln(()=>tl(tt,ot,kt))})(he,Number.isFinite(Ne)&&Ne>0?Math.max(Ne,ze||0):ze)},markPending($){if(!ei.value)return;const X=n_($);X!=null&&(function(he,pe){var Ne;const ze=ta.get(he);if(ze&&q4(ze))return us.set(he,Math.max(0,(Ne=us.get(he))!=null?Ne:0)+1),op(),void ro("async-node");us.set(he,1),ta.set(he,(function(tt){return{index:tt,sessionKey:yo(),threadKey:cs(),layoutEpochKey:El.value}})(pe)),op(),ro("async-node")})(String($),X)},markSettled($){if(!ei.value)return;const X=String($),he=i_($);(he!=null||(function(pe){return us.has(String(pe))})(X))&&(function(pe){var Ne;const ze=(Ne=us.get(pe))!=null?Ne:0;return!(ze<=0||(ze<=1?(us.delete(pe),ta.delete(pe)):us.set(pe,ze-1),op(),ze===1&&ro("async-node"),0))})(X)&&he!=null&&Ku()}};function DG(){let $=0;for(const X of Js.values())$+=jt("getVisibleDomHeight.offsetHeight",()=>{var he;return(he=X?.offsetHeight)!=null?he:0});return Math.ceil(Math.max(0,$))}ri(DC,{reportHeight($,X){U4.reportHeight($,X),sp?.reportHeight($,X)},markPending($){U4.markPending($),sp?.markPending($)},markSettled($){U4.markSettled($),sp?.markSettled($)}});let V4,K4=null,rp=null;function s2($){return $!==!1&&$!=null&&$!==""}function s_(){return En.value?(function(){if(!En.value)return!0;const $=Qe.value.length,X=Xs(zn.start,0,$),he=Xs(zn.end,X,$);if(X>=he)return!0;for(let pe=X;pe=Ie.value}function Z4(){return at.value===!0&&!It.value&&xm.value===0&&Ta.size===0&&Ia.size===0&&gr==null&&s_()}function r_(){var $,X;if((($=i.virtualScroll)==null?void 0:$.settleMode)!=="manual"||K4===yo()&&V4===cs())return!0;const he=(X=i.virtualScroll)==null?void 0:X.settledToken;return!!s2(he)&&rp===Pm(he)}function G4(){return Z4()&&r_()}function FG($,X){return X.totalNodes<=0?$==="final"?"final":"estimate":X.measuredCount>=X.totalNodes?$==="final"?"final":"measured":X.measuredCount>0||X.estimatedCount>0?"mixed":"estimate"}function bf($="manual",X){const he=t_(),pe=(function(Ne){return Ne||(at.value!==!0?Qe.value.length>0?"streaming":"estimating":!s_()||Ia.size>0||gr!=null?"measuring":G4()?"settled":"settling")})(X);return{sessionKey:yo(),threadKey:cs(),phase:pe,nodeCount:he.totalNodes,liveRange:{start:zn.start,end:zn.end},renderedCount:Jn.value,measuredCount:he.measuredCount,estimatedCount:he.estimatedCount,averageNodeHeight:he.averageNodeHeight,topSpacerHeight:he.topSpacerHeight,bottomSpacerHeight:he.bottomSpacerHeight,visibleDomHeight:DG(),totalHeight:l_(),width:he.width,final:at.value===!0,stable:G4(),confidence:FG(pe,he),reason:$}}function _m(){const $=Jl.value||ve(),X=O.value;if(!$||!X)return null;const he=$.ownerDocument||X.ownerDocument||document,pe=$===he.documentElement||$===he.body||$===he.scrollingElement,Ne=jt("getScrollBox.scrollTop",()=>le($,he,pe)),ze=jt("getScrollBox.scrollHeight",()=>{var ot,kt,rt,ht,yt;return pe?Math.max((kt=(ot=he.documentElement)==null?void 0:ot.scrollHeight)!=null?kt:0,(ht=(rt=he.body)==null?void 0:rt.scrollHeight)!=null?ht:0,(yt=$.scrollHeight)!=null?yt:0):$.scrollHeight}),tt=jt("getScrollBox.clientHeight",()=>{var ot;return pe?((ot=he.documentElement)==null?void 0:ot.clientHeight)||$.clientHeight||0:$.clientHeight});return{root:$,doc:he,isViewportRoot:pe,scrollTop:Ne,scrollHeight:ze,clientHeight:tt}}function l_(){const $=Qe.value.length,X=Math.max(0,Zs(0,$)),he=jt("getRendererLogicalHeight.offsetHeight",()=>{var Ne,ze;return(ze=(Ne=O.value)==null?void 0:Ne.offsetHeight)!=null?ze:0}),pe=Math.max(0,he>0?he:jt("getRendererLogicalHeight.scrollHeight",()=>{var Ne,ze;return(ze=(Ne=O.value)==null?void 0:Ne.scrollHeight)!=null?ze:0}));return $<=0?Math.ceil(he):En.value?X>0?Math.max(1,Math.ceil(X),(function(){let Ne=z4.value+j4.value;for(const ze of mi.values())ze&&(Ne+=Math.max(0,jt("getVirtualizedDomLogicalHeight.offsetHeight",()=>ze.offsetHeight||0)));return Math.ceil(Math.max(0,Ne))})(),(function(Ne,ze){return Ne<=0||ze<=0?0:ze<=Ne+Math.max(512,.05*Ne)?Math.ceil(ze):0})(X,pe)):Math.max(1,Math.ceil(pe)):ei.value?X>0||as.count>0||Os.getEstimatedNodeHeightCount()>0?(Zi.value&&Jn.value,Math.max(1,Math.ceil(pe),Math.ceil(X))):Math.ceil(pe):Math.max(1,Math.ceil(pe),Math.ceil(X))}function a_($){const X=O.value;if(!X)return null;const he=jt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>X.getBoundingClientRect());return(function(Ne){return Ne.isViewportRoot?Ne.clientHeight:jt("getViewportBottomInRoot.getBoundingClientRect",()=>Ne.root.getBoundingClientRect().bottom)})($)-he.bottom}function BG($={}){const X=$.requireViewport!==!1,he=(function(ze=64){const tt=_m(),ot=O.value;if(!tt||!ot)return!1;const kt=(function(ht){if(ht.isViewportRoot)return{top:0,bottom:ht.clientHeight};const yt=jt("getVirtualViewportRect.getBoundingClientRect",()=>ht.root.getBoundingClientRect());return{top:yt.top,bottom:yt.bottom}})(tt),rt=jt("isRendererNearVirtualViewport.getBoundingClientRect",()=>ot.getBoundingClientRect());return rt.bottom>=kt.top-ze&&rt.top<=kt.bottom+ze})();if(X&&!he)return null;const pe=(function(){const ze=_m(),tt=O.value;if(!ze||!tt||Math.max(0,ze.scrollHeight-ze.scrollTop-ze.clientHeight)>64)return null;const ot=a_(ze);return ot==null?null:ot>=-8&&ot<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,ot)}:null})();if(pe)return{anchor:pe,captured:!0};const Ne=iu();if(Ne)return{anchor:{type:"node",nodeIndex:Ne.nodeIndex,offsetWithinNodePx:Ne.offsetWithinNodePx},captured:he};if($.allowFallback===!0){const ze=(function(){const tt=Qe.value.length;return tt<=0?null:{type:"node",nodeIndex:Xs(Un.value,0,Math.max(0,tt-1)),offsetWithinNodePx:0}})();return ze?{anchor:ze,captured:!1}:null}return null}function Q4($){let X=2166136261;for(let he=0;he<$.length;he++)X^=$.charCodeAt(he),X=Math.imul(X,16777619);return(X>>>0).toString(36)}function RG($,X){let he=$;for(let pe=0;pe8192?`${pe.slice(0,8192)}...${pe.length}`:pe;return`${pe.length}:${Q4(Ne)}`})($)}`;if(typeof $=="function")return"fn";if(typeof $!="object")return typeof $;if(X.has($))return"cycle";if(he>=6)return"max-depth";X.add($);try{if(Array.isArray($)){if($.length<=160){const rt=[];for(let ht=0;ht<$.length;ht++)rt.push(r2($[ht],X,he+1));return`a:${$.length}:${rt.join(",")}`}const ze=[],tt=[],ot=Math.max(0,$.length-32);let kt=2166136261;for(let rt=0;rt<$.length;rt++){const ht=r2($[rt],X,he+1);kt=RG(kt,ht),rt<32&&ze.push(ht),rt>=ot&&tt.push(ht)}return[`a:${$.length}`,`h=${ze.join(",")}`,`t=${tt.join(",")}`,`all=${(kt>>>0).toString(36)}`].join(":")}const pe=$,Ne=Object.keys(pe).filter(ze=>{const tt=pe[ze];return ze!=="parent"&&ze!=="el"&&ze!=="component"&&(tt==null||typeof tt=="string"||typeof tt=="number"||typeof tt=="boolean"||OG.has(ze))}).sort();return`o:${Ne.length}:${Ne.map(ze=>`${ze}=${r2(pe[ze],X,he+1)}`).join(";")}`}finally{X.delete($)}}let Y4=-1,J4="",wf=[2166136261];function Mm($){const X=Qe.value[$];return X?Q4(r2(X)):""}function $G($,X){let he=$;for(let pe=0;pe>>0}function X4(){var $,X;const he=q.value;if(Y4===he)return J4;const pe=Qe.value.length;let Ne=O4(pe);(Y4!==he-1||Ne>pe||wf.length>>0).toString(36),Y4=he,J4}function lp($,X={}){var he;const pe=X.includeHeightCache===!0,Ne=(he=X.includeContentHash)!=null?he:pe,ze=pe?(function(ot){const kt=(function(){var wt,Vt;const Dt=Number((Vt=(wt=i.virtualScroll)==null?void 0:wt.heightCacheLimit)!=null?Vt:5e3);return!Number.isFinite(Dt)||Dt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(Dt))})();if(!Number.isFinite(kt)||ot.length<=kt)return ot;const rt=new Map,ht=wt=>{!wt||rt.size>=kt||rt.set(wt.index,wt)},yt=Qe.value.length,nt=Xs(zn.start-2*io.value,0,yt),pt=Xs(zn.end+2*io.value,nt,yt);for(const wt of ot)wt.index>=nt&&wt.index=0&&rt.sizewt.index-Vt.index).slice(0,kt)})(gn().map(ot=>{var kt;const rt=Qe.value[ot.index];return rt?On(Ot({},ot),{nodeType:String((kt=rt.type)!=null?kt:""),signature:Mm(ot.index)}):null}).filter(ot=>!!ot)):[],tt=BG({allowFallback:X.allowAnchorFallback===!0,requireViewport:X.requireViewport});return tt||ze.length||X.includeEmptyState===!0?On(Ot({sessionKey:$.sessionKey,threadKey:$.threadKey},tt?{anchor:tt.anchor,anchorCaptured:tt.captured}:{anchorCaptured:!1}),{metrics:$,width:$.width,contentHash:Ne?X4():void 0,measurementKey:Vu()||void 0,heightCache:ze.length?ze:void 0}):null}function e3($){var X,he;const pe=_m();if(!pe)return;const Ne=(function(ot){const kt=O.value;if(!kt)return null;const rt=ie(kt,ot.root),ht=Qe.value.length,yt=jt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>kt.offsetHeight||0),nt=Math.max(0,yt>0?yt:ht>0?jt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>kt.scrollHeight||0):0),pt=l_();return rt+Math.max(nt,pt)})(pe);if(Ne==null)return;const ze=Math.max(0,$.distanceFromBottomPx),tt=Math.max(0,Ne-pe.clientHeight-ze);(function(ot){tu=Nm()+120,Fr=ot})(tt),pe.isViewportRoot?(he=(X=pe.doc.defaultView)==null?void 0:X.scrollTo)==null||he.call(X,0,tt):yN(pe.root,pe.doc,tt,{isReverseFlexScrollRoot:Ce,getNormalizedScrollTop:le})}const t3=[];function u_(){if(Z)for(_l!=null&&(Ki?.(_l),_l=null);t3.length;){const $=t3.pop();$!=null&&window.clearTimeout($)}}function ap($){const X=!!Qo.value;Qo.value=null,tu=0,Fr=null,u_(),X&&$&&ro($)}function up(){if(!Qo.value||!Z||_l!=null)return;const $=()=>{_l=null;const X=Qo.value;X&&e3(X)};_l=eo?eo($):null,_l==null&&$()}function c_($,X={}){const he=Qe.value.length;return he<=0?[]:$.filter(pe=>!(!Number.isInteger(pe.index)||pe.index<0||pe.index>=he)&&!(!Number.isFinite(pe.height)||pe.height<=0)&&!(X.requireSignature&&!pe.signature)&&!(X.requireCompatibilityMetadata&&!pe.nodeType&&!pe.signature)&&(function(Ne){var ze;const tt=Qe.value[Ne.index];return!(!tt||Ne.nodeType&&Ne.nodeType!==String((ze=tt.type)!=null?ze:"")||Ne.signature&&Ne.signature!==Mm(Ne.index))})(pe))}function d_($){const X=og(kf()),he=og($);return X!==-1&&he!==-1&&X===he}function n3($){var X;const he=Number($?.width);if(Number.isFinite(he)&&he>0)return he;const pe=Number((X=$?.metrics)==null?void 0:X.width);return Number.isFinite(pe)&&pe>0?pe:null}function f_($){var X;return $.sessionKey===yo()&&!!W4($.threadKey)&&((X=$.measurementKey)!=null?X:"")===Vu()&&!!d_(n3($))&&!!(function(he){const pe=he.heightCache;return!!pe?.length&&(h_(he)?pe.some(Ne=>!!(Ne.nodeType||Ne.signature)):pe.some(Ne=>!!Ne.signature))})($)}function h_($){return!!($.contentHash&&$.contentHash===X4())}function PG($){return!h_($)}let Cf=null,Af=null,l2=null,Im=null,Tm=null;function i3($){var X;const he=$.map(Ne=>{var ze,tt;return[Ne.index,Math.round(10*Ne.height),(ze=Ne.nodeType)!=null?ze:"",(tt=Ne.signature)!=null?tt:""].join("")}).join(""),pe=og(kf());return[(X=cs())!=null?X:"",yo(),Vu(),Qe.value.length,pe,$.length,Q4(he)].join(":")}function p_($=(X=>(X=i.virtualScroll)==null?void 0:X.heightCache)()){if(!ei.value||!$?.length||Qe.value.length<=0||!d_((X=i.virtualScroll)==null?void 0:X.heightCacheWidth))return!1;var X;const he=c_($,{requireSignature:!0});if(!he.length)return!1;const pe=i3(he);return pe===Cf?(Af="standalone",!0):(Me(he,{mode:"merge"}),so(),Cf=pe,Af="standalone",Fm(),ro("restore"),!0)}function o3($,X={}){var he,pe,Ne;if(!ei.value||!$||$.sessionKey!==yo()||!W4($.threadKey)||Qe.value.length<=0)return!1;const ze=!!((he=$.heightCache)!=null&&he.length)&&!a2(),tt=!$.anchor||$.anchorCaptured===!1&&X.allowUncapturedAnchor!==!0?null:$.anchor,ot=X.restoreAnchor===!0&&!!tt&&!a2()&&Number(n3($))>0;let kt=!1;if((pe=$.heightCache)!=null&&pe.length&&f_($)){const ht=c_($.heightCache,{requireCompatibilityMetadata:!$.contentHash,requireSignature:PG($)});ht.length&&(Me(ht,{mode:"merge"}),so(),Cf=i3(ht),Af="restore",Fm(),kt=!0)}if(ze||ot)return!1;if(!X.restoreAnchor||!tt)return kt&&ro("restore"),!0;const rt=(function(ht,yt){var nt;const pt=ht.anchor,St=pt?pt.type==="bottom"?`bottom:${Math.round(pt.distanceFromBottomPx)}`:`node:${pt.nodeIndex}:${Math.round(pt.offsetWithinNodePx)}`:"none";return[(nt=cs())!=null?nt:"",yo(),Vu(),o2.value,yt,St].join(":")})($,(Ne=X.restoreToken)!=null?Ne:"imperative");return l2===rt?(kt&&ro("restore"),!0):(l2=rt,(function(ht){const yt=()=>{if(ht.type==="node")return ap(),void Ml({nodeIndex:ht.nodeIndex,offsetWithinNodePx:ht.offsetWithinNodePx});if(Br(),rs.value=null,Qo.value=ht,u_(),e3(ht),Z)for(const nt of[0,120,280,480])t3.push(window.setTimeout(()=>{const pt=Qo.value;pt&&e3(pt)},nt))};(function(nt){if(!En.value)return!1;const pt=Qe.value.length;return!(pt<=0||(Un.value=nt.type==="node"?Xs(nt.nodeIndex,0,pt-1):pt-1,vo(),0))})(ht)?vt(yt):yt()})(tt),ro("restore"),!0)}function a2(){const $=kf();return Number.isFinite($)&&$>0}function m_($){var X;return $.sessionKey===yo()&&!!W4($.threadKey)&&(Qe.value.length<=0||!(!((X=$.heightCache)!=null&&X.length)||a2())||!(!($.anchor&&Number(n3($))>0)||a2()))}function s3(){Gn.clear();for(const $ of Object.keys(ls)){const X=Number($);Number.isInteger(X)&&X>=0&&X{let X=!1,he=null;const pe=()=>{X||(X=!0,he!=null&&window.clearTimeout(he),$())};if(eo)return eo(pe),void(he=window.setTimeout(pe,50));he=window.setTimeout(pe,0)})}function r3($,X=cs(),he=El.value){return yo()===$&&cs()===X&&El.value===he}function l3(){return ao(this,arguments,function*($={}){var X,he,pe,Ne,ze;const tt=yo(),ot=cs(),kt=El.value,rt=(X=$.frames)!=null?X:2,ht=(he=$.timeoutMs)!=null?he:120,yt=(pe=$.reason)!=null?pe:"manual",nt=$.expectedSettledTokenKey,pt=$.flushPendingTimers===!0,St=bf(yt),wt=()=>On(Ot({},St),{phase:St.final?"settling":St.phase,stable:!1,confidence:St.confidence==="final"?"mixed":St.confidence,reason:yt}),Vt=()=>r3(tt,ot,kt)&&(nt==null||Dm()===nt);for(let Cn=0;Cnwindow.setTimeout(kn,Cn))})(ht),!Vt()||(pt&&nn(),Ku(),Em(),!Vt()))return wt();const Dt=Z4();Dt&&(K4=tt,V4=ot,((Ne=i.virtualScroll)==null?void 0:Ne.settleMode)==="manual"&&nt!=null&&s2((ze=i.virtualScroll)==null?void 0:ze.settledToken)&&Dm()===nt&&(rp=Pm(i.virtualScroll.settledToken)));const rn=Vt()&&Dt&&r_(),hn=bf(yt,rn?"final":void 0);return f3(hn,!0),hn})}let a3="content",xf=null,Sf=null,u3=0,Lm=null,cp=null,c3=null,d3=null;function Nm(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function v_($){var X,he;const pe=Lm;if(!pe)return!0;const Ne=(he=(X=i.virtualScroll)==null?void 0:X.heightDiffThresholdPx)!=null?he:1;return Math.abs($.totalHeight-pe.totalHeight)>Ne||$.sessionKey!==pe.sessionKey||$.phase!==pe.phase||$.stable!==pe.stable||$.final!==pe.final||$.threadKey!==pe.threadKey||$.nodeCount!==pe.nodeCount||$.measuredCount!==pe.measuredCount||$.width!==pe.width}function Dm($=(X=>(X=i.virtualScroll)==null?void 0:X.settledToken)()){return Ps($)}function y_($,X){var he,pe;return[$,X.sessionKey,(he=X.threadKey)!=null?he:"",Vu(),X4(),Ps((pe=i.virtualScroll)==null?void 0:pe.settledToken),Math.round(X.totalHeight),Math.round(X.width)].join("\0")}function Fm(){c3=null,d3=null,cp=null}function zG($){const X=$.heightCache;return X?.length?i3(X):""}function Bm($){var X,he,pe;const Ne=$.metrics,ze=$.anchor?(tt=$.anchor).type==="bottom"?`bottom:${Math.round(tt.distanceFromBottomPx)}`:`node:${tt.nodeIndex}:${Math.round(tt.offsetWithinNodePx)}`:"none";var tt;return[$.sessionKey,(X=$.threadKey)!=null?X:"",(he=$.measurementKey)!=null?he:Vu(),(pe=$.contentHash)!=null?pe:"",zG($),ze,$.anchorCaptured?1:0,Ne.liveRange.start,Ne.liveRange.end,Ne.renderedCount,Ne.nodeCount,Math.round(Ne.totalHeight),Math.round(Ne.width),Ne.phase,Ne.stable?1:0].join("\0")}function f3($,X=!1){if(!ei.value||(function(tt=!1){return!tt&&So.value&&!ns.value})(X))return;const he=X||v_($),pe=(function(tt,ot=!1){return ot||tt.stable||tt.phase==="final"?{state:lp(tt,{includeHeightCache:!0})}:{state:lp(tt)}})($,X),Ne=pe.state,ze=!!(Ne&&(he||(function(tt,ot=!1){return!!ot||Bm(tt)!==cp})(Ne,X)));if(he&&(F($),Lm=$,u3=Nm()),Ne&&ze&&(W(Ne),Ne.anchor&&P(Ne.anchor),cp=Bm(Ne)),$.stable){const tt=y_("settled",$);if(tt!==c3){c3=tt;const ot=lp($,{includeHeightCache:!0});ot&&(W(ot),cp=Bm(ot)),(function(kt){o("render-settled",kt)})($)}}if($.phase==="final"){const tt=y_("final",$);if(tt!==d3){d3=tt;const ot=lp($,{includeHeightCache:!0});ot&&(W(ot),cp=Bm(ot)),(function(kt){o("render-final",kt)})($)}}}function h3(){xf!=null&&(Ki?.(xf),xf=null),Sf!=null&&Z&&(window.clearTimeout(Sf),Sf=null)}function k_(){xf=null,Sf=null,(function($){if(Ia.size>0||gr!=null)return!0;switch($){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(a3)&&(Ku(),Em()),f3(bf(a3))}function ro($){var X,he;if(!ei.value||(a3=$,xf!=null||Sf!=null))return;const pe=Math.max(0,(he=(X=i.virtualScroll)==null?void 0:X.emitIntervalMs)!=null?he:32),Ne=Math.max(0,pe-(Nm()-u3)),ze=()=>{Sf=null,xf=eo?eo(k_):null,xf==null&&k_()};Z&&Ne>0?Sf=window.setTimeout(ze,Ne):ze()}function b_(){Yl.value+=1}function u2($){if(Zi.value&&$>=Jn.value){const X=Qe.value[$],he=Ue.value===!0&&at.value!==!0&&$>=Qe.value.length-2,pe=X?.type==="code_block"||X?.type==="image"||X?.type==="mermaid"||X?.type==="infographic";if(!he||pe)return!1}return!Te.value||$=de.value&&(K.value||(K.value=!0,R4()),!cn.value||!Xi))return dp($),void(X&&Oc($,!0));if(${if(su.delete(ze),!Te.value||vr.value.has(ze))return;const kt=mi.get(ze);if(!kt)return;const rt=ve(kt),ht=kt.ownerDocument||document,yt=ht.defaultView||window,nt=!rt||rt===ht.documentElement||rt===ht.body,pt=!nt&&rt?jt("nodeVisibilityFallback.root.getBoundingClientRect",()=>rt.getBoundingClientRect()):null,St=nt?0:pt.top,wt=nt?jt("nodeVisibilityFallback.clientHeight",()=>{var Dt,rn;return(rn=(Dt=yt.innerHeight)!=null?Dt:rt?.clientHeight)!=null?rn:0}):pt.bottom,Vt=jt("nodeVisibilityFallback.node.getBoundingClientRect",()=>kt.getBoundingClientRect());Vt.bottom>=St-500&&Vt.top<=wt+500&&Oc(ze,!0)},1800+tt);su.set(ze,ot)})($);let Ne=null;Ne=qe(()=>pe.isVisible.value,ze=>{if(ze){ru($),Oc($,!0),Ne?.(),Tl.delete($),_s.get($)===pe&&_s.delete($);try{pe.destroy()}catch{}}},{immediate:!0}),Tl.set($,Ne),En.value&&yi()}function p3(){gr=null,Ln(()=>{let $=!1;for(const[X,he]of Ia)Ia.delete(X),Js.get(X)===he.el&&Il.get(X)===he.version&&($=tl(X,he.height,{allowShrink:he.allowShrink})||$);return $})}function fp(){gr!=null&&(Ki?.(gr),gr=null),Ia.clear()}function d2($,X){(function(he,pe,Ne){var ze;if(!Number.isFinite(Ne)||Ne<=0||Js.get(he)!==pe)return;const tt=Il.get(he);if(tt==null)return;const ot=Qe.value[he],kt=It.value&&at.value!==!0&&!((ze=i.nodes)!=null&&ze.length)&&he>=Qe.value.length-2,rt=!(ot?.loading===!0||kt),ht=Ia.get(he),yt=ht?ht.allowShrink&&rt:rt,nt=ht&&!yt?Math.max(ht.height,Ne):Ne;Ia.set(he,{height:nt,allowShrink:yt,version:tt,el:pe}),gr==null&&(gr=eo?eo(p3):null,gr==null&&p3())})($,X,Ys($,X))}function Ku(){for(const[$,X]of Js)X&&d2($,X)}function w_(){Oo?.disconnect(),Oo=null,Mo.clear()}function m3(){for(;yf.length;)At(yf.pop())}qe(ns,$=>{$&&ro("content")},{flush:"post"}),t({getVirtualMetrics:bf,captureVirtualState:function($={}){var X;return lp(bf("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:$.allowFallbackAnchor===!0,requireViewport:$.requireViewport===!0,includeEmptyState:(X=$.includeEmptyState)==null||X})},restoreVirtualState:function($,X={}){const he=X.restoreAnchor===!0,pe=X.restoreToken==null?"imperative":String(X.restoreToken);Im=$,Tm={restoreAnchor:he,restoreToken:pe,allowUncapturedAnchor:X.allowUncapturedAnchor===!0},!o3($,{restoreAnchor:he,restoreToken:pe,allowUncapturedAnchor:X.allowUncapturedAnchor===!0})&&m_($)||(Im=null,Tm=null)},forceMeasure:function($="manual"){return ao(this,null,function*(){yield vt(),yield g_(),Ku(),Em(),yield vt();const X=bf($);return f3(X,!0),X})},settle:l3,scrollToNode:function($,X="start"){ap(),Br();const he=Qe.value.length;if(he<=0)return;const pe=Xs($,0,he-1),Ne=()=>{var ze;const tt=ea({nodeIndex:pe,offsetWithinNodePx:0}),ot=nu(pe),kt=_m(),rt=(ze=kt?.clientHeight)!=null?ze:0,ht=Gs();let yt=tt;if(X==="center")yt=tt-rt/2+ot/2;else if(X==="end")yt=tt-rt+ot;else if(X==="nearest"&&ht!=null){if(tt>=ht&&tt+ot<=ht+rt)return;yt=ttmr.value,$=>{if(!$){w_();for(const X of Ma.values())for(const he of X)At(he);Ma.clear(),Il.clear(),m3(),fp()}},{immediate:!0}),qe(at,$=>{$&&(function(){if(Z&&at.value&&Js.size){m3();for(const X of[80,240,640]){const he=et(X,()=>{for(const[pe,Ne]of Js)Ne&&d2(pe,Ne)},"final");he!=null&&yf.push(he)}}})(),ro($?"final":"content")});const jG=kN(()=>ro("content"),16),HG=kN(()=>ro("batch"),16);qe([()=>Qe.value.length,()=>Jn.value],()=>{Qo.value&&up(),jG()},{flush:"post",immediate:!0}),qe([()=>zn.start,()=>zn.end],()=>{HG()},{flush:"post"});const{cleanupBatchScheduler:WG}=(function($){const{props:X,isClient:he,isTestEnv:pe,parsedNodesIdentity:Ne,parsedNodeCount:ze,desiredRenderedCount:tt,datasetKey:ot,batchingEnabled:kt,incrementalRenderingActive:rt,resolvedBatchSize:ht,resolvedInitialBatch:yt,renderedCount:nt,adaptiveBatchSize:pt,previousRenderContext:St,previousBatchConfig:wt,requestFrame:Vt,cancelFrame:Dt,hasIdleCallback:rn,cleanupNodeVisibility:hn,onDatasetKeyChanged:Cn,onDatasetChanged:kn}=$;let An=null,Kn="raf",ii=null,Wi=0,er=!1,$s=!1;const Ea=new Set,lu=new Set;function qm(){if(he){An!=null&&(Kn==="raf"&&Dt?Dt(An):Kn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(An):Kn==="timeout"&&window.clearTimeout(An),An=null),Wi+=1;for(const yr of Ea)Dt&&Dt(yr);for(const yr of lu)window.clearTimeout(yr);Ea.clear(),lu.clear(),ii=null,er=!1,$s=!1}}function b2(){return typeof performance<"u"?performance.now():Date.now()}function P_(yr){(function(Zu){var Pc;if(!rt.value)return;const Gu=Math.max(2,(Pc=X.renderBatchBudgetMs)!=null?Pc:6),Qu=Math.max(1,ht.value||1),La=Math.max(1,Math.floor(Qu/4));Zu>1.5*Gu?pt.value=Math.max(La,Math.floor(.8*pt.value)):Zu<.6*Gu&&pt.value=Gu)return;const Qu=Math.max(1,yr),La=()=>{const mp=b2();An=null;const Um=ii??Qu;ii=null;const gp=b2();nt.value=Math.min(Gu,nt.value+Um),hn(nt.value),(function(C3,w2){if(!he)return void P_(w2);er=!0;const W_=++Wi;vt().then(()=>{var q_;if(W_!==Wi)return;const cQ=b2(),dQ=Math.max(w2,cQ-C3),U_=()=>{W_===Wi&&P_(dQ)};if(Vt){let Mf=null,vp=null,K_=!1;const Z_=()=>{K_||(K_=!0,Mf!==null&&(Ea.delete(Mf),Mf=null),vp!==null&&(lu.delete(vp),window.clearTimeout(vp),vp=null),U_())};return Mf=Vt(()=>{Z_()}),Ea.add(Mf),vp=window.setTimeout(()=>{Mf!==null&&Dt&&Dt(Mf),Z_()},Math.max(32,(q_=X.renderBatchIdleTimeoutMs)!=null?q_:120)),void lu.add(vp)}const V_=window.setTimeout(()=>{lu.delete(V_),U_()},0);lu.add(V_)})})(mp,b2()-gp)};if(!he||il.immediate)return void La();const zc=Math.max(0,(Zu=X.renderBatchDelay)!=null?Zu:16);if(ii=ii!=null?Math.max(ii,Qu):Qu,An==null){if(!pe&&rn&&window.requestIdleCallback){const mp=Math.max(0,(Pc=X.renderBatchIdleTimeoutMs)!=null?Pc:120);return Kn="idle",void(An=window.requestIdleCallback(()=>La(),{timeout:mp}))}if(Vt&&!pe)return Kn="raf",void(An=Vt(()=>{zc===0?La():(Kn="timeout",An=window.setTimeout(()=>La(),zc))}));Kn="timeout",An=window.setTimeout(()=>La(),zc)}}function j_(yr,il={}){er?$s=!0:yr==null?H_():z_(yr,il)}function H_(){rt.value&&z_(kt.value?Math.max(1,Math.round(pt.value)):Math.max(1,ht.value))}return qe([Ne,ze,ot,rt,ht,yt,()=>X.renderBatchDelay],()=>{var yr;const il=ze.value,Zu=St.value,Pc=ot.value,Gu=!Object.is(Pc,Zu.key),Qu=il!==Zu.total,La=Gu||Qu;St.value={key:Pc,total:il};const zc=wt.value,mp=(yr=X.renderBatchDelay)!=null?yr:16,Um=zc.batchSize!==ht.value||zc.initial!==yt.value||zc.delay!==mp||zc.enabled!==rt.value;wt.value={batchSize:ht.value,initial:yt.value,delay:mp,enabled:rt.value},Gu&&Cn(il),(La||Um||!rt.value)&&qm(),(La||Um)&&(pt.value=Math.max(1,ht.value||1)),La&&kn();const gp=tt.value;if(!il)return nt.value=0,void hn(0);if(!rt.value)return nt.value=gp,void hn(nt.value);const C3=Gu||Zu.total===0;nt.value=C3||Um?Math.min(gp,yt.value):Math.min(nt.value,gp);const w2=Math.max(1,yt.value||ht.value||il);nt.value{rt.value&&(typeof il=="number"&&yr<=il||yr>nt.value&&j_())}),{cleanupBatchScheduler:qm}})({props:I,isClient:Z,isTestEnv:_e,parsedNodesIdentity:Zn,parsedNodeCount:Ss,desiredRenderedCount:Ie,datasetKey:NG,batchingEnabled:oi,incrementalRenderingActive:Zi,resolvedBatchSize:dn,resolvedInitialBatch:ti,renderedCount:Jn,adaptiveBatchSize:is,previousRenderContext:Us,previousBatchConfig:it,requestFrame:eo,cancelFrame:Ki,hasIdleCallback:He,cleanupNodeVisibility:_G,onDatasetKeyChanged:$=>{fp(),to(),so(),Fm(),$>0&>($)},onDatasetChanged:()=>{En.value&&yi({immediate:!0})}});qe([jn,En,()=>O.value,()=>Y()],([$,X])=>{if(!$)return KS(),void In();MG(),X?yi({immediate:!0}):In()},{flush:"post",immediate:!0}),qe([()=>Qe.value.length,()=>En.value],$=>ao(null,[$],function*([X,he]){he&&X&&Z&&(yield vt(),yi({immediate:!0}))}),{flush:"post"}),qe(Pi,$=>{$&&(function(){var X;if(po.value&&Bs.value&&qs.value&&((X=Nr.value)!=null&&X[1]))return;const he=Ft({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),pe=Ft({type:"list_item",children:[he],raw:"- Probe paragraph text"}),Ne=Ft({type:"list",ordered:!1,items:[pe],raw:"- Probe paragraph text"});po.value=he,Bs.value=pe,qs.value=Ne;const ze={1:null,2:null,3:null,4:null,5:null,6:null};for(let tt=1;tt<=6;tt++)ze[tt]=Ft({type:"heading",level:tt,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(tt)} Probe heading`});Nr.value=ze})()},{immediate:!0}),qe([()=>O.value,Pi],()=>{if(!Pi.value)return P4(),void(Q.value=0);GS(),P4(),Pi.value&&O.value&&typeof ResizeObserver<"u"&&(Sm=new ResizeObserver(()=>{GS(),rs.value&&_a(),Qo.value&&up(),ro("resize")}),Sm.observe(O.value))},{immediate:!0}),qe([Pi,di,El],()=>ao(null,null,function*(){if(!Pi.value)return ne.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void so();yield vt(),(function(){if(!Pi.value||typeof window>"u")return ne.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void so();const $={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},X=ZS($4(R.value),".paragraph-node");$.paragraph=U8(R.value,X,"pre-wrap");const he=$4(z.value),pe=he?.querySelector(".paragraph-node");$.listItem=U8(z.value,pe,"pre-wrap");const Ne=jt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var tt,ot;return(ot=(tt=H.value)==null?void 0:tt.offsetHeight)!=null?ot:0}),ze=jt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var tt,ot;return(ot=(tt=z.value)==null?void 0:tt.offsetHeight)!=null?ot:0});$.listWrapperOverhead=Math.max(0,Ne-ze);for(let tt=1;tt<=6;tt++){const ot=ZS($4(j[tt]),`h${tt}`);$.headings[tt]=U8(j[tt],ot,"pre-wrap")}ne.value=$,so()})()}),{flush:"post",immediate:!0}),qe(()=>Qe.value.length,()=>{En.value&&yi({immediate:!0})}),qe([Pi,Q],()=>{so(),En.value&&yi({immediate:!0}),rs.value&&_a(),Qo.value&&up(),ro("resize")},{immediate:!1}),qe(()=>Te.value,$=>{if($)for(const[X,he]of mi)c2(X,he);else if(R4(),En.value)yi({immediate:!0});else for(const[X,he]of mi)he&&Oc(X,!0)},{immediate:!1}),qe([me,de,()=>Y()],()=>{var $;($=Xi.refresh)==null||$.call(Xi);for(const[X,he]of mi)c2(X,he)},{immediate:!1}),qe([()=>I.viewportPriority,()=>Qe.value.length,de],([$,X,he])=>{if($!==!1){if(K.value&&(X<=200||X<=he)){K.value=!1;for(const[pe,Ne]of mi)c2(pe,Ne)}}else K.value=!1}),qe(()=>Jn.value,()=>{En.value&&yi({immediate:!0})}),qe([Un,no,io,()=>Qe.value.length,En],()=>{vo()},{immediate:!0});let Rm=null,Om=!1,hp=null;function $m(){Rm=null,K4=null,V4=void 0,rp=null,Fm()}function g3(){fp(),to(),so(),Gn.clear();const $=Qe.value.length;$>0&>($),s3()}function v3(){h3(),nn(),Lm=null,Cf=null,Af=null,l2=null,Im=null,Tm=null,Om=!1,$m(),o_("restore"),Br(),ap()}function Pm($){var X;return[(X=cs())!=null?X:"",yo(),Vu(),o2.value,Dm($),Qe.value.length,Math.round(Zs(0,Qe.value.length)),Math.round(kf()),as.count,Math.round(as.total)].join(":")}function C_(){return ao(this,null,function*(){var $,X,he,pe;const Ne=($=i.virtualScroll)==null?void 0:$.settledToken,ze=Dm(Ne),tt=yo(),ot=cs(),kt=El.value;if(ei.value&&((X=i.virtualScroll)==null?void 0:X.settleMode)==="manual"&&s2(Ne))if(Z4()){if(Pm(Ne)!==rp&&!Om){Om=!0;try{const rt=yield l3({reason:"manual",expectedSettledTokenKey:ze}),ht=Dm()===ze;r3(tt,ot,kt)&&rt.sessionKey===tt&&rt.threadKey===ot&&ht&&rt.stable&&rt.phase==="final"&&(rp=Pm((he=i.virtualScroll)==null?void 0:he.settledToken))}finally{Om=!1,yield vt();const rt=(pe=i.virtualScroll)==null?void 0:pe.settledToken,ht=s2(rt)?Pm(rt):"";r3(tt,ot,kt)&&ht&&rp!==ht&&C_()}}}else ro("manual")})}qe(ei,($,X)=>{if($!==X){if(!$)return v3(),void h3();v3(),g3(),hp=El.value,ro("content")}},{flush:"post"}),qe([ei,El],([$,X])=>{$?hp!=null?hp!==X&&(hp=X,(function(he="resize"){fp(),to(),so(),Gn.clear();const pe=Qe.value.length;pe>0&>(pe),s3(),Cf=null,Af=null,l2=null,Lm=null,Om=!1,$m(),p_(),vt(()=>{Ku(),rs.value&&_a(),Qo.value&&up(),ro(he)})})("resize")):hp=X:hp=null},{flush:"post",immediate:!0}),qe([ei,()=>yo(),()=>cs()],([$])=>{$&&(v3(),g3(),o_("content"),ro("content"))}),qe([ei,()=>yo(),()=>cs(),El,()=>Qe.value.length],([$])=>{$&&(function(X="async-node"){let he=!1;for(const[pe,Ne]of Array.from(ta.entries()))q4(Ne)||(ta.delete(pe),us.delete(pe),he=!0);he&&(op(),ro(X))})("async-node")},{flush:"post"}),qe([ei,()=>{var $;return($=i.virtualScroll)==null?void 0:$.sessionKey},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>i.indexKey,()=>q.value],([$])=>{$&&(Fm(),(function(X="content"){if(!ei.value)return;const he=[],pe=Qe.value.length,Ne=O4(pe);for(const ze of Array.from(Gn.keys())){if(ze>=pe){he.push(ze);continue}if(ze=pe&&Gn.delete(ze);he.length&&((function(ze,tt={}){const ot=Array.from(ze,Number);Mn(ot);let kt=0;if(Ln(()=>(kt=en(ot,tt),kt>0)),kt>0)(function(rt){for(const ht of rt)Gn.delete(ht)})(ot);else for(const rt of ot)$o.delete(rt)})(he,{notify:!1}),so(),$m(),rs.value&&_a(),Qo.value&&up(),ro(X))})("content"))},{flush:"post",immediate:!0}),qe([ei,()=>Qe.value.length,()=>yo(),()=>cs()],([$,X,he,pe],[Ne,ze,tt,ot])=>{$&&Ne&&he===tt&&pe===ot&&X!==ze&&$m()},{flush:"post"}),qe([ei,()=>{var $;return($=i.virtualScroll)==null?void 0:$.heightCache},()=>{var $;return($=i.virtualScroll)==null?void 0:$.heightCacheWidth},()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>Qe.value.length,()=>yo(),Q],()=>{p_()},{flush:"post",immediate:!0}),qe([ei,()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreAnchor},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>Qe.value.length,()=>yo(),Q],$=>ao(null,[$],function*([X,he]){if(!X||!he)return;yield vt();const pe=(function(){var Ne;const ze=(Ne=i.virtualScroll)==null?void 0:Ne.restoreAnchor;return ze==null||ze===!1?null:ze===!0?"true":String(ze)})();o3(he,{restoreAnchor:pe!=null,restoreToken:pe??void 0})}),{flush:"post",immediate:!0}),qe([ei,Q,()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey}],([$])=>{var X;if(!$)return;const he=(X=i.virtualScroll)==null?void 0:X.restoreState;he&&Cf&&Af==="restore"&&(f_(he)||(g3(),Cf=null,Af=null,ro("resize")))},{flush:"post"}),qe([ei,()=>Qe.value.length,()=>yo(),Q],$=>ao(null,[$],function*([X]){var he;const pe=Im,Ne=Tm;X&&pe&&(yield vt(),!o3(pe,{restoreAnchor:Ne?.restoreAnchor===!0,restoreToken:(he=Ne?.restoreToken)!=null?he:"imperative",allowUncapturedAnchor:Ne?.allowUncapturedAnchor===!0})&&m_(pe)||(Im=null,Tm=null))}),{flush:"post",immediate:!0}),qe([ei,at,()=>{var $;return($=i.virtualScroll)==null?void 0:$.settleMode},()=>yo(),()=>cs(),El,xm,n2,()=>Jn.value,Ie,()=>as.count,()=>as.total],([$,X,he])=>{if(!$||X!==!0||he==="manual"||!G4())return;const pe=(function(){var Ne;const ze=Qe.value.length;return[(Ne=cs())!=null?Ne:"",yo(),Vu(),o2.value,ze,Math.round(Zs(0,ze)),Math.round(kf()),as.count,Math.round(as.total)].join(":")})();Rm!==pe&&(Rm=pe,l3({reason:"final"}).then(Ne=>{Ne.stable||Rm!==pe||(Rm=null)}))},{flush:"post",immediate:!0}),qe([ei,at,()=>{var $;return($=i.virtualScroll)==null?void 0:$.settleMode},()=>{var $;return($=i.virtualScroll)==null?void 0:$.settledToken},()=>yo(),()=>cs(),El,xm,n2,()=>Jn.value,Ie,()=>Qe.value.length,()=>as.count,()=>as.total],()=>{C_()},{flush:"post",immediate:!0}),qe([()=>Qe.value.length,En,no,io,()=>zn.start,()=>zn.end],([$,X,he,pe,Ne,ze])=>{ke.value&&Bt("virtualization",{nodes:$,virtualization:X,maxLiveNodes:he,buffer:pe,focusIndex:Un.value,scroll:X?(()=>{const tt=Jl.value||ve();return tt?{reverse:Ce(tt),scrollTop:Math.round(tt.scrollTop),scrollTopAbs:Math.round(Math.abs(tt.scrollTop)),scrollHeight:Math.round(tt.scrollHeight),clientHeight:Math.round(tt.clientHeight)}:null})():null,liveRange:{start:Ne,end:ze},rendered:Jn.value})}),qe([()=>I.customId],([$],X,he)=>{if(!$||ts)return;const pe=(function(Ne,ze){return Ne?(Ms.controllers[Ne]=ze,()=>{Ms.controllers[Ne]===ze&&delete Ms.controllers[Ne]}):()=>{}})($,{captureRestoreAnchor:iu,restoreAnchor:Ml,getAnchorDrift:Uu,getReport:EG});he(()=>{pe()})},{immediate:!0}),si(()=>{(function(){if(ei.value)try{Ku(),Em();const $=bf("manual");v_($)&&(F($),Lm=$,u3=Nm());const X=lp($,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});X&&(W(X),X.anchor&&P(X.anchor),cp=Bm(X))}catch{}})(),WG(),R4(),Ze(),w_();for(const $ of Ma.values())for(const X of $)At(X);Ma.clear(),Il.clear(),Gn.clear(),m3(),fp(),P4(),Br(),ap(),h3(),KS(),In()});const qG=Mg("ViewportDeferredMermaidBlockNode",_u({loader:()=>ao(null,null,function*(){try{return(yield es(()=>import("./index11-DHi1-CuT.js"),__vite__mapDeps([7,5]))).default}catch($){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',$),al}}),loadingComponent:DN,delay:0}),DN),UG=Mg("ViewportDeferredInfographicBlockNode",_u({loader:()=>ao(null,null,function*(){try{return(yield es(()=>import("./index10-CoFm5QTj.js"),[])).default}catch($){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',$),al}}),loadingComponent:NN,delay:0}),NN),VG=Mg("ViewportDeferredD2BlockNode",_u(()=>ao(null,null,function*(){try{return(yield es(()=>import("./index8-QUl1r--p.js"),[])).default}catch($){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',$),al}})),al),A_={text:Uo,paragraph:wh,heading:n4,code_block:B8,list:w1,list_item:b1,blockquote:t9,table:f0,definition_list:n9,footnote:i9,footnote_reference:jl,footnote_anchor:c0,admonition:l9,vmr_container:s9,hardbreak:Id,link:Zr,image:Md,thematic_break:o9,math_inline:Ja,math_block:tW,strong:Vr,emphasis:Gr,strikethrough:Kr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,checkbox:zl,checkbox_input:zl,inline_code:Mr,html_inline:Hl,reference:Ur,html_block:d0},KG=D(()=>H4()),x_=D(()=>vN(I.codeBlockProps)),ZG=D(()=>vN(I.codeBlockProps,{omit:["langs"]})),S_=D(()=>Ot(Ot({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,monacoOptions:I.codeBlockMonacoOptions,themes:I.themes,langs:m.value==="shiki"?I.langs:void 0,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof be.value=="boolean"?{showTooltips:be.value}:{}),ZG.value)),__=D(()=>Ot(On(Ot({},S_.value),{langs:I.langs}),x_.value));function M_($){return typeof $=="boolean"?$:void 0}const GG=D(()=>{const $=I.codeBlockProps||{},X={},he=M_($.showLineNumbers);he!==void 0&&(X.showLineNumbers=he);const pe=M_($.diffInline);pe!==void 0&&(X.diffInline=pe);const Ne=(function(ze){const tt=Number(ze);return Number.isFinite(tt)&&tt>0?tt:void 0})($.reservedHeightPx);return Ne!==void 0&&(X.reservedHeightPx=Ne),X}),QG=D(()=>Ot(Ot({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,themes:I.themes,langs:I.langs,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof be.value=="boolean"?{showTooltips:be.value}:{}),x_.value)),YG=D(()=>Ot({},I.mermaidProps||{})),I_=D(()=>Ot({},I.d2Props||{})),JG=D(()=>Ot({},I.infographicProps||{})),zm=D(()=>({typewriter:f.value,fade:I.fade,customHtmlTags:lt.value.customHtmlTags})),XG=D(()=>Ot(Ot({},zm.value),typeof be.value=="boolean"?{showTooltip:be.value}:{})),eQ=D(()=>Ot(Ot({},zm.value),typeof be.value=="boolean"?{showTooltips:be.value}:{})),tQ=D(()=>Ot(Ot({},zm.value),typeof be.value=="boolean"?{showTooltips:be.value}:{})),nQ=D(()=>Ot(Ot({},zm.value),typeof be.value=="boolean"?{showTooltips:be.value}:{}));function iQ($){return Array.isArray($.children)&&$.children.length>0}const f2=D(()=>TG.value.map($=>{var X,he,pe,Ne,ze,tt,ot,kt;let rt=(function(Dt){var rn,hn,Cn,kn,An,Kn,ii;if(Dt.type!=="code_block")return Dt;const Wi=Dt,er=[String((rn=Wi.language)!=null?rn:""),String((hn=Wi.loading)!=null?hn:""),String((Cn=Wi.diff)!=null?Cn:""),String((kn=Wi.code)!=null?kn:""),String((An=Wi.originalCode)!=null?An:""),String((Kn=Wi.updatedCode)!=null?Kn:""),String((ii=Wi.raw)!=null?ii:"")].join("\0"),$s=Io.get(Wi);if($s&&$s.signature===er)return $s.node;const Ea=Ot({},Wi);return Io.set(Wi,{signature:er,node:Ea}),Ea})($.node);const ht=h2(rt);let yt=N_(rt,ht);if((rt.type==="html_block"||rt.type==="html_inline")&&yt===A_[rt.type]){const Dt=rt,rn=String((X=Dt.tag)!=null?X:"").trim().toLowerCase()||_j(Dt.content);if(rn){const hn=xi.value[rn];if(xo.value.has(rn)&&hn)yt=hn,rt=On(Ot({},Dt),{type:rn,tag:rn,content:vpe(Dt.content,rn)});else if(Mj((he=Dt.content)!=null?he:Dt.raw,rn)){const Cn=String((Ne=(pe=Dt.content)!=null?pe:Dt.raw)!=null?Ne:"");rt.type==="html_inline"?(yt=Uo,rt={type:"text",content:Cn,raw:Cn}):(yt=wh,rt={type:"paragraph",children:[{type:"text",content:Cn,raw:Cn}],raw:Cn})}}}const nt=rt.type==="code_block"&&m.value==="pre"&&yt===al&&!y3(xi.value,ht);let pt=Ot({},(function(Dt,rn,hn){const Cn=rn??h2(Dt);if(Dt.type==="code_block"){const kn=Cn?y3(xi.value,Cn):void 0;if(hn&&m.value==="pre"&&!kn&&hn===al)return GG.value;if(hn&&Cn&&hn===kn)return Cn==="mermaid"?E_(Dt):Cn==="infographic"?L_(Dt):Cn==="d2"||Cn==="d2lang"?I_.value:__.value;if(hn&&hn===xi.value.code_block)return __.value;if(YS(hn))return QG.value}return Cn==="mermaid"?E_(Dt):Cn==="infographic"?L_(Dt):Cn==="d2"||Cn==="d2lang"?I_.value:Dt.type==="link"?XG.value:Dt.type==="list"?eQ.value:Dt.type==="blockquote"?tQ.value:Dt.type==="table"?nQ.value:Dt.type==="code_block"?S_.value:zm.value})(rt,ht,yt));const St=Pi.value?ip.value[$.index]:null;rt.type==="code_block"&&St?.kind==="code-block"&&(pt=On(Ot({},pt),nt?{reservedHeightPx:(ze=St.height)!=null?ze:St.contentHeight}:{estimatedHeightPx:St.height,estimatedContentHeightPx:St.contentHeight,estimatedDiffInline:St.diffInline})),nt||rt.type!=="code_block"||ht!=="mermaid"||Yp(pt.estimatedPreviewHeightPx)!=null||(pt=On(Ot({},pt),{estimatedPreviewHeightPx:yk(gk(String((tt=rt.code)!=null?tt:"")))})),nt||rt.type!=="code_block"||ht!=="infographic"||Yp(pt.estimatedPreviewHeightPx)!=null||(pt=On(Ot({},pt),{estimatedPreviewHeightPx:kk(vk(String((ot=rt.code)!=null?ot:"")))})),rt.type==="math_block"&&(pt=On(Ot({},pt),{cacheScope:ho}));const wt=(function(Dt,rn){const hn=String(Dt.type);return!$v(hn)&&xi.value[hn]===rn})(rt,yt),Vt=wt?P7(rt,we.value):void 0;return On(Ot({},$),{node:rt,component:yt,bindings:pt,customBindings:Ot(Ot({},Vt??{}),pt),rendersCustomNode:wt,hasSlotChildren:iQ(rt),slotContent:String((kt=rt.content)!=null?kt:""),isCodeBlock:rt.type==="code_block",indexKey:`${KG.value}-${$.index}`,vnodeKey:`${LG.value}\0${$.index}\0${rt.type}`})}));function h2($){var X;return $?.type==="code_block"?String((X=$.language)!=null?X:"").trim().toLowerCase():""}function y3($,X){const he=X.trim().toLowerCase();if(he)for(const pe of[he,Xb(he),OH(he)]){const Ne=pe&&$[pe];if(Ne)return Ne}}function T_($,X,he,pe){var Ne,ze;const tt=Ot({},$.value);return Yp(tt.estimatedPreviewHeightPx)==null&&(tt.estimatedPreviewHeightPx=pe(he(String((Ne=X?.code)!=null?Ne:"")),void 0,tt.maxHeight==="none"?null:(ze=Yp(tt.maxHeight))!=null?ze:void 0)),tt}function E_($){return T_(YG,$,gk,yk)}function L_($){return T_(JG,$,vk,kk)}function N_($,X){if(!$)return UC;const he=xi.value,pe=he[String($.type)];if($.type==="code_block"){const Ne=X??h2($),ze=Ne?y3(he,Ne):void 0;return ze||(m.value==="pre"?he.code_block||al:Ne==="mermaid"?he.mermaid||qG:Ne==="infographic"?he.infographic||UG:Ne==="d2"||Ne==="d2lang"?he.d2||VG:pe||he.code_block||JS.value)}return pe||A_[String($.type)]||UC}function k3($){o("click",$)}function oQ($){var X;(X=$.target)!=null&&X.closest("[data-node-index]")&&o("mouseover",$)}function sQ($){var X;(X=$.target)!=null&&X.closest("[data-node-index]")&&o("mouseout",$)}function D_($){o("mouseover",$)}function F_($){o("mouseout",$)}const _f=U(null),nl=U(!1),jm=U(null),rQ=D(()=>!(I.domMode!=="minimal"||se.value||I.fade!==!1||f.value||nl.value||Ye.value||En.value||Rs.value||bi.value||oo.value||Object.keys(xi.value).length!==0));let Hm,pp=null,b3=0,p2=0,m2=0;const B_=["code_block","admonition","table","math_block","html_block","image","thematic_break"],lQ=new Set(B_),R_=[".typewriter-cursor",".height-estimation-probes",...B_.map($=>`[data-node-type="${$}"]`),"script","style"].join(",");function O_($){if(!$||typeof $!="object")return!1;const X=$.type;return typeof X=="string"&&lQ.has(X)}function g2($){var X,he;if(!$||typeof $!="object")return 0;const pe=$,Ne=(he=(X=pe.raw)!=null?X:pe.content)!=null?he:pe.code;if(typeof Ne=="string")return Ne.length;const ze=pe.children;if(Array.isArray(ze))return ze.reduce((ot,kt)=>ot+g2(kt),0);const tt=pe.items;return Array.isArray(tt)?tt.reduce((ot,kt)=>ot+g2(kt),0):0}function v2(){Hm&&(clearTimeout(Hm),Hm=void 0)}function w3(){b3+=1,pp!=null&&(Ki?.(pp),pp=null)}function Wm(){w3(),$c(),_f.value&&(_f.value.style.visibility="hidden")}function aQ($){var X;if($.nodeType!==Node.TEXT_NODE||!((X=$.textContent)!=null?X:"").trim())return!1;const he=$.parentElement;return!!he&&!he.closest(R_)}function uQ($){let X=$.lastChild;for(;X;){if(aQ(X))return X;if(X.nodeType===Node.ELEMENT_NODE){const he=X;if(!he.matches(R_)&&he.lastChild){X=he.lastChild;continue}}for(;X&&X!==$&&!X.previousSibling;)X=X.parentNode;if(!X||X===$)break;X=X.previousSibling}return null}function $_(){const $=f2.value;for(let X=$.length-1;X>=0;X--){const he=$[X];if(!he||O_(he.node)||!u2(he.index))continue;const pe=mi.get(he.index);if(!pe)continue;const Ne=uQ(pe);if(Ne)return Ne}return null}function $c(){jm.value&&(jm.value.classList.remove(FN),jm.value=null)}function y2(){if(d.value!=="simple"||!Z||!nl.value||!O.value)return void $c();const $=$_(),X=$?(function(he){var pe;const Ne=(pe=he.parentElement)==null?void 0:pe.closest(".text-node");return Ne instanceof HTMLElement?Ne:he.parentElement})($):null;X!==jm.value&&($c(),X&&(X.classList.add(FN),jm.value=X))}function k2(){if(d.value!=="precise"||!Z||!nl.value||pp!=null)return;const $=b3,X=()=>{pp=null,$===b3&&(function(){var he,pe;if(d.value!=="precise"||!(Z&&nl.value&&O.value&&_f.value))return;const Ne=O.value,ze=_f.value;ze.style.visibility="hidden";const tt=$_();if(!tt)return;let ot=0,kt=0,rt=20,ht=!1;if(tt?.textContent){const yt=tt.textContent.length,nt=document.createRange();nt.setStart(tt,Math.max(0,yt-1)),nt.setEnd(tt,yt);const pt=typeof nt.getClientRects=="function"?nt.getClientRects():void 0,St=(pe=pt?.[pt.length-1])!=null?pe:(he=tt.parentElement)==null?void 0:he.getBoundingClientRect();if(St){const wt=jt("typewriterCursor.root.getBoundingClientRect",()=>Ne.getBoundingClientRect());ot=St.right-wt.left+Ne.scrollLeft,kt=St.top-wt.top+Ne.scrollTop,rt=St.height||rt,ht=!0}nt.detach()}ht&&(ze.style.transform=`translate(${Math.max(0,ot)}px, ${Math.max(0,kt)}px)`,ze.style.height=`${rt}px`,ze.style.visibility="visible")})()};eo?pp=eo(X):X()}return qe([Ke,()=>i.content,()=>i.nodes,()=>I.typewriter,at],()=>ao(null,null,function*(){var $,X;if(!Z||se.value||!J.value)return;if(at.value)return nl.value=!1,v2(),void Wm();if(($=i.nodes)!=null&&$.length)return nl.value=!1,v2(),Wm(),p2=((X=i.content)!=null?X:"").length,void(m2=Ke.value.length);const he=(function(){var ot,kt;return(ot=i.nodes)!=null&&ot.length?i.nodes.reduce((rt,ht)=>rt+g2(ht),0):((kt=i.content)!=null?kt:"").length})(),pe=(function(){var ot;return(ot=i.nodes)!=null&&ot.length?i.nodes.reduce((kt,rt)=>kt+g2(rt),0):Ke.value.length})(),Ne=!O_(Qe.value[Qe.value.length-1]),ze=he>p2,tt=pe>m2;if(!f.value||!Ne||!ze&&!tt)return f.value&&Ne||(nl.value=!1,Wm()),p2=he,void(m2=pe);p2=he,m2=pe,nl.value=!0,d.value==="precise"&&_f.value&&(_f.value.style.visibility="hidden"),v2(),yield vt(),d.value==="simple"?y2():($c(),k2()),Hm=setTimeout(()=>{Hm=void 0,nl.value=!1},3e3)}),{flush:"post",immediate:!0}),qe(nl,$=>ao(null,null,function*(){$?(yield vt(),d.value!=="simple"?($c(),d.value==="precise"&&k2()):y2()):Wm()}),{flush:"post"}),qe(d,()=>ao(null,null,function*(){if(Z&&!se.value&&J.value&&nl.value){if(yield vt(),d.value==="simple")return w3(),void y2();$c(),d.value!=="precise"?Wm():k2()}}),{flush:"post"}),qe([()=>Jn.value,()=>zn.start,()=>zn.end],()=>ao(null,null,function*(){Z&&!se.value&&J.value&&nl.value&&(yield vt(),d.value!=="simple"?($c(),d.value==="precise"&&k2()):y2())}),{flush:"post"}),si(()=>{v2(),w3(),$c(),Rn.clear()}),($,X)=>{const he=zY("NodeRenderer",!0);return p(se)?(k(!0),L(Be,{key:0},xt(f2.value,pe=>(k(),L(Be,{key:pe.vnodeKey},[pe.rendersCustomNode?(k(),ce(jo(pe.component),fi({key:0,ref_for:!0},pe.customBindings,{node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onClick:k3,onMouseover:D_,onMouseout:F_,onCopy:X[0]||(X[0]=Ne=>s(Ne)),onHandleArtifactClick:X[1]||(X[1]=Ne=>o("handleArtifactClick",Ne))}),{default:ae(()=>[pe.hasSlotChildren?(k(),ce(he,fi({key:0,ref_for:!0},Ct.value,{nodes:pe.node.children,"index-key":pe.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):pe.slotContent?(k(),ce(he,fi({key:1,ref_for:!0},Ct.value,{content:pe.slotContent,final:!pe.node.loading,"index-key":`${pe.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),ce(jo(pe.component),fi({key:1,node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey},{ref_for:!0},pe.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onClick:k3,onMouseover:D_,onMouseout:F_,onCopy:X[2]||(X[2]=Ne=>s(Ne)),onHandleArtifactClick:X[3]||(X[3]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(k(),L("div",{key:1,ref_key:"containerRef",ref:O,class:$e(["markstream-vue markdown-renderer",[{dark:I.isDark},{virtualized:En.value},{"virtual-scroll-coordinated":ns.value},{"stable-layout":Tt.value},{"typewriter-simple-cursor":nl.value&&d.value==="simple"}]]),"data-custom-id":I.customId,onClick:k3,onMouseover:oQ,onMouseout:sQ},[ci.value||En.value?(k(),L(Be,{key:0},[ci.value?(k(),ce(xke,{key:0,width:di.value,"flow-root":En.value||ns.value,"paragraph-node":po.value,"list-item-node":Bs.value,"list-node":qs.value,"heading-nodes":Nr.value,"set-paragraph-wrapper":yn,"set-list-item-wrapper":Bn,"set-list-wrapper":ni,"set-heading-wrapper":IG},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ee("",!0),En.value?(k(),L("div",{key:1,class:"node-spacer",style:sn({height:`${z4.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],64)):ee("",!0),rQ.value?(k(!0),L(Be,{key:1},xt(f2.value,pe=>(k(),L(Be,{key:pe.vnodeKey},[u2(pe.index)?(k(),ce(jo(pe.component),fi({key:0,node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey},{ref_for:!0},pe.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onMouseover:X[4]||(X[4]=Ne=>o("mouseover",Ne)),onMouseout:X[5]||(X[5]=Ne=>o("mouseout",Ne)),onCopy:X[6]||(X[6]=Ne=>s(Ne)),onHandleArtifactClick:X[7]||(X[7]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ee("",!0)],64))),128)):(k(!0),L(Be,{key:2},xt(f2.value,pe=>(k(),L("div",{key:pe.vnodeKey,ref_for:!0,ref:Ne=>c2(pe.index,Ne),class:"node-slot","data-node-index":pe.index,"data-node-type":pe.node.type},[u2(pe.index)?(k(),L("div",{key:0,ref_for:!0,ref:Ne=>(function(ze,tt){var ot;tt||(function(yt){const nt=`${H4()}-${yt}`;let pt=!1;for(const St of Array.from(us.keys())){const wt=ta.get(St);(wt?.index===yt||St===nt||St.startsWith(`${nt}-`))&&(us.delete(St),ta.delete(St),pt=!0)}pt&&(op(),ro("async-node"))})(ze),Ia.delete(ze),(function(yt){var nt;const pt=((nt=Il.get(yt))!=null?nt:0)+1;Il.set(yt,pt)})(ze);const kt=Ma.get(ze);if(kt){for(const yt of kt)At(yt);Ma.delete(ze)}if((function(yt){const nt=Mo.get(yt);nt&&(Oo?.unobserve(nt),Zo.delete(nt),Mo.delete(yt))})(ze),!tt||!mr.value)return Js.delete(ze),void Il.delete(ze);Js.set(ze,tt);const rt=()=>{d2(ze,tt)};queueMicrotask(rt);const ht=(Oo||typeof ResizeObserver>"u"||(Oo=new ResizeObserver(yt=>{if(yt.length)for(const nt of yt){const pt=Zo.get(nt.target),St=Mo.get(pt??-1);pt!=null&&St&&d2(pt,St)}else Ku()})),Oo);if(ht&&(Mo.set(ze,tt),Zo.set(tt,ze),ht.observe(tt)),typeof window<"u"){const yt=((ot=Qe.value[ze])==null?void 0:ot.type)==="code_block"?[16,80,240,800]:at.value?[80]:[];if(yt.length){const nt=yt.map(pt=>et(pt,rt,"node-resize")).filter(pt=>pt!=null);nt.length&&Ma.set(ze,nt)}}})(pe.index,Ne),class:"node-content"},[pe.isCodeBlock?pe.rendersCustomNode?(k(),ce(jo(pe.component),fi({key:1,ref_for:!0},pe.customBindings,{node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:X[12]||(X[12]=Ne=>s(Ne)),onHandleArtifactClick:X[13]||(X[13]=Ne=>o("handleArtifactClick",Ne))}),{default:ae(()=>[pe.hasSlotChildren?(k(),ce(he,fi({key:0,ref_for:!0},Ct.value,{nodes:pe.node.children,"index-key":pe.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):pe.slotContent?(k(),ce(he,fi({key:1,ref_for:!0},Ct.value,{content:pe.slotContent,final:!pe.node.loading,"index-key":`${pe.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),ce(jo(pe.component),fi({key:2,node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey},{ref_for:!0},pe.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:X[14]||(X[14]=Ne=>s(Ne)),onHandleArtifactClick:X[15]||(X[15]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(k(),ce(mo,{key:0,name:"fade",css:I.fade!==!1,appear:I.fade!==!1},{default:ae(()=>[pe.rendersCustomNode?(k(),ce(jo(pe.component),fi({key:0,ref_for:!0},pe.customBindings,{node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:X[8]||(X[8]=Ne=>s(Ne)),onHandleArtifactClick:X[9]||(X[9]=Ne=>o("handleArtifactClick",Ne))}),{default:ae(()=>[pe.hasSlotChildren?(k(),ce(he,fi({key:0,ref_for:!0},Ct.value,{nodes:pe.node.children,"index-key":pe.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):pe.slotContent?(k(),ce(he,fi({key:1,ref_for:!0},Ct.value,{content:pe.slotContent,final:!pe.node.loading,"index-key":`${pe.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),ce(jo(pe.component),fi({key:1,node:pe.node,loading:pe.node.loading,"index-key":pe.indexKey},{ref_for:!0},pe.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:X[10]||(X[10]=Ne=>s(Ne)),onHandleArtifactClick:X[11]||(X[11]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(k(),L("div",{key:1,class:"node-placeholder",style:sn({height:`${nu(pe.index)}px`})},null,4))],8,Mke))),128)),nl.value&&d.value==="precise"?(k(),L("span",{key:3,ref_key:"typewriterCursorRef",ref:_f,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ee("",!0),En.value?(k(),L("div",{key:4,class:"node-spacer",style:sn({height:`${j4.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],42,_ke))}}})),[["__scopeId","data-v-a9489508"]]),yl=mW;yl.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",yl.__name,yl.name].filter(n=>!!n));for(const n of t)e.component(n,mW)};const X7=Object.freeze(Object.defineProperty({__proto__:null,default:yl},Symbol.toStringTag,{value:"Module"})),Ike={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Tke={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Eke={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Lke={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Nke={class:"admonition-title"},Dke=["aria-expanded","aria-controls"],Fke=["id"],l9=$i(ct({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const i=e,o=t,s=D(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;const u=i.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=U(!!i.node.collapsible&&!((n=i.node.open)==null||n));function l(){i.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(k(),L("div",{class:$e(["admonition",[`admonition-${i.node.kind}`]])},[S("div",{id:a,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(k(),L("svg",Ike,[...c[1]||(c[1]=[S("circle",{cx:"12",cy:"12",r:"10"},null,-1),S("path",{d:"M12 16v-4"},null,-1),S("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(k(),L("svg",Tke,[...c[2]||(c[2]=[S("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),S("path",{d:"M9 18h6"},null,-1),S("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(k(),L("svg",Eke,[...c[3]||(c[3]=[S("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"},null,-1),S("path",{d:"M12 9v4"},null,-1),S("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(k(),L("svg",Lke,[...c[4]||(c[4]=[S("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),S("path",{d:"M12 8v4"},null,-1),S("path",{d:"M12 16h.01"},null,-1)])])):ee("",!0),S("span",Nke,B(s.value),1),i.node.collapsible?(k(),L("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(k(),L("svg",{style:sn({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...c[5]||(c[5]=[S("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Dke)):ee("",!0)]),hi(S("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[V(p(yl),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:c[0]||(c[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,Fke),[[Jo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);l9.install=e=>{e.component(l9.__name,l9)};const QC=()=>es(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let iy=null,oy=QC,sy=null,BN=!1,RN=!1;function lkt(){return ao(this,null,function*(){if(iy)return iy;const e=oy;return e?e===QC&&BN?null:sy||(sy=ao(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===QC)return e===oy&&(BN=!0,(function(i){RN||(RN=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',i))})(n)),null;throw n}finally{e===oy&&(sy=null)}return e!==oy?null:t?(iy=(function(n){var i;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(i=n.default)!=null?i:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),iy):null}),sy):null})}let ry=null,gW=null,ly=null;function akt(){return typeof gW=="function"}function ukt(){return ao(this,null,function*(){if(ry)return ry;const e=gW;return e?ly||(ly=ao(null,null,function*(){const t=yield e(),n=(function(i){var o,s,r;if(!i)return null;const l=(o=i.default)!=null?o:i,a=typeof l=="function"&&typeof((s=l.prototype)==null?void 0:s.render)=="function"?l:(r=i.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(ry=n,ry):null}).finally(()=>{ly=null}),ly):null})}const ckt=Symbol("markstreamLanguageIconResolver");function Bke(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Rke(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}let ON=!1;function vW(){ON||typeof Worker>"u"||(ON=!0,h2e(new Bke),_2e(new Rke))}vW();function pd(e,t,n="/api/v1"){return`${e}${n}${t.startsWith("/")?t:`/${t}`}`}function $N(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}const ex={},Ik=Symbol("resolveImage");class xu extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class la extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class tx extends Error{size;limit;constructor(t){super(`file too large to preview: ${t.size} bytes (limit ${t.limit})`),this.name="FileTooLargeError",this.size=t.size,this.limit=t.limit}}function Fi(e){return e instanceof xu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function o4(e){return e instanceof la||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}function Oke(e){return o4(e)&&typeof e.cause=="object"&&e.cause!==null&&e.cause.name==="TimeoutError"}function $ke(e){return e instanceof tx||typeof e=="object"&&e!==null&&e.name==="FileTooLargeError"&&typeof e.limit=="number"}const Pke=41301,zke=40922;function PN(e){return Fi(e)&&e.code===zke}const tc=3e4,ay=5*6e4,zN=5*6e4,yW="0123456789ABCDEFGHJKMNPQRSTVWXYZ",YC=500,kW=40101;function jN(e,t){for(const[n,i]of Object.entries(t))if(i!==void 0)if(Array.isArray(i))for(const o of i)o!==void 0&&e.append(n,String(o));else e.set(n,String(i))}function uy(e=tc){try{return AbortSignal.timeout(e)}catch{return}}function jke(e,t){let n="",i=e;for(let o=0;oyW[n%32]).join("")}function sg(){return`${jke(Date.now(),10)}${Hke(16)}`}function HN(e){try{const t=[];return e.forEach((n,i)=>{typeof n=="string"?t.push({field:i,value:n}):t.push({field:i,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function V8(e){try{const t=await e.text();return t?t.length>YC?`${t.slice(0,YC)}...`:t:void 0}catch{return}}class WN{constructor(t){this.opts=t,this.tracer=t.tracer??ex}tracer;async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t,n,i){let o=pd(this.opts.origin,t,this.opts.restBasePath);if(n){const c=new URLSearchParams;jN(c,n);const d=c.toString();d&&(o=`${o}?${d}`)}const s=sg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"GET",path:t,url:o,requestId:s});let a;try{a=await fetch(o,{method:"GET",headers:r,signal:uy()})}catch(c){throw this.tracer.restFailure?.({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c}),new la({message:`Network error calling GET ${t}`,cause:c,method:"GET",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:tc,timestamp:Date.now(),durationMs:Date.now()-l})}if(a.ok){this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:0,msg:""});const c=Number(a.headers.get("content-length")??0);if(i?.maxBytes!==void 0&&c>i.maxBytes)throw a.body?.cancel(),new tx({size:c,limit:i.maxBytes});return a.blob()}let u;try{u=await a.clone().json()}catch{}throw this.checkAuthRequired(a,u?.code??0),this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u?.code??a.status,msg:u?.msg??a.statusText,envelopeRequestId:u?.request_id}),new xu({code:u?.code??a.status,msg:u?.msg??a.statusText,requestId:u?.request_id??s,details:u?.details,timestamp:Date.now(),durationMs:Date.now()-l})}async post(t,n,i){return this.request("POST",t,n,void 0,i?.allowCodes,i?.timeoutMs)}async postZip(t,n,i){const o="POST",s=pd(this.opts.origin,t,this.opts.restBasePath),r=sg(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();this.tracer.restRequest?.({method:o,path:t,url:s,requestId:r,body:i});let u;try{u=await fetch(s,{method:o,headers:l,body:JSON.stringify(n),signal:uy(ay)})}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new la({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"fetch",timeoutMs:ay,timestamp:Date.now(),durationMs:Date.now()-a})}const c=u.headers.get("content-type")??void 0,d=c?.split(";",1)[0]?.trim().toLowerCase();if(!u.ok||d!=="application/zip"){let h;try{h=await u.clone().json()}catch{}if(this.checkAuthRequired(u,h?.code??0),!u.ok||h!==void 0&&h.code!==0){const v=h?.code??u.status,y=h?.msg??u.statusText;throw this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:v,msg:y,envelopeRequestId:h?.request_id}),new xu({code:v,msg:y,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const m=u.clone(),g=new TypeError(`Expected application/zip, received ${c??"no content type"}`);throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:g}),new la({message:`Invalid ZIP response from ${o} ${t}`,cause:g,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:ay,status:u.status,statusText:u.statusText,contentType:c,bodyPreview:await V8(m),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await u.blob()}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:h}),new la({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:ay,status:u.status,statusText:u.statusText,contentType:c,timestamp:Date.now(),durationMs:Date.now()-a})}return this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:u.headers.get("content-disposition")??void 0}}async postForm(t,n,i){if(i?.onUploadProgress!==void 0)return this.postFormXhr(t,n,i.onUploadProgress);const o=pd(this.opts.origin,t,this.opts.restBasePath),s=sg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:HN(n)});let a;try{a=await fetch(o,{method:"POST",headers:r,body:n,signal:uy()})}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:d}),new la({message:`Network error calling POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:tc,timestamp:Date.now(),durationMs:Date.now()-l})}let u;const c=a.clone();try{u=await a.json()}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:a.status,error:d}),new la({message:`Failed to parse JSON response from POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:tc,status:a.status,statusText:a.statusText,contentType:a.headers.get("content-type")??void 0,bodyPreview:await V8(c),timestamp:Date.now(),durationMs:Date.now()-l})}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u.code,msg:u.msg,envelopeRequestId:u.request_id,data:u.data}),this.checkAuthRequired(a,u.code),u.code!==0){const d=u.code??a.status;throw new xu({code:d,msg:u.msg??a.statusText,requestId:u.request_id??s,details:u.details,timestamp:Date.now(),durationMs:Date.now()-l})}return u.data}postFormXhr(t,n,i){const o=pd(this.opts.origin,t,this.opts.restBasePath),s=sg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();return this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:HN(n)}),new Promise((a,u)=>{const c=new XMLHttpRequest;c.open("POST",o),c.timeout=tc;for(const[d,f]of Object.entries(r))c.setRequestHeader(d,f);c.upload.onprogress=d=>{d.lengthComputable&&i(d.loaded,d.total)},c.onerror=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c.statusText||"network error"}),u(new la({message:`Network error calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:tc,timestamp:Date.now(),durationMs:Date.now()-l}))},c.ontimeout=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:"timeout"}),u(new la({message:`Timeout calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:tc,timestamp:Date.now(),durationMs:Date.now()-l}))},c.onload=()=>{let d;try{d=JSON.parse(c.responseText)}catch(f){this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:c.status,error:f}),u(new la({message:`Failed to parse JSON response from POST ${t}`,cause:f,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:tc,status:c.status,statusText:c.statusText,bodyPreview:c.responseText.slice(0,YC),timestamp:Date.now(),durationMs:Date.now()-l}));return}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:c.status,durationMs:Date.now()-l,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthStatus(c.status,d.code),d.code!==0){const f=d.code??c.status;u(new xu({code:f,msg:d.msg??c.statusText,requestId:d.request_id??s,details:d.details,timestamp:Date.now(),durationMs:Date.now()-l}));return}a(d.data)},c.send(n)})}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,i,o,s=[],r=tc){let l=pd(this.opts.origin,n,this.opts.restBasePath);if(o){const m=new URLSearchParams;jN(m,o);const g=m.toString();g&&(l=`${l}?${g}`)}const a=sg(),u={"X-Request-Id":a};this.addClientHeaders(u),i!==void 0&&(u["Content-Type"]="application/json; charset=utf-8");const c=Date.now();this.tracer.restRequest?.({method:t,path:n,url:l,requestId:a,body:i});let d;try{d=await fetch(l,{method:t,headers:u,body:i!==void 0?JSON.stringify(i):void 0,signal:uy(r)})}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"fetch",durationMs:Date.now()-c,error:m}),new la({message:`Network error calling ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"fetch",timeoutMs:r,timestamp:Date.now(),durationMs:Date.now()-c})}let f;const h=d.clone();try{const m=await d.text();f=d.status===204&&m===""?{code:0,msg:"",data:null,request_id:a}:JSON.parse(m)}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"parse",durationMs:Date.now()-c,status:d.status,error:m}),new la({message:`Failed to parse JSON response from ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"parse",timeoutMs:r,status:d.status,statusText:d.statusText,contentType:d.headers.get("content-type")??void 0,bodyPreview:await V8(h),timestamp:Date.now(),durationMs:Date.now()-c})}if(this.tracer.restResponse?.({method:t,path:n,requestId:a,status:d.status,durationMs:Date.now()-c,code:f.code,msg:f.msg,envelopeRequestId:f.request_id,data:f.data}),this.checkAuthRequired(d,f.code),f.code!==0&&!s.includes(f.code))throw new xu({code:typeof f.code=="number"?f.code:d.status,msg:typeof f.msg=="string"&&f.msg.length>0?f.msg:`HTTP ${d.status}${d.statusText?` ${d.statusText}`:""}`,requestId:f.request_id??a,details:f.details,timestamp:Date.now(),durationMs:Date.now()-c});return f.data}addClientHeaders(t){const n=this.opts.credentialStore?.getToken();n!==void 0&&(t.Authorization=`Bearer ${n}`);const i=this.opts.identity;i!==void 0&&(t["X-Kimi-Client-Id"]=i.clientId,t["X-Kimi-Client-Name"]=i.clientName,t["X-Kimi-Client-Version"]=i.clientVersion,t["X-Kimi-Client-Ui-Mode"]=i.clientUiMode)}checkAuthRequired(t,n){this.checkAuthStatus(t.status,n)}checkAuthStatus(t,n){(t===401||n===kW)&&this.opts.credentialStore?.markAuthRequired?.()}}function bW(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function qN(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function gu(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,archivedAt:e.archived_at,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:bW(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function cy(e){const t=e.activity.status;return{id:e.id,title:e.meta.title??e.meta.last_prompt??e.id.slice(0,12),createdAt:new Date(e.meta.created_at).toISOString(),updatedAt:new Date(e.meta.updated_at).toISOString(),busy:t==="running",pendingInteraction:t==="approval"?"approval":t==="question"?"question":void 0,lastTurnReason:t==="failed"?"failed":void 0,archived:e.meta.archived,archivedAt:e.meta.archived_at==null?void 0:new Date(e.meta.archived_at).toISOString(),lastPrompt:e.meta.last_prompt??void 0,cwd:e.workspace.cwd??"",model:"",pullRequest:e.git===void 0?void 0:e.git.pull_request,usage:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalCostUsd:0,contextTokens:0,contextLimit:0,turnCount:0},messageCount:0,lastSeq:0,workspaceId:e.workspace.id.length>0?e.workspace.id:void 0}}function p0(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function UN(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:e.kind==="session_media"?{kind:"sessionMedia",fileId:e.file_id}:{kind:"url",url:e.url}}function nx(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:UN(e.source)};case"video":return{type:"video",source:UN(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function wW(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(nx),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function CW(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:t.kind==="sessionMedia"?n={kind:"session_media",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function Wke(e){return{content:e.content.map(CW),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function qke(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function Uke(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function Vke(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Kke(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Vke),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function Zke(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Kke),createdAt:e.created_at}}function Gke(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function Qke(e){const t={};for(const[n,i]of Object.entries(e.answers))t[n]=Gke(i);return{answers:t,method:e.method,note:e.note}}function JC(e,t){if(typeof e.run_in_background!="boolean")throw new Error(`task wire missing required run_in_background (id ${e.id})`);return{id:e.id,agentId:e.agent_id??t,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,model:e.model,thinkingEffort:e.thinking_effort,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function VN(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function Gc(e,t){const n=e[t];return typeof n=="string"?n:void 0}function _p(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ia(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function AW(e){if(!e||typeof e!="object")return null;const t=e,n=Gc(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const i=t.budget,o=i&&typeof i=="object"?i:{};return{goalId:Gc(t,"goalId")??Gc(t,"goal_id")??"goal",objective:Gc(t,"objective")??"",completionCriterion:Gc(t,"completionCriterion")??Gc(t,"completion_criterion"),status:n,turnsUsed:_p(t,"turnsUsed")??_p(t,"turns_used")??0,tokensUsed:_p(t,"tokensUsed")??_p(t,"tokens_used")??0,wallClockMs:_p(t,"wallClockMs")??_p(t,"wall_clock_ms")??0,terminalReason:Gc(t,"terminalReason")??Gc(t,"terminal_reason"),budget:{tokenBudget:ia(o,"tokenBudget")??ia(o,"token_budget"),remainingTokens:ia(o,"remainingTokens")??ia(o,"remaining_tokens"),turnBudget:ia(o,"turnBudget")??ia(o,"turn_budget"),remainingTurns:ia(o,"remainingTurns")??ia(o,"remaining_turns"),wallClockBudgetMs:ia(o,"wallClockBudgetMs")??ia(o,"wall_clock_budget_ms"),remainingWallClockMs:ia(o,"remainingWallClockMs")??ia(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Yke(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:gu(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:gu(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":{const n=t.payload?.sessionId??t.payload?.session_id;if(typeof n!="string"||n.length===0)return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};const i=t.payload?.workspace_id;return{type:"sessionArchived",sessionId:n,workspaceId:typeof i=="string"&&i.length>0?i:void 0}}case"event.workspace.created":return{type:"workspaceCreated",workspace:p0(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:p0(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:bW(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=AW(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:wW(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(nx),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:Uke(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at,feedback:t.payload.feedback,selectedLabel:t.payload.selected_label};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:Zke(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:JC(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.plugin.changed":return{type:"pluginsChanged"};case"event.capability.changed":return{type:"capabilityChanged",capabilityId:t.payload.capability_id,install:t.payload.install};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:XC(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function Jke(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function Mp(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function KN(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function XC(e){const t={};for(const[n,i]of Object.entries(e.providers))t[n]={type:i.type,baseUrl:i.base_url,defaultModel:i.default_model,hasApiKey:i.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function Xke(e){return e.session_id}function ebe(e){return e.seq}function tbe(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function ZN(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const nbe={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function ibe(e,t){switch(t.op){case"reset":return obe(e,t);case"turn.upsert":return rbe(e,t.turn);case"step.upsert":return abe(e,t.turnId,t.step);case"frame.upsert":return cbe(e,t);case"append":return fbe(e,t);case"marker.upsert":return QN(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return QN(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return mbe(e,t.task);case"interaction.upsert":return gbe(e,t.interaction);case"attachment.upsert":return ybe(e,t.attachment);case"todo.upsert":return bbe(e,t.todo);case"prompt.upsert":return Cbe(e,t.prompt);case"meta.merge":return Sbe(e,t.meta);case"items.remove":return pbe(e,t.ids)}}function obe(e,t){const n=new Set;for(const i of t.snapshot.interactions)i.state==="pending"&&n.add(i.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(i=>[i.taskId,i])),interactions:new Map(t.snapshot.interactions.map(i=>[i.interactionId,i])),attachments:new Map(t.snapshot.attachments.map(i=>[i.attachmentId,i])),todos:new Map(t.snapshot.todos.map(i=>[i.todoId,i])),prompts:new Map(t.snapshot.prompts.map(i=>[i.promptId,i])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function GN(e,t){return{...e,kind:"turn",steps:[...t]}}function xW(e){return{kind:"turn",turnId:e,ordinal:tbe(e),state:"running",origin:{kind:"other"},steps:[]}}function sbe(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function z1(e,t){const n=e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}function ix(e,t){const n=[...e];let i=n.length;for(let o=0;ot.ordinal){i=o;break}}return n.splice(i,0,t),n}function s4(e,t,n){return e.map(i=>i.kind==="turn"&&i.turnId===t?n(i):i)}function rbe(e,t){const n=z1(e,t.turnId);return n?lbe(n,t)?{state:e,changed:!1}:{state:{...e,items:s4(e.items,t.turnId,i=>GN(t,i.steps))},changed:!0}:{state:{...e,items:ix(e.items,GN(t,[]))},changed:!0}}function lbe(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function abe(e,t,n){const i=z1(e,t)??xW(t),o=i.steps.findIndex(u=>u.stepId===n.stepId);let s,r=!0;if(o>=0){const u=i.steps[o];u&&ube(u,n)?(r=!1,s=i.steps):s=i.steps.map(c=>c.stepId===n.stepId?{...n,kind:"step",frames:c.frames}:c)}else s=[...i.steps,{...n,kind:"step",frames:[]}].toSorted((u,c)=>u.ordinal-c.ordinal);if(!r)return{state:e,changed:!1};const l={...i,steps:[...s]},a=z1(e,t)?s4(e.items,t,()=>l):ix(e.items,l);return{state:{...e,items:a},changed:!0}}function ube(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function cbe(e,t){const n=z1(e,t.turnId)??xW(t.turnId),i=n.steps.find(c=>c.stepId===t.stepId)??sbe(t.stepId,t.turnId),o=i.frames.findIndex(c=>c.frameId===t.frame.frameId);let s;if(o>=0){const c=i.frames[o];if(c!==void 0&&dbe(c,t.frame))return{state:e,changed:!1};s=i.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else s=[...i.frames,t.frame];const r={...i,frames:[...s]},l=n.steps.some(c=>c.stepId===t.stepId)?n.steps.map(c=>c.stepId===t.stepId?r:c):[...n.steps,r].toSorted((c,d)=>c.ordinal-d.ordinal),a={...n,steps:l},u=z1(e,t.turnId)?s4(e.items,t.turnId,()=>a):ix(e.items,a);return{state:{...e,items:u},changed:!0}}function dbe(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail:!1}function fbe(e,t){if(t.target.type==="task")return hbe(e,t);const{turnId:n,stepId:i,frameId:o}=t.target,s=z1(e,n),r=s?.steps.find(f=>f.stepId===i),l=r?.frames.find(f=>f.frameId===o);if(!s||!r||!l||l.kind!=="text"&&l.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const a=SW(l.text,t.offset,t.text);if(a.gap)return{state:e,changed:!1,gap:a.gap};if(!a.changed)return{state:e,changed:!1};const u={...l,text:a.text},c={...r,frames:r.frames.map(f=>f.frameId===o?u:f)},d={...s,steps:s.steps.map(f=>f.stepId===i?c:f)};return{state:{...e,items:s4(e.items,n,()=>d)},changed:!0}}function hbe(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,i=e.tasks.get(n),o=i?.outputTail??"",s=SW(o,t.offset,t.text);if(s.gap)return{state:e,changed:!1,gap:s.gap};if(!s.changed)return{state:e,changed:!1};const r=i?{...i,outputTail:s.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:s.text},l=new Map(e.tasks);return l.set(n,r),{state:{...e,tasks:l},changed:!0}}function SW(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const i=e.length-t;return e.slice(t)!==n.slice(0,i)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(i>0?n.slice(i):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function QN(e,t,n,i){if(e.items.some(s=>eA(s)===n)){let s=!1;const r=e.items.map(l=>eA(l)!==n||l===t?l:(s=!0,t));return s?{state:{...e,items:r},changed:!0}:{state:e,changed:!1}}if(i!==void 0){const s=[...e.items];let r=s.length;for(let l=0;l=i){r=l;break}}return s.splice(r,0,t),{state:{...e,items:s},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function eA(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function pbe(e,t){const n=new Set(t),i=e.items.filter(l=>l.kind==="turn"&&n.has(l.turnId)),o=e.items.filter(l=>!n.has(eA(l)));if(o.length===e.items.length)return{state:e,changed:!1};let s=e.pendingInteractions,r=e.interactions;if(i.length>0){const l=new Set,a=new Set(s),u=new Set;for(const c of i)for(const d of c.steps)for(const f of d.frames)f.kind==="tool"&&l.add(f.toolCallId);for(const c of r.values())c.toolCallId!==void 0&&l.has(c.toolCallId)&&(u.add(c.interactionId),a.delete(c.interactionId));if(u.size>0){const c=new Map(r);for(const d of u)c.delete(d);r=c}s=a}return{state:{...e,items:o,interactions:r,pendingInteractions:s},changed:!0}}function mbe(e,t){const n=e.tasks.get(t.taskId);if(n&&xbe(n,t))return{state:e,changed:!1};const i=new Map(e.tasks);return i.set(t.taskId,t),{state:{...e,tasks:i},changed:!0}}function gbe(e,t){const n=e.interactions.get(t.interactionId);if(n&&vbe(n,t))return{state:e,changed:!1};const i=new Map(e.interactions);i.set(t.interactionId,t);let o=e.pendingInteractions;if(t.state==="pending"){if(!o.has(t.interactionId)){const s=new Set(o);s.add(t.interactionId),o=s}}else if(o.has(t.interactionId)){const s=new Set(o);s.delete(t.interactionId),o=s}return{state:{...e,interactions:i,pendingInteractions:o},changed:!0}}function vbe(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function ybe(e,t){const n=e.attachments.get(t.attachmentId);if(n&&kbe(n,t))return{state:e,changed:!1};const i=new Map(e.attachments);return i.set(t.attachmentId,t),{state:{...e,attachments:i},changed:!0}}function kbe(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function bbe(e,t){const n=e.todos.get(t.todoId);if(n&&wbe(n,t))return{state:e,changed:!1};const i=new Map(e.todos);return i.set(t.todoId,t),{state:{...e,todos:i},changed:!0}}function wbe(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function Cbe(e,t){const n=e.prompts.get(t.promptId);if(n&&Abe(n,t))return{state:e,changed:!1};const i=new Map(e.prompts);return i.set(t.promptId,t),{state:{...e,prompts:i},changed:!0}}function Abe(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function xbe(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function Sbe(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,swarm:t.modes.swarm===null?void 0:t.modes.swarm??e.meta.modes?.swarm,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,i=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,o={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.swarm===void 0&&n.tower===void 0?void 0:n,agent:i};return o.goal===e.meta.goal&&o.activity===e.meta.activity&&o.modes===e.meta.modes&&o.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:o},changed:!0}}class _be{constructor(t){this.agentId=t}#e=nbe;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let i,o=this.#e;for(const s of t){const r=ibe(o,s);if(r.gap){i={target:s.target,...r.gap};continue}r.changed&&(o=r.state,n.push(s))}if(this.#e=o,n.length>0){const s={agentId:this.agentId,ops:n};for(const r of this.#t)r(s)}return{accepted:n,gap:i}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,i=this.#e.hasMoreOlder;if(t!==void 0){const o=n.reduce((s,r)=>r.kind==="turn"?s+1:s,0);if(o>t.tailTurns){const s=o-t.tailTurns,r=[];let l=0;for(const a of n)if(a.kind==="turn"){if(l+=1,l<=s)continue;r.push(a)}else l>s&&r.push(a);n=r,i=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:i}}}function Lt(e,t,n){function i(l,a){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,a);const u=r.prototype,c=Object.keys(u);for(let d=0;dn?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class C1 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _W extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const MW={};function Vd(e){return MW}function IW(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function tA(e,t){return typeof t=="bigint"?t.toString():t}function r4(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ox(e){return e==null}function sx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Mbe(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const a=i.match(/\d?e-(\d?)/);a?.[1]&&(o=Number.parseInt(a[1]))}const s=n>o?n:o,r=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return r%l/10**s}const YN=Symbol("evaluating");function Hi(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==YN)return i===void 0&&(i=YN,i=n()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Jh(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function af(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function JN(e){return JSON.stringify(e)}function Ibe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const TW="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function J0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Tbe=r4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function j1(e){if(J0(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(J0(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function EW(e){return j1(e)?{...e}:Array.isArray(e)?[...e]:e}const Ebe=new Set(["string","number","symbol"]);function H1(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uf(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function Tn(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Lbe(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Nbe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Dbe(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=af(e._zod.def,{get shape(){const r={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(r[l]=n.shape[l])}return Jh(this,"shape",r),r},checks:[]});return uf(e,s)}function Fbe(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=af(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete r[l]}return Jh(this,"shape",r),r},checks:[]});return uf(e,s)}function Bbe(e,t){if(!j1(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(s,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=af(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Jh(this,"shape",s),s}});return uf(e,o)}function Rbe(e,t){if(!j1(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=af(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Jh(this,"shape",i),i}});return uf(e,n)}function Obe(e,t){const n=af(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Jh(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return uf(e,n)}function $be(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=af(t._zod.def,{get shape(){const l=t._zod.def.shape,a={...l};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)a[u]=e?new e({type:"optional",innerType:l[u]}):l[u];return Jh(this,"shape",a),a},checks:[]});return uf(t,r)}function Pbe(e,t,n){const i=af(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const r in n){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=new e({type:"nonoptional",innerType:o[r]}))}else for(const r in o)s[r]=new e({type:"nonoptional",innerType:o[r]});return Jh(this,"shape",s),s}});return uf(t,i)}function Xp(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function dy(e){return typeof e=="string"?e:e?.message}function Kd(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=dy(e.inst?._zod.def?.error?.(e))??dy(t?.error?.(e))??dy(n.customError?.(e))??dy(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function rx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function X0(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const LW=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,tA,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},NW=Lt("$ZodError",LW),DW=Lt("$ZodError",LW,{Parent:Error});function zbe(e,t=n=>n.message){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}function jbe(e,t=n=>n.message){const n={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>i({issues:r}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let r=n,l=0;for(;l(t,n,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new C1;if(r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>Kd(a,s,Vd())));throw TW(l,o?.callee),l}return r.value},ax=e=>async(t,n,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>Kd(a,s,Vd())));throw TW(l,o?.callee),l}return r.value},l4=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new C1;return s.issues.length?{success:!1,error:new(e??NW)(s.issues.map(r=>Kd(r,o,Vd())))}:{success:!0,data:s.value}},Hbe=l4(DW),a4=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>Kd(r,o,Vd())))}:{success:!0,data:s.value}},Wbe=a4(DW),qbe=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return lx(e)(t,n,o)},Ube=e=>(t,n,i)=>lx(e)(t,n,i),Vbe=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ax(e)(t,n,o)},Kbe=e=>async(t,n,i)=>ax(e)(t,n,i),Zbe=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return l4(e)(t,n,o)},Gbe=e=>(t,n,i)=>l4(e)(t,n,i),Qbe=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return a4(e)(t,n,o)},Ybe=e=>async(t,n,i)=>a4(e)(t,n,i),Jbe=/^[cC][^\s-]{8,}$/,Xbe=/^[0-9a-z]+$/,e4e=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,t4e=/^[0-9a-vA-V]{20}$/,n4e=/^[A-Za-z0-9]{27}$/,i4e=/^[a-zA-Z0-9_-]{21}$/,o4e=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,s4e=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,XN=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,r4e=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,l4e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function a4e(){return new RegExp(l4e,"u")}const u4e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,c4e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,d4e=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,f4e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,h4e=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,FW=/^[A-Za-z0-9_-]*$/,p4e=/^\+[1-9]\d{6,14}$/,BW="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",m4e=new RegExp(`^${BW}$`);function RW(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function g4e(e){return new RegExp(`^${RW(e)}$`)}function v4e(e){const t=RW({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${BW}T(?:${i})$`)}const y4e=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},k4e=/^-?\d+$/,OW=/^-?\d+(?:\.\d+)?$/,b4e=/^(?:true|false)$/i,w4e=/^[^A-Z]*$/,C4e=/^[^a-z]*$/,xl=Lt("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),$W={number:"number",bigint:"bigint",object:"date"},PW=Lt("$ZodCheckLessThan",(e,t)=>{xl.init(e,t);const n=$W[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?i.value<=t.value:i.value{xl.init(e,t);const n=$W[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),A4e=Lt("$ZodCheckMultipleOf",(e,t)=>{xl.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Mbe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),x4e=Lt("$ZodCheckNumberFormat",(e,t)=>{xl.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,s]=Nbe[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,n&&(l.pattern=k4e)}),e._zod.check=r=>{const l=r.value;if(n){if(!Number.isInteger(l)){r.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?r.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):r.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}ls&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),S4e=Lt("$ZodCheckMaxLength",(e,t)=>{var n;xl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!ox(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const r=rx(o);i.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),_4e=Lt("$ZodCheckMinLength",(e,t)=>{var n;xl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!ox(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const r=rx(o);i.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),M4e=Lt("$ZodCheckLengthEquals",(e,t)=>{var n;xl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!ox(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===t.length)return;const r=rx(o),l=s>t.length;i.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),u4=Lt("$ZodCheckStringFormat",(e,t)=>{var n,i;xl.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),I4e=Lt("$ZodCheckRegex",(e,t)=>{u4.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),T4e=Lt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=w4e),u4.init(e,t)}),E4e=Lt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=C4e),u4.init(e,t)}),L4e=Lt("$ZodCheckIncludes",(e,t)=>{xl.init(e,t);const n=H1(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),N4e=Lt("$ZodCheckStartsWith",(e,t)=>{xl.init(e,t);const n=new RegExp(`^${H1(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),D4e=Lt("$ZodCheckEndsWith",(e,t)=>{xl.init(e,t);const n=new RegExp(`.*${H1(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),F4e=Lt("$ZodCheckOverwrite",(e,t)=>{xl.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class B4e{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(` +`).filter(r=>r),o=Math.min(...i.map(r=>r.length-r.trimStart().length)),s=i.map(r=>r.slice(o)).map(r=>" ".repeat(this.indent*2)+r);for(const r of s)this.content.push(r)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(` +`))}}const R4e={major:4,minor:3,patch:6},No=Lt("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=R4e;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(r,l,a)=>{let u=Xp(r),c;for(const d of l){if(d._zod.def.when){if(!d._zod.def.when(r))continue}else if(u)continue;const f=r.issues.length,h=d._zod.check(r);if(h instanceof Promise&&a?.async===!1)throw new C1;if(c||h instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await h,r.issues.length!==f&&(u||(u=Xp(r,f)))});else{if(r.issues.length===f)continue;u||(u=Xp(r,f))}}return c?c.then(()=>r):r},s=(r,l,a)=>{if(Xp(r))return r.aborted=!0,r;const u=o(l,i,a);if(u instanceof Promise){if(a.async===!1)throw new C1;return u.then(c=>e._zod.parse(c,a))}return e._zod.parse(u,a)};e._zod.run=(r,l)=>{if(l.skipChecks)return e._zod.parse(r,l);if(l.direction==="backward"){const u=e._zod.parse({value:r.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(c=>s(c,r,l)):s(u,r,l)}const a=e._zod.parse(r,l);if(a instanceof Promise){if(l.async===!1)throw new C1;return a.then(u=>o(u,i,l))}return o(a,i,l)}}Hi(e,"~standard",()=>({validate:o=>{try{const s=Hbe(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Wbe(e,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),ux=Lt("$ZodString",(e,t)=>{No.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??y4e(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ao=Lt("$ZodStringFormat",(e,t)=>{u4.init(e,t),ux.init(e,t)}),O4e=Lt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=s4e),Ao.init(e,t)}),$4e=Lt("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=XN(i))}else t.pattern??(t.pattern=XN());Ao.init(e,t)}),P4e=Lt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=r4e),Ao.init(e,t)}),z4e=Lt("$ZodURL",(e,t)=>{Ao.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),j4e=Lt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=a4e()),Ao.init(e,t)}),H4e=Lt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=i4e),Ao.init(e,t)}),W4e=Lt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Jbe),Ao.init(e,t)}),q4e=Lt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Xbe),Ao.init(e,t)}),U4e=Lt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=e4e),Ao.init(e,t)}),V4e=Lt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=t4e),Ao.init(e,t)}),K4e=Lt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=n4e),Ao.init(e,t)}),Z4e=Lt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=v4e(t)),Ao.init(e,t)}),G4e=Lt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=m4e),Ao.init(e,t)}),Q4e=Lt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=g4e(t)),Ao.init(e,t)}),Y4e=Lt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=o4e),Ao.init(e,t)}),J4e=Lt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=u4e),Ao.init(e,t),e._zod.bag.format="ipv4"}),X4e=Lt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=c4e),Ao.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),e3e=Lt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=d4e),Ao.init(e,t)}),t3e=Lt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=f4e),Ao.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const r=Number(s);if(`${r}`!==s)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function jW(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const n3e=Lt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=h4e),Ao.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{jW(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function i3e(e){if(!FW.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return jW(n)}const o3e=Lt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=FW),Ao.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{i3e(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),s3e=Lt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=p4e),Ao.init(e,t)});function r3e(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const l3e=Lt("$ZodJWT",(e,t)=>{Ao.init(e,t),e._zod.check=n=>{r3e(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),HW=Lt("$ZodNumber",(e,t)=>{No.init(e,t),e._zod.pattern=e._zod.bag.pattern??OW,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),a3e=Lt("$ZodNumberFormat",(e,t)=>{x4e.init(e,t),HW.init(e,t)}),u3e=Lt("$ZodBoolean",(e,t)=>{No.init(e,t),e._zod.pattern=b4e,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),c3e=Lt("$ZodUnknown",(e,t)=>{No.init(e,t),e._zod.parse=n=>n}),d3e=Lt("$ZodNever",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function eD(e,t,n){e.issues.length&&t.issues.push(...e1(n,e.issues)),t.value[n]=e.value}const f3e=Lt("$ZodArray",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let r=0;reD(u,n,r))):eD(a,n,r)}return s.length?Promise.all(s).then(()=>n):n}});function Tk(e,t,n,i,o){if(e.issues.length){if(o&&!(n in i))return;t.issues.push(...e1(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function WW(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=Lbe(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function qW(e,t,n,i,o,s){const r=[],l=o.keySet,a=o.catchall._zod,u=a.def.type,c=a.optout==="optional";for(const d in t){if(l.has(d))continue;if(u==="never"){r.push(d);continue}const f=a.run({value:t[d],issues:[]},i);f instanceof Promise?e.push(f.then(h=>Tk(h,n,d,t,c))):Tk(f,n,d,t,c)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const h3e=Lt("$ZodObject",(e,t)=>{if(No.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...l};return Object.defineProperty(t,"shape",{value:a}),a}})}const i=r4(()=>WW(t));Hi(e._zod,"propValues",()=>{const l=t.shape,a={};for(const u in l){const c=l[u]._zod;if(c.values){a[u]??(a[u]=new Set);for(const d of c.values)a[u].add(d)}}return a});const o=J0,s=t.catchall;let r;e._zod.parse=(l,a)=>{r??(r=i.value);const u=l.value;if(!o(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l;l.value={};const c=[],d=r.shape;for(const f of r.keys){const h=d[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},a);g instanceof Promise?c.push(g.then(v=>Tk(v,l,f,u,m))):Tk(g,l,f,u,m)}return s?qW(c,u,l,a,i.value,e):c.length?Promise.all(c).then(()=>l):l}}),p3e=Lt("$ZodObjectJIT",(e,t)=>{h3e.init(e,t);const n=e._zod.parse,i=r4(()=>WW(t)),o=f=>{const h=new B4e(["shape","payload","ctx"]),m=i.value,g=C=>{const A=JN(C);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};h.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const C of m.keys)v[C]=`key_${y++}`;h.write("const newResult = {};");for(const C of m.keys){const A=v[C],T=JN(C),_=f[C]?._zod?.optout==="optional";h.write(`const ${A} = ${g(C)};`),_?h.write(` + if (${A}.issues.length) { + if (${T} in input) { + payload.issues = payload.issues.concat(${A}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${T}, ...iss.path] : [${T}] + }))); + } + } + + if (${A}.value === undefined) { + if (${T} in input) { + newResult[${T}] = undefined; + } + } else { + newResult[${T}] = ${A}.value; + } + + `):h.write(` + if (${A}.issues.length) { + payload.issues = payload.issues.concat(${A}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${T}, ...iss.path] : [${T}] + }))); + } + + if (${A}.value === undefined) { + if (${T} in input) { + newResult[${T}] = undefined; + } + } else { + newResult[${T}] = ${A}.value; + } + + `)}h.write("payload.value = newResult;"),h.write("return payload;");const b=h.compile();return(C,A)=>b(f,C,A)};let s;const r=J0,l=!MW.jitless,u=l&&Tbe.value,c=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=i.value);const m=f.value;return r(m)?l&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),c?qW([],m,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function tD(e,t,n,i){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Xp(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(r=>Kd(r,i,Vd())))}),t)}const UW=Lt("$ZodUnion",(e,t)=>{No.init(e,t),Hi(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Hi(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Hi(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Hi(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>sx(s.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return i(o,s);let r=!1;const l=[];for(const a of t.options){const u=a._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)l.push(u),r=!0;else{if(u.issues.length===0)return u;l.push(u)}}return r?Promise.all(l).then(a=>tD(a,o,e,s)):tD(l,o,e,s)}}),m3e=Lt("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,UW.init(e,t);const n=e._zod.parse;Hi(e._zod,"propValues",()=>{const o={};for(const s of t.options){const r=s._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,a]of Object.entries(r)){o[l]||(o[l]=new Set);for(const u of a)o[l].add(u)}}return o});const i=r4(()=>{const o=t.options,s=new Map;for(const r of o){const l=r._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const a of l){if(s.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);s.set(a,r)}}return s});e._zod.parse=(o,s)=>{const r=o.value;if(!J0(r))return o.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),o;const l=i.value.get(r?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:r,path:[t.discriminator],inst:e}),o)}}),g3e=Lt("$ZodIntersection",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},i),r=t.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([a,u])=>nD(n,a,u)):nD(n,s,r)}});function nA(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(j1(e)&&j1(t)){const n=Object.keys(t),i=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of i){const r=nA(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};o[s]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;il.l&&l.r).map(([l])=>l);if(s.length&&o&&e.issues.push({...o,keys:s}),Xp(e))return e;const r=nA(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const v3e=Lt("$ZodRecord",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!j1(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],r=t.keyType._zod.values;if(r){n.value={};const l=new Set;for(const u of r)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const c=t.valueType._zod.run({value:o[u],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...e1(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...e1(u,c.issues)),n.value[u]=c.value)}let a;for(const u in o)l.has(u)||(a=a??[],a.push(u));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let a=t.keyType._zod.run({value:l,issues:[]},i);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&OW.test(l)&&a.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(a=d)}if(a.issues.length){t.mode==="loose"?n.value[l]=o[l]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(d=>Kd(d,i,Vd())),input:l,path:[l],inst:e});continue}const c=t.valueType._zod.run({value:o[l],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...e1(l,d.issues)),n.value[a.value]=d.value})):(c.issues.length&&n.issues.push(...e1(l,c.issues)),n.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),y3e=Lt("$ZodEnum",(e,t)=>{No.init(e,t);const n=IW(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(o=>Ebe.has(typeof o)).map(o=>typeof o=="string"?H1(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const r=o.value;return i.has(r)||o.issues.push({code:"invalid_value",values:n,input:r,inst:e}),o}}),k3e=Lt("$ZodLiteral",(e,t)=>{if(No.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?H1(i):i?H1(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),i}}),b3e=Lt("$ZodTransform",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new _W(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(r=>(n.value=r,n));if(o instanceof Promise)throw new C1;return n.value=o,n}});function iD(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const VW=Lt("$ZodOptional",(e,t)=>{No.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Hi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Hi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${sx(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>iD(s,n.value)):iD(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),w3e=Lt("$ZodExactOptional",(e,t)=>{VW.init(e,t),Hi(e._zod,"values",()=>t.innerType._zod.values),Hi(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),C3e=Lt("$ZodNullable",(e,t)=>{No.init(e,t),Hi(e._zod,"optin",()=>t.innerType._zod.optin),Hi(e._zod,"optout",()=>t.innerType._zod.optout),Hi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${sx(n.source)}|null)$`):void 0}),Hi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),A3e=Lt("$ZodDefault",(e,t)=>{No.init(e,t),e._zod.optin="optional",Hi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>oD(s,t)):oD(o,t)}});function oD(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const x3e=Lt("$ZodPrefault",(e,t)=>{No.init(e,t),e._zod.optin="optional",Hi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),S3e=Lt("$ZodNonOptional",(e,t)=>{No.init(e,t),Hi(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>sD(s,e)):sD(o,e)}});function sD(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const _3e=Lt("$ZodCatch",(e,t)=>{No.init(e,t),Hi(e._zod,"optin",()=>t.innerType._zod.optin),Hi(e._zod,"optout",()=>t.innerType._zod.optout),Hi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>Kd(r,i,Vd()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>Kd(s,i,Vd()))},input:n.value}),n.issues=[]),n)}}),M3e=Lt("$ZodPipe",(e,t)=>{No.init(e,t),Hi(e._zod,"values",()=>t.in._zod.values),Hi(e._zod,"optin",()=>t.in._zod.optin),Hi(e._zod,"optout",()=>t.out._zod.optout),Hi(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const s=t.out._zod.run(n,i);return s instanceof Promise?s.then(r=>fy(r,t.in,i)):fy(s,t.in,i)}const o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>fy(s,t.out,i)):fy(o,t.out,i)}});function fy(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const I3e=Lt("$ZodReadonly",(e,t)=>{No.init(e,t),Hi(e._zod,"propValues",()=>t.innerType._zod.propValues),Hi(e._zod,"values",()=>t.innerType._zod.values),Hi(e._zod,"optin",()=>t.innerType?._zod?.optin),Hi(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(rD):rD(o)}});function rD(e){return e.value=Object.freeze(e.value),e}const T3e=Lt("$ZodCustom",(e,t)=>{xl.init(e,t),No.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then(s=>lD(s,n,i,e));lD(o,n,i,e)}});function lD(e,t,n,i){if(!e){const o={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(X0(o))}}var aD;class E3e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function L3e(){return new E3e}(aD=globalThis).__zod_globalRegistry??(aD.__zod_globalRegistry=L3e());const Ig=globalThis.__zod_globalRegistry;function N3e(e,t){return new e({type:"string",...Tn(t)})}function D3e(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Tn(t)})}function uD(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Tn(t)})}function F3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Tn(t)})}function B3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tn(t)})}function R3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tn(t)})}function O3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tn(t)})}function $3e(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Tn(t)})}function P3e(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Tn(t)})}function z3e(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tn(t)})}function j3e(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Tn(t)})}function H3e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tn(t)})}function W3e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Tn(t)})}function q3e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Tn(t)})}function U3e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tn(t)})}function V3e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tn(t)})}function K3e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tn(t)})}function Z3e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tn(t)})}function G3e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tn(t)})}function Q3e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Tn(t)})}function Y3e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Tn(t)})}function J3e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Tn(t)})}function X3e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Tn(t)})}function e8e(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tn(t)})}function t8e(e,t){return new e({type:"string",format:"date",check:"string_format",...Tn(t)})}function n8e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Tn(t)})}function i8e(e,t){return new e({type:"string",format:"duration",check:"string_format",...Tn(t)})}function o8e(e,t){return new e({type:"number",checks:[],...Tn(t)})}function s8e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Tn(t)})}function r8e(e,t){return new e({type:"boolean",...Tn(t)})}function l8e(e){return new e({type:"unknown"})}function a8e(e,t){return new e({type:"never",...Tn(t)})}function cD(e,t){return new PW({check:"less_than",...Tn(t),value:e,inclusive:!1})}function K8(e,t){return new PW({check:"less_than",...Tn(t),value:e,inclusive:!0})}function dD(e,t){return new zW({check:"greater_than",...Tn(t),value:e,inclusive:!1})}function Z8(e,t){return new zW({check:"greater_than",...Tn(t),value:e,inclusive:!0})}function fD(e,t){return new A4e({check:"multiple_of",...Tn(t),value:e})}function KW(e,t){return new S4e({check:"max_length",...Tn(t),maximum:e})}function Ek(e,t){return new _4e({check:"min_length",...Tn(t),minimum:e})}function ZW(e,t){return new M4e({check:"length_equals",...Tn(t),length:e})}function u8e(e,t){return new I4e({check:"string_format",format:"regex",...Tn(t),pattern:e})}function c8e(e){return new T4e({check:"string_format",format:"lowercase",...Tn(e)})}function d8e(e){return new E4e({check:"string_format",format:"uppercase",...Tn(e)})}function f8e(e,t){return new L4e({check:"string_format",format:"includes",...Tn(t),includes:e})}function h8e(e,t){return new N4e({check:"string_format",format:"starts_with",...Tn(t),prefix:e})}function p8e(e,t){return new D4e({check:"string_format",format:"ends_with",...Tn(t),suffix:e})}function hm(e){return new F4e({check:"overwrite",tx:e})}function m8e(e){return hm(t=>t.normalize(e))}function g8e(){return hm(e=>e.trim())}function v8e(){return hm(e=>e.toLowerCase())}function y8e(){return hm(e=>e.toUpperCase())}function k8e(){return hm(e=>Ibe(e))}function b8e(e,t,n){return new e({type:"array",element:t,...Tn(n)})}function w8e(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Tn(n)})}function C8e(e){const t=A8e(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(X0(i,n.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(X0(o))}},e(n.value,n)));return t}function A8e(e,t){const n=new xl({check:"custom",...Tn(t)});return n._zod.check=e,n}function GW(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ig,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Cs(e,t,n={path:[],schemaPath:[]}){var i;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const f=r.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,c)}const d=e._zod.parent;d&&(r.ref||(r.ref=d),Cs(d,t,c),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&Object.assign(r.schema,a),t.io==="input"&&Or(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((i=r.schema).default??(i.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function QW(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const a=i.get(l);if(a&&a!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,r[0])}}const o=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(r[0])?.id,f=e.external.uri??(m=>m);if(d)return{ref:f(d)};const h=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=h,{defId:h,ref:`${f("__shared")}#/${l}/${h}`}}if(r[1]===n)return{ref:"#"};const u=`#/${l}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:u+c}},s=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:a,defId:u}=o(r);l.def={...l.schema},u&&(l.defId=u);const c=l.schema;for(const d in c)delete c[d];c.$ref=a};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ + +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){s(r);continue}if(e.external){const u=e.external.registry.get(r[0])?.id;if(t!==r[0]&&u){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(l.cycle){s(r);continue}if(l.count>1&&e.reused==="ref"){s(r);continue}}}function YW(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=r=>{const l=e.seen.get(r);if(l.ref===null)return;const a=l.def??l.schema,u={...a},c=l.ref;if(l.ref=null,c){i(c);const f=e.seen.get(c),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(a.allOf=a.allOf??[],a.allOf.push(h)):Object.assign(a,h),Object.assign(a,u),r._zod.parent===c)for(const g in a)g==="$ref"||g==="allOf"||g in u||delete a[g];if(h.$ref&&f.def)for(const g in a)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(a[g])===JSON.stringify(f.def[g])&&delete a[g]}const d=r._zod.parent;if(d&&d!==c){i(d);const f=e.seen.get(d);if(f?.schema.$ref&&(a.$ref=f.schema.$ref,f.def))for(const h in a)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(a[h])===JSON.stringify(f.def[h])&&delete a[h]}e.override({zodSchema:r,jsonSchema:a,path:l.path??[]})};for(const r of[...e.seen.entries()].reverse())i(r[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const l=r[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const r=JSON.parse(JSON.stringify(o));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:Lk(t,"input",e.processors),output:Lk(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function Or(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Or(i.element,n);if(i.type==="set")return Or(i.valueType,n);if(i.type==="lazy")return Or(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Or(i.innerType,n);if(i.type==="intersection")return Or(i.left,n)||Or(i.right,n);if(i.type==="record"||i.type==="map")return Or(i.keyType,n)||Or(i.valueType,n);if(i.type==="pipe")return Or(i.in,n)||Or(i.out,n);if(i.type==="object"){for(const o in i.shape)if(Or(i.shape[o],n))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(Or(o,n))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(Or(o,n))return!0;return!!(i.rest&&Or(i.rest,n))}return!1}const x8e=(e,t={})=>n=>{const i=GW({...n,processors:t});return Cs(e,i),QW(i,e),YW(i,e)},Lk=(e,t,n={})=>i=>{const{libraryOptions:o,target:s}=i??{},r=GW({...o??{},target:s,io:t,processors:n});return Cs(e,r),QW(r,e),YW(r,e)},S8e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_8e=(e,t,n,i)=>{const o=n;o.type="string";const{minimum:s,maximum:r,format:l,patterns:a,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof r=="number"&&(o.maxLength=r),l&&(o.format=S8e[l]??l,o.format===""&&delete o.format,l==="time"&&delete o.format),u&&(o.contentEncoding=u),a&&a.size>0){const c=[...a];c.length===1?o.pattern=c[0].source:c.length>1&&(o.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},M8e=(e,t,n,i)=>{const o=n,{minimum:s,maximum:r,format:l,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof l=="string"&&l.includes("int")?o.type="integer":o.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c),typeof s=="number"&&(o.minimum=s,typeof c=="number"&&t.target!=="draft-04"&&(c>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof r=="number"&&(o.maximum=r,typeof u=="number"&&t.target!=="draft-04"&&(u<=r?delete o.maximum:delete o.exclusiveMaximum)),typeof a=="number"&&(o.multipleOf=a)},I8e=(e,t,n,i)=>{n.type="boolean"},T8e=(e,t,n,i)=>{n.not={}},E8e=(e,t,n,i)=>{},L8e=(e,t,n,i)=>{const o=e._zod.def,s=IW(o.entries);s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),n.enum=s},N8e=(e,t,n,i)=>{const o=e._zod.def,s=[];for(const r of o.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(r))}else s.push(r);if(s.length!==0)if(s.length===1){const r=s[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),s.every(r=>typeof r=="boolean")&&(n.type="boolean"),s.every(r=>r===null)&&(n.type="null"),n.enum=s},D8e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},F8e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},B8e=(e,t,n,i)=>{const o=n,s=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(o.minItems=r),typeof l=="number"&&(o.maxItems=l),o.type="array",o.items=Cs(s.element,t,{...i,path:[...i.path,"items"]})},R8e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const r=s.shape;for(const u in r)o.properties[u]=Cs(r[u],t,{...i,path:[...i.path,"properties",u]});const l=new Set(Object.keys(r)),a=new Set([...l].filter(u=>{const c=s.shape[u]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));a.size>0&&(o.required=Array.from(a)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Cs(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},O8e=(e,t,n,i)=>{const o=e._zod.def,s=o.inclusive===!1,r=o.options.map((l,a)=>Cs(l,t,{...i,path:[...i.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=r:n.anyOf=r},$8e=(e,t,n,i)=>{const o=e._zod.def,s=Cs(o.left,t,{...i,path:[...i.path,"allOf",0]}),r=Cs(o.right,t,{...i,path:[...i.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,a=[...l(s)?s.allOf:[s],...l(r)?r.allOf:[r]];n.allOf=a},P8e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object";const r=s.keyType,a=r._zod.bag?.patterns;if(s.mode==="loose"&&a&&a.size>0){const c=Cs(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const d of a)o.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Cs(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=Cs(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const u=r._zod.values;if(u){const c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(o.required=c)}},z8e=(e,t,n,i)=>{const o=e._zod.def,s=Cs(o.innerType,t,i),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},j8e=(e,t,n,i)=>{const o=e._zod.def;Cs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},H8e=(e,t,n,i)=>{const o=e._zod.def;Cs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},W8e=(e,t,n,i)=>{const o=e._zod.def;Cs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},q8e=(e,t,n,i)=>{const o=e._zod.def;Cs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType;let r;try{r=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},U8e=(e,t,n,i)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Cs(s,t,i);const r=t.seen.get(e);r.ref=s},V8e=(e,t,n,i)=>{const o=e._zod.def;Cs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},JW=(e,t,n,i)=>{const o=e._zod.def;Cs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},K8e=Lt("ZodISODateTime",(e,t)=>{Z4e.init(e,t),Fo.init(e,t)});function Z8e(e){return e8e(K8e,e)}const G8e=Lt("ZodISODate",(e,t)=>{G4e.init(e,t),Fo.init(e,t)});function Q8e(e){return t8e(G8e,e)}const Y8e=Lt("ZodISOTime",(e,t)=>{Q4e.init(e,t),Fo.init(e,t)});function J8e(e){return n8e(Y8e,e)}const X8e=Lt("ZodISODuration",(e,t)=>{Y4e.init(e,t),Fo.init(e,t)});function e5e(e){return i8e(X8e,e)}const t5e=(e,t)=>{NW.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>jbe(e,n)},flatten:{value:n=>zbe(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,tA,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,tA,2)}},isEmpty:{get(){return e.issues.length===0}}})},Aa=Lt("ZodError",t5e,{Parent:Error}),n5e=lx(Aa),i5e=ax(Aa),o5e=l4(Aa),s5e=a4(Aa),r5e=qbe(Aa),l5e=Ube(Aa),a5e=Vbe(Aa),u5e=Kbe(Aa),c5e=Zbe(Aa),d5e=Gbe(Aa),f5e=Qbe(Aa),h5e=Ybe(Aa),Do=Lt("ZodType",(e,t)=>(No.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Lk(e,"input"),output:Lk(e,"output")}}),e.toJSONSchema=x8e(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(af(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>uf(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>n5e(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>o5e(e,n,i),e.parseAsync=async(n,i)=>i5e(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>s5e(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>r5e(e,n,i),e.decode=(n,i)=>l5e(e,n,i),e.encodeAsync=async(n,i)=>a5e(e,n,i),e.decodeAsync=async(n,i)=>u5e(e,n,i),e.safeEncode=(n,i)=>c5e(e,n,i),e.safeDecode=(n,i)=>d5e(e,n,i),e.safeEncodeAsync=async(n,i)=>f5e(e,n,i),e.safeDecodeAsync=async(n,i)=>h5e(e,n,i),e.refine=(n,i)=>e.check(lwe(n,i)),e.superRefine=n=>e.check(awe(n)),e.overwrite=n=>e.check(hm(n)),e.optional=()=>mD(e),e.exactOptional=()=>Z5e(e),e.nullable=()=>gD(e),e.nullish=()=>mD(gD(e)),e.nonoptional=n=>ewe(e,n),e.array=()=>Ti(e),e.or=n=>P5e([e,n]),e.and=n=>H5e(e,n),e.transform=n=>vD(e,V5e(n)),e.default=n=>Y5e(e,n),e.prefault=n=>X5e(e,n),e.catch=n=>nwe(e,n),e.pipe=n=>vD(e,n),e.readonly=()=>swe(e),e.describe=n=>{const i=e.clone();return Ig.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return Ig.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Ig.get(e);const i=e.clone();return Ig.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),XW=Lt("_ZodString",(e,t)=>{ux.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(i,o,s)=>_8e(e,i,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(u8e(...i)),e.includes=(...i)=>e.check(f8e(...i)),e.startsWith=(...i)=>e.check(h8e(...i)),e.endsWith=(...i)=>e.check(p8e(...i)),e.min=(...i)=>e.check(Ek(...i)),e.max=(...i)=>e.check(KW(...i)),e.length=(...i)=>e.check(ZW(...i)),e.nonempty=(...i)=>e.check(Ek(1,...i)),e.lowercase=i=>e.check(c8e(i)),e.uppercase=i=>e.check(d8e(i)),e.trim=()=>e.check(g8e()),e.normalize=(...i)=>e.check(m8e(...i)),e.toLowerCase=()=>e.check(v8e()),e.toUpperCase=()=>e.check(y8e()),e.slugify=()=>e.check(k8e())}),p5e=Lt("ZodString",(e,t)=>{ux.init(e,t),XW.init(e,t),e.email=n=>e.check(D3e(m5e,n)),e.url=n=>e.check($3e(g5e,n)),e.jwt=n=>e.check(X3e(L5e,n)),e.emoji=n=>e.check(P3e(v5e,n)),e.guid=n=>e.check(uD(hD,n)),e.uuid=n=>e.check(F3e(hy,n)),e.uuidv4=n=>e.check(B3e(hy,n)),e.uuidv6=n=>e.check(R3e(hy,n)),e.uuidv7=n=>e.check(O3e(hy,n)),e.nanoid=n=>e.check(z3e(y5e,n)),e.guid=n=>e.check(uD(hD,n)),e.cuid=n=>e.check(j3e(k5e,n)),e.cuid2=n=>e.check(H3e(b5e,n)),e.ulid=n=>e.check(W3e(w5e,n)),e.base64=n=>e.check(Q3e(I5e,n)),e.base64url=n=>e.check(Y3e(T5e,n)),e.xid=n=>e.check(q3e(C5e,n)),e.ksuid=n=>e.check(U3e(A5e,n)),e.ipv4=n=>e.check(V3e(x5e,n)),e.ipv6=n=>e.check(K3e(S5e,n)),e.cidrv4=n=>e.check(Z3e(_5e,n)),e.cidrv6=n=>e.check(G3e(M5e,n)),e.e164=n=>e.check(J3e(E5e,n)),e.datetime=n=>e.check(Z8e(n)),e.date=n=>e.check(Q8e(n)),e.time=n=>e.check(J8e(n)),e.duration=n=>e.check(e5e(n))});function Ht(e){return N3e(p5e,e)}const Fo=Lt("ZodStringFormat",(e,t)=>{Ao.init(e,t),XW.init(e,t)}),m5e=Lt("ZodEmail",(e,t)=>{P4e.init(e,t),Fo.init(e,t)}),hD=Lt("ZodGUID",(e,t)=>{O4e.init(e,t),Fo.init(e,t)}),hy=Lt("ZodUUID",(e,t)=>{$4e.init(e,t),Fo.init(e,t)}),g5e=Lt("ZodURL",(e,t)=>{z4e.init(e,t),Fo.init(e,t)}),v5e=Lt("ZodEmoji",(e,t)=>{j4e.init(e,t),Fo.init(e,t)}),y5e=Lt("ZodNanoID",(e,t)=>{H4e.init(e,t),Fo.init(e,t)}),k5e=Lt("ZodCUID",(e,t)=>{W4e.init(e,t),Fo.init(e,t)}),b5e=Lt("ZodCUID2",(e,t)=>{q4e.init(e,t),Fo.init(e,t)}),w5e=Lt("ZodULID",(e,t)=>{U4e.init(e,t),Fo.init(e,t)}),C5e=Lt("ZodXID",(e,t)=>{V4e.init(e,t),Fo.init(e,t)}),A5e=Lt("ZodKSUID",(e,t)=>{K4e.init(e,t),Fo.init(e,t)}),x5e=Lt("ZodIPv4",(e,t)=>{J4e.init(e,t),Fo.init(e,t)}),S5e=Lt("ZodIPv6",(e,t)=>{X4e.init(e,t),Fo.init(e,t)}),_5e=Lt("ZodCIDRv4",(e,t)=>{e3e.init(e,t),Fo.init(e,t)}),M5e=Lt("ZodCIDRv6",(e,t)=>{t3e.init(e,t),Fo.init(e,t)}),I5e=Lt("ZodBase64",(e,t)=>{n3e.init(e,t),Fo.init(e,t)}),T5e=Lt("ZodBase64URL",(e,t)=>{o3e.init(e,t),Fo.init(e,t)}),E5e=Lt("ZodE164",(e,t)=>{s3e.init(e,t),Fo.init(e,t)}),L5e=Lt("ZodJWT",(e,t)=>{l3e.init(e,t),Fo.init(e,t)}),eq=Lt("ZodNumber",(e,t)=>{HW.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(i,o,s)=>M8e(e,i,o),e.gt=(i,o)=>e.check(dD(i,o)),e.gte=(i,o)=>e.check(Z8(i,o)),e.min=(i,o)=>e.check(Z8(i,o)),e.lt=(i,o)=>e.check(cD(i,o)),e.lte=(i,o)=>e.check(K8(i,o)),e.max=(i,o)=>e.check(K8(i,o)),e.int=i=>e.check(pD(i)),e.safe=i=>e.check(pD(i)),e.positive=i=>e.check(dD(0,i)),e.nonnegative=i=>e.check(Z8(0,i)),e.negative=i=>e.check(cD(0,i)),e.nonpositive=i=>e.check(K8(0,i)),e.multipleOf=(i,o)=>e.check(fD(i,o)),e.step=(i,o)=>e.check(fD(i,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function bn(e){return o8e(eq,e)}const N5e=Lt("ZodNumberFormat",(e,t)=>{a3e.init(e,t),eq.init(e,t)});function pD(e){return s8e(N5e,e)}const D5e=Lt("ZodBoolean",(e,t)=>{u3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>I8e(e,n,i)});function Pv(e){return r8e(D5e,e)}const F5e=Lt("ZodUnknown",(e,t)=>{c3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>E8e()});function Es(){return l8e(F5e)}const B5e=Lt("ZodNever",(e,t)=>{d3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>T8e(e,n,i)});function R5e(e){return a8e(B5e,e)}const O5e=Lt("ZodArray",(e,t)=>{f3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>B8e(e,n,i,o),e.element=t.element,e.min=(n,i)=>e.check(Ek(n,i)),e.nonempty=n=>e.check(Ek(1,n)),e.max=(n,i)=>e.check(KW(n,i)),e.length=(n,i)=>e.check(ZW(n,i)),e.unwrap=()=>e.element});function Ti(e,t){return b8e(O5e,e,t)}const $5e=Lt("ZodObject",(e,t)=>{p3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>R8e(e,n,i,o),Hi(e,"shape",()=>t.shape),e.keyof=()=>Co(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Es()}),e.loose=()=>e.clone({...e._zod.def,catchall:Es()}),e.strict=()=>e.clone({...e._zod.def,catchall:R5e()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Bbe(e,n),e.safeExtend=n=>Rbe(e,n),e.merge=n=>Obe(e,n),e.pick=n=>Dbe(e,n),e.omit=n=>Fbe(e,n),e.partial=(...n)=>$be(nq,e,n[0]),e.required=(...n)=>Pbe(iq,e,n[0])});function Jt(e,t){const n={type:"object",shape:e??{},...Tn(t)};return new $5e(n)}const tq=Lt("ZodUnion",(e,t)=>{UW.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>O8e(e,n,i,o),e.options=t.options});function P5e(e,t){return new tq({type:"union",options:e,...Tn(t)})}const z5e=Lt("ZodDiscriminatedUnion",(e,t)=>{tq.init(e,t),m3e.init(e,t)});function cf(e,t,n){return new z5e({type:"union",options:t,discriminator:e,...Tn(n)})}const j5e=Lt("ZodIntersection",(e,t)=>{g3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>$8e(e,n,i,o)});function H5e(e,t){return new j5e({type:"intersection",left:e,right:t})}const W5e=Lt("ZodRecord",(e,t)=>{v3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>P8e(e,n,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function cx(e,t,n){return new W5e({type:"record",keyType:e,valueType:t,...Tn(n)})}const iA=Lt("ZodEnum",(e,t)=>{y3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(i,o,s)=>L8e(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const s={};for(const r of i)if(n.has(r))s[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new iA({...t,checks:[],...Tn(o),entries:s})},e.exclude=(i,o)=>{const s={...t.entries};for(const r of i)if(n.has(r))delete s[r];else throw new Error(`Key ${r} not found in enum`);return new iA({...t,checks:[],...Tn(o),entries:s})}});function Co(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new iA({type:"enum",entries:n,...Tn(t)})}const q5e=Lt("ZodLiteral",(e,t)=>{k3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>N8e(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Qn(e,t){return new q5e({type:"literal",values:Array.isArray(e)?e:[e],...Tn(t)})}const U5e=Lt("ZodTransform",(e,t)=>{b3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>F8e(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new _W(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(X0(s,n.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(X0(r))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function V5e(e){return new U5e({type:"transform",transform:e})}const nq=Lt("ZodOptional",(e,t)=>{VW.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>JW(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function mD(e){return new nq({type:"optional",innerType:e})}const K5e=Lt("ZodExactOptional",(e,t)=>{w3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>JW(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function Z5e(e){return new K5e({type:"optional",innerType:e})}const G5e=Lt("ZodNullable",(e,t)=>{C3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>z8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function gD(e){return new G5e({type:"nullable",innerType:e})}const Q5e=Lt("ZodDefault",(e,t)=>{A3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>H8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Y5e(e,t){return new Q5e({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():EW(t)}})}const J5e=Lt("ZodPrefault",(e,t)=>{x3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>W8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function X5e(e,t){return new J5e({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():EW(t)}})}const iq=Lt("ZodNonOptional",(e,t)=>{S3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>j8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function ewe(e,t){return new iq({type:"nonoptional",innerType:e,...Tn(t)})}const twe=Lt("ZodCatch",(e,t)=>{_3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>q8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function nwe(e,t){return new twe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const iwe=Lt("ZodPipe",(e,t)=>{M3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>U8e(e,n,i,o),e.in=t.in,e.out=t.out});function vD(e,t){return new iwe({type:"pipe",in:e,out:t})}const owe=Lt("ZodReadonly",(e,t)=>{I3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>V8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function swe(e){return new owe({type:"readonly",innerType:e})}const rwe=Lt("ZodCustom",(e,t)=>{T3e.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>D8e(e,n)});function lwe(e,t={}){return w8e(rwe,e,t)}function awe(e){return C8e(e)}const Oh=Ht().min(1),dx=Ht().min(1),zv=Ht().min(1),$h=Ht().min(1),Gl=Ht().min(1),uwe=/^[A-Za-z0-9._-]{1,128}$/;function cwe(e){return uwe.test(e)&&e!=="."&&e!==".."}const oq=cf("kind",[Jt({kind:Qn("user"),payload:Es().optional()}),Jt({kind:Qn("cron"),taskId:$h.optional(),payload:Es().optional()}),Jt({kind:Qn("task"),taskId:$h,payload:Es().optional()}),Jt({kind:Qn("hook"),payload:Es().optional()}),Jt({kind:Qn("compaction"),payload:Es().optional()}),Jt({kind:Qn("side"),payload:Es().optional()}),Jt({kind:Qn("other"),payload:Es().optional()})]),dwe=Jt({inputTokens:bn().optional(),outputTokens:bn().optional(),cachedTokens:bn().optional(),cost:bn().optional()}),m0=Jt({inputOther:bn(),output:bn(),inputCacheRead:bn(),inputCacheCreation:bn()}),fwe=Jt({llmFirstTokenLatencyMs:bn().optional(),llmStreamDurationMs:bn().optional(),llmRequestBuildMs:bn().optional(),llmServerFirstTokenMs:bn().optional(),llmServerDecodeMs:bn().optional(),llmClientConsumeMs:bn().optional()}),hwe=Jt({failedAttempt:bn(),nextAttempt:bn(),maxAttempts:bn(),delayMs:bn(),errorName:Ht(),errorMessage:Ht(),statusCode:bn().optional()}),sq=Co(["queued","running","completed","failed","cancelled"]),pwe=Co(["running","completed","interrupted","failed"]),mwe=Jt({kind:Qn("text"),frameId:zv,role:Co(["assistant","user"]),text:Ht(),attachmentIds:Ti(Ht()).optional(),taskId:$h.optional(),promptIds:Ti(Ht()).optional()}),gwe=Jt({kind:Qn("thinking"),frameId:zv,text:Ht()}),vwe=Jt({agentId:Gl,role:Co(["child","member"]).optional()}),ywe=Jt({kind:Co(["stdout","stderr","progress","status","custom"]),text:Ht().optional(),percent:bn().optional(),customKind:Ht().optional(),customData:Es().optional()}),kwe=Jt({kind:Qn("tool"),frameId:zv,toolCallId:Ht(),name:Ht(),view:Ht().optional(),state:Co(["running","done","error"]),input:Es().optional(),output:Es().optional(),display:Es().optional(),error:Ht().optional(),inputText:Ht().optional(),progress:ywe.optional(),taskId:$h.optional(),approvalId:Ht().optional(),todoId:Ht().optional(),agentRefs:Ti(vwe).optional()}),fx=Jt({interactionId:Ht(),interactionKind:Co(["approval","question"]),toolCallId:Ht().optional(),state:Co(["pending","approved","rejected","cancelled","answered","dismissed"]),request:Es().optional(),response:Es().optional()}),bwe=Jt({kind:Qn("notice"),frameId:zv,level:Co(["error","warning","info"]),source:Ht().optional(),message:Ht(),detail:Es().optional()}),rq=cf("kind",[mwe,gwe,kwe,bwe]),lq=Jt({kind:Qn("step"),stepId:dx,turnId:Oh,ordinal:bn().int(),state:pwe,frames:Ti(rq),startedAt:Ht().optional(),endedAt:Ht().optional(),usage:m0.optional(),finishReason:Ht().optional(),timing:fwe.optional(),retry:hwe.optional(),endReason:Ht().optional(),endMessage:Ht().optional()}),aq=Jt({kind:Qn("turn"),turnId:Oh,ordinal:bn().int(),state:sq,origin:oq,prompt:Ht().optional(),attachmentIds:Ti(Ht()).optional(),steps:Ti(lq),startedAt:Ht().optional(),endedAt:Ht().optional(),usage:dwe.optional(),durationMs:bn().optional(),error:Ht().optional()}),uq=Jt({kind:Qn("marker"),markerId:Ht(),marker:Ht(),payload:Es().optional(),at:Ht().optional()}),cq=Jt({kind:Qn("taskref"),refId:Ht(),taskId:$h,at:Ht().optional()}),dq=cf("kind",[aq,uq,cq]),hx=Jt({taskId:$h,kind:Co(["shell","subagent","tool","other"]),state:Co(["running","completed","failed","timed_out","killed","lost"]),detached:Pv(),description:Ht().optional(),agentId:Gl.optional(),outputTail:Ht(),startedAt:Ht().optional(),endedAt:Ht().optional(),resultSummary:Ht().optional(),error:Ht().optional(),stateReason:Ht().optional(),usage:m0.optional(),model:Ht().optional(),thinkingEffort:Ht().optional()}),fq=Jt({objective:Ht(),status:Co(["active","paused","blocked","complete"]),completionCriterion:Ht().optional(),budgetUsed:bn().optional(),budgetLimit:bn().optional()}),wwe=Jt({plan:Jt({reviewPath:Ht().optional(),version:bn().optional()}).optional(),swarm:Jt({trigger:Ht().optional()}).optional(),tower:Jt({}).optional()}),Cwe=Jt({plan:Jt({reviewPath:Ht().optional(),version:bn().optional()}).nullable().optional(),swarm:Jt({trigger:Ht().optional()}).nullable().optional(),tower:Jt({}).nullable().optional()}),Awe=cf("kind",[Jt({kind:Qn("idle")}),Jt({kind:Qn("running"),turnId:bn(),step:bn(),stepId:Ht(),since:bn()}),Jt({kind:Qn("streaming"),turnId:bn(),step:bn(),stepId:Ht(),stream:Co(["assistant","thinking","tool_call"]),toolCallId:Ht().optional(),toolName:Ht().optional(),since:bn()}),Jt({kind:Qn("tool_call"),turnId:bn(),step:bn(),toolCallId:Ht(),name:Ht(),since:bn()}),Jt({kind:Qn("retrying"),turnId:bn(),step:bn(),stepId:Ht(),failedAttempt:bn(),nextAttempt:bn(),maxAttempts:bn(),delayMs:bn(),errorName:Ht().optional(),statusCode:bn().optional(),since:bn()}),Jt({kind:Qn("awaiting_approval"),turnId:bn(),step:bn().optional(),approval:Es().optional(),since:bn()}),Jt({kind:Qn("interrupted"),turnId:bn(),step:bn().optional(),reason:Co(["aborted","max_steps","error"]),message:Ht().optional(),at:bn()}),Jt({kind:Qn("ended"),turnId:bn(),reason:Co(["completed","cancelled","failed","blocked"]),durationMs:bn().optional(),at:bn()})]),xwe=Jt({byModel:cx(Ht(),m0).optional(),currentTurn:m0.optional(),total:m0.optional()}),Swe=Jt({model:Ht().optional(),thinkingEffort:Ht().optional(),usage:xwe.optional(),contextTokens:bn().optional(),maxContextTokens:bn().optional(),contextUsage:bn().optional(),permission:Co(["manual","yolo","auto"]).optional(),phase:Awe.optional()}),px=Jt({goal:fq.optional(),modes:wwe.optional(),activity:Co(["idle","turn","disposing","unknown"]).optional(),agent:Swe.optional()}),_we=px.extend({goal:fq.nullable().optional(),modes:Cwe.optional()}),c4=Jt({attachmentId:Ht(),mediaType:Ht(),name:Ht().optional(),size:bn().optional(),source:cf("kind",[Jt({kind:Qn("url"),url:Ht()}),Jt({kind:Qn("file"),fileId:Ht()}),Jt({kind:Qn("session_media"),fileId:Ht()})]).optional(),placeholder:Ht().optional()}),Mwe=Jt({title:Ht(),status:Co(["pending","in_progress","done"])}),mx=Jt({todoId:Ht(),items:Ti(Mwe),updatedAt:Ht().optional()}),gx=Jt({promptId:Ht(),status:Co(["running","queued","blocked","completed","failed","aborted"]),userMessageId:Ht().optional(),content:Es().optional(),createdAt:Ht(),finishedAt:Ht().optional(),steeredAt:Ht().optional()}),hq=Jt({items:Ti(dq),tasks:Ti(hx),interactions:Ti(fx).default([]),attachments:Ti(c4).default([]),todos:Ti(mx).default([]),prompts:Ti(gx).default([]),meta:px,hasMoreOlder:Pv().optional()}),Iwe=aq.omit({steps:!0}),Twe=lq.omit({frames:!0}),Ewe=cf("type",[Jt({type:Qn("frame"),turnId:Oh,stepId:dx,frameId:zv}),Jt({type:Qn("task"),taskId:$h})]),vx=cf("op",[Jt({op:Qn("reset"),agentId:Gl,snapshot:hq}),Jt({op:Qn("turn.upsert"),turn:Iwe}),Jt({op:Qn("step.upsert"),turnId:Oh,step:Twe}),Jt({op:Qn("frame.upsert"),turnId:Oh,stepId:dx,frame:rq}),Jt({op:Qn("append"),target:Ewe,offset:bn().int().nonnegative(),text:Ht()}),Jt({op:Qn("marker.upsert"),item:uq,beforeTurn:bn().int().optional()}),Jt({op:Qn("taskref.upsert"),item:cq,beforeTurn:bn().int().optional()}),Jt({op:Qn("task.upsert"),task:hx}),Jt({op:Qn("interaction.upsert"),interaction:fx}),Jt({op:Qn("attachment.upsert"),attachment:c4}),Jt({op:Qn("todo.upsert"),todo:mx}),Jt({op:Qn("prompt.upsert"),prompt:gx}),Jt({op:Qn("meta.merge"),meta:_we}),Jt({op:Qn("items.remove"),ids:Ti(Ht())})]);Jt({agentId:Gl,ops:Ti(vx)});const Lwe=Co(["off","turn","block","delta"]),W1=bn().int().nonnegative(),Nwe=cx(Ht(),Lwe);Jt({session_id:Ht().min(1),transcript:Nwe,transcript_since:cx(Ht(),W1).optional()});Jt({agent_id:Gl,before_turn:Ht().min(1).optional(),after_turn:Ht().min(1).optional(),page_size:bn().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),cwe(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const Dwe=Jt({agentId:Gl,type:Co(["main","sub","independent"]).optional(),parentAgentId:Gl.optional(),label:Ht().optional(),createdAt:Ht().optional(),disposedAt:Ht().optional()}),Fwe=Jt({agent_id:Gl,items:Ti(dq),has_more:Pv(),tasks:Ti(hx),interactions:Ti(fx).default([]),attachments:Ti(c4).default([]),todos:Ti(mx).default([]),prompts:Ti(gx).default([]),meta:px,agents:Ti(Dwe),pending_interactions:Ti(Ht()),seq:W1.optional()});Jt({agent_id:Gl,batches:Ti(Jt({seq:W1,ops:Ti(vx)})),latest_seq:W1,complete:Pv()});const Bwe=Jt({turn_id:Oh,ordinal:bn().int(),state:sq,origin:oq,prompt:Ht(),attachment_ids:Ti(Ht()).optional(),started_at:Ht().optional()});Jt({agents:Ti(Jt({agent_id:Gl,messages:Ti(Bwe),attachments:Ti(c4).default([])}))});const Rwe=Jt({state:Co(["pending","approved","rejected","cancelled"]),selected_option:Ht().optional(),feedback:Ht().optional()}),Owe=Jt({tool_call_id:Ht(),turn_id:Oh,source:Co(["interaction","display","output"]),plan:Ht(),path:Ht().optional(),options:Ti(Jt({label:Ht(),description:Ht().optional()})).optional(),review:Rwe.optional()});Jt({agent_id:Gl,plans:Ti(Owe)});const $we=Jt({agent_id:Gl,snapshot:hq,has_more_older:Pv(),seq:W1.optional()}),Pwe=Jt({agent_id:Gl,ops:Ti(vx),seq:W1.optional()}),pq=$we.extend({type:Qn("transcript.reset")}),mq=Pwe.extend({type:Qn("transcript.ops")});cf("type",[pq,mq]);const yD=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),zwe=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),jwe=new Set(["server_hello","ack","ping","resync_required","error","pong"]),Hwe=new Set(["assistant.delta","thinking.delta"]);function Wwe(e,t){if(jwe.has(e))return{route:"ignore"};const n=e.startsWith("event."),i=n?e.slice(6):e;return Hwe.has(i)?qwe(t)?{route:"agent",agentType:i}:{route:"protocol"}:n?zwe.has(i)?{route:"protocol"}:yD.has(i)?{route:"agent",agentType:i}:{route:"protocol"}:yD.has(i)?{route:"agent",agentType:i}:{route:"agent",agentType:i}}function qwe(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}const Uwe="kimi-code.bearer.",Vwe=3e4;class kD{constructor(t){this.opts=t,this.tracer=t.tracer??ex}ws=null;connected=!1;closed=!1;subscriptions=new Map;transcriptSubscriptions=new Map;sideChannelAgents=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;clientHelloId=null;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;tracer;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),this.tracer.wsEvent?.({kind:"lifecycle",event:"connect",detail:{url:this.opts.wsUrl,attempt:this.reconnectAttempts}});const t=this.opts.credentialStore?.getToken(),n=t!==void 0?[`${Uwe}${t}`]:void 0,i=new WebSocket(this.opts.wsUrl,n);this.ws=i,i.onopen=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"open"})},i.onmessage=o=>{this.lastActivityAt=Date.now();try{const s=JSON.parse(String(o.data));this.tracer.wsEvent?.({kind:"in",frame:s}),this.handleFrame(s)}catch(s){this.tracer.wsEvent?.({kind:"lifecycle",event:"parse-error",detail:{error:String(s)}}),this.opts.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},i.onerror=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"error"}),this.opts.handlers.onError(0,"WebSocket error",!1)},i.onclose=o=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"close",detail:o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0}),this.connected=!1,this.ws=null,this.opts.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,this.tracer.wsEvent?.({kind:"lifecycle",event:"reconnect-scheduled",detail:{delayMs:n,attempt:this.reconnectAttempts}}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const i=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);i!==-1&&this.pendingSubscriptions.splice(i,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(i=>i.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,i){let o=this.transcriptSubscriptions.get(t);o===void 0&&(o=new Map,this.transcriptSubscriptions.set(t,o)),o.set(n,i!==void 0?{sinceSeq:i}:{}),this.connected&&this.sendTranscriptSubscribe(t,n)}unsubscribeTranscript(t,n){const i=this.transcriptSubscriptions.get(t);if(i!==void 0)if(n===void 0)this.transcriptSubscriptions.delete(t);else{for(const o of n)i.delete(o);i.size===0&&this.transcriptSubscriptions.delete(t)}!this.connected||!this.ws||this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}markSideChannelAgent(t,n){if(!this.opts.mainAgentOnly)return;let i=this.sideChannelAgents.get(t);if(i===void 0&&(i=new Set,this.sideChannelAgents.set(t,i)),i.has(n))return;i.add(n);const o=this.subscriptions.get(t);this.connected&&o!==void 0&&this.sendSubscribe([t],{[t]:o})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,i){const o=py(t,n),s=this.terminalAttachments.get(o),r=i??s?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,i){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:i}})}terminalResize(t,n,i,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:i,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(py(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(py(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,Vwe),i=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:i}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.opts.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,i=t.type;if(i==="transcript.reset"){const o=pq.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const r=o.data;this.opts.handlers.onTranscriptReset?.(s,r.agent_id,{...r.snapshot,hasMoreOlder:r.has_more_older},r.seq);const l=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==void 0&&r.seq!==void 0&&(l.sinceSeq=r.seq);return}if(i==="transcript.ops"){const o=mq.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const r=o.data,l=this.opts.handlers.onTranscriptOps?.(s,r.agent_id,r.ops,r.seq),a=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==!1&&a!==void 0&&r.seq!==void 0&&(a.sinceSeq=r.seq);return}switch(i){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.opts.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.opts.handlers.onRawAgentEvent?this.opts.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.opts.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":n.id===this.clientHelloId&&(this.clientHelloId=null,n.code===0&&this.opts.handlers.onReplayComplete?.());break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,r=n.seq,l=py(o,s),a=this.terminalAttachments.get(l);a&&this.terminalAttachments.set(l,{...a,lastSeq:Math.max(a.lastSeq,r)});const u=typeof n.payload?.data=="string"?n.payload.data:"";this.opts.handlers.onTerminalOutput?.(o,s,u,r);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,r=n.payload?.exit_code,l=typeof r=="number"?r:null;this.opts.handlers.onTerminalExit?.(o,s,l);break}default:{this.trackCursor(n);const o=n.type,s=Wwe(o,n.payload);if(s.route==="protocol"){this.opts.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.opts.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const r=n,l=n;this.opts.handlers.onRawAgentEvent({type:s.agentType,seq:r.seq,session_id:r.session_id,timestamp:r.timestamp,payload:r.payload,...l.volatile!==void 0?{volatile:l.volatile}:{},...l.offset!==void 0?{offset:l.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.opts.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;const i=this.nextId();this.clientHelloId=i,this.send({type:"client_hello",id:i,payload:{client_id:this.opts.clientId,subscriptions:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}});for(const o of this.transcriptSubscriptions.keys())this.sendTranscriptSubscribe(o);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}})}rawAgentFilter(t){return Object.fromEntries(t.map(n=>[n,["main",...this.sideChannelAgents.get(n)??[]]]))}sendTranscriptSubscribe(t,n){const i=this.transcriptSubscriptions.get(t);if(i===void 0||i.size===0)return;const o={},s={};for(const[r,l]of i)o[r]="delta",l.sinceSeq!==void 0&&(n===void 0||n===r)&&(s[r]=l.sinceSeq);this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:o,...Object.keys(s).length>0?{transcript_since:s}:{}}})}sendTerminalAttach(t,n,i){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:i>0?i:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,i=t.seq;if(typeof n!="string"||typeof i!="number")return;const o=this.subscriptions.get(n);if(!o||i<=o.seq&&o.epoch!==void 0)return;const s=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(i,o.seq),epoch:s})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),this.tracer.wsEvent?.({kind:"out",frame:t})}catch{}}nextId(){return`c_${++this.msgSeq}`}}function py(e,t){return`${e}\0${t}`}async function Kwe(e,t,n){const i=await e.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),o=Fwe.parse(i),s={items:o.items,tasks:o.tasks,interactions:o.interactions,attachments:o.attachments,todos:o.todos,prompts:o.prompts,meta:o.meta,hasMoreOlder:o.has_more};return{agentId:o.agent_id,...s,agents:o.agents,pendingInteractions:o.pending_interactions,...o.seq!==void 0?{seq:o.seq}:{}}}const G8=10485760,Zwe=5e3,bD=40001;function Gwe(e,t){if(e===void 0)return t;let n;const i=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(i!==void 0)try{n=decodeURIComponent(i.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function Qwe(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function Q8(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function wD(e){return e==="auto_compact"||e==="manual_compact"}class Ywe{constructor(t){this.opts=t,this.tracer=t.tracer??ex,this.http=new WN({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore}),this.httpV2=new WN({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore,restBasePath:"/api/v2"})}http;httpV2;tracer;async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,experimentalFlags:t.experimental_flags??{},backend:t.backend==="v2"?"v2":"v1",webTitle:t.web_title??""}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},i=await this.http.get("/sessions",n);return{items:i.items.map(gu),hasMore:i.has_more}}async listSessionsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),include:t?.include,"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionIdsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),fields:"id,archived","workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionGroupsV2(t){const n={view:"by_workspace","group.page_size":t?.groupPageSize,"meta.has_prompt":t?.hasPrompt===void 0?void 0:String(t.hasPrompt),sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,"meta.archived":t?.archived===void 0?void 0:String(t.archived),"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{groups:i.groups,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const i=await this.http.post("/sessions",n);return gu(i)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return gu(n)}async updateSession(t,n){const i={};n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(i.agent_config=o);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,i);return gu(s)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return AW(n)}async getSessionPlans(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript/plan`,{agent_id:n.agentId,tool_call_id:n.toolCallId});return i.plans.map(o=>({agentId:i.agent_id,toolCallId:o.tool_call_id,turnId:o.turn_id,source:o.source,plan:o.plan,...o.path!==void 0?{path:o.path}:{},...o.options!==void 0?{options:o.options.map(s=>({label:s.label,...s.description!==void 0?{description:s.description}:{}}))}:{},...o.review!==void 0?{review:{state:o.review.state,...o.review.selected_option!==void 0?{selectedOption:o.review.selected_option}:{},...o.review.feedback!==void 0?{feedback:o.review.feedback}:{}}}:{}}))}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return gu(n)}async archiveSessions(t){return this.httpV2.post("/sessions:archive",{ids:t})}async restoreSessions(t){return this.httpV2.post("/sessions:restore",{ids:t})}async listMessages(t,n){const i={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,i);return{items:o.items.map(wW),hasMore:o.has_more}}async getSessionTranscript(t,n){return Kwe(this.http,t,n)}async exportSession(t,n,i){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` +`).length,r=`/sessions/${encodeURIComponent(t)}/export`,l={web_log_bytes:o,web_log_entries:s},a=i?.desktop===!0;let u;try{u=await this.http.postZip(r,{web_log:n,...a?{desktop:!0}:{}},l)}catch(d){if(a&&Fi(d)&&d.code===bD)u=await this.http.postZip(r,{web_log:n},l);else throw d}const c=`${t}.zip`;return{blob:u.blob,fileName:Gwe(u.contentDisposition,c)}}async submitPrompt(t,n){const i=Date.now();this.tracer.traceKeyEvent?.("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Wke(n));return this.tracer.traceKeyEvent?.("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-i}),{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}catch(o){throw this.tracer.traceKeyEvent?.("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-i,...Qwe(o)}),o}}async steerPrompts(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:i.steered,promptIds:i.prompt_ids}}async abortPrompt(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:i.aborted,atSeq:i.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async generateSessionTitle(t,n){try{const i={};n?.force===!0&&(i.force=!0),n?.source!==void 0&&(i.source=n.source);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,i);return typeof o?.title=="string"&&o.title.length>0?o.title:null}catch{return null}}async forkSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,i,{timeoutMs:zN});return gu(o)}async createChildSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,i,{timeoutMs:zN});return gu(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(gu)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,qke(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,Qke(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const i={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,i)).items.map(s=>JC(s))}async getTask(t,n,i){const o={with_output:i?.withOutput,output_bytes:i?.outputBytes},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return JC(s)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async detachTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:detach`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(Q8)}async createTerminal(t,n={}){const i={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,i);return Q8(o)}async getTerminal(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Q8(i)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async activateSkill(t,n,i,o){const s={};i!==void 0&&i.length>0&&(s.args=i),o!==void 0&&o.length>0&&(s.attachments=o.map(CW));const r=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s);return{activated:r.activated,skillName:r.skill_name}}async listCapabilities(){return(await this.http.get("/capabilities")).capabilities??[]}async getCapability(t){return this.http.get(`/capabilities/${encodeURIComponent(t)}`)}async installCapability(t){return this.http.post(`/capabilities/${encodeURIComponent(t)}:install`,{})}async listPlugins(){return(await this.http.get("/plugins")).plugins??[]}async listPluginMarketplace(){return(await this.http.get("/plugins/marketplace")).entries??[]}async installPlugin(t){return this.http.post("/plugins",{source:t})}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:${n?"enable":"disable"}`,{})}async removePlugin(t){return this.http.post(`/plugins/${encodeURIComponent(t)}:remove`,{})}async listDirectory(t,n){const i={};n.path!==void 0&&(i.path=n.path),n.depth!==void 0&&(i.depth=n.depth),n.includeGitStatus!==void 0&&(i.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,i),s=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(VN)])):void 0;return{items:o.items.map(VN),childrenByPath:s,truncated:o.truncated}}async readFile(t,n){const i={path:n.path};n.offset!==void 0&&(i.offset=n.offset),n.length!==void 0&&(i.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,i);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:search",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async suggestFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:suggest",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const i={pattern:n.pattern};n.regex!==void 0&&(i.regex=n.regex),n.caseSensitive!==void 0&&(i.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,i);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const i={};n!==void 0&&(i.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,i);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:i.path,diff:i.diff,truncated:i.truncated??!1}}getFileDownloadUrl(t,n){const i=n.split("/").map(o=>encodeURIComponent(o)).join("/");return pd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/fs/${i}:download`)}async openFile(t,n){const i={path:n.path};return n.line!==void 0&&(i.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,i)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,i,o){const s={app_id:n,path:i};o!==void 0&&(s.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,s)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(p0)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const i=await this.http.post("/workspaces",n);return p0(i)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const i=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return p0(i)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(i=>({name:i.name,path:i.path,isDir:i.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(Jke)}async listProviders(){return(await this.http.get("/providers")).items.map(Mp)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),i=Mp(n);return n.api_key!==void 0?{...i,apiKey:n.api_key}:i}async addProvider(t){const n={id:t.id??"",type:t.type,models:(t.models??[]).map(o=>{const s={model:o.model,max_context_size:o.maxContextSize};return o.displayName!==void 0&&(s.display_name=o.displayName),o.capabilities!==void 0&&(s.capabilities=o.capabilities),o.maxOutputSize!==void 0&&(s.max_output_size=o.maxOutputSize),o.supportEfforts!==void 0&&(s.support_efforts=o.supportEfforts),o.adaptiveThinking!==void 0&&(s.adaptive_thinking=o.adaptiveThinking),s})};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const i=await this.http.post("/providers",n);return Mp(i)}async updateProvider(t,n){const i={type:n.type,models:(n.models??[]).map(s=>{const r={model:s.model,max_context_size:s.maxContextSize};return s.displayName!==void 0&&(r.display_name=s.displayName),s.capabilities!==void 0&&(r.capabilities=s.capabilities),s.maxOutputSize!==void 0&&(r.max_output_size=s.maxOutputSize),s.supportEfforts!==void 0&&(r.support_efforts=s.supportEfforts),s.adaptiveThinking!==void 0&&(r.adaptive_thinking=s.adaptiveThinking),r})};n.newId!==void 0&&(i.new_id=n.newId),n.apiKey!==void 0&&(i.api_key=n.apiKey),n.baseUrl!==void 0&&(i.base_url=n.baseUrl),n.defaultModel!==void 0&&(i.default_model=n.defaultModel);const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,i);return{provider:Mp(o.provider)}}async deleteProvider(t){return await this.http.delete(`/providers/${encodeURIComponent(t)}`),{deleted:t}}async listCatalogProviders(){return(await this.http.get("/catalog/providers")).items.map(KN)}async getCatalogProvider(t){const n=await this.http.get(`/catalog/providers/${encodeURIComponent(t)}`);return KN(n)}async importCatalogProvider(t){const n={catalog_id:t.catalogId};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.id!==void 0&&(n.id=t.id);const i=await this.http.post("/providers:import_catalog",n);return{provider:Mp(i.provider),modelsImported:i.models_imported}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const i=await this.http.post("/providers:import_registry",n);return{providers:i.providers.map(Mp),modelsImported:i.models_imported}}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return Y8(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return Y8(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return Y8(t)}async getConfig(){const t=await this.http.get("/config");return XC(t)}async setConfig(t){const n={},i={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[s,r]of Object.entries(t)){const l=i[s];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return XC(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(t){let n;try{n=await this.http.post("/oauth/login",t===void 0?{}:{region:t})}catch(i){if(t!==void 0&&Fi(i)&&i.code===bD)n=await this.http.post("/oauth/login",{});else throw i}return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at,errorMessage:t.error_message}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async getUsage(){const t=await this.http.get("/oauth/usage");if(t.kind==="error")return{kind:"error",message:t.message,status:t.status};const n=i=>({name:i.name,window:i.window,used:i.used,limit:i.limit,resetAt:i.reset_at});return{kind:"ok",summary:t.summary===null?null:n(t.summary),limits:t.limits.map(n),extraUsage:t.extra_usage===null?null:{balanceCents:t.extra_usage.balance_cents,totalCents:t.extra_usage.total_cents,monthlyChargeLimitEnabled:t.extra_usage.monthly_charge_limit_enabled,monthlyChargeLimitCents:t.extra_usage.monthly_charge_limit_cents,monthlyUsedCents:t.extra_usage.monthly_used_cents,currency:t.extra_usage.currency}}}async getUserInfo(){return this.http.get("/oauth/userinfo")}async getOAuthRegion(){try{const t=await Promise.race([this.http.get("/oauth/region"),new Promise((n,i)=>{setTimeout(()=>i(new Error("oauth region probe timed out")),Zwe)})]);return t.region==="mainland-cn"||t.region==="global"?t.region:null}catch{return null}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const i=await this.http.postForm("/files",n,t.onProgress===void 0?void 0:{onUploadProgress:t.onProgress});return{id:i.id,name:i.name,mediaType:i.media_type,size:i.size}}getFileUrl(t){return pd(this.opts.origin,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}getSessionMediaUrl(t,n){return pd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async getSessionMediaBlob(t,n){return this.http.getBlob(`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async readHostFileContent(t){const n=await this.http.getBlob("/fs:content",{path:t},{maxBytes:G8});if(n.size>G8)throw new tx({size:n.size,limit:G8});const i=n.type,o=!Jwe(i),s=i||(o?"application/octet-stream":"text/plain");if(o){const l=await Xwe(n);return{path:t,content:l,encoding:"base64",mime:s,isBinary:!0,size:n.size}}const r=await n.text();return{path:t,content:r,encoding:"utf-8",mime:s,isBinary:!1,size:n.size}}connectEvents(t){const n=$N(this.opts.origin,this.opts.identity.clientId),i=this.opts.projectorFactory(),o=new kD({wsUrl:n,clientId:this.opts.identity.clientId,tracer:this.tracer,credentialStore:this.opts.credentialStore,mainAgentOnly:this.opts.mainAgentOnly,handlers:{onWireEvent:s=>{const r=Xke(s),l=ebe(s),a=Yke(s);a.type==="historyCompacted"&&!wD(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:s=>{const{type:r,seq:l,session_id:a,payload:u,offset:c}=s,d=i.project(r,u,a,{offset:c});for(const f of d){const h=u?.turnId,m=f.type==="assistantDelta"&&typeof h=="number"&&typeof c=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:c,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!wD(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:m})}},onResync:(s,r,l)=>{i.reset(s),t.onResync(s,r,l)},onConnectionState:s=>{t.onConnectionChange(s)},onReplayComplete:()=>{t.onReplayComplete?.()},onError:(s,r,l)=>{t.onError(s,r,l)},onTerminalOutput:(s,r,l,a)=>{t.onTerminalOutput?.(s,r,l,a)},onTerminalExit:(s,r,l)=>{t.onTerminalExit?.(s,r,l)},onTranscriptReset:(s,r,l,a)=>{t.onTranscriptReset?.(s,r,l,a)},onTranscriptOps:(s,r,l,a)=>t.onTranscriptOps?.(s,r,l,a)??!0}});return o.connect(),{subscribe(s,r){o.subscribe(s,r??{seq:0})},unsubscribe(s){o.unsubscribe(s),i.forgetSession(s)},subscribeTranscript(s,r,l){o.subscribeTranscript(s,r,l)},unsubscribeTranscript(s,r){o.unsubscribeTranscript(s,r)},bindNextPromptId(s,r){i.bindNextPromptId(s,r)},abort(s,r){o.abort(s,r)},terminalAttach(s,r,l){o.terminalAttach(s,r,l)},terminalInput(s,r,l){o.terminalInput(s,r,l)},terminalResize(s,r,l,a){o.terminalResize(s,r,l,a)},terminalDetach(s,r){o.terminalDetach(s,r)},terminalClose(s,r){o.terminalClose(s,r)},markSideChannelAgent(s,r){o.markSideChannelAgent(s,r),i.markSideChannelAgent(r)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}connectTranscriptChannel(t){const n=`${this.opts.identity.clientId}-transcript`,i=new kD({wsUrl:$N(this.opts.origin,n),clientId:n,tracer:this.tracer,credentialStore:this.opts.credentialStore,handlers:{onWireEvent:()=>{},onResync:()=>{},onConnectionState:o=>t.onConnectionState?.(o),onError:(o,s,r)=>t.onError?.(o,s,r),onTranscriptReset:t.onTranscriptReset,onTranscriptOps:t.onTranscriptOps}});return i.connect(),{subscribe:()=>{},unsubscribe:()=>{},subscribeTranscript:(o,s,r)=>i.subscribeTranscript(o,s,r),unsubscribeTranscript:(o,s)=>i.unsubscribeTranscript(o,s),bindNextPromptId:()=>{},abort:()=>{},terminalAttach:()=>{},terminalInput:()=>{},terminalResize:()=>{},terminalDetach:()=>{},terminalClose:()=>{},markSideChannelAgent:()=>{},health:()=>i.health(),reconnect:()=>i.reconnect(),close:()=>i.close()}}}function Y8(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}function Jwe(e){const t=e.toLowerCase().split(";")[0].trim();return t===""||t==="text/plain"||t.startsWith("text/")?!0:/(json|xml|javascript|typescript|x-yaml|yaml|svg|x-sh|x-python|markdown|csv|html|css)$/.test(t)}function Xwe(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const o=typeof i.result=="string"?i.result:"";t(o.slice(o.indexOf(",")+1))},i.onerror=()=>n(i.error),i.readAsDataURL(e)})}const eCe="main",tCe=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function J8(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function nCe(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function CD(){return{turnPromptId:new Map,currentPromptId:void 0,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",subagentMeta:new Map,restartedThisRun:new Set,settledByKernel:new Set,retiredBindings:new Set,registrationSeq:0,registrationOrderByKey:new Map,retryActive:!1}}function Cr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function nr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function oa(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function iCe(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,i=n&&typeof n=="object"?n:{},o=Cr(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const s=Cr(t,"goalId")??Cr(t,"goal_id")??"goal",r=Cr(t,"objective")??"";return{goalId:s,objective:r,completionCriterion:Cr(t,"completionCriterion")??Cr(t,"completion_criterion"),status:o,turnsUsed:nr(t,"turnsUsed")??nr(t,"turns_used")??0,tokensUsed:nr(t,"tokensUsed")??nr(t,"tokens_used")??0,wallClockMs:nr(t,"wallClockMs")??nr(t,"wall_clock_ms")??0,terminalReason:Cr(t,"terminalReason")??Cr(t,"terminal_reason"),budget:{tokenBudget:oa(i,"tokenBudget")??oa(i,"token_budget"),remainingTokens:oa(i,"remainingTokens")??oa(i,"remaining_tokens"),turnBudget:oa(i,"turnBudget")??oa(i,"turn_budget"),remainingTurns:oa(i,"remainingTurns")??oa(i,"remaining_turns"),wallClockBudgetMs:oa(i,"wallClockBudgetMs")??oa(i,"wall_clock_budget_ms"),remainingWallClockMs:oa(i,"remainingWallClockMs")??oa(i,"remaining_wall_clock_ms"),overBudget:i.overBudget===!0||i.over_budget===!0}}}function sd(e,t,n,i,o){if(typeof i!="string"||i.length===0)return null;const r={...t.subagentMeta.get(i)??{id:i,agentId:i,sessionId:n,kind:"subagent",description:e("tasks.dockSubagent"),status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:i,sessionId:n,kind:"subagent"};return t.subagentMeta.set(i,r),r}function oCe(e,t,n){if(t==="turn.step.started")return null;if(t==="tool.use"||t==="tool.call.started"){const i=Cr(n,"name")??Cr(n,"toolName")??"tool",o=lP(e,sCe(i)),s=rCe(e,i,n.args??n.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(t==="tool.progress"){const i=n.update;if(i&&typeof i=="object"){const s=Cr(i,"text");if(s)return X8(s);const r=Cr(i,"message");if(r)return X8(r)}const o=Cr(n,"message");if(o)return X8(o)}return null}function sCe(e){return e.replace(/_\d+$/,"")}const AD=2e3;function X8(e){return e.length>AD?`${e.slice(0,AD)}…`:e}function rCe(e,t,n){if(n==null)return"";const i=typeof n=="string"?n:JSON.stringify(n);return z6(e,t,i)}function lCe(e,t,n,i,o,s,r){if(r.has(i)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const h=Cr(s,"delta");if(!h)return[];const m=t.subagentMeta.get(i),g=sd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:m?.startedAt??new Date().toISOString()}),v=[];return g&&v.push({type:"taskCreated",sessionId:n,task:g}),v.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:h,stream:"stdout",kind:"text"}),v}const l=oCe(e,o,s);if(l===null||l.length===0)return[];const a=o==="tool.progress"?s.update:void 0,u=a!=null&&typeof a=="object"?a.replace===!0:!1,c=t.subagentMeta.get(i),d=sd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:c?.startedAt??new Date().toISOString()}),f=[];return d&&f.push({type:"taskCreated",sessionId:n,task:d}),f.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:l,stream:"stdout",replace:u}),f}function aCe(e){return Array.isArray(e)?e.map(t=>nx(t)):[]}function uCe(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}const cCe=new Set(["session.meta.updated","goal.updated","compaction.completed","compaction.started","compaction.cancelled","compaction.blocked","hook.result","mcp.server.status","skill.activated","tool.list.updated"]);function dCe(e,t,n){switch(e){case"session.meta.updated":{const i=t?.patch?.title??t?.title,o=t?.patch?.lastPrompt,s={};return typeof i=="string"&&i.length>0&&(s.title=i),typeof o=="string"&&(s.lastPrompt=o),s.title!==void 0||s.lastPrompt!==void 0?[{type:"sessionMetaUpdated",sessionId:n,...s}]:[]}case"goal.updated":{const i=iCe(t?.snapshot??null);return[{type:"goalUpdated",sessionId:n,goal:i?.status==="complete"?null:i}]}case"compaction.completed":{const i=t?.result??{};return[{type:"compactionCompleted",sessionId:n,tokensBefore:typeof i.tokensBefore=="number"?i.tokensBefore:void 0,tokensAfter:typeof i.tokensAfter=="number"?i.tokensAfter:void 0,summary:typeof i.summary=="string"?i.summary:void 0},{type:"historyCompacted",sessionId:n,beforeSeq:0,reason:"auto_compact"}]}case"compaction.started":return[{type:"compactionStarted",sessionId:n,trigger:t?.trigger==="manual"?"manual":"auto",instruction:typeof t?.instruction=="string"?t.instruction:void 0}];case"compaction.cancelled":return[{type:"compactionCancelled",sessionId:n}];default:return[]}}function fCe(e){const{t}=e,n=new Map,i=new Set;function o(f){let h=n.get(f);return h||(h=CD(),n.set(f,h)),h}function s(f){n.set(f,CD())}function r(f){n.delete(f)}function l(f){return n.has(f)}function a(f){i.add(f)}function u(f,h){const m=o(f);m.currentPromptId=h}function c(f,h,m,g){try{return d(f,h,m,g)}catch(v){return Cu("[agentProjector] Error projecting event:",f,v instanceof Error?v.message:v),[]}}function d(f,h,m,g){if(cCe.has(f))return dCe(f,h,m);const v=o(m),y=h,b=[],C=y?.agentId;if(typeof C=="string"&&C!==eCe){const A=i.has(C);if(f==="prompt.submitted"){if(!A)return[];const T=y?.promptId,N=y?.userMessageId;if(!T||!N)return[];const _=aCe(y?.content);return _.length===0?[]:[{type:"messageCreated",agentId:C,message:{id:N,sessionId:m,role:"user",content:_,createdAt:typeof y?.createdAt=="string"?y.createdAt:new Date().toISOString(),promptId:T}}]}if(A&&(f==="thinking.delta"||f==="assistant.delta")){const T=y?.delta??"";return T?[{type:"agentDelta",sessionId:m,agentId:C,delta:{[f==="thinking.delta"?"thinking":"text"]:T}}]:[]}if(A&&f==="turn.ended")return[{type:"agentTurnEnded",sessionId:m,agentId:C,reason:y?.reason}];if(tCe.has(f))return lCe(t,v,m,C,f,y??{},i)}switch(f){case"turn.started":{const A=y?.turnId,T=v.currentPromptId??J8("pr_");v.currentPromptId=T,A!==void 0&&v.turnPromptId.set(A,T),b.push({type:"turnActiveChanged",sessionId:m,active:!0});break}case"turn.step.started":case"thinking.delta":case"assistant.delta":case"tool.use":case"tool.call.started":case"tool.call.delta":case"tool.progress":case"tool.result":break;case"turn.step.completed":{const A=nCe(y?.usage);v.totalInput+=A.input,v.totalOutput+=A.output,v.totalCacheRead+=A.cacheRead,v.totalCacheCreate+=A.cacheCreate;break}case"agent.status.updated":{y?.model&&(v.model=y.model),y?.contextTokens!==void 0&&(v.contextTokens=y.contextTokens),y?.maxContextTokens!==void 0&&(v.contextLimit=y.maxContextTokens);const A=y?.phase;A!=null&&A.kind==="retrying"?(v.retryActive=!0,b.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:nr(A,"failedAttempt")??0,nextAttempt:nr(A,"nextAttempt")??0,maxAttempts:nr(A,"maxAttempts")??0,delayMs:nr(A,"delayMs")??0,errorName:Cr(A,"errorName"),statusCode:nr(A,"statusCode"),turnId:nr(A,"turnId")}})):v.retryActive&&A!==void 0&&A!==null&&typeof A.kind=="string"&&(v.retryActive=!1,b.push({type:"turnRetry",sessionId:m,retry:void 0})),b.push({type:"sessionUsageUpdated",sessionId:m,usage:uCe(v),model:v.model||void 0,swarmMode:y?.swarmMode===!0?!0:y?.swarmMode===!1?!1:void 0,planMode:y?.planMode===!0?!0:y?.planMode===!1?!1:void 0,thinking:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:void 0});break}case"turn.ended":{const A=y?.turnId,T=(A!==void 0?v.turnPromptId.get(A):void 0)??v.currentPromptId;b.push({type:"turnActiveChanged",sessionId:m,active:!1,reason:y?.reason,promptId:T}),v.turnCount++,v.currentPromptId=void 0;break}case"prompt.completed":{const A=y?.promptId;typeof A=="string"&&A.length>0&&b.push({type:"promptCompleted",sessionId:m,promptId:A,reason:y?.reason??"completed"});break}case"prompt.aborted":{const A=y?.promptId;typeof A=="string"&&A.length>0&&b.push({type:"promptAborted",sessionId:m,promptId:A});break}case"turn.step.retrying":{v.retryActive=!0,b.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:nr(y??{},"failedAttempt")??0,nextAttempt:nr(y??{},"nextAttempt")??0,maxAttempts:nr(y??{},"maxAttempts")??0,delayMs:nr(y??{},"delayMs")??0,errorName:Cr(y??{},"errorName"),statusCode:nr(y??{},"statusCode"),turnId:typeof y?.turnId=="number"?y.turnId:void 0}});break}case"turn.step.interrupted":break;case"subagent.spawned":{const A=typeof y?.subagentId=="string"&&y.subagentId.length>0?y.subagentId:J8("task_"),T=typeof y?.taskId=="string"&&y.taskId.length>0?y.taskId:void 0,N=T!==void 0&&T!==A?v.subagentMeta.get(T):void 0,_=v.subagentMeta.get(A);N!==void 0&&v.subagentMeta.delete(T),T!==void 0&&!v.registrationOrderByKey.has(T)&&v.registrationOrderByKey.set(T,++v.registrationSeq);const w=_===void 0||N===void 0?_??N:{..._,createdAt:N.createdAt,startedAt:N.startedAt??_.startedAt,runInBackground:!0,backgroundTaskId:_.backgroundTaskId??T},M=w?.backgroundTaskId??(w!==void 0&&T!==void 0&&w.id===T?T:void 0),x=T!==void 0?v.registrationOrderByKey.get(T):void 0,E=M!==void 0?v.registrationOrderByKey.get(M):void 0,I=v.retiredBindings.has(T??"")||x!==void 0&&E!==void 0&&x0?y.model:w?.model,thinkingEffort:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:w?.thinkingEffort,parentToolCallId:typeof y?.parentToolCallId=="string"?y.parentToolCallId:w?.parentToolCallId,swarmIndex:typeof y?.swarmIndex=="number"?y.swarmIndex:w?.swarmIndex,runInBackground:F?y?.runInBackground===!0||y?.runInBackground===void 0&&w?.runInBackground===!0:y?.runInBackground===!0||w?.runInBackground===!0,outputPreview:F?void 0:w?.outputPreview,outputBytes:F?void 0:w?.outputBytes,outputLines:F?void 0:w?.outputLines,suspendedReason:F?void 0:w?.suspendedReason,text:F?void 0:w?.text,backgroundTaskId:I?w?.backgroundTaskId:F?T:T??w?.backgroundTaskId};v.subagentMeta.set(P.id,P),b.push({type:"taskCreated",sessionId:m,task:P});break}case"subagent.started":{const A=typeof y?.subagentId=="string"?y.subagentId:void 0,T=A!==void 0&&(v.subagentMeta.get(A)?.status!==void 0&&v.subagentMeta.get(A).status!=="running"||v.settledByKernel.has(A));T&&v.settledByKernel.delete(A);const N=sd(t,v,m,y?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString(),suspendedReason:void 0,...T?{createdAt:new Date().toISOString(),completedAt:void 0,completedAtEstimated:void 0,outputPreview:void 0,outputBytes:void 0,outputLines:void 0,text:void 0}:{}});T&&A!==void 0&&v.restartedThisRun.add(A),N&&b.push({type:"taskCreated",sessionId:m,task:N});break}case"subagent.suspended":{const A=sd(t,v,m,y?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof y?.reason=="string"?y.reason:void 0});A&&b.push({type:"taskCreated",sessionId:m,task:A});break}case"subagent.completed":{const A=typeof y?.resultSummary=="string"?y.resultSummary:void 0,T=sd(t,v,m,y?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:A});T&&b.push({type:"taskCreated",sessionId:m,task:T}),T!==null&&v.restartedThisRun.delete(T.id),b.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"completed",outputPreview:A});break}case"subagent.failed":{const A=typeof y?.error=="string"?y.error:void 0,T=sd(t,v,m,y?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:A});T&&b.push({type:"taskCreated",sessionId:m,task:T}),T!==null&&v.restartedThisRun.delete(T.id),b.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"failed",outputPreview:A});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:y?.code,message:y?.message,name:y?.name,details:y?.details,retryable:y?.retryable}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:y?.message}});break}case"task.started":case"background.task.started":{const A=y?.info??{},T=typeof A.startedAt=="number"?new Date(A.startedAt).toISOString():void 0,N=typeof A.taskId=="string"?A.taskId:typeof A.taskId=="number"?String(A.taskId):J8("task_"),_=typeof A.description=="string"?A.description:typeof A.command=="string"?A.command:t("tasks.defaultDescription");if(A.kind==="agent"){const M=typeof A.agentId=="string"&&A.agentId.length>0?A.agentId:void 0;if(M!==void 0){const x=v.subagentMeta.get(M),E=v.registrationOrderByKey.get(N),I=x?.backgroundTaskId!==void 0?v.registrationOrderByKey.get(x.backgroundTaskId):void 0;if(v.retiredBindings.has(N)||E!==void 0&&I!==void 0&&EI.backgroundTaskId===N);if(x===void 0&&(v.retiredBindings.has(N)||v.registrationOrderByKey.has(N)&&v.registrationOrderByKey.get(N)0&&v.settledByKernel.add(A.agentId),b.push({type:"taskCompleted",sessionId:m,taskId:typeof A.taskId=="string"?A.taskId:typeof A.taskId=="number"?String(A.taskId):"",status:A.status==="killed"?"cancelled":T?"failed":"completed"});break}}return b}return{project:c,bindNextPromptId:u,reset:s,forgetSession:r,markSideChannelAgent:a,hasSessionState:l}}function hCe(e){return new Ywe({origin:e.origin,identity:e.identity,tracer:e.tracer,credentialStore:e.credentialStore,projectorFactory:()=>fCe({t:e.t}),mainAgentOnly:e.mainAgentOnly})}const pCe={t:e=>e},xD="Sub Agent";function mCe(){return{sessions:[],activeSessionId:void 0,approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},turnErrorBySession:{},turnRetryBySession:{},compactionBySession:{},warnings:[]}}function gCe(e){return{...e,sessions:e.sessions,approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},turnErrorBySession:{...e.turnErrorBySession},turnRetryBySession:{...e.turnRetryBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function vCe(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const i=e.lastSeqBySession[t]??0;n>i&&(e.lastSeqBySession[t]=n)}}function my(e,t){const n=e.sessions.find(i=>i.id===t.sessionId)?.lastSeq??0;return t.seq>Math.max(e.lastSeqBySession[t.sessionId]??0,n)}const yCe={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function oA(e,t){const n=[],i=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};i(t("warnings.details.code"),e.code);const o=e.details??{};i(t("warnings.details.status"),o.statusCode),i(t("warnings.details.requestId"),o.requestId),i(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(o))r==="statusCode"||r==="requestId"||i(r,l);const s=(e.code!==void 0?yCe[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${s}`),message:e.message,details:n.length>0?n:void 0}}function kCe(e,t,n,i=pCe){const o=gCe(e);switch(vCe(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(r=>r.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?{...t.session,pullRequest:s.pullRequest}:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],delete o.turnErrorBySession[s],delete o.turnRetryBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{if(!my(e,n))break;let s;o.sessions=o.sessions.map(r=>r.id!==t.sessionId?r:(s=t.pendingInteraction??(t.busy?r.pendingInteraction:"none"),{...r,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?r.mainTurnActive:!1),pendingInteraction:s,lastTurnReason:t.lastTurnReason})),s==="none"?(delete o.approvalsBySession[t.sessionId],delete o.questionsBySession[t.sessionId]):s==="question"&&delete o.approvalsBySession[t.sessionId],t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&(delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId]);break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const r=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:r}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,{[s]:r,...l}=o.compactionBySession;o.compactionBySession=l;break}case"compactionCancelled":{const{[t.sessionId]:s,...r}=o.compactionBySession;o.compactionBySession=r;break}case"messageCreated":case"messageUpdated":case"assistantDelta":case"toolOutput":break;case"approvalRequested":{const s=t.sessionId,r=o.approvalsBySession[s]??[];r.some(u=>u.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...r,t.approval]);const a=t.approval.display;a?.kind==="plan_review"&&typeof a.plan=="string"&&a.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:a.plan,path:typeof a.path=="string"?a.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,r=t.approvalId,l=o.approvalsBySession[s]??[];o.approvalsBySession[s]=l.filter(a=>a.approvalId!==r);break}case"questionRequested":{const s=t.sessionId,r=o.questionsBySession[s]??[];r.some(a=>a.questionId===t.question.questionId)||(o.questionsBySession[s]=[...r,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,r=t.questionId,l=o.questionsBySession[s]??[];o.questionsBySession[s]=l.filter(a=>a.questionId!==r);break}case"taskCreated":{const s=t.sessionId,r=o.tasksBySession[s]??[],l=r.findIndex(f=>f.id===t.task.id),a=t.task.backgroundTaskId===void 0?-1:r.findIndex(f=>f.id===t.task.backgroundTaskId),u=a!==-1&&l!==-1&&a!==l?r[a]:void 0,c=u!==void 0?r.filter((f,h)=>h!==a):r,d=c.findIndex(f=>f.id===t.task.id||t.task.backgroundTaskId!==void 0&&f.id===t.task.backgroundTaskId);if(d===-1)o.tasksBySession[s]=[...c,t.task];else{const f=[...c],h=c[d],m=t.task.backgroundTaskId!==void 0&&(t.task.backgroundTaskId===h.backgroundTaskId||h.id===t.task.backgroundTaskId)||h.id===t.task.id&&(h.kind!=="subagent"||h.agentId===void 0),g=(m&&h.status!=="running"?h:void 0)??(u!==void 0&&u.status!=="running"?u:void 0),v=g!==void 0&&(t.task.status==="running"||t.task.status!==g.status),y=!m&&h.status!=="running"||t.task.backgroundTaskId!==void 0&&h.backgroundTaskId!==void 0&&t.task.backgroundTaskId!==h.backgroundTaskId,b=m&&h.completedAt!==void 0&&h.completedAtEstimated!==!0;f[d]={...t.task,status:v?g.status:t.task.status,subagentPhase:v?g.subagentPhase:t.task.subagentPhase,completedAt:v?g.completedAt:b?h.completedAt:t.task.completedAt,completedAtEstimated:v?g.completedAtEstimated:b?h.completedAtEstimated:t.task.completedAtEstimated,outputLines:v?g.outputLines:y?u?.outputLines??t.task.outputLines:h.outputLines??u?.outputLines??t.task.outputLines,text:v?g.text:y?u?.text??t.task.text:h.text??u?.text??t.task.text,outputPreview:v?g.outputPreview:t.task.outputPreview??(y?u?.outputPreview:h.outputPreview??u?.outputPreview),outputBytes:v?g.outputBytes:t.task.outputBytes??(y?u?.outputBytes:h.outputBytes??u?.outputBytes),description:t.task.description===xD&&h.description!==xD?h.description:t.task.description,swarmIndex:t.task.swarmIndex??h.swarmIndex,parentToolCallId:t.task.parentToolCallId??h.parentToolCallId,subagentType:t.task.subagentType??h.subagentType,model:t.task.model??h.model,thinkingEffort:t.task.thinkingEffort??h.thinkingEffort,runInBackground:y?t.task.runInBackground:t.task.runInBackground??h.runInBackground,backgroundTaskId:y?t.task.backgroundTaskId:t.task.backgroundTaskId??h.backgroundTaskId,agentId:t.task.agentId??h.agentId},o.tasksBySession[s]=f}break}case"taskProgress":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>{if(l.id!==t.taskId)return l;if(l.kind==="subagent"&&t.kind==="text")return{...l,text:(l.text??"")+t.outputChunk};const a=l.outputLines??[];if(t.replace===!0){const c=a.length>0?[...a.slice(0,-1),t.outputChunk]:[t.outputChunk];return{...l,outputLines:c}}if(a.at(-1)===t.outputChunk)return l;const u=[...a,t.outputChunk];return{...l,outputLines:l.kind==="subagent"?u:u.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>l.id!==t.taskId&&l.backgroundTaskId!==t.taskId||t.status==="completed"&&(l.status==="cancelled"||l.status==="failed")||t.status==="failed"&&l.status==="cancelled"?l:{...l,status:t.status,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,outputPreview:t.outputPreview??l.outputPreview,outputBytes:t.outputBytes??l.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{if(!my(e,n))break;if(o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active)o.turnActiveBySession[t.sessionId]=!0,delete o.turnErrorBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];else{delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];const s=t.reason===void 0||t.reason==="completed"?"completed":"failed",r=o.tasksBySession[t.sessionId];r!==void 0&&(o.tasksBySession[t.sessionId]=r.map(l=>l.kind!=="subagent"||l.status!=="running"||l.runInBackground===!0?l:{...l,status:s,subagentPhase:s,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,suspendedReason:void 0}))}break}case"turnRetry":{if(!my(e,n))break;t.retry===void 0?delete o.turnRetryBySession[t.sessionId]:o.turnRetryBySession[t.sessionId]=t.retry;break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError){if(my(e,n)){if(n.sessionId!==void 0){const r=s.details??{};o.turnErrorBySession[n.sessionId]={code:s.code,message:s.message,name:s.name,retryable:s.retryable,statusCode:typeof r.statusCode=="number"?r.statusCode:void 0,requestId:typeof r.requestId=="string"?r.requestId:void 0}}(n.sessionId===void 0||n.sessionId!==e.activeSessionId)&&(o.warnings=[...o.warnings,oA(s,i.t)])}}else if(s&&s._agentWarning){const r=s.message??s.code??i.t("warnings.agentWarningFallback");o.warnings=[...o.warnings,`${i.t("warnings.noteLabel")}: ${r}`]}else{const r=s?.type??"(unknown)";o.warnings=[...o.warnings,i.t("warnings.unhandledEvent",{type:r})]}break}}return o}function bCe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n]*)>([\s\S]*?)<\/notification>/g,CCe=/([\w-]+)="([^"]*)"/g,ACe=/]*)>[\s\S]*?<\/output-file>/,xCe=/]*)>([\s\S]*?)<\/output-preview>/,SCe=/^Title: (.*)$/m,_Ce=/^Severity: (.*)$/m;function a9(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function e5(e){const t={};for(const n of e.matchAll(CCe))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=a9(n[2]));return t}function MCe(e,t,n){const i=e5(e),o=SCe.exec(t)?.[1]?.trim()??"",s=_Ce.exec(t)?.[1]?.trim()??"";let r=t.split(` +`).filter(f=>!f.startsWith("Title: ")&&!f.startsWith("Severity: ")).join(` +`);const l=r.search(/^<\w/m);l!==-1&&(r=r.slice(0,l)),r=r.trim();const a=ACe.exec(t),u=a?(()=>{const f=e5(a[1]??""),h=Number(f.bytes);return f.path!==void 0&&f.path!==""?{path:f.path,bytes:Number.isFinite(h)?h:void 0}:void 0})():void 0,c=xCe.exec(t),d=c?(()=>{const f=e5(c[1]??""),h=(c[2]??"").replace(/^\n/,""),m=h.indexOf(` +`),g=a9(m===-1?"":h.slice(m+1)).replace(/\n$/,""),v=Number(f.bytes),y=Number(f.total_bytes);return{text:g,bytes:Number.isFinite(v)?v:void 0,totalBytes:Number.isFinite(y)?y:void 0,truncated:f.truncated==="true"?!0:f.truncated==="false"?!1:void 0}})():void 0;return{id:i.id??"",category:i.category??"",type:i.type??"",sourceKind:i.source_kind??"",sourceId:i.source_id??"",agentId:i.agent_id,title:a9(o),severity:s,body:a9(r),outputFile:u,outputPreview:d,raw:n}}function ICe(e){if(!e.includes("SD||s>SD||(o+1)*(s+1)>LCe)return null;const r=Array.from({length:o+1},()=>Array.from({length:s+1},()=>0));for(let h=1;h<=o;h++)for(let m=1;m<=s;m++)r[h][m]=n[h-1]===i[m-1]?r[h-1][m-1]+1:Math.max(r[h-1][m],r[h][m-1]);const l=[];let a=o,u=s;for(;a>0||u>0;)a>0&&u>0&&n[a-1]===i[u-1]?(l.push({type:"context",text:n[a-1]}),a--,u--):u>0&&(a===0||r[a][u-1]>=r[a-1][u])?(l.push({type:"add",text:i[u-1]}),u--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const c=[];let d=1,f=1;for(const h of l)h.type==="context"?(c.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(c.push({type:"add",text:h.text,newNo:f}),f++):(c.push({type:"del",text:h.text,oldNo:d}),d++);return c}const _D=500;function MD(e,t){const n=[],i=zu(e),o=zu(t),s=Math.min(i.length,_D),r=Math.min(o.length,_D);for(let l=1;l<=s;l++)n.push({type:"del",text:i[l-1],oldNo:l});i.length>s&&n.push({type:"context",text:`… ${i.length-s} more lines …`});for(let l=1;l<=r;l++)n.push({type:"add",text:o[l-1],newNo:l});return o.length>r&&n.push({type:"context",text:`… ${o.length-r} more lines …`}),n}function yq(e){let t=0,n=0;for(const i of e)i.type==="add"?t++:i.type==="del"&&n++;return{added:t,removed:n}}const NCe=/^read[_-]?media(?:file)?$/i,DCe=/^data:([^;]+);base64,(.*)$/s,FCe=/^<(image|video|audio)\s+path="([^"]+)">$/,BCe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,RCe=/Mime type:\s*([^.\s]+)/i,OCe=/Size:\s*(\d+)\s*bytes/i,$Ce=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,PCe="Image compressed to fit model limits:",zCe=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function jCe(e){return e.includes(PCe)?e.replace(zCe,""):e}function HCe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function ID(e){const t=BCe.exec(e.trim());return t?{kind:t[1],path:HCe(t[2])}:null}const kq=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,WCe=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function rA(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),i=n>0?t.slice(0,n):t;return kq.test(i)?i:void 0}const qCe=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function TD(e){const t=qCe.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",i=WCe.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:i!==void 0&&kq.test(i)?i:void 0}}const UCe=/(?=0&&e[i]==="\\";)n+=1,i-=1;return n%2===1}function bq(e){let t="",n=0,i=0;for(;i0?t:void 0}return[JSON.stringify(e)]}}function eAe(e,t){if(Er(e)==="task")for(const n of t??[]){const i=/^agent_id:\s*(\S+)\s*$/.exec(n);if(i?.[1])return i[1]}}function tAe(e,t){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,kind:e.kind,subagentType:e.subagentType,prompt:e.command??t,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase??"working",status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function wq(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const i=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:i,diff:t.diff};const o=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,s=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(o!==void 0&&s!==void 0){const r=Nk(o,s)??MD(o,s);return{kind:"diff",path:i,diff:r}}return{kind:"diff",path:i,diff:[]}}if(n==="file_io"){const i=typeof t.path=="string"?t.path:"",o=typeof t.operation=="string"?t.operation:"";if(o==="write"&&typeof t.content=="string")return{kind:"file",path:i,content:t.content};if(o==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=Nk(t.before,t.after)??MD(t.before,t.after);return{kind:"diff",path:i,diff:r}}const s=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o||n,path:i,detail:s}}if(n==="shell"||n==="command"){const i=typeof t.command=="string"?t.command:e.action;return{kind:"shell",command:i,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:Gre(i)}}if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(s=>{const r=s??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const i=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},u=typeof a.label=="string"?a.label:"";if(!u)return null;const c=typeof a.description=="string"?a.description:void 0;return{label:u,description:c}}).filter(l=>l!==null);return{kind:"plan_review",plan:i,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Cq(e){const t=` +`,n=` +`,i=e.indexOf(t),o=e.lastIndexOf(n);return i>=0&&o>=i+t.length?e.slice(i+t.length,o):nAe(e)}function nAe(e){const t=e.split(` +`);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` +`):e}function iAe(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function oAe(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` +`);return Cq(t)}function sAe(e,t){const n=e.metadata?.origin??{},i=oAe(e);return t==="cron_missed"?{text:i,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:i,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function rAe(e,t,n){const{text:i,cron:o}=sAe(e,n);return{id:e.id,role:"cron",no:t,text:i,createdAt:e.createdAt,cron:o}}function lAe(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function aAe(e){return e.metadata?.origin?.kind==="compaction_summary"}function uAe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function cAe(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function dAe(e){const t=[];for(const n of e){const i=t.at(-1);n.type==="text"&&i?.type==="text"?i.text+=n.text:n.type==="thinking"&&i?.type==="thinking"?i.thinking+=n.thinking:n.type==="thinking"?t.push({type:"thinking",thinking:n.thinking}):t.push({...n})}return JSON.stringify(t)}function d4(e,t,n,i=!0,o={},s={},r){const l=[];let a=r?.startNo??1;const u=r?.collect,c=new Map;for(const g of t)c.set(g.toolCallId,g);let d=null;function f(g=!1){if(!d)return;const v=d;if(d=null,!g&&v.blocks.length===0&&v.textParts.length===0&&v.thinkingParts.length===0&&v.tools.length===0)return;if(!g||!i)for(let b=0;bN.kind==="tool"&&N.tool.id===A.id);T&&T.kind==="tool"&&(T.tool=A)}const y={id:v.id,role:"assistant",no:a++,text:v.textParts.join(` +`),thinking:v.thinkingParts.length>0?v.thinkingParts.join(` +`):void 0,tools:v.tools.length>0?v.tools:void 0,blocks:v.blocks.length>0?v.blocks:void 0,approval:v.approval,approvalId:v.approvalId,durationMs:v.durationMs,createdAt:v.createdAt,endedAt:v.endedAt,goalContinuation:v.goalContinuation};l.push(y),u?.(y,v.sources)}function h(g,v){let y=null;for(const b of v)if(b.type==="text"){if(b.text){y==="text"?g.textParts[g.textParts.length-1]+=b.text:g.textParts.push(b.text);const C=g.blocks.at(-1);C&&C.kind==="text"?C.text+=(y==="text"?"":` +`)+b.text:g.blocks.push({kind:"text",text:b.text}),y="text"}}else if(b.type==="thinking"){if(b.thinking){y==="thinking"?g.thinkingParts[g.thinkingParts.length-1]+=b.thinking:g.thinkingParts.push(b.thinking);const C=g.blocks.at(-1);if(C&&C.kind==="thinking"){C.thinking+=(y==="thinking"?"":` +`)+b.thinking;const A=[C.startedAt,b.startedAt].filter(_=>_!==void 0).sort()[0],T=C.startedAt!==void 0&&C.durationMs===void 0||b.startedAt!==void 0&&b.durationMs===void 0,N=[C,b].flatMap(_=>_.startedAt!==void 0&&_.durationMs!==void 0?[Date.parse(_.startedAt)+_.durationMs]:[]);C.startedAt=A,C.durationMs=!T&&A!==void 0&&N.length>0?Math.max(...N)-Date.parse(A):void 0}else g.blocks.push({kind:"thinking",thinking:b.thinking,startedAt:b.startedAt,durationMs:b.durationMs});y="thinking"}}else if(b.type==="toolUse"){y=null;const C=c.get(b.toolCallId),A=b.toolName==="ExitPlanMode"?s[b.toolCallId]:void 0,T={id:b.toolCallId,name:b.toolName,arg:typeof b.input=="string"?b.input:JSON.stringify(b.input),agentId:Er(b.toolName)==="task"?b.agentRefs?.find(N=>N.role!=="member")?.agentId??b.agentRefs?.[0]?.agentId:void 0,status:"running",output:b.outputLines,plan:A,planPath:b.toolName==="ExitPlanMode"?A?.path??o[b.toolCallId]?.path:void 0};g.tools.push(T),g.blocks.push({kind:"tool",tool:T}),C&&(g.approval=wq(C),g.approvalId=C.approvalId)}else if(b.type==="toolResult"){y=null;const C=g.tools.findIndex(A=>A.id===b.toolCallId);if(C!==-1){const A=g.tools[C],T=yx(b.output),N={...A,status:b.isError?"error":"ok",output:T,media:b.isError?void 0:XCe(A.name,b.output),agentId:A.agentId??eAe(A.name,T)};N.name==="ExitPlanMode"&&!N.planPath&&(N.planPath=cAe(N.output)),g.tools[C]=N;const _=g.blocks.find(w=>w.kind==="tool"&&w.tool.id===b.toolCallId);_&&_.kind==="tool"&&(_.tool=N)}}else y=null}function m(g,v){if(g.type==="image"||g.type==="video"){const y=g.type,b=g.source;if(b.kind==="url")return{url:b.url,kind:y};if(b.kind==="base64")return{url:`data:${b.mediaType};base64,${b.data}`,kind:y};if(b.kind==="file"&&n)return{url:n(b.fileId),kind:y,fileId:b.fileId};if(b.kind==="sessionMedia")return{url:r?.getSessionMediaUrl?.(v,b.fileId)??"",kind:y,fileId:b.fileId,sessionId:v}}if(g.type==="file"&&n){if(g.mediaType.startsWith("image/"))return{url:n(g.fileId),kind:"image",fileId:g.fileId};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video",fileId:g.fileId}}}for(const g of e){if(g.role==="system")continue;if(aAe(g)){f();const A=g.metadata?.[gq],T={id:g.id,role:"compaction",no:a,text:g.content.filter(N=>N.type==="text").map(N=>N.text).join(` +`),compaction:{trigger:A?.trigger,tokensBefore:A?.tokensBefore,tokensAfter:A?.tokensAfter}};l.push(T),u?.(T,[g]);continue}if(g.role==="user"){const A=iAe(g),T=g.metadata?.origin?.kind,N=T==="skill_activation"&&g.metadata?.origin?.trigger!=="user-slash";if(A===void 0&&(T==="injection"||N))continue;if(A===void 0&&(T==="task"||T==="background_task"||T==="task_notification")){const Q=g.content.filter(ge=>ge.type==="text").map(ge=>ge.text).join(` +`),ne=TCe(g.metadata),te=ne!==void 0?[ne]:ICe(Q);if(te.length>0){d??={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt};for(const ge of te)d.blocks.push({kind:"notification",notification:{...ge,createdAt:g.createdAt}})}continue}if(f(),A!==void 0){const Q=rAe(g,a++,A);l.push(Q),u?.(Q,[g]);continue}if(T==="system_trigger"&&g.metadata?.origin?.name==="goal_continuation"){d={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt,goalContinuation:!0};continue}if(!lAe(g))continue;const _=g.metadata?.origin,w=_?.kind==="skill_activation"&&_?.trigger==="user-slash",M=_?.kind==="plugin_command"&&_?.trigger==="user-slash",x=[],E=[];for(const Q of g.content){if(Q.type==="text")if(w){const te=ID(Q.text);if(te&&(te.kind==="video"||te.kind==="image")&&n){const Ae=rA(te.path);if(Ae){E.push({url:n(Ae),kind:te.kind,fileId:Ae});continue}}const ge=TD(Q.text);ge&&E.push({kind:"file",url:ge.fileId&&n?n(ge.fileId):"",fileId:ge.fileId,name:ge.name,mediaType:ge.mediaType,size:ge.size})}else if(M)x.push(_.commandArgs??"");else{const te=ID(Q.text);if(te&&(te.kind==="video"||te.kind==="image")&&n){const me=rA(te.path);if(me){E.push({url:n(me),kind:te.kind,fileId:me});continue}}const ge=TD(Q.text);if(ge){E.push({kind:"file",url:ge.fileId&&n?n(ge.fileId):"",fileId:ge.fileId,name:ge.name,mediaType:ge.mediaType,size:ge.size});continue}const Ae=jCe(Q.text);if(Ae!==Q.text&&Ae.trim().length===0)continue;x.push(Ae)}const ne=m(Q,g.sessionId);if(ne){E.push({url:ne.url,kind:ne.kind,name:Q.type==="file"?Q.name:void 0,fileId:ne.fileId,sessionId:ne.sessionId});continue}Q.type==="file"&&n&&E.push({kind:"file",url:n(Q.fileId),fileId:Q.fileId,name:Q.name,mediaType:Q.mediaType||void 0,size:Q.size})}const I=w?_?.skillArgs??"":x.join(` +`),F=ZCe(I),W=GCe(I),P=E.filter(Q=>Q.kind==="file"),O=E.filter(Q=>Q.kind==="image"||Q.kind==="video"),R=[...F].some(Q=>Q<=P.length),z=[...W].some(Q=>Q<=O.length),H=R||z?E:[];let j=0,K=0;const re=E.filter(Q=>Q.kind==="file"?(j+=1,!(R&&F.has(j))):Q.kind==="image"||Q.kind==="video"?(K+=1,!(z&&W.has(K))):!0),q={id:g.id,role:"user",no:a++,text:I,attachments:re.length>0?re:void 0,inlineAttachments:H.length>0?H:void 0,skillActivation:w?{name:_.skillName,args:_.skillArgs}:void 0,pluginCommand:M?{pluginId:_.pluginId,commandName:_.commandName,args:_.commandArgs}:void 0,createdAt:g.createdAt};l.push(q),u?.(q,[g]);continue}if(g.role==="tool"){d&&(d.sources.push(g),h(d,g.content),d.endedAt=g.createdAt);continue}const v=g.promptId;uAe(d,v)?d!==null&&d.promptId===void 0&&v!==void 0&&(d.promptId=v):(f(),d={id:g.id,promptId:v,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[],durationMs:g.durationMs,createdAt:g.createdAt});const b=d;if(b===null)continue;const C=dAe(g.content);b.promptId!==void 0&&b.seenSigs.has(C)||(b.seenSigs.add(C),b.sources.push(g),g.durationMs!==void 0&&(b.durationMs=g.durationMs),h(b,g.content),g.endedAt!==void 0?b.endedAt=g.endedAt:g.id!==b.id&&(b.endedAt=g.createdAt))}return f(!0),l}function Aq(e,t,n){return e.state==="running"&&e.frames.at(-1)===t&&!n}function fAe(e,t){if(t.size===0)return;let n=!1;for(const l of t.values())if(l.settledAt===void 0){n=!0;break}if(!n)return;const i=new Date().toISOString(),o=e.items.findLast(l=>l.kind==="turn"&&l.state==="running"),s=o?.kind==="turn"?o.steps.findLast(l=>l.state==="running"):void 0,r=e.interactions.some(l=>l.state==="pending");for(const l of e.items)if(l.kind==="turn")for(const a of l.steps){const u=r&&a===s;for(const c of a.frames){if(c.kind!=="thinking")continue;const d=t.get(c.frameId);d===void 0||d.settledAt!==void 0||Aq(a,c,u)||(d.settledAt=i)}}}function hAe(e,t){if(t.size===0)return;const n=new Set;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind==="thinking"&&n.add(s.frameId);for(const i of[...t.keys()])n.has(i)||t.delete(i)}function pAe(e,t,n,i){const o=e.items.filter(d=>d.kind==="turn"),s=o[0]?.turnId,r=o.length===1?s:void 0,l=new Map(e.tasks.map(d=>[d.taskId,d])),a=new Map(e.prompts.map(d=>[d.promptId,d])),u=e.items.flatMap(d=>d.kind==="turn"?kx(d,e.attachments,l,d.turnId===s?n?.createdAt:void 0,d.turnId===r?n?.disposedAt:void 0,i?.sessionId,{promptById:a}):[]),c=e.meta.activity==="turn";return d4(u,[],t,c,{},{},{getSessionMediaUrl:i?.getSessionMediaUrl}).map(gAe)}function kx(e,t,n,i,o,s="",r){const l=[],a=new Map(t.map(v=>[v.attachmentId,v])),u=lA([e.startedAt,...e.steps.map(v=>v.startedAt),i])??"",c=ED(e.endedAt)??ED(o),d=e.turnId,f=e.origin.payload??e.origin,h=(e.attachmentIds??[]).length>0;if(e.prompt!==void 0&&e.prompt.length>0||h){const v=e.prompt!==void 0&&e.prompt.length>0?[{type:"text",text:e.prompt}]:[];for(const y of e.attachmentIds??[]){const b=LD(a.get(y));b!==void 0&&v.push(b)}l.push({id:`${e.turnId}:input`,sessionId:s,role:"user",content:v,createdAt:u,promptId:d,metadata:r?.includeOrigin===!0||e.origin.kind==="task"&&(e.prompt??"").includes("0;if(y.text.length===0&&!b)continue;if(y.role==="user"){if(y.taskId!==void 0){const T=mAe(y.taskId,y.text,n.get(y.taskId));l.push({id:y.frameId,sessionId:"",role:"user",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d,metadata:{origin:{kind:"task",taskId:y.taskId},[vq]:T}});continue}const C=y.text.length>0?[{type:"text",text:y.text}]:[];for(const T of y.attachmentIds??[]){const N=LD(a.get(T));N!==void 0&&C.push(N)}const A=y.promptIds?.map(T=>r?.promptById?.get(T)).find(T=>T!==void 0);l.push({id:y.frameId,sessionId:s,role:"user",content:C,createdAt:A?.createdAt??v.startedAt??u,promptId:d});continue}l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d})}else if(y.kind==="thinking"){if(y.text.length===0)continue;const b=r?.pendingInteractionAtByStepId?.get(v.stepId),C=Aq(v,y,b!==void 0),A=r?.thinkingTiming,T=A?.get(y.frameId);let N,_;if(T!==void 0)T.settledAt===void 0&&!C&&(T.settledAt=new Date().toISOString()),N=T.startedAt,_=t5(T.startedAt,T.settledAt);else if(A!==void 0&&C){const w=new Date().toISOString();A.set(y.frameId,{startedAt:w}),N=w}else N=v.startedAt,_=t5(v.startedAt,lA([v.endedAt,b]));l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"thinking",thinking:y.text,startedAt:N,durationMs:_}],createdAt:v.startedAt??u,promptId:d})}else y.kind==="tool"&&(l.push({id:`${y.frameId}:call`,sessionId:"",role:"assistant",content:[{type:"toolUse",toolCallId:y.toolCallId,toolName:y.name,input:y.input??y.display??{},outputLines:y.state==="running"?yx(y.output):void 0,agentRefs:y.agentRefs}],createdAt:v.startedAt??u,promptId:d}),y.state!=="running"&&l.push({id:`${y.frameId}:result`,sessionId:"",role:"tool",content:[{type:"toolResult",toolCallId:y.toolCallId,output:y.output??y.error??"",isError:y.state==="error"}],createdAt:v.endedAt??v.startedAt??u,promptId:d}));const m=e.durationMs??t5(u||void 0,c),g=l.findLastIndex(v=>v.role==="assistant");return g>=0&&(m!==void 0||c!==void 0)&&(l[g]={...l[g],durationMs:m,endedAt:c??l[g].endedAt}),l}function mAe(e,t,n){const[i="",...o]=t.split(` +`),s=n?.state??"info";return{id:`task:${e}:${s}`,category:"task",type:`task.${s}`,sourceKind:n?.kind==="subagent"?"subagent":"background_task",sourceId:e,agentId:n?.agentId,title:i.trim(),severity:s==="completed"?"info":"warning",body:o.join(` +`).trim(),raw:t}}function gAe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function lA(e){let t;for(const n of e){if(n===void 0)continue;const i=Date.parse(n);Number.isFinite(i)&&(t===void 0||i=0?n:void 0}const ND=6e3,aA=256*1024,vAe=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function DD(e,t){return t===0?e:e-1}function yAe(e,t){const n=zu(t),i=[];let o=0;for(const s of e){if(s.type==="hunk"){const r=vAe.exec(s.text);if(!r)return null;const l=DD(Number(r[1]),r[2]===void 0?1:Number(r[2])),a=DD(Number(r[3]),r[4]===void 0?1:Number(r[4]));if(an.length)return null;for(;o=n.length||n[o]!==s.text)return null;o++,s.type==="context"&&i.push(s.text)}for(;oaA||zu(n).length>ND)return null;const i=yAe(e,n);return i===null||i.length>aA||zu(i).length>ND?null:{before:i,after:n}}const bAe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function wAe(e){return bAe.has(e.type)}const CAe=50,AAe=100,uA=32*1024,xAe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,CAe)},cancelTask(e){clearTimeout(e)}};function SAe(e,t,n={}){const i=n.scheduler??xAe,o=Math.max(1,Math.floor(n.maxItemsPerSlice??AAe)),s=[];let r=0,l=null,a=null,u=0,c=!1;const d=()=>s.length-r,f=()=>{u+=1,l!==null&&(i.cancelFrame(l),l=null),a!==null&&(i.cancelTask(a),a=null)},h=()=>{r===s.length?(s.length=0,r=0):r>=1024&&(s.splice(0,r),r=0)};let m;const g=()=>{if(c||l!==null||a!==null||d()===0)return;const y=++u,b=()=>{y===u&&m()};l=i.requestFrame(b),a=i.requestTask(b)};m=()=>{f();let y=0;for(;!c&&y{if(!c){if(t(y)){const b=s.length>r?s.at(-1):void 0,C=b===void 0?void 0:n.coalesce?.(b,y);C===void 0?s.push(y):s[s.length-1]=C,g();return}if(d()===0){e(y);return}s.push(y),m()}});return v.flush=()=>{if(!c){for(f();!c&&r{if(c||d()===0)return;let b=r;for(let C=r;C{c||(c=!0,f(),s.length=0,r=0)},v}function cA(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function _Ae(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,i=cA(t);if(n===void 0||i===void 0||n.kind!==i.kind||i.value.length<=uA)return[e];const o=[];let s=0;for(;ss&&/[\uD800-\uDBFF]/u.test(i.value[r-1])&&/[\uDC00-\uDFFF]/u.test(i.value[r])&&(r-=1);const l=i.value.slice(s,r);o.push({appEvent:{...t,delta:i.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+s}}}),s=r}return o}function MAe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,i=t.meta.stream,o=cA(e.appEvent),s=cA(t.appEvent);if(n===void 0||i===void 0||o===void 0||s===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==i.turnId||n.kind!==i.kind||o.kind!==s.kind||n.kind!==o.kind||i.kind!==s.kind||i.offset!==n.offset+o.value.length||o.value.length+s.value.length>uA)return;const r=o.value+s.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}function IAe(e,t){const i=e.items.filter(d=>d.kind==="turn")[0]?.turnId,o=new Map(e.tasks.map(d=>[d.taskId,d])),s=new Map(e.prompts.map(d=>[d.promptId,d])),r=d=>d.kind==="turn"?d.origin.payload??d.origin:void 0,l=new Set,a=e.items.flatMap((d,f)=>{if(d.kind==="turn"){const h=d.startedAt!==void 0||d.steps.some(m=>m.startedAt!==void 0);return TAe(d,e.attachments,o,d.turnId===i&&!h&&e.hasMoreOlder!==!0?t.agentCreatedAt:void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s)}if(d.kind==="marker"&&d.marker==="compaction"){const h=EAe(d.payload,d.at,t.sessionId,d.markerId,NAe(e.items,f));return h===void 0?[]:[h]}if(d.kind==="marker"&&d.marker==="cron.fired"){const h=d.payload,m=h?.origin?.jobId,g=typeof h?.prompt=="string"?h.prompt:void 0,v=e.items.slice(f+1).find(b=>{if(b.kind!=="turn"||l.has(b.turnId))return!1;const C=r(b);return C?.kind==="cron_job"&&(m===void 0||C.jobId===m)&&(g===void 0||b.kind==="turn"&&Cq(b.prompt??"")===g)});if(v!==void 0&&v.kind==="turn")return l.add(v.turnId),[];const y=LAe(d.payload,d.at,t.sessionId,d.markerId);return y===void 0?[]:[y]}return[]}),u=e.interactions.map(d=>zp(d,t.sessionId)).filter(d=>d!==void 0),c=e.meta.activity==="turn";return d4(a,u,t.getFileUrl,c,t.planReviewByToolCallId??{},t.plansByToolCallId??{},{getSessionMediaUrl:t.getSessionMediaUrl}).map(BAe)}function TAe(e,t,n,i,o,s,r,l,a){const u=e.origin.payload??e.origin,c=u?.kind;return[...e.prompt===void 0&&c==="system_trigger"?[{id:`${e.turnId}:origin`,sessionId:s,role:"user",content:[],createdAt:lA([e.startedAt,...e.steps.map(f=>f.startedAt),i])??"",promptId:e.turnId,metadata:{origin:u}}]:[],...kx(e,t,n,i,o,s,{includeOrigin:!0,pendingInteractionAtByStepId:r,thinkingTiming:l,promptById:a})]}function EAe(e,t,n,i,o){const s=e;if(s?.phase!=="completed")return;const r=s.result??{},l={trigger:o,tokensBefore:typeof r.tokensBefore=="number"?r.tokensBefore:void 0,tokensAfter:typeof r.tokensAfter=="number"?r.tokensAfter:void 0};return{id:i,sessionId:n,role:"assistant",content:typeof r.summary=="string"?[{type:"text",text:r.summary}]:[],createdAt:t??"",metadata:{origin:{kind:"compaction_summary"},[gq]:l}}}function LAe(e,t,n,i){const o=e,s=o?.origin;if(!(s?.kind!=="cron_job"||typeof o?.prompt!="string"))return{id:i,sessionId:n,role:"user",content:[{type:"text",text:o.prompt}],createdAt:t??"",metadata:{origin:s}}}function NAe(e,t){for(let n=t-1;n>=0;n--){const i=e[n];if(i?.kind!=="marker"||i.marker!=="compaction")continue;const o=i.payload;if(o?.phase==="started")return o.trigger==="manual"?"manual":"auto"}return"auto"}function zp(e,t){if(e.interactionKind!=="approval"||e.state!=="pending")return;const n=e.request??{};if(typeof n.toolName!="string"||typeof n.action!="string")return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:void 0;if(i!==void 0)return{approvalId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:void 0,toolCallId:i,toolName:n.toolName,action:n.action,display:n.display,expiresAt:"",createdAt:""}}function rg(e,t){if(e.interactionKind!=="question"||e.state!=="pending")return;const n=e.request??{};if(!Array.isArray(n.questions))return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:typeof n.tool_call_id=="string"?n.tool_call_id:void 0;return{questionId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:typeof n.turn_id=="number"?n.turn_id:void 0,toolCallId:i,questions:n.questions.map(DAe),createdAt:""}}function DAe(e){const t=Array.isArray(e.options)?e.options:[];return{id:typeof e.id=="string"?e.id:"",question:typeof e.question=="string"?e.question:"",header:typeof e.header=="string"?e.header:void 0,body:typeof e.body=="string"?e.body:void 0,options:t.map(FAe),multiSelect:e.multi_select===!0,allowOther:e.allow_other===!0,otherLabel:typeof e.other_label=="string"?e.other_label:void 0,otherDescription:typeof e.other_description=="string"?e.other_description:void 0}}function FAe(e){const t=e??{};return{id:typeof t.id=="string"?t.id:"",label:typeof t.label=="string"?t.label:"",description:typeof t.description=="string"?t.description:void 0,recommended:t.recommended===!0||t.is_recommended===!0}}function BAe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function RAe(){let e=[];const t=(n,i)=>{const s=IAe(n,i).map((r,l)=>{const a=JSON.stringify(r),u=e[l],c=u!==void 0&&u.fingerprint===a?u.turn:r;return e[l]={turn:c,fingerprint:a},c});return e.length=s.length,s};return t.reset=()=>{e=[]},t}function OAe(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function $Ae(e){const t=[];if(!e)return t;let n=0,i=0,o=!1;for(const s of e.split(` +`)){if(s.startsWith("diff --git")){o=!1;continue}if(!o&&OAe(s))continue;if(s.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(s);a&&(n=Number.parseInt(a[1],10),i=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:s});continue}if(!o||s.startsWith("\\"))continue;const r=s.charAt(0),l=s.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:i}),i+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:i}),n+=1,i+=1)}return t}function FD(e){return e?e.split(` +`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function PAe(e){return e.suspendedReason||FD(e.text)||FD(e.outputLines?.join(` +`))||e.summary||""}function zAe(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` +`):e.summary??""}function jAe(e){return e==="completed"?"completed":e==="failed"?"failed":e==="aborted"?"cancelled":"working"}function BD(e,t){return{id:e.agentId??e.item??`result-${t}`,agentId:e.agentId,name:e.item??`subagent ${t+1}`,activity:e.body.split(` +`)[0]??"",phase:jAe(e.outcome),body:e.body}}function HAe(e,t){return!!(t.agentId&&e.agentId===t.agentId||t.item&&e.name.includes(t.item))}function WAe(e,t){const n=e.map(o=>({id:o.id,agentId:o.agentId,name:o.name,activity:PAe(o),phase:o.phase,body:zAe(o)}));if(!t)return n;const i=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(s=>HAe(s,o))).map((o,s)=>BD(o,s));return n.length>0?[...n,...i]:t.subagents.map((o,s)=>BD(o,s))}const qAe=["queued","working","suspended","completed","failed","cancelled"];function xq(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function UAe(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function VAe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const i=n.parentToolCallId??"swarm",o=t.get(i)??[];o.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:xq(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(i,o)}return[...t.entries()].map(([n,i])=>{const o=i.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),s=UAe();for(const r of o)s[r.phase]++;return{id:n,members:o,counts:s}}).filter(n=>n.members.length>1).toSorted((n,i)=>{const o=n.members.at(0)?.swarmIndex??0,s=i.members.at(0)?.swarmIndex??0;return o!==s?o-s:n.id.localeCompare(i.id)})}function KAe(e){let t=0,n=0;for(const i of e){n+=i.members.length;for(const o of qAe)(o==="completed"||o==="failed"||o==="cancelled")&&(t+=i.counts[o])}return{done:t,total:n}}function ZAe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const i=t.get(n.parentToolCallId)??[];i.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:xq(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,i)}for(const[n,i]of t)t.set(n,i.toSorted((o,s)=>o.swarmIndex-s.swarmIndex||o.id.localeCompare(s.id)));return t}function bx(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Sq(e){for(const t of["path","file_path","filePath","filename"]){const n=e[t];if(typeof n=="string"&&n.length>0)return n}}const Tg=100*1024;function _q(e){const t=Er(e.name);if(t!=="edit"&&t!=="multi_edit")return null;const n=bx(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const l=typeof n.old_string=="string"?n.old_string:void 0,a=typeof n.new_string=="string"?n.new_string:void 0;return l===void 0||a===void 0||l.length>Tg||a.length>Tg?null:Nk(l,a)}const i=Array.isArray(n.edits)?n.edits:void 0;if(!i||i.length===0)return null;const o=[];let s=0,r=0;for(const l of i){if(!l||typeof l!="object")return null;const a=l;if(a.replace_all===!0)return null;const u=typeof a.old_string=="string"?a.old_string:void 0,c=typeof a.new_string=="string"?a.new_string:void 0;if(u===void 0||c===void 0||u.length>Tg||c.length>Tg)return null;const d=Nk(u,c);if(d===null)return null;o.length>0&&o.push({type:"hunk",text:"···"});for(const f of d)o.push({...f,oldNo:f.oldNo!==void 0?f.oldNo+s:void 0,newNo:f.newNo!==void 0?f.newNo+r:void 0});s+=zu(u).length,r+=zu(c).length}return o}const GAe=5e3;function QAe(e){if(Er(e.name)!=="write")return null;const t=bx(e.arg);return!t||typeof t.content!="string"||t.content.length>Tg||t.content.split(` +`).length>GAe?null:{content:t.content,path:Sq(t)}}function RD(e){const t=bx(e.arg);return t?Sq(t):void 0}function YAe(e){switch(e){case"running":return"running";case"completed":return"completed";case"killed":return"cancelled";default:return"failed"}}function JAe(e,t){return t==="running"?e.stateReason!==void 0?"suspended":"working":t}function XAe(e){return e==="subagent"?"subagent":e==="shell"?"bash":"tool"}function e6e(e){return Mq(e).parents}function Mq(e){const t=new Map,n=new Map;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind!=="tool"||s.agentRefs===void 0||s.agentRefs.forEach((r,l)=>{t.set(r.agentId,s.toolCallId),n.set(r.agentId,l)});return{parents:t,swarmIndexes:n}}function t6e(e,t,n){const i=Mq(e);let o=i.parents,s=i.swarmIndexes;if(n!==void 0){for(const[u,c]of i.parents)n.parents.set(u,c);for(const[u,c]of i.swarmIndexes)n.swarmIndexes.set(u,c);o=n.parents,s=n.swarmIndexes}const r=e.tasks.map(u=>{const c=YAe(u.state);return{id:u.taskId,agentId:u.agentId,sessionId:t,kind:XAe(u.kind),description:u.description??"",status:c,createdAt:u.startedAt??"",startedAt:u.startedAt,completedAt:u.endedAt,outputPreview:u.outputTail.length>0?u.outputTail:void 0,text:u.resultSummary,subagentPhase:u.kind==="subagent"?JAe(u,c):void 0,suspendedReason:c==="running"?u.stateReason:void 0,model:u.model,thinkingEffort:u.thinkingEffort,runInBackground:u.detached,parentToolCallId:u.agentId!==void 0?o.get(u.agentId):void 0,swarmIndex:u.agentId!==void 0?s.get(u.agentId):void 0}}),l=new Map;r.forEach((u,c)=>{u.agentId!==void 0&&u.id===u.agentId&&l.set(u.agentId,c)});const a=new Set;return r.forEach((u,c)=>{if(u.agentId===void 0||u.id===u.agentId)return;const d=l.get(u.agentId);if(d===void 0)return;const f=r[d],h=u.completedAt!==void 0&&f.startedAt!==void 0&&u.completedAt>=f.startedAt,m=f.status==="running"&&u.status!=="running"&&h;r[d]={...f,backgroundTaskId:u.status==="running"||h?u.id:void 0,status:m?u.status:f.status,subagentPhase:m?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":f.subagentPhase,description:f.description.length>0?f.description:u.description,model:f.model??u.model,thinkingEffort:f.thinkingEffort??u.thinkingEffort,completedAt:h?u.completedAt??f.completedAt:f.completedAt,outputPreview:h?f.outputPreview??u.outputPreview:f.outputPreview,text:h?f.text??u.text:f.text},a.add(c)}),r.filter((u,c)=>!a.has(c))}function n6e(){let e=[],t=null,n=null,i=null,o,s,r=!0;const l=new WeakMap,a=u=>{const{messages:c,approvals:d}=u,f=u.sessionActive??!0,h=u.planReviewByToolCallId??{},m=u.plansByToolCallId??{},g=(w,M)=>l.set(w,M);let v=n!==null;if(v){const w=n,M=Object.keys(h);v=M.length===Object.keys(w).length&&M.every(x=>h[x]===w[x])}let y=i!==null;if(y){const w=i,M=Object.keys(m);y=M.length===Object.keys(w).length&&M.every(x=>m[x]===w[x])}const b=e.length>0&&d===t&&v&&y&&u.getFileUrl===o&&u.getSessionMediaUrl===s;let C=0,A=0,T=1;if(b){let w=-1;for(let M=e.length-1;M>=0;M--)if(e[M].role==="assistant"){w=M;break}for(let M=0;M0?[...e.slice(0,C),...N]:N;return e=_,t=d,n={...h},i={...m},o=u.getFileUrl,s=u.getSessionMediaUrl,r=f,_};return a.reset=()=>{e=[],t=null,n=null,i=null,o=void 0,r=!0},a}function i6e(e){const t=new Map;let n=0;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.role==="compaction"||o.goalContinuation===!0)break;o.role==="user"&&(n++,t.set(o.id,n))}return t}const Iq=["light","dark","system"],o6e=["small","medium","large","xlarge"],n5="medium",Tq="kimi-web.color-scheme",dA="kimi-web.font-scale",OD="kimi-web.ui-font-size";function fA(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function wx(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function s6e(e){try{globalThis.localStorage.removeItem(e)}catch{}}function r6e(){const e=fA(Tq);return e&&Iq.includes(e)?e:"system"}const gy={light:"#ffffff",dark:"#121212"};function l6e(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?gy.dark:e==="light"?gy.light:null;t.forEach(i=>{const s=(i.getAttribute("media")??"").includes("dark")?gy.dark:gy.light;i.setAttribute("content",n??s)})}function Eq(e){return o6e.includes(e)}function a6e(e){return e<=13?"small":e<=15?"medium":e<=17?"large":"xlarge"}function u6e(){const e=fA(dA);if(e==="xxlarge")return"xlarge";if(e!==null)return Eq(e)?e:n5;const t=fA(OD);if(t===null)return n5;const n=Number(t),i=Number.isFinite(n)?a6e(n):n5;return wx(dA,i),s6e(OD),i}function c6e(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=e)}const Cx=U(r6e()),Ax=U(u6e());let $D=!1;function d6e(){$D||($D=!0,qe(Cx,l6e,{immediate:!0}),qe(Ax,c6e,{immediate:!0}))}function f6e(e){Iq.includes(e)&&(Cx.value=e,wx(Tq,e))}function h6e(e){Eq(e)&&(Ax.value=e,wx(dA,e))}function pm(){return d6e(),{colorScheme:Cx,fontScale:Ax,setColorScheme:f6e,setFontScale:h6e}}const vy=U(!1);let PD=!1;function i5(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function f4(){return!PD&&typeof window<"u"&&typeof document<"u"&&(PD=!0,vy.value=i5(),new MutationObserver(()=>{vy.value=i5()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{vy.value=i5()})),vy}const Lq="kimi-web.sidebar-multi-tab";function p6e(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function m6e(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function g6e(){return p6e(Lq)==="1"}const Nq=U(g6e());function v6e(e){Nq.value=e,m6e(Lq,e?"1":"0")}function mm(){return{sidebarTabs:Nq,setSidebarTabs:v6e}}const zD=document.createElement("i");function y6e(e){const t="&"+e+";";zD.innerHTML=t;const n=zD.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ju(e,t,n,i){const o=e.length;let s=0,r;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),e.splice(...r);else for(n&&e.splice(t,n);s0?(ju(e,e.length,0,t),e):t}const jD={}.hasOwnProperty;function k6e(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function uo(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return r;function r(a){return Ri(a)?(e.enter(n),l(a)):t(a)}function l(a){return Ri(a)&&s++r))return;const _=t.events.length;let w=_,M,x;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){if(M){x=t.events[w][1].end;break}M=!0}for(y(i),N=_;NC;){const T=n[A];t.containerState=T[1],T[0].exit.call(t,e)}n.length=C}function b(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function L6e(e,t,n){return uo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function WD(e){if(e===null||kl(e)||_6e(e))return 1;if(S6e(e))return 2}function Sx(e,t,n){const i=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},f={...e[n][1].start};qD(d,-a),qD(f,a),r={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:a>1?"strong":"emphasis",start:{...r.start},end:{...l.end}},e[i][1].end={...r.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=fa(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=fa(u,[["enter",o,t],["enter",r,t],["exit",r,t],["enter",s,t]]),u=fa(u,Sx(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=fa(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=fa(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,ju(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&Ri(N)?uo(e,b,"linePrefix",s+1)(N):b(N)}function b(N){return N===null||Vn(N)?e.check(UD,g,A)(N):(e.enter("codeFlowValue"),C(N))}function C(N){return N===null||Vn(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),C)}function A(N){return e.exit("codeFenced"),t(N)}function T(N,_,w){let M=0;return x;function x(P){return N.enter("lineEnding"),N.consume(P),N.exit("lineEnding"),E}function E(P){return N.enter("codeFencedFence"),Ri(P)?uo(N,I,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):I(P)}function I(P){return P===l?(N.enter("codeFencedFenceSequence"),F(P)):w(P)}function F(P){return P===l?(M++,N.consume(P),F):M>=r?(N.exit("codeFencedFenceSequence"),Ri(P)?uo(N,W,"whitespace")(P):W(P)):w(P)}function W(P){return P===null||Vn(P)?(N.exit("codeFencedFence"),_(P)):w(P)}}}function W6e(e,t,n){const i=this;return o;function o(r){return r===null?n(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}const o5={name:"codeIndented",tokenize:U6e},q6e={partial:!0,tokenize:V6e};function U6e(e,t,n){const i=this;return o;function o(u){return e.enter("codeIndented"),uo(e,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?r(u):n(u)}function r(u){return u===null?a(u):Vn(u)?e.attempt(q6e,r,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Vn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function V6e(e,t,n){const i=this;return o;function o(r){return i.parser.lazy[i.now().line]?n(r):Vn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):uo(e,s,"linePrefix",5)(r)}function s(r){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(r):Vn(r)?o(r):n(r)}}const K6e={name:"codeText",previous:G6e,resolve:Z6e,tokenize:Q6e};function Z6e(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=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 tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&lg(this.left,i),s.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),lg(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),lg(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=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}function Oq(e,t,n,i,o,s,r,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(y){return y===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(y),e.exit(s),f):y===null||y===32||y===41||hA(y)?n(y):(e.enter(i),e.enter(r),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function f(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(l),f(y)):y===null||y===60||Vn(y)?n(y):(e.consume(y),y===92?m:h)}function m(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function g(y){return!c&&(y===null||y===41||kl(y))?(e.exit("chunkString"),e.exit(l),e.exit(r),e.exit(i),t(y)):c999||h===null||h===91||h===93&&!a||h===94&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(h):h===93?(e.exit(s),e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):Vn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Vn(h)||l++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!Ri(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}}function Pq(e,t,n,i,o,s){let r;return l;function l(f){return f===34||f===39||f===40?(e.enter(i),e.enter(o),e.consume(f),e.exit(o),r=f===40?41:f,a):n(f)}function a(f){return f===r?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),t):(e.enter(s),u(f))}function u(f){return f===r?(e.exit(s),a(r)):f===null?n(f):Vn(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),uo(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===r||f===null||Vn(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===r||f===92?(e.consume(f),c):c(f)}}function g0(e,t){let n;return i;function i(o){return Vn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Ri(o)?uo(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const o7e={name:"definition",tokenize:r7e},s7e={partial:!0,tokenize:l7e};function r7e(e,t,n){const i=this;let o;return s;function s(h){return e.enter("definition"),r(h)}function r(h){return $q.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return o=xx(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return kl(h)?g0(e,u)(h):u(h)}function u(h){return Oq(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(s7e,d,d)(h)}function d(h){return Ri(h)?uo(e,f,"whitespace")(h):f(h)}function f(h){return h===null||Vn(h)?(e.exit("definition"),i.parser.defined.push(o),t(h)):n(h)}}function l7e(e,t,n){return i;function i(l){return kl(l)?g0(e,o)(l):n(l)}function o(l){return Pq(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Ri(l)?uo(e,r,"whitespace")(l):r(l)}function r(l){return l===null||Vn(l)?t(l):n(l)}}const a7e={name:"hardBreakEscape",tokenize:u7e};function u7e(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Vn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const c7e={name:"headingAtx",resolve:d7e,tokenize:f7e};function d7e(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},ju(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function f7e(e,t,n){let i=0;return o;function o(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),r(c)}function r(c){return c===35&&i++<6?(e.consume(c),r):c===null||kl(c)?(e.exit("atxHeadingSequence"),l(c)):n(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||Vn(c)?(e.exit("atxHeading"),t(c)):Ri(c)?uo(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||kl(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}const h7e=["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"],KD=["pre","script","style","textarea"],p7e={concrete:!0,name:"htmlFlow",resolveTo:v7e,tokenize:y7e},m7e={partial:!0,tokenize:b7e},g7e={partial:!0,tokenize:k7e};function v7e(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 y7e(e,t,n){const i=this;let o,s,r,l,a;return u;function u(q){return c(q)}function c(q){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(q),d}function d(q){return q===33?(e.consume(q),f):q===47?(e.consume(q),s=!0,g):q===63?(e.consume(q),o=3,i.interrupt?t:j):Su(q)?(e.consume(q),r=String.fromCharCode(q),v):n(q)}function f(q){return q===45?(e.consume(q),o=2,h):q===91?(e.consume(q),o=5,l=0,m):Su(q)?(e.consume(q),o=4,i.interrupt?t:j):n(q)}function h(q){return q===45?(e.consume(q),i.interrupt?t:j):n(q)}function m(q){const Q="CDATA[";return q===Q.charCodeAt(l++)?(e.consume(q),l===Q.length?i.interrupt?t:I:m):n(q)}function g(q){return Su(q)?(e.consume(q),r=String.fromCharCode(q),v):n(q)}function v(q){if(q===null||q===47||q===62||kl(q)){const Q=q===47,ne=r.toLowerCase();return!Q&&!s&&KD.includes(ne)?(o=1,i.interrupt?t(q):I(q)):h7e.includes(r.toLowerCase())?(o=6,Q?(e.consume(q),y):i.interrupt?t(q):I(q)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(q):s?b(q):C(q))}return q===45||Ha(q)?(e.consume(q),r+=String.fromCharCode(q),v):n(q)}function y(q){return q===62?(e.consume(q),i.interrupt?t:I):n(q)}function b(q){return Ri(q)?(e.consume(q),b):x(q)}function C(q){return q===47?(e.consume(q),x):q===58||q===95||Su(q)?(e.consume(q),A):Ri(q)?(e.consume(q),C):x(q)}function A(q){return q===45||q===46||q===58||q===95||Ha(q)?(e.consume(q),A):T(q)}function T(q){return q===61?(e.consume(q),N):Ri(q)?(e.consume(q),T):C(q)}function N(q){return q===null||q===60||q===61||q===62||q===96?n(q):q===34||q===39?(e.consume(q),a=q,_):Ri(q)?(e.consume(q),N):w(q)}function _(q){return q===a?(e.consume(q),a=null,M):q===null||Vn(q)?n(q):(e.consume(q),_)}function w(q){return q===null||q===34||q===39||q===47||q===60||q===61||q===62||q===96||kl(q)?T(q):(e.consume(q),w)}function M(q){return q===47||q===62||Ri(q)?C(q):n(q)}function x(q){return q===62?(e.consume(q),E):n(q)}function E(q){return q===null||Vn(q)?I(q):Ri(q)?(e.consume(q),E):n(q)}function I(q){return q===45&&o===2?(e.consume(q),O):q===60&&o===1?(e.consume(q),R):q===62&&o===4?(e.consume(q),K):q===63&&o===3?(e.consume(q),j):q===93&&o===5?(e.consume(q),H):Vn(q)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(m7e,re,F)(q)):q===null||Vn(q)?(e.exit("htmlFlowData"),F(q)):(e.consume(q),I)}function F(q){return e.check(g7e,W,re)(q)}function W(q){return e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),P}function P(q){return q===null||Vn(q)?F(q):(e.enter("htmlFlowData"),I(q))}function O(q){return q===45?(e.consume(q),j):I(q)}function R(q){return q===47?(e.consume(q),r="",z):I(q)}function z(q){if(q===62){const Q=r.toLowerCase();return KD.includes(Q)?(e.consume(q),K):I(q)}return Su(q)&&r.length<8?(e.consume(q),r+=String.fromCharCode(q),z):I(q)}function H(q){return q===93?(e.consume(q),j):I(q)}function j(q){return q===62?(e.consume(q),K):q===45&&o===2?(e.consume(q),j):I(q)}function K(q){return q===null||Vn(q)?(e.exit("htmlFlowData"),re(q)):(e.consume(q),K)}function re(q){return e.exit("htmlFlow"),t(q)}}function k7e(e,t,n){const i=this;return o;function o(r){return Vn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s):n(r)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}function b7e(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(h4,t,n)}}const w7e={name:"htmlText",tokenize:C7e};function C7e(e,t,n){const i=this;let o,s,r;return l;function l(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),a}function a(j){return j===33?(e.consume(j),u):j===47?(e.consume(j),T):j===63?(e.consume(j),C):Su(j)?(e.consume(j),w):n(j)}function u(j){return j===45?(e.consume(j),c):j===91?(e.consume(j),s=0,m):Su(j)?(e.consume(j),b):n(j)}function c(j){return j===45?(e.consume(j),h):n(j)}function d(j){return j===null?n(j):j===45?(e.consume(j),f):Vn(j)?(r=d,R(j)):(e.consume(j),d)}function f(j){return j===45?(e.consume(j),h):d(j)}function h(j){return j===62?O(j):j===45?f(j):d(j)}function m(j){const K="CDATA[";return j===K.charCodeAt(s++)?(e.consume(j),s===K.length?g:m):n(j)}function g(j){return j===null?n(j):j===93?(e.consume(j),v):Vn(j)?(r=g,R(j)):(e.consume(j),g)}function v(j){return j===93?(e.consume(j),y):g(j)}function y(j){return j===62?O(j):j===93?(e.consume(j),y):g(j)}function b(j){return j===null||j===62?O(j):Vn(j)?(r=b,R(j)):(e.consume(j),b)}function C(j){return j===null?n(j):j===63?(e.consume(j),A):Vn(j)?(r=C,R(j)):(e.consume(j),C)}function A(j){return j===62?O(j):C(j)}function T(j){return Su(j)?(e.consume(j),N):n(j)}function N(j){return j===45||Ha(j)?(e.consume(j),N):_(j)}function _(j){return Vn(j)?(r=_,R(j)):Ri(j)?(e.consume(j),_):O(j)}function w(j){return j===45||Ha(j)?(e.consume(j),w):j===47||j===62||kl(j)?M(j):n(j)}function M(j){return j===47?(e.consume(j),O):j===58||j===95||Su(j)?(e.consume(j),x):Vn(j)?(r=M,R(j)):Ri(j)?(e.consume(j),M):O(j)}function x(j){return j===45||j===46||j===58||j===95||Ha(j)?(e.consume(j),x):E(j)}function E(j){return j===61?(e.consume(j),I):Vn(j)?(r=E,R(j)):Ri(j)?(e.consume(j),E):M(j)}function I(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),o=j,F):Vn(j)?(r=I,R(j)):Ri(j)?(e.consume(j),I):(e.consume(j),W)}function F(j){return j===o?(e.consume(j),o=void 0,P):j===null?n(j):Vn(j)?(r=F,R(j)):(e.consume(j),F)}function W(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||kl(j)?M(j):(e.consume(j),W)}function P(j){return j===47||j===62||kl(j)?M(j):n(j)}function O(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function R(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),z}function z(j){return Ri(j)?uo(e,H,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):H(j)}function H(j){return e.enter("htmlTextData"),r(j)}}const _x={name:"labelEnd",resolveAll:_7e,resolveTo:M7e,tokenize:I7e},A7e={tokenize:T7e},x7e={tokenize:E7e},S7e={tokenize:L7e};function _7e(e){let t=-1;const n=[];for(;++t=3&&(u===null||Vn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),i++,a):(e.exit("thematicBreakSequence"),Ri(u)?uo(e,l,"whitespace")(u):l(u))}}const sl={continuation:{tokenize:j7e},exit:W7e,name:"list",tokenize:z7e},$7e={partial:!0,tokenize:q7e},P7e={partial:!0,tokenize:H7e};function z7e(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,r=0;return l;function l(h){const m=i.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||h===i.containerState.marker:pA(h)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(u9,n,u)(h):u(h);if(!i.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return pA(h)&&++r<10?(e.consume(h),a):(!i.interrupt||r<2)&&(i.containerState.marker?h===i.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||h,e.check(h4,i.interrupt?n:c,e.attempt($7e,f,d))}function c(h){return i.containerState.initialBlankLine=!0,s++,f(h)}function d(h){return Ri(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function j7e(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(h4,o,s);function o(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,uo(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Ri(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(P7e,t,r)(l))}function r(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,uo(e,e.attempt(sl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function H7e(e,t,n){const i=this;return uo(e,o,"listItemIndent",i.containerState.size+1);function o(s){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(s):n(s)}}function W7e(e){e.exit(this.containerState.type)}function q7e(e,t,n){const i=this;return uo(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const r=i.events[i.events.length-1];return!Ri(s)&&r&&r[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const ZD={name:"setextUnderline",resolveTo:U7e,tokenize:V7e};function U7e(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const r={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",r,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=r,e.push(["exit",r,t]),e}function V7e(e,t,n){const i=this;let o;return s;function s(u){let c=i.events.length,d;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){d=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),o=u,r(u)):n(u)}function r(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===o?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Ri(u)?uo(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Vn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const K7e={tokenize:Z7e};function Z7e(e){const t=this,n=e.attempt(h4,i,e.attempt(this.parser.constructs.flowInitial,o,uo(e,e.attempt(this.parser.constructs.flow,o,e.attempt(X6e,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const G7e={resolveAll:jq()},Q7e=zq("string"),Y7e=zq("text");function zq(e){return{resolveAll:jq(e==="text"?J7e:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,r,l);return r;function r(c){return u(c)?s(c):l(c)}function l(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=o[c];let f=-1;if(d)for(;++f-1){const l=r[0];typeof l=="string"?r[0]=l.slice(i):r.shift()}s>0&&r.push(e[o].slice(0,s))}return r}function dxe(e,t){let n=-1;const i=[];let o;for(;++n>1}};tr.from=function(e){if(e instanceof tr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new tr(t)};function Hq(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),s=t.child(i);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let r=o.text,l=s.text,a=0;for(;r[a]==l[a];a++)n++;return a&&a0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,i--;return d&&f&&d=56320&&e<57344}function Uq(e){return e>=55296&&e<56320}class on{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;it&&i(a,o+l,s||null,r)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,t-c),Math.min(a.content.size,n-c),i,o+c)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,o){let s="",r=!0;return this.nodesBetween(t,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(t,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(r?r=!1:s+=i),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(o[o.length-1]=n.withText(n.text+i.text),s=1);st)for(let s=0,r=0;rt&&((rn)&&(l.isText?l=l.cut(Math.max(0,t-r),Math.min(l.text.length,n-r)):l=l.cut(Math.max(0,t-r-1),Math.min(l.content.size,n-r-1))),i.push(l),o+=l.nodeSize),r=a}return new on(i,o)}cutByIndex(t,n){return t==n?on.empty:t==0&&n==this.content.length?this:new on(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return o[t]=n,new on(o,s)}addToStart(t){return new on([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new on(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=t)return s==t?yy(n+1,s):yy(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return on.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return on.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return on.empty;let n,i=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;ni.type.rank-o.type.rank),n}}ji.none=[];class ev extends Error{}class mn{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=Kq(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new mn(i,this.openStart,this.openEnd)}removeBetween(t,n){return new mn(Vq(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return mn.empty;let i=n.openStart||0,o=n.openEnd||0;if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new mn(on.fromJSON(t,n.content),i,o)}static maxOpen(t,n=!0){let i=0,o=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new mn(t,i,o)}}mn.empty=new mn(on.empty,0,0);function Vq(e,t,n){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i),{index:r,offset:l}=e.findIndex(n);if(o==t||s.isText){if(l!=n&&!e.child(r).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(Vq(s.content,t-o-1,n-o-1)))}function Kq(e,t,n,i,o,s){let{index:r,offset:l}=e.findIndex(t),a=e.maybeChild(r);if(l==t||a.isText)return s&&i<=0&&o<=0&&!s.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=Kq(a.content,t-l-1,n,r==0?i-1:0,r==e.childCount-1?o-1:0,a);return u&&e.replaceChild(r,a.copy(u))}function mxe(e,t,n){if(n.openStart>e.depth)throw new ev("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ev("Inconsistent open depths");return Zq(e,t,n,0)}function Zq(e,t,n,i){let o=e.index(i),s=e.node(i);if(o==t.index(i)&&i=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function v0(e,t,n,i){let o=(t||e).node(n),s=0,r=t?t.index(n):o.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(Ch(e.nodeAfter,i),s++));for(let l=s;lo&&gA(e,t,o+1),r=i.depth>o&&gA(n,i,o+1),l=[];return v0(null,e,o,l),s&&r&&t.index(o)==n.index(o)?(Gq(s,r),Ch(Ah(s,Qq(e,t,n,i,o+1)),l)):(s&&Ch(Ah(s,Fk(e,t,o+1)),l),v0(t,n,o,l),r&&Ch(Ah(r,Fk(n,i,o+1)),l)),v0(i,null,o,l),new on(l)}function Fk(e,t,n){let i=[];if(v0(null,e,n,i),e.depth>n){let o=gA(e,t,n+1);Ch(Ah(o,Fk(e,t,n+1)),i)}return v0(t,null,n,i),new on(i)}function gxe(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)o=t.node(s).copy(on.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class tv{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],o=t.child(n);return i?t.child(n).cut(i):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new kxe(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],o=0,s=n;for(let r=t;;){let{index:l,offset:a}=r.content.findIndex(s),u=s-a;if(i.push(r,l,o+a),!u||(r=r.child(l),r.isText))break;s=u-1,o+=a+1}return new tv(n,i,s)}static resolveCached(t,n){let i=QD.get(t);if(i)for(let s=0;st&&this.nodesBetween(t,n,s=>(i.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Yq(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=on.empty,o=0,s=i.childCount){let r=this.contentMatchAt(t).matchFragment(i,o,s),l=r&&r.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let o=on.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};xh.prototype.text=void 0;class Bk extends xh{constructor(t,n,i,o){if(super(t,n,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Yq(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Bk(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Bk(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Yq(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Ph{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new wxe(t,n);if(i.next==null)return Ph.empty;let o=Jq(i);i.next&&i.err("Unexpected trailing text");let s=Ixe(Mxe(o));return Txe(s,i),s}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let o=0;o{let s=o+(i.validEnd?"*":" ")+" ";for(let r=0;r"+t.indexOf(i.next[r].next);return s}).join(` +`)}}Ph.empty=new Ph(!0);class wxe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Jq(e){let t=[];do t.push(Cxe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Cxe(e){let t=[];do t.push(Axe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function Axe(e){let t=_xe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=xxe(e,t);else break;return t}function YD(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function xxe(e,t){let n=YD(e),i=n;return e.eat(",")&&(e.next!="}"?i=YD(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function Sxe(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let s in n){let r=n[s];r.isInGroup(t)&&o.push(r)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function _xe(e){if(e.eat("(")){let t=Jq(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=Sxe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function Mxe(e){let t=[[]];return o(s(e,0),n()),t;function n(){return t.push([])-1}function i(r,l,a){let u={term:a,to:l};return t[r].push(u),u}function o(r,l){r.forEach(a=>a.to=l)}function s(r,l){if(r.type=="choice")return r.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(r.type=="seq")for(let a=0;;a++){let u=s(r.exprs[a],l);if(a==r.exprs.length-1)return u;o(u,l=n())}else if(r.type=="star"){let a=n();return i(l,a),o(s(r.expr,a),a),[i(a)]}else if(r.type=="plus"){let a=n();return o(s(r.expr,l),a),o(s(r.expr,a),a),[i(a)]}else{if(r.type=="opt")return[i(l)].concat(s(r.expr,l));if(r.type=="range"){let a=l;for(let u=0;u{e[r].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||o.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=t[i.join(",")]=new Ph(i.indexOf(e.length-1)>-1);for(let r=0;r-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:tU(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new xh(this,this.computeAttrs(t),on.from(n),ji.setFrom(i))}createChecked(t=null,n,i){return n=on.from(n),this.checkContent(n),new xh(this,this.computeAttrs(t),n,ji.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=on.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(on.empty,!0);return s?new xh(this,t,n.append(s),ji.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;ni[s]=new oU(s,n,r));let o=n.spec.topNode||"doc";if(!i[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function Exe(e,t,n){let i=n.split("|");return o=>{let s=o===null?"null":typeof o;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${s}`)}}class Lxe{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?Exe(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class p4{constructor(t,n,i,o){this.name=t,this.rank=n,this.schema=i,this.spec=o,this.attrs=iU(t,o.attrs),this.excluded=null;let s=eU(this.attrs);this.instance=s?new ji(this,s):null}create(t=null){return!t&&this.instance?this.instance:new ji(this,tU(this.attrs,t))}static compile(t,n){let i=Object.create(null),o=0;return t.forEach((s,r)=>i[s]=new p4(s,o++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class Nxe{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=tr.from(t.nodes),n.marks=tr.from(t.marks||{}),this.nodes=XD.compile(this.spec.nodes,this),this.marks=p4.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],r=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[r]||(i[r]=Ph.parse(r,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?eF(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],r=s.spec.excludes;s.excluded=r==null?[s]:r==""?[]:eF(this,r.split(" "))}this.nodeFromJSON=o=>xh.fromJSON(this,o),this.markFromJSON=o=>ji.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof XD){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,o)}text(t,n){let i=this.nodes.text;return new Bk(i,i.defaultAttrs,t,ji.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function eF(e,t){let n=[];for(let i=0;i-1)&&n.push(r=a)}if(!r)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function Dxe(e){return e.tag!=null}function Fxe(e){return e.style!=null}let sU=class yA{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(o=>{if(Dxe(o))this.tags.push(o);else if(Fxe(o)){let s=/[^=]*/.exec(o.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=t.nodes[o.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let i=new nF(this,n,!1);return i.addAll(t,ji.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new nF(this,n,!0);return i.addAll(t,ji.none,n.from,n.to),mn.maxOpen(i.finish())}matchTag(t,n,i){for(let o=i?this.tags.indexOf(i)+1:0;ot.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(r.getAttrs){let a=r.getAttrs(n);if(a===!1)continue;r.attrs=a||void 0}return r}}}static schemaRules(t){let n=[];function i(o){let s=o.priority==null?50:o.priority,r=0;for(;r{i(r=iF(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})}for(let o in t.nodes){let s=t.nodes[o].spec.parseDOM;s&&s.forEach(r=>{i(r=iF(r)),r.node||r.ignore||r.mark||(r.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new yA(t,yA.schemaRules(t)))}};const rU={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Bxe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},lU={ol:!0,ul:!0},nv=1,kA=2,y0=4;function tF(e,t,n){return t!=null?(t?nv:0)|(t==="full"?kA:0):e&&e.whitespace=="pre"?nv|kA:n&~y0}class ky{constructor(t,n,i,o,s,r){this.type=t,this.attrs=n,this.marks=i,this.solid=o,this.options=r,this.content=[],this.activeMarks=ji.none,this.match=s||(r&y0?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(on.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,o;return(o=i.findWrapping(t.type))?(this.match=i,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&nv)){let i=this.content[this.content.length-1],o;if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=on.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(on.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!rU.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class nF{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,r=tF(null,n.preserveWhitespace,0)|(i?y0:0);o?s=new ky(o.type,o.attrs,ji.none,!0,n.topMatch||o.type.contentMatch,r):i?s=new ky(null,null,ji.none,!0,null,r):s=new ky(t.schema.topNodeType,null,ji.none,!0,null,r),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,o=this.top,s=o.options&kA?"full":this.localPreserveWS||(o.options&nv)>0,{schema:r}=this.parser;if(s==="full"||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,` +`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(u)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(t,n,i,o){let s,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let a=this.enter(r,n.attrs||null,i,n.preserveWhitespace);a&&(s=!0,i=a)}else{let a=this.parser.schema.marks[n.mark];i=i.concat(a.create(n.attrs))}let l=this.top;if(r&&r.isLeaf)this.findInside(t);else if(o)this.addElement(t,i,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,i,!1));else{let a=t;typeof n.contentElement=="string"?a=t.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(t):n.contentElement&&(a=n.contentElement),this.findAround(t,a,!0),this.addAll(a,i),this.findAround(t,a,!1)}s&&this.sync(l)&&this.open--}addAll(t,n,i,o){let s=i||0;for(let r=i?t.childNodes[i]:t.firstChild,l=o==null?null:t.childNodes[o];r!=l;r=r.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(r,n);this.findAtPoint(t,s)}findPlace(t,n,i){let o,s;for(let r=this.open,l=0;r>=0;r--){let a=this.nodes[r],u=a.findWrapping(t);if(u&&(!o||o.length>u.length+l)&&(o=u,s=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!o)return null;this.sync(s);for(let r=0;r(r.type?r.type.allowsMarkType(u.type):oF(u.type,t))?(a=u.addToSet(a),!1):!0),this.nodes.push(new ky(t,n,a,o,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=nv)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let o=i.length-1;o>=0;o--)t+=i[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,o=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(o?0:1),r=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(r(l-1,a))return!0;return!1}else{let c=a>0||a==0&&o?this.nodes[a].type:i&&a>=s?i.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function Rxe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&lU.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function Oxe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function iF(e){let t={};for(let n in e)t[n]=e[n];return t}function oF(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let s=[],r=l=>{s.push(l);for(let a=0;a{if(s.length||r.marks.length){let l=0,a=0;for(;l=0;o--){let s=this.serializeMark(t.marks[o],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(t,n,i={}){let o=this.marks[t.type.name];return o&&c9(by(i),o(t,n),null,t.attrs)}static renderSpec(t,n,i=null,o){return typeof n=="string"?{dom:t.createTextNode(n)}:c9(t,n,i,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Bu(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=sF(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return sF(t.marks)}}function sF(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function by(e){return e.document||window.document}const rF=new WeakMap;function $xe(e){let t=rF.get(e);return t===void 0&&rF.set(e,t=Pxe(e)),t}function Pxe(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let l,a=n?e.createElementNS(n,o):e.createElement(o),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:m}=c9(e,f,n,i);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const aU=65535,uU=Math.pow(2,16);function zxe(e,t){return e+t*uU}function lF(e){return e&aU}function jxe(e){return(e-(e&aU))/uU}const cU=1,dU=2,d9=4,fU=8;class bA{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&fU)>0}get deletedBefore(){return(this.delInfo&(cU|d9))>0}get deletedAfter(){return(this.delInfo&(dU|d9))>0}get deletedAcross(){return(this.delInfo&d9)>0}}class Rl{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Rl.empty)return Rl.empty}recover(t){let n=0,i=lF(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[l+s],c=this.ranges[l+r],d=a+u;if(t<=d){let f=u?t==a?-1:t==d?1:n:n,h=a+o+(f<0?0:c);if(i)return h;let m=t==(n<0?a:d)?null:zxe(l/3,t-a),g=t==a?dU:t==d?cU:d9;return(n<0?t!=a:t!=d)&&(g|=fU),new bA(h,g,m)}o+=c-u}return i?t+o:new bA(t+o,0,null)}touches(t,n){let i=0,o=lF(n),s=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;lt)break;let u=this.ranges[l+s],c=a+u;if(t<=c&&l==o*3)return!0;i+=this.ranges[l+r]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let o=0,s=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t._maps[n].invert(),o!=null&&o>n?i-o-1:void 0)}}invert(){let t=new iv;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;is&&a!r.isAtom||!l.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),o),n.openStart,n.openEnd);return vs.fromReplace(t,this.from,this.to,s)}invert(){return new Tu(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new yd(n.pos,i.pos,this.mark)}merge(t){return t instanceof yd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new yd(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new yd(n.from,n.to,t.markFromJSON(n.mark))}}Lr.jsonID("addMark",yd);class Tu extends Lr{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new mn(Mx(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return vs.fromReplace(t,this.from,this.to,i)}invert(){return new yd(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Tu(n.pos,i.pos,this.mark)}merge(t){return t instanceof Tu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Tu(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Tu(n.from,n.to,t.markFromJSON(n.mark))}}Lr.jsonID("removeMark",Tu);class kd extends Lr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return vs.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return vs.fromReplace(t,this.pos,this.pos+1,new mn(on.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let o=0;oi.pos?null:new ql(n.pos,i.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ql(n.from,n.to,n.gapFrom,n.gapTo,mn.fromJSON(t,n.slice),n.insert,!!n.structure)}}Lr.jsonID("replaceAround",ql);function wA(e,t,n){let i=e.resolve(t),o=n-t,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let r=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,o--}}return!1}function Hxe(e,t,n,i){let o=[],s=[],r,l;e.doc.nodesBetween(t,n,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let f=Math.max(u,t),h=Math.min(u+a.nodeSize,n),m=i.addToSet(d);for(let g=0;ge.step(a)),s.forEach(a=>e.step(a))}function Wxe(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,(r,l)=>{if(!r.isInline)return;s++;let a=null;if(i instanceof p4){let u=r.marks,c;for(;c=i.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(r.marks)&&(a=[i]):a=r.marks;if(a&&a.length){let u=Math.min(l+r.nodeSize,n);for(let c=0;ce.step(new Tu(r.from,r.to,r.style)))}function Ix(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),r=[],l=t+1;for(let a=0;a=0;a--)e.step(r[a])}function qxe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Tx(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,o=0,s=0;;--i){let r=e.$from.node(i),l=e.$from.index(i)+o,a=e.$to.indexAfter(i)-s;if(in;m--)g||i.index(m)>0?(g=!0,c=on.from(i.node(m).copy(c)),d++):a--;let f=on.empty,h=0;for(let m=s,g=!1;m>n;m--)g||o.after(m+1)=0;r--){if(i.size){let l=n[r].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=on.from(n[r].type.create(n[r].attrs,i))}let o=t.start,s=t.end;e.step(new ql(o,s,o,s,new mn(i,0,0),n.length,!0))}function Kxe(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(r,l)=>{let a=typeof o=="function"?o(r):o;if(r.isTextblock&&!r.hasMarkup(i,a)&&Zxe(e.doc,e.mapping.slice(s).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",m=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&pU(e,r,l,s),Ix(e,e.mapping.slice(s).map(l,1),i,void 0,u===null);let c=e.mapping.slice(s),d=c.map(l,1),f=c.map(l+r.nodeSize,1);return e.step(new ql(d,f,d+1,f-1,new mn(on.from(i.create(a,null,r.marks)),0,0),1,!0)),u===!0&&hU(e,r,l,s),!1}})}function hU(e,t,n,i){t.forEach((o,s)=>{if(o.isText){let r,l=/\r?\n|\r/g;for(;r=l.exec(o.text);){let a=e.mapping.slice(i).map(n+1+s+r.index);e.replaceWith(a,a+1,t.type.schema.linebreakReplacement.create())}}})}function pU(e,t,n,i){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+s);e.replaceWith(r,r+1,t.type.schema.text(` +`))}})}function Zxe(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function Gxe(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let r=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,r);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ql(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new mn(on.from(r),0,0),1,!0))}function f9(e,t,n=1,i){let o=e.resolve(t),s=o.depth-n,r=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!r.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,c=n-2;u>s;u--,c--){let d=o.node(u),f=o.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=i&&i[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=i&&i[c]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let l=o.indexAfter(s),a=i&&i[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function Qxe(e,t,n=1,i){let o=e.doc.resolve(t),s=on.empty,r=on.empty;for(let l=o.depth,a=o.depth-n,u=n-1;l>a;l--,u--){s=on.from(o.node(l).copy(s));let c=i&&i[u];r=on.from(c?c.type.create(c.attrs,r):o.node(l).copy(r))}e.step(new Hs(t,t,new mn(s.append(r),n,n),!0))}function mU(e,t){let n=e.resolve(t),i=n.index();return Jxe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function Yxe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o=0;o--){let s=i.index(o);if(i.node(o).canReplaceWith(s,s,n))return i.before(o+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let o=i.depth-1;o>=0;o--){let s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s=0;r--){let l=r==i.depth?0:i.pos<=(i.start(r+1)+i.end(r+1))/2?-1:1,a=i.index(r)+(l>0?1:0),u=i.node(r),c=!1;if(s==1)c=u.canReplace(a,a,o);else{let d=u.contentMatchAt(a).findWrapping(o.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?i.pos:l<0?i.before(r+1):i.after(r+1)}return null}function Ex(e,t,n=t,i=mn.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return gU(o,s,i)?new Hs(t,n,i):new nSe(o,s,i).fit()}function gU(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class nSe{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=on.empty;for(let o=0;o<=t.depth;o++){let s=t.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=on.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;let s=this.placed,r=i.depth,l=o.depth;for(;r&&l&&s.childCount==1;)s=s.firstChild.content,r--,l--;let a=new mn(s,r,l);return t>-1?new ql(i.pos,t,this.$to.pos,this.$to.end(),a,n):a.size||i.pos!=this.$to.pos?new Hs(i.pos,o.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,o=this.unplaced.openEnd;i1&&(o=0),s.type.spec.isolating&&o<=i){t=i;break}n=s.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let o,s=null;i?(s=a5(this.unplaced.content,i-1).firstChild,o=s.content):o=this.unplaced.content;let r=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(n==1&&(r?u.matchType(r.type)||(d=u.fillBefore(on.from(r),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:l,parent:s,inject:d};if(n==2&&r&&(c=u.findWrapping(r.type)))return{sliceDepth:i,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=a5(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new mn(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=a5(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new mn(Eg(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new mn(Eg(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g1||a==0||g.content.size)&&(d=v,c.push(vU(g.mark(f.allowedMarks(g.marks)),u==1?a:0,u==l.childCount?h:-1)))}let m=u==l.childCount;m||(h=-1),this.placed=Lg(this.placed,n,on.from(c)),this.frontier[n].match=d,m&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=l;g1&&o==this.$to.end(--i);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:o}=this.frontier[n],s=n=0;l--){let{match:a,type:u}=this.frontier[l],c=u5(t,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:r,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Lg(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let o=t.node(i),s=o.type.contentMatch.fillBefore(o.content,!0,t.index(i));this.openFrontierNode(o.type,o.attrs,s)}return t}openFrontierNode(t,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Lg(this.placed,this.depth,on.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(on.empty,!0);n.childCount&&(this.placed=Lg(this.placed,this.frontier.length,n))}}function Eg(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Eg(e.firstChild.content,t-1,n)))}function Lg(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Lg(e.lastChild.content,t-1,n)))}function a5(e,t){for(let n=0;n1&&(i=i.replaceChild(0,vU(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(on.empty,!0)))),e.copy(i)}function u5(e,t,n,i,o){let s=e.node(t),r=o?e.indexAfter(t):e.index(t);if(r==s.childCount&&!n.compatibleContent(s.type))return null;let l=i.fillBefore(s.content,!0,r);return l&&!iSe(n,s.content,r)?l:null}function iSe(e,t,n){for(let i=n;i0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;r.indexOf(f)>-1?l=f:o.before(f)==h&&r.splice(1,0,-f)}let a=r.indexOf(l),u=[],c=i.openStart;for(let f=i.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==i.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=oSe(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(l)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=i.openStart;f>=0;f--){let h=(f+c+1)%(i.openStart+1),m=u[h];if(m)for(let g=0;g=0&&(e.replace(t,n,i),!(e.steps.length>d));f--){let h=r[f];h<0||(t=o.before(h),n=s.after(h))}}function yU(e,t,n,i,o){if(ti){let s=o.contentMatchAt(0),r=s.fillBefore(e).append(e);e=r.append(s.matchFragment(r).fillBefore(on.empty,!0))}return e}function rSe(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=eSe(e.doc,t,i.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new mn(on.from(i),0,0))}function lSe(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n);if(i.parent.isTextblock&&o.parent.isTextblock&&i.start()!=o.start()&&i.parentOffset==0&&o.parentOffset==0){let r=i.sharedDepth(n),l=!1;for(let a=i.depth;a>r;a--)i.node(a).type.spec.isolating&&(l=!0);for(let a=o.depth;a>r;a--)o.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);for(let a=o.depth;a>0&&n==o.start(a);a--)n=o.before(a);i=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=kU(i,o);for(let r=0;r0&&(a||i.node(l-1).canReplace(i.index(l-1),o.indexAfter(l-1))))return e.delete(i.before(l),o.after(l))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r&&i.start(r-1)==o.start(r-1)&&i.node(r-1).canReplace(i.index(r-1),o.index(r-1)))return e.delete(i.before(r),n);e.delete(t,n)}function kU(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let o=i;o>=0;o--){let s=e.start(o);if(st.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(s==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==s-1)&&n.push(o)}return n}class A1 extends Lr{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return vs.fail("No node at attribute step's position");let i=Object.create(null);for(let s in n.attrs)i[s]=n.attrs[s];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return vs.fromReplace(t,this.pos,this.pos+1,new mn(on.from(o),0,n.isLeaf?0:1))}getMap(){return Rl.empty}invert(t){return new A1(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new A1(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new A1(n.pos,n.attr,n.value)}}Lr.jsonID("attr",A1);class ov extends Lr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return vs.ok(i)}getMap(){return Rl.empty}invert(t){return new ov(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ov(n.attr,n.value)}}Lr.jsonID("docAttr",ov);let q1=class extends Error{};q1=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};q1.prototype=Object.create(Error.prototype);q1.prototype.constructor=q1;q1.prototype.name="TransformError";class aSe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new iv}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new q1(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i{t=Math.min(t,l),n=Math.max(n,a)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=mn.empty){let o=Ex(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new mn(on.from(i),0,0))}delete(t,n){return this.replace(t,n,mn.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return sSe(this,t,n,i),this}replaceRangeWith(t,n,i){return rSe(this,t,n,i),this}deleteRange(t,n){return lSe(this,t,n),this}lift(t,n){return Uxe(this,t,n),this}join(t,n=1){return Xxe(this,t,n),this}wrap(t,n){return Vxe(this,t,n),this}setBlockType(t,n=t,i,o=null){return Kxe(this,t,n,i,o),this}setNodeMarkup(t,n,i=null,o){return Gxe(this,t,n,i,o),this}setNodeAttribute(t,n,i){return this.step(new A1(t,n,i)),this}setDocAttribute(t,n){return this.step(new ov(t,n)),this}addNodeMark(t,n){return this.step(new kd(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof ji)n.isInSet(i.marks)&&this.step(new zh(t,n));else{let o=i.marks,s,r=[];for(;s=n.isInSet(o);)r.push(new zh(t,s)),o=s.removeFromSet(o);for(let l=r.length-1;l>=0;l--)this.step(r[l])}return this}split(t,n=1,i){return Qxe(this,t,n,i),this}addMark(t,n,i){return Hxe(this,t,n,i),this}removeMark(t,n,i){return Wxe(this,t,n,i),this}clearIncompatible(t,n,i){return Ix(this,t,n,i),this}}const c5=Object.create(null);class Ui{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new uSe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;s--){let r=n<0?jp(t.node(0),t.node(s),t.before(s+1),t.index(s),n,i):jp(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,i);if(r)return r}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Ul(t.node(0))}static atStart(t){return jp(t,t,0,0,1)||new Ul(t)}static atEnd(t){return jp(t,t,t.content.size,t.childCount,-1)||new Ul(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=c5[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in c5)throw new RangeError("Duplicate use of selection JSON ID "+t);return c5[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ai.between(this.$anchor,this.$head).getBookmark()}}Ui.prototype.visible=!0;class uSe{constructor(t,n){this.$from=t,this.$to=n}}let aF=!1;function uF(e){!aF&&!e.parent.inlineContent&&(aF=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ai extends Ui{constructor(t,n=t){uF(t),uF(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return Ui.near(i);let o=t.resolve(n.map(this.anchor));return new ai(o.parent.inlineContent?o:i,i)}replace(t,n=mn.empty){if(super.replace(t,n),n==mn.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof ai&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new m4(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ai(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let o=t.resolve(n);return new this(o,i==n?o:t.resolve(i))}static between(t,n,i){let o=t.pos-n.pos;if((!i||o)&&(i=o>=0?1:-1),!n.parent.inlineContent){let s=Ui.findFrom(n,i,!0)||Ui.findFrom(n,-i,!0);if(s)n=s.$head;else return Ui.near(n,i)}return t.parent.inlineContent||(o==0?t=n:(t=(Ui.findFrom(t,-i,!0)||Ui.findFrom(t,i,!0)).$anchor,t.pos0?0:1);o>0?r=0;r+=o){let l=t.child(r);if(l.isAtom){if(!s&&Xn.isSelectable(l))return Xn.create(e,n-(o<0?l.nodeSize:0))}else{let a=jp(e,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function cF(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(Ui.near(e.doc.resolve(r),n))}const dF=1,wy=2,fF=4;class dSe extends aSe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=wy,this}ensureMarks(t){return ji.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&wy)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~wy,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let i=this.selection;return n&&(t=t.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||ji.none))),i.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,i){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(i==null&&(i=n),!t)return this.deleteRange(n,i);let s=this.storedMarks;if(!s){let r=this.doc.resolve(n);s=i==n?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,o.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Ui.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=fF,this}get scrolledIntoView(){return(this.updated&fF)>0}}function hF(e,t){return!t||!e?e:e.bind(t)}class Ng{constructor(t,n,i){this.name=t,this.init=hF(n.init,i),this.apply=hF(n.apply,i)}}const fSe=[new Ng("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Ng("selection",{init(e,t){return e.selection||Ui.atStart(t.doc)},apply(e){return e.selection}}),new Ng("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new Ng("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class d5{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=fSe.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new Ng(i.key,i.spec.state,i))})}}class rh{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let i=0;ii.toJSON())),t&&typeof t=="object")for(let i in t){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[i],s=o.spec.state;s&&s.toJSON&&(n[i]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new d5(t.schema,t.plugins),s=new rh(o);return o.fields.forEach(r=>{if(r.name=="doc")s.doc=xh.fromJSON(t.schema,n.doc);else if(r.name=="selection")s.selection=Ui.fromJSON(s.doc,n.selection);else if(r.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(i)for(let l in i){let a=i[l],u=a.spec.state;if(a.key==r.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[r.name]=u.fromJSON.call(a,t,n[l],s);return}}s[r.name]=r.init(t,s)}}),s}}function bU(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):i=="handleDOMEvents"&&(o=bU(o,t,{})),n[i]=o}return n}class gm{constructor(t){this.spec=t,this.props={},t.props&&bU(t.props,this,this.props),this.key=t.key?t.key.key:wU("plugin")}getState(t){return t[this.key]}}const f5=Object.create(null);function wU(e){return e in f5?e+"$"+ ++f5[e]:(f5[e]=0,e+"$")}class Nx{constructor(t="key"){this.key=wU(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const CA=` + + + + +`,CU=` + + + + +`,AU='',xU=` + + + +`,SU=` + + +`,_U='',MU=` + + +`,IU=` + + +`,TU=` + + +`,hSe='',pSe='',mSe='',gSe='',vSe='',ySe={sm:14,md:16,lg:20},kSe={file:CA,folder:CU,skill:AU,copy:xU,check:SU,"external-link":_U,target:MU,"file-edit":IU,close:TU,attachment:hSe,image:pSe,video:mSe,fullscreen:gSe,quote:vSe};function Qr(e,t="md"){const n=ySe[t];return kSe[e].replace(/]*>/,i=>i.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^
      ([\s\S]*?)<\/summary>/,Boe=/([\s\S]*?)<\/resume_hint>/,M3=/]*)>|<\/subagent>/g,Roe="",oI=/(completed|failed|aborted):\s*(\d+)/g,sI=/([a-z_]+)="([^"]*)"/g;function $oe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Ooe(e){const t={};sI.lastIndex=0;let n;for(;(n=sI.exec(e))!==null;)t[n[1]]=$oe(n[2]);return t}function Poe(e){const t={completed:0,failed:0,aborted:0};oI.lastIndex=0;let n;for(;(n=oI.exec(e))!==null;){const i=n[1];t[i]=Number(n[2])}return t}function zoe(e,t){const n=Ooe(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function joe(e){const t=[],n=[];M3.lastIndex=0;let i;for(;(i=M3.exec(e))!==null;)if(i[0]===Roe){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(zoe(o.attrs,e.slice(o.bodyStart,i.index)))}else n.length===0?n.push({attrs:i[1]??"",bodyStart:M3.lastIndex}):n.push(null);return t}function Hoe(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` -`):e;if(!t.includes(""))return null;const n=Foe.exec(t)?.[1]?.trim()??"",{completed:i,failed:o,aborted:s}=Poe(n),r=Boe.exec(t)?.[1]?.trim(),l=joe(t),a=i+o+s;return{summary:n,completed:i,failed:o,aborted:s,total:a>0?a:l.length,subagents:l,resumeHint:r}}const Woe=3,qoe="Use TaskOutput with one of the task_id values above to read the full output.";function Uf(e,t){return new RegExp(`^${t}: (.+)$`,"m").exec(e)?.[1]}function Uoe(e,t){const n=Number(Uf(e,t)??0);return Number.isFinite(n)?n:0}function GO(e,t){return e.match(t)?.length??0}function rI(e,t,n){const i=new RegExp(`^\\[${t}\\]$`,"gm"),o=[];let s;for(;(s=i.exec(e))!==null;)s.index>=n&&o.push(s.index);return o}function lI(e,t){return t>=2&&e[t-1]===` -`&&e[t-2]===` -`}function aI(e,t,n){const i=e.slice(t+n.length+2),o=/^\[/m.exec(i);return(o===null?i:i.slice(0,o.index)).trim()}function Voe(e){return e.endsWith(qoe)}function Koe(e){const t=Uf(e,"active_background_tasks");if(t===void 0)return!1;const n=Number(t);return Number.isFinite(n)?GO(e,/^task_id: /gm)===n:!1}function Zoe(e,t){return[...e.matchAll(/^description: (.+)$/gm)].map(i=>i[1]??"").slice(0,Math.min(Woe,t))}function Goe(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` -`):e,n=/^\[/m.exec(t),i=n===null?t:t.slice(0,n.index),o=Uf(i,"wait_status");if(o!=="completed"&&o!=="timed_out"&&o!=="no_tasks")return null;const s=Number(Uf(i,"waited_ms")??0);let r,l=n?.index??t.length;o==="completed"&&n!==null&&t.slice(n.index).startsWith("[finished]")&&(r=aI(t,n.index,"finished"),l=n.index+10);let a=0,u=-1;for(const f of rI(t,"completed_during_wait",l)){if(!lI(t,f))continue;const h=aI(t,f,"completed_during_wait");Voe(h)&&(a=GO(h,/^task_id: /gm),u=f)}let c=0,d=[];for(const f of rI(t,"still_running",l)){if(u>=0&&fc.replace(/\\/g,"/"),i=n(e);let o=n(t);o.length>1&&(o=o.replace(/\/+$/,""));const s=uI(o)||uI(i),r=s?o.toLowerCase():o,l=s?i.toLowerCase():i,a=r.endsWith("/")?r:`${r}/`;if(l!==r&&!l.startsWith(a))return null;const u=l===r?"":i.slice(a.length);return u.split("/").includes("..")?null:u||null}const Joe=50,Xoe=3,QO=Joe*2;function ese(e){const t=(e??[]).filter(n=>typeof n=="number"&&Number.isFinite(n)&&n>0).slice(0,2);return t.length===0?QO:Math.round(t.reduce((n,i)=>n+i,0))}function YO(e){return e==null||!Number.isFinite(e)||e<=0?QO:Math.round(e)}const _w=96;function tse(e,t,n){const i=e.filter(r=>r.visible),o=i[0],s=i[2];return{firstRowHeight:o?o.height:null,spanToThirdRow:s?s.viewportBottom-t+n:null}}function nse(e,t,n){const i=s=>s!=null&&Number.isFinite(s)&&s>0;return(s=>s!=null&&Number.isFinite(s)&&s>=0)(t)?i(e)?Math.round(e)+Math.round(t):i(n)?Math.round(n)*3+Math.round(t):_w:_w}function ise(e){return e>Xoe}function cI(e){return Math.round(e*.4)}function ose(e){return e==null||!Number.isFinite(e)||e<=0?_w:Math.round(e)}function sse(e,t,n,i){const o=YO(n),s=ose(i),r=Math.max(o,Math.round(e*.6));if(t===void 0||!Number.isFinite(t))return r;const l=Math.round(t)-s;return Math.max(o,Math.min(r,l))}function I3(e,t,n){return t==null||!Number.isFinite(t)?e:Math.max(YO(n),Math.min(e,Math.round(t)))}function rse(e,t,n,i){return Math.max(Math.round(i),Math.min(Math.round(e+t),Math.round(n)))}function lse(e,t){return t===null||t===e}const D9="application/x-kimi-session-row";function ase(e,t){return e.includes(t)?e:[...e,t]}function use(e,t){return e.includes(t)?e.filter(n=>n!==t):e}function cse(e,t){const n=new Set(t),i=new Map,o=[];for(const r of e)n.has(r.id)?i.set(r.id,r):o.push(r);const s=[];for(const r of t){const l=i.get(r);l!==void 0&&s.push(l)}return{pinned:s,unpinned:o}}const dse={"&":"&","<":"<",">":">",'"':""","'":"'"};function Fg(e){return e.replace(/[&<>"']/g,t=>dse[t]??t)}function fse(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hse(e,t,n=40){const i=e.replace(/\s+/g," ").trim();if(i.length===0)return"";const o=t.trim();if(o.length===0)return dI(i,n*2);const s=i.toLowerCase().indexOf(o.toLowerCase());if(s<0)return dI(i,n*2);const r=Math.max(0,s-n),l=Math.min(i.length,s+o.length+n),a=r>0,u=l`${s}`)}const JO=/([\s\S]*?)<\/kbd>/g;function pse(e){let t="",n=0;for(const i of e.matchAll(JO))t+=Fg(e.slice(n,i.index)),t+=`${Fg(i[1]??"")}`,n=i.index+i[0].length;return t+Fg(e.slice(n))}function mse(e){return e.replace(JO,"$1")}let gse=0;function vse(e,t){const n=++gse;return e.pendingPlanBySession[t]=n,n}function Mw(e,t,n){return n===void 0||e.pendingPlanBySession[t]!==n?!1:(delete e.pendingPlanBySession[t],!0)}function Iw(e,t,n){e.pendingPlanBySession[t]===void 0&&(e.planModeBySession[t]=n)}function yse(e,t,n){return e.find(i=>i.window?.duration===t&&i.window?.unit===n)}const kse=30;function bse(e){return e!==void 0&&e0?(l.push(t("settings.planUsage.durationDay",{n:o})),l.push(t("settings.planUsage.durationHour",{n:s})),l.push(t("settings.planUsage.durationMinute",{n:r}))):s>0?(l.push(t("settings.planUsage.durationHour",{n:s})),l.push(t("settings.planUsage.durationMinute",{n:r}))):r>0?l.push(t("settings.planUsage.durationMinute",{n:r})):l.push(t("settings.planUsage.durationSecond",{n:i})),t("settings.planUsage.resetsIn",{duration:l.join(" ")})}function Tw(e,t){if(t<=0)return"ok";const n=e/t;return n>=.85?"danger":n>=.5?"warn":"ok"}function _y(e,t){return t<=0?0:Math.min(100,Math.round(e/t*100))}function wse(e,t){const n=(e/100).toFixed(2);switch(t.toUpperCase()){case"CNY":return{symbol:"¥",number:n};case"USD":return{symbol:"$",number:n};default:return{symbol:"",number:`${n} ${t}`}}}const Cse=["kimi","openai","openai_responses","anthropic","google-genai","vertexai"];function C2(){return{model:"",maxContextSize:"",displayName:"",capabilities:["tool_use","thinking"],supportEfforts:[],adaptiveThinking:!0}}function Ew(e,t){const n=[];for(const i of Object.values(t??{})){if(i===null||typeof i!="object")continue;const o=i;o.provider===e.id&&n.push({model:typeof o.model=="string"?o.model:"",maxContextSize:typeof o.maxContextSize=="number"?String(o.maxContextSize):"",displayName:typeof o.displayName=="string"?o.displayName:"",capabilities:Array.isArray(o.capabilities)?o.capabilities.filter(s=>typeof s=="string"):[],supportEfforts:Array.isArray(o.supportEfforts)?o.supportEfforts.filter(s=>typeof s=="string"):[],...typeof o.adaptiveThinking=="boolean"?{adaptiveThinking:o.adaptiveThinking}:{}})}return n}const tP=/^[\p{L}\p{N}][\p{L}\p{N}\-_ ]*$/u;function Ase(e,t={}){const n=e.id.trim();if(n==="")return"idRequired";if(!tP.test(n))return"idInvalid";if(t.requireApiKey===!0&&e.apiKey.trim()==="")return"apiKeyRequired";if(t.requireBaseUrl===!0&&e.baseUrl.trim()==="")return"baseUrlRequired";if(e.models.length===0)return"modelRequired";for(const i of e.models){if(i.model.trim()==="")return"modelRequired";const o=i.maxContextSize.trim();if(o==="")return"contextSizeRequired";if(!/^\d+$/.test(o)||Number(o)<1)return"contextSizeInvalid"}return null}function nP(e){return e.map(t=>{const n=t.displayName.trim();return{model:t.model.trim(),maxContextSize:Number(t.maxContextSize.trim()),...t.capabilities.length>0?{capabilities:[...t.capabilities]}:{},...t.supportEfforts.length>0?{supportEfforts:[...t.supportEfforts]}:{},...t.adaptiveThinking!==void 0?{adaptiveThinking:t.adaptiveThinking}:{},...n===""?{}:{displayName:n}}})}function xse(e){const t=e.apiKey.trim(),n=e.baseUrl.trim();return{id:e.id.trim(),type:e.type,models:nP(e.models),...t===""?{}:{apiKey:t},...n===""?{}:{baseUrl:n}}}function Sse(e,t,n){const i=nP(e.models),o=e.id.trim(),s=e.apiKey.trim(),r=e.baseUrl.trim(),l=n?.existingDefaultModel?.trim()??"",a=l.indexOf("/")>=0?l.slice(l.indexOf("/")+1):l;return{...t!==void 0&&o!==""&&o!==t.id?{newId:o}:{},type:e.type,models:i,...s===""&&n?.includeBlankApiKey!==!0?{}:{apiKey:s},...r===""?{}:{baseUrl:r},...a!==""&&i.some(u=>u.model===a)?{defaultModel:a}:{}}}function iP(e){return e.id==="managed:kimi-code"&&e.type==="kimi"}const F9="/devices/",oP="kimi-rc-device-id";function _se(e){return new URLSearchParams(e.search).get("rc")==="1"}function sP(e){const{pathname:t}=e;if(!t.startsWith(F9))return;const n=t.slice(F9.length).split("/")[0];if(n)try{const i=decodeURIComponent(n);return i.length>0?i:void 0}catch{return}}function Mse(e){if(sP({pathname:e})===void 0)return e;const t=e.slice(F9.length),n=t.indexOf("/");return n<0?"/":t.slice(n)}function Ise(e){return`${F9}${encodeURIComponent(e)}/`}function rP(e,t){const n=new URLSearchParams(t),i=n.get("rc"),o=n.get("from");if(i===null&&o===null)return e;const s=new URLSearchParams;return i!==null&&s.set("rc",i),o!==null&&s.set("from",o),`${e}?${s.toString()}`}function Tse(e){const t=sP(e);return t!==void 0?(Lse(t),t):Ese()}function Ese(){try{return window.sessionStorage.getItem(oP)??void 0}catch{return}}function Lse(e){try{window.sessionStorage.setItem(oP,e)}catch{}}const Nse=/^(\d+)\t(.*)$/;function Dse(e){const t=e.at(-1)===""?e.slice(0,-1):e;if(t.length===0)return null;const n=[],i=[];for(const o of t){const s=Nse.exec(o);if(!s)return null;i.push(Number(s[1])),n.push(s[2]??"")}return{contents:n,lineNumbers:i}}function fI(e,t){let n="",i=t;const o=/^((?:\\\\|\/\/)[^\\/]+[\\/][^\\/]+)/.exec(t),s=/^([a-zA-Z]:)[\\/]?/.exec(t);o?(n=o[1],i=t.slice(o[1].length)):t.startsWith("/")?(n="/",i=t.slice(1)):s&&(n=s[1],i=t.slice(s[0].length));const r=n!=="",l=i.split(/[\\/]+/).filter(Boolean);for(const u of e.split("/"))u===""||u==="."||(u===".."?l.length>0&&l[l.length-1]!==".."?l.pop():r||l.push(".."):l.push(u));const a=l.join("/");return n==="/"?`/${a}`:n!==""?a?`${n}/${a}`:`${n}/`:a}function lP(e,t){for(const n of e.stateMachineNames){const i=(e.stateMachineInputs(n)??[]).find(o=>o.name===t);if(i!==void 0)return i}return null}function Fse(e,t){const n=lP(e,t);return n!==null&&typeof n.fire=="function"?(n.fire(),!0):!1}function hI(e,t,n){const i=lP(e,t);return i!==null&&typeof i.value==typeof n?(i.value=n,!0):!1}const T3={isPageHidden:()=>typeof document<"u"&&document.hidden,onVisibilityChange:e=>typeof document>"u"?()=>{}:(document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)),observeIntersection:(e,t)=>{if(typeof IntersectionObserver!="function")return()=>{};const n=new IntersectionObserver(i=>{const o=i[0];o!==void 0&&t(o.isIntersecting)});return n.observe(e),()=>n.disconnect()}};function aP(e,t,n={}){const i=n.isPageHidden??T3.isPageHidden,o=n.onVisibilityChange??T3.onVisibilityChange,s=n.observeIntersection??T3.observeIntersection;let r=!i(),l=!0,a=!1;function u(){const f=!r||!l;f!==a&&(a=f,a?e.pause():e.play())}const c=o(()=>{r=!i(),u()}),d=s(t,f=>{l=f,u()});return u(),()=>{c(),d()}}const er="kimi-web.server-credential",Bse="token",Rse=10080*60*1e3;let Cu;const Lw=new Set;function $se(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Bse);if(!n)return;const i=new URL(window.location.href);return i.hash="",window.history.replaceState(window.history.state,"",`${i.pathname}${i.search}`),n}function Nw(e){return{version:1,credential:e,expiresAt:Date.now()+Rse}}function Ose(e){return JSON.stringify(e)}function E6(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function Dw(e){globalThis.localStorage?.setItem(er,Ose(e))}function Pse(){try{const e=globalThis.localStorage?.getItem(er);if(e){const n=E6(e);if(n===void 0){const i=Nw(e);let o=!1;try{Dw(i),o=!0}catch{}if(!o)try{globalThis.localStorage?.getItem(er)===e&&globalThis.localStorage?.removeItem(er),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(er)}catch{}return o?i:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(er),globalThis.localStorage?.getItem(er)===e&&globalThis.localStorage?.removeItem(er);return}const t=globalThis.sessionStorage?.getItem(er);if(t){const n=Nw(t);let i=!1;try{Dw(n),i=!0}catch{}try{globalThis.sessionStorage?.removeItem(er),i=!0}catch{}return i?n:void 0}return}catch{return}}function zse(){const e=$se();return e?(uP(e),!0):(Cu=Pse(),Cu!==void 0)}function jse(){if(Cu!==void 0){if(Cu.expiresAt<=Date.now()){Hse(Cu);return}return Cu.credential}}function Hse(e){Cu=void 0;try{globalThis.sessionStorage?.removeItem(er);const t=globalThis.localStorage?.getItem(er),n=t==null?void 0:E6(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(er)}catch{}}function uP(e){const t=Nw(e);Cu=t;try{Dw(t)}catch{}try{globalThis.sessionStorage?.removeItem(er)}catch{}}function Wse(){const e=Cu;Cu=void 0;try{const t=globalThis.localStorage?.getItem(er),i=(t==null?void 0:E6(t))?.credential??t;e!==void 0&&i===e.credential&&globalThis.localStorage?.removeItem(er),globalThis.sessionStorage?.removeItem(er)}catch{}}function qse(e){return Lw.add(e),()=>{Lw.delete(e)}}function Use(){Wse();for(const e of Lw)try{e()}catch{}}function pv(e){return e.approvalCount>0?"awaiting-approval":e.questionCount>0?"awaiting-question":e.pendingInteraction==="approval"?"awaiting-approval":e.pendingInteraction==="question"?"awaiting-question":e.busy?"running":e.lastTurnReason==="failed"?"aborted":e.unread?"unread":"idle"}function pI(e){let t=null;for(const n of e){const i=pv(n);if(i==="awaiting-approval")return"approval";i==="awaiting-question"?t="question":i==="aborted"?t!=="question"&&(t="aborted"):i==="unread"&&t===null&&(t="unread")}return t}let mI;function Vse(e){if(typeof Intl.Segmenter=="function")return mI??=new Intl.Segmenter("und",{granularity:"grapheme"}),mI.segment(e)}const Kse=/\p{Emoji_Presentation}/u,Zse=/\p{Regional_Indicator}/u,Gse=/\p{Extended_Pictographic}/u,Qse="️";function Yse(e){return Kse.test(e)||Zse.test(e)?!0:Gse.test(e)&&e.includes(Qse)}function cP(e){const t=Vse(e)?.[Symbol.iterator]().next().value;if(t===void 0||!Yse(t.segment))return{emoji:null,rest:e};const n=e.slice(t.index+t.segment.length).replace(/^\s+/,"");return{emoji:t.segment,rest:n}}function Jse(e,t){const{rest:n}=cP(e),i=t?.trim()??"";return i?n?`${i} ${n}`:i:n}function dP(e,t){const n=e.findIndex(s=>s.id===t.id);if(n!==-1&&e[n].updatedAt===t.updatedAt)return e.map(s=>s.id===t.id?t:s);const i=e.filter(s=>s.id!==t.id),o=i.findIndex(s=>s.updatedAt0?i:void 0}catch{return}}function Xse(e){return e===void 0||e.length===0?"/":`${Fw}${encodeURIComponent(e)}`}function hP(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const e=navigator.userAgentData;return e?.platform==="macOS"||e?.platform==="iOS"}function ere(e,t=hP()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyA"||e.key.toLowerCase()==="a")&&!e.defaultPrevented}function tre(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement&&(e.isContentEditable||e.closest("input, textarea")!==null)}function nre(e,t){return typeof Element>"u"||!(e instanceof Element)?null:e.closest(t)}function yI(e){e.ownerDocument.getSelection()?.selectAllChildren(e)}function ire(e,t=hP()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyK"||e.key.toLowerCase()==="k")&&!e.defaultPrevented}const ore=[{pattern:/\brm\s+(?:-[a-zA-Z]*[rf][a-zA-Z]*|--recursive|--force)\b/,detail:"rm -rf"},{pattern:/\bsudo\b/,detail:"sudo"},{pattern:/\bmkfs(?:\.[a-z0-9]+)?\b/,detail:"mkfs"},{pattern:/\bdd\b[^|;&]*\bof=/,detail:"dd of=…"},{pattern:/>\s*\/dev\/(?:sd|nvme|disk|hd)/,detail:"> /dev/…"},{pattern:/:\(\)\s*\{/,detail:"fork bomb"},{pattern:/\bgit\s+push\b[^|;&]*(?:--force(?:-with-lease)?\b|\s-f\b)/,detail:"git push --force"},{pattern:/\bchmod\s+(?:-[a-zA-Z]+\s+)*777\b/,detail:"chmod 777"},{pattern:/\b(?:curl|wget)\b[^|;&]*\|\s*(?:sudo\s+)?(?:ba|z)?sh\b/,detail:"curl | sh"},{pattern:/\b(?:shutdown|reboot|poweroff|halt)\b/,detail:"shutdown / reboot"}];function sre(e){const t=e.replace(/"[^"]*"|'[^']*'/g," ");for(const{pattern:n,detail:i}of ore)if(n.test(t))return i}function tf(e){return Array.isArray?Array.isArray(e):mP(e)==="[object Array]"}function rre(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Bw(e){return e==null?"":rre(e)}function br(e){return typeof e=="string"}function My(e){return typeof e=="number"}function lre(e){return e===!0||e===!1||are(e)&&mP(e)=="[object Boolean]"}function pP(e){return typeof e=="object"}function are(e){return pP(e)&&e!==null}function El(e){return e!=null}function A2(e){return!e.trim().length}function mP(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const ure="Incorrect 'index' type",Rw="Invalid doc index: must be a non-negative integer within the bounds of the docs array",cre=e=>`Invalid value for key ${e}`,dre=e=>`Pattern length exceeds max of ${e}.`,fre=e=>`Missing ${e} property in key`,hre=e=>`Property 'weight' in key '${e}' must be a positive integer`,pre="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",kI=Object.prototype.hasOwnProperty;var mre=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const i=gP(n);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function gP(e){let t=null,n=null,i=null,o=1,s=null;if(br(e)||tf(e))i=e,t=bI(e),n=Iy(e);else{if(!kI.call(e,"name"))throw new Error(fre("name"));const r=e.name;if(i=r,kI.call(e,"weight")&&e.weight!==void 0&&(o=e.weight,o<=0))throw new Error(hre(Iy(r)));t=bI(r),n=Iy(r),s=e.getFn??null}return{path:t,id:n,weight:o,src:i,getFn:s}}function bI(e){return tf(e)?e:e.split(".")}function Iy(e){return tf(e)?e.join("."):e}function gre(e,t){const n=[];let i=!1;const o=(s,r,l,a)=>{if(El(s))if(!r[l])n.push(a!==void 0?{v:s,i:a}:s);else{const u=s[r[l]];if(!El(u))return;if(l===r.length-1&&(br(u)||My(u)||lre(u)||typeof u=="bigint"))n.push(a!==void 0?{v:Bw(u),i:a}:Bw(u));else if(tf(u)){i=!0;for(let c=0,d=u.length;ce.score===t.score?e.idx=9&&e<=13||e===32||e===160}function Cre(e=1,t=3){const n=new Map,i=Math.pow(10,t);return{get(o){let s=0,r=!1;for(let a=0;a{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(br(this.docs[0]))for(let n=0;ne&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const i of e)Number.isInteger(i)&&i>=0&&t.add(i);if(t.size===0)return;this.records=this.records.filter(i=>!t.has(i.i));const n=Array.from(t).sort((i,o)=>i-o);for(const i of this.records){let o=0,s=n.length;for(;o>>1;n[r]t),records:this.records}}};function vP(e,t,{getFn:n=On.getFn,fieldNormWeight:i=On.fieldNormWeight}={}){const o=new L6({getFn:n,fieldNormWeight:i});return o.setKeys(e.map(gP)),o.setSources(t),o.create(),o}function Are(e,{getFn:t=On.getFn,fieldNormWeight:n=On.fieldNormWeight}={}){const{keys:i,records:o}=e,s=new L6({getFn:t,fieldNormWeight:n});return s.setKeys(i),s.setIndexRecords(o),s}function xre(e=[],t=On.minMatchCharLength){const n=[];let i=-1,o=-1,s=0;for(let r=e.length;s=t&&n.push([i,o]),i=-1)}return e[s-1]&&s-i>=t&&n.push([i,s-1]),n}function Sre(e,t,n,{location:i=On.location,distance:o=On.distance,threshold:s=On.threshold,findAllMatches:r=On.findAllMatches,minMatchCharLength:l=On.minMatchCharLength,includeMatches:a=On.includeMatches,ignoreLocation:u=On.ignoreLocation}={}){if(t.length>32)throw new Error(dre(32));const c=t.length,d=e.length,f=Math.max(0,Math.min(i,d));let h=s,m=f;const g=(_,x)=>{const E=_/c;if(u)return E;const M=Math.abs(f-x);return o?E+M/o:M?1:E},v=l>1||a,y=v?Array(d):[];let b;for(;(b=e.indexOf(t,m))>-1;){const _=g(0,b);if(h=Math.min(_,h),m=b+c,v){let x=0;for(;x=M;z-=1){const O=z-1,B=n[e[O]];if(q[z]=(q[z+1]<<1|1)&B,_&&(q[z]|=(w[z+1]|w[z])<<1|1|w[z+1]),q[z]&I&&(C=g(_,O),C<=h)){if(h=C,m=O,T=_,m<=f)break;M=Math.max(1,2*f-m)}}if(g(_+1,f)>h)break;w=q}if(v&&m>=0){const _=Math.min(d-1,m+c-1+T);for(let x=m;x<=_;x+=1)n[e[x]]&&(y[x]=1)}const S={isMatch:m>=0,score:Math.max(.001,C)};if(v){const _=xre(y,l);_.length?a&&(S.indices=_):S.isMatch=!1}return S}function _re(e){const t={};for(let n=0,i=e.length;nn[0]-i[0]||n[1]-i[1]);const t=[e[0]];for(let n=1,i=e.length;ne.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(Mre,t=>yP[t]):e=>e;var D6=class{constructor(e,{location:t=On.location,threshold:n=On.threshold,distance:i=On.distance,includeMatches:o=On.includeMatches,findAllMatches:s=On.findAllMatches,minMatchCharLength:r=On.minMatchCharLength,isCaseSensitive:l=On.isCaseSensitive,ignoreDiacritics:a=On.ignoreDiacritics,ignoreLocation:u=On.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:i,includeMatches:o,findAllMatches:s,minMatchCharLength:r,isCaseSensitive:l,ignoreDiacritics:a,ignoreLocation:u},e=l?e:e.toLowerCase(),e=a?S0(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const c=(f,h)=>{this.chunks.push({pattern:f,alphabet:_re(f),startIndex:h})},d=this.pattern.length;if(d>32){let f=0;const h=d%32,m=d-h;for(;f{const{isMatch:y,score:b,indices:w}=Sre(e,m,g,{location:o+v,distance:s,threshold:r,findAllMatches:l,minMatchCharLength:a,includeMatches:i,ignoreLocation:u});y&&(f=!0),d+=b,y&&w&&c.push(...w)});const h={isMatch:f,score:f?d/this.chunks.length:1};return f&&i&&(h.indices=N6(c)),h}};const Ire=new Set(["fuzzy","include"]);function Tre(e){return e.startsWith("inverse")}const $w=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,i;const o=[],s=e.length;for(;(i=t.indexOf(e,n))>-1;)n=i+s,o.push([i,n-1]);const r=!!o.length;return{isMatch:r,score:r?0:1,indices:o}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new D6(e,{location:t.location??On.location,threshold:t.threshold??On.threshold,distance:t.distance??On.distance,includeMatches:t.includeMatches??On.includeMatches,findAllMatches:t.findAllMatches??On.findAllMatches,minMatchCharLength:t.minMatchCharLength??On.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??On.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??On.ignoreDiacritics,ignoreLocation:t.ignoreLocation??On.ignoreLocation});return{type:"fuzzy",search(i){return n.searchIn(i)}}}}],wI=$w.length,Ere="\0",Lre="|";function Nre(e){const t=[],n=e.length;let i=0;for(;i=n)break;let o=i;for(;o=n||e[s]===" "){o++;break}if(e[s]==="$"&&(s+1>=n||e[s+1]===" ")){o+=2;break}}o++}t.push(e.substring(i,o)),i=o}else{for(;o{const i=Nre(n.replace(/\u0000/g,"|").trim()).filter(s=>s&&!!s.trim()),o=[];for(let s=0,r=i.length;s!!(e[R9.AND]||e[R9.OR]),Bre=e=>!!e[Pw.PATH],Rre=e=>!tf(e)&&pP(e)&&!zw(e),AI=e=>({[R9.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function kP(e,t,{auto:n=!0}={}){const i=o=>{if(br(o)){const a={keyId:null,pattern:o};return n&&(a.searcher=B9(o,t)),a}const s=Object.keys(o),r=Bre(o);if(!r&&s.length>1&&!zw(o))return i(AI(o));if(Rre(o)){const a=r?o[Pw.PATH]:s[0],u=r?o[Pw.PATTERN]:o[a];if(!br(u))throw new Error(cre(a));const c={keyId:Iy(a),pattern:u};return n&&(c.searcher=B9(u,t)),c}const l={children:[],operator:s[0]};return s.forEach(a=>{const u=o[a];tf(u)&&u.forEach(c=>{l.children.push(i(c))})}),l};return zw(e)||(e=AI(e)),i(e)}function jw(e,{ignoreFieldNorm:t=On.ignoreFieldNorm}){let n=1;return e.forEach(({key:i,norm:o,score:s})=>{const r=i?i.weight:null;n*=Math.pow(s===0&&r?Number.EPSILON:s,(r||1)*(t?1:o))}),n}function $re(e,{ignoreFieldNorm:t=On.ignoreFieldNorm}){e.forEach(n=>{n.score=jw(n.matches,{ignoreFieldNorm:t})})}var Ore=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const i=t[e];t[e]=t[n],t[n]=i,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let i=e;do{e=i;const o=2*e+1,s=2*e+2;if(o0&&(i=o),s0&&(i=s),i!==e){const r=t[e];t[e]=t[i],t[i]=r}}while(i!==e)}};function Pre(e){const t=[];return e.matches.forEach(n=>{if(!El(n.indices)||!n.indices.length)return;const i={indices:n.indices,value:n.value};n.key&&(i.key=n.key.id),n.idx>-1&&(i.refIndex=n.idx),t.push(i)}),t}function zre(e,t,{includeMatches:n=On.includeMatches,includeScore:i=On.includeScore}={}){return e.map(o=>{const{idx:s}=o,r={item:t[s],refIndex:s};return n&&(r.matches=Pre(o)),i&&(r.score=o.score),r})}const jre=/[\p{L}\p{M}\p{N}_]+/gu,xI=new WeakSet;function Hre(e){xI.has(e)||(xI.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function Wre(e){if(typeof e=="function"){let t=!1;return n=>{const i=e(n);if(!t&&(t=!0,!Array.isArray(i)||i.some(o=>typeof o!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(i)?"array containing non-strings":typeof i}.`);return i}}return e instanceof RegExp?(e.global||Hre(e),t=>t.match(e)||[]):t=>t.match(jre)||[]}function Hw({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const i=Wre(n);return{tokenize(o){return e||(o=o.toLowerCase()),t&&(o=S0(o)),i(o)}}}var qre=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Hw({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:i,fieldCount:o}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const s of n){this.termSearchers.push(new D6(s,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const r=i.get(s)||0,l=Math.log(1+(o-r+.5)/(r+.5));this.idfWeights.push(l)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,i=0,o=0,s=0;const r=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u0?1-n/i:0,a={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&t.length&&(a.indices=N6(t)),this.combineAll&&(this.useMask?a.matchedMask=s:a.matchedTerms=r,a.termCount=this.numTerms),a}};function E3(e,t,n,i){const o=i.tokenize(t);if(!o.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const s=new Set(o);let r=e.docTermFieldHits.get(n);r||(r=new Map,e.docTermFieldHits.set(n,r));for(const l of s)r.set(l,(r.get(l)||0)+1),e.df.set(l,(e.df.get(l)||0)+1)}function bP(e,t,n,i){const{i:o,v:s,$:r}=t;if(s!==void 0){E3(e,s,o,i);return}if(r)for(let l=0;ll-a);for(const l of n)Kre(e,l);const i=l=>{let a=0,u=n.length;for(;a>>1;n[c]o?i(l):l,a);e.docFieldCount=s;const r=new Map;for(const[l,a]of e.docTermFieldHits)r.set(l>o?i(l):l,a);e.docTermFieldHits=r}var nf=class{constructor(e,t,n){this.options={...On,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new mre(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=B9(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof L6))throw new Error(ure);if(this._myIndex=t||vP(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=Hw({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Ure(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!El(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=Hw({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Vre(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let i=0,o=this._docs.length;i!i.has(s)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(Rw);this._invertedIndex&&SI(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:i,includeScore:o,shouldSort:s,sortFn:r,ignoreFieldNorm:l}=this.options;if(br(e)&&!e.trim()){let f=this._docs.map((h,m)=>({item:h,refIndex:m}));return My(n)&&n>-1&&(f=f.slice(0,n)),f}const a=s&&My(n)&&n>0&&br(e),u=r,c=(f,h)=>u(f,h)||f.idx-h.idx;let d;if(a){const f=new Ore(n,c);br(this._docs[0])?this._searchStringList(e,{heap:f,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:f,ignoreFieldNorm:l}),d=f.extractSorted()}else d=br(e)?br(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),$re(d,{ignoreFieldNorm:l}),s&&d.sort(br(e)?c:u),My(n)&&n>-1&&(d=d.slice(0,n));return zre(d,this._docs,{includeMatches:i,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const i=this._getSearcher(e),o=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:s}=this._myIndex,r=t?null:[];return s.forEach(({v:l,i:a,n:u})=>{if(!El(l))return;const c=i.searchIn(l);if(c.isMatch){const d={score:c.score,value:l,norm:u,indices:c.indices};o&&(d.matchedMask=c.matchedMask,d.matchedTerms=c.matchedTerms,d.termCount=c.termCount);const f=[d];if(!o||this._coversAllTokens(f)){const h={item:l,idx:a,matches:f};t?(h.score=jw(h.matches,{ignoreFieldNorm:n}),t.insert(h)):r.push(h)}}}),r}_searchLogical(e){const t=kP(e,this.options),n=this._normalizedKeys(),i=(l,a,u)=>{if(!("children"in l)){const{keyId:h,searcher:m}=l;let g;return h===null?(g=[],n.forEach((v,y)=>{g.push(...this._findMatches({key:v,value:a[y],searcher:m}))})):g=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(a,h),searcher:m}),g&&g.length?[{idx:u,item:a,matches:g}]:[]}const{children:c,operator:d}=l,f=[];for(let h=0,m=c.length;h{if(El(l)){const u=i(t,l,a);u.length&&(s.has(a)||(s.set(a,{idx:a,item:l,matches:[]}),r.push(s.get(a))),u.forEach(({matches:c})=>{s.get(a).matches.push(...c)}))}}),r}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const i=this._getSearcher(e),o=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:s}=this._myIndex,r=this._normalizedKeys(),l=t?null:[];return s.forEach(({$:a,i:u})=>{if(!El(a))return;const c=[];let d=!1,f=!1;if(r.forEach((h,m)=>{const g=this._findMatches({key:h,value:a[m],searcher:i});g.length?(c.push(...g),g[0].hasInverse&&(f=!0)):d=!0}),!(f&&d)&&c.length&&(!o||this._coversAllTokens(c))){const h={idx:u,item:a,matches:c};t?(h.score=jw(h.matches,{ignoreFieldNorm:n}),t.insert(h)):l.push(h)}}),l}_findMatches({key:e,value:t,searcher:n}){if(!El(t))return[];const i=[];if(tf(t))t.forEach(({v:o,i:s,n:r})=>{if(!El(o))return;const l=n.searchIn(o);if(l.isMatch){const a={score:l.score,key:e,value:o,idx:s,norm:r,indices:l.indices,hasInverse:l.hasInverse};l.termCount!==void 0&&(a.matchedMask=l.matchedMask,a.matchedTerms=l.matchedTerms,a.termCount=l.termCount),i.push(a)}});else{const{v:o,n:s}=t,r=n.searchIn(o);if(r.isMatch){const l={score:r.score,key:e,value:o,norm:s,indices:r.indices,hasInverse:r.hasInverse};r.termCount!==void 0&&(l.matchedMask=r.matchedMask,l.matchedTerms=r.matchedTerms,l.termCount=r.termCount),i.push(l)}}return i}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let i=0;for(let o=0;oF6(t))};var Zre=nf;const Gre=/^[\uD800-\uDBFF]$/,Qre=/^[\uDC00-\uDFFF]$/,Yre=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;var _I;(function(e){e[e.Unknown=1e-13]="Unknown",e[e.Rule=1e-12]="Rule",e[e.DICT=2e-8]="DICT",e[e.Surname=1]="Surname",e[e.Custom=1]="Custom"})(_I||(_I={}));const Wl={Normal:1,Surname:10,Custom:100};function Fa(e){var t;return e.length-(((t=e.match(Yre))===null||t===void 0?void 0:t.length)||0)}function Ww(e){const t=[];let n=0;for(;n1)return this.StringDICT.get(t);{const n=t.charCodeAt(0);return this.NumberDICT[n]}}set(t,n){if(t.length>1)this.StringDICT.set(t,n);else{const i=t.charCodeAt(0);this.NumberDICT[i]=n}}clear(){this.NumberDICT=[],this.StringDICT.clear()}}const Jre=["zh","ch","sh","z","c","s","b","p","m","f","d","t","n","l","g","k","h","j","q","x","r","y","w",""],Xre=["j","q","x"],ele=["uān","uán","uǎn","uàn","uan","uē","ué","uě","uè","ue","ūn","ún","ǔn","ùn","un","ū","ú","ǔ","ù","u"],tle={uān:"üān",uán:"üán",uǎn:"üǎn",uàn:"üàn",uan:"üan",uē:"üē",ué:"üé",uě:"üě",uè:"üè",ue:"üe",ūn:"ǖn",ún:"ǘn",ǔn:"ǚn",ùn:"ǜn",un:"ün",ū:"ǖ",ú:"ǘ",ǔ:"ǚ",ù:"ǜ",u:"ü"},nle=["ia","ian","iang","iao","ie","iu","iong","ua","uai","uan","uang","ue","ui","uo","üan","üe","van","ve"],MI={一:"yì",二:"èr",三:"sān",四:"sì",五:"wǔ",六:"liù",七:"qī",八:"bā",九:"jiǔ",十:"shí",百:"bǎi",千:"qiān",万:"wàn",亿:"yì",单:"dān",两:"liǎng",双:"shuāng",多:"duō",几:"jǐ",十一:"shí yī",零一:"líng yī",第一:"dì yī",一十:"yī shí",一十一:"yī shí yī"},II={重:"chóng",行:"háng",斗:"dǒu",更:"gēng"};function ile(){const e={零一:"líng yī","〇一":"líng yī",十一:"shí yī",一十:"yī shí",第一:"dì yī",一十一:"yī shí yī"};for(let t in MI)for(let n in II){const i=`${t}${n}`,o=`${MI[t]} ${II[n]}`;e[i]=o}return e}const TI=ile(),ole=Object.keys(TI).map(e=>({zh:e,pinyin:TI[e],probability:1e-12,length:Fa(e),priority:Wl.Normal,dict:Symbol("rule")})),CP={不:{bú:[4]},一:{yí:[4],yì:[1,2,3]}},sle={不:["的","而","之","后","也","还","地"],一:["的","而","之","后","也","还","是"]},rle=Object.keys(CP),qw={南宫:"nán gōng",第五:"dì wǔ",万俟:"mò qí",司马:"sī mǎ",上官:"shàng guān",欧阳:"ōu yáng",夏侯:"xià hóu",诸葛:"zhū gě",闻人:"wén rén",东方:"dōng fāng",赫连:"hè lián",皇甫:"huáng fǔ",尉迟:"yù chí",公羊:"gōng yáng",澹台:"tán tái",公冶:"gōng yě",宗政:"zōng zhèng",濮阳:"pú yáng",淳于:"chún yú",太叔:"tài shū",申屠:"shēn tú",公孙:"gōng sūn",仲孙:"zhòng sūn",轩辕:"xuān yuán",令狐:"líng hú",钟离:"zhōng lí",宇文:"yǔ wén",长孙:"zhǎng sūn",慕容:"mù róng",鲜于:"xiān yú",闾丘:"lǘ qiū",司徒:"sī tú",司空:"sī kōng",亓官:"qí guān",司寇:"sī kòu",仉督:"zhǎng dū",子车:"zǐ jū",颛孙:"zhuān sūn",端木:"duān mù",巫马:"wū mǎ",公西:"gōng xī",漆雕:"qī diāo",乐正:"yuè zhèng",壤驷:"rǎng sì",公良:"gōng liáng",拓跋:"tuò bá",夹谷:"jiá gǔ",宰父:"zǎi fǔ",榖梁:"gǔ liáng",段干:"duàn gān",百里:"bǎi lǐ",东郭:"dōng guō",南门:"nán mén",呼延:"hū yán",羊舌:"yáng shé",梁丘:"liáng qiū",左丘:"zuǒ qiū",东门:"dōng mén",西门:"xī mén",句龙:"gōu lóng",毌丘:"guàn qiū",赵:"zhào",钱:"qián",孙:"sūn",李:"lǐ",周:"zhōu",吴:"wú",郑:"zhèng",王:"wáng",冯:"féng",陈:"chén",褚:"chǔ",卫:"wèi",蒋:"jiǎng",沈:"shěn",韩:"hán",杨:"yáng",朱:"zhū",秦:"qín",尤:"yóu",许:"xǔ",何:"hé",吕:"lǚ",施:"shī",张:"zhāng",孔:"kǒng",曹:"cáo",严:"yán",华:"huà",金:"jīn",魏:"wèi",陶:"táo",姜:"jiāng",戚:"qī",谢:"xiè",邹:"zōu",喻:"yù",柏:"bǎi",水:"shuǐ",窦:"dòu",章:"zhāng",云:"yún",苏:"sū",潘:"pān",葛:"gě",奚:"xī",范:"fàn",彭:"péng",郎:"láng",鲁:"lǔ",韦:"wéi",昌:"chāng",马:"mǎ",苗:"miáo",凤:"fèng",花:"huā",方:"fāng",俞:"yú",任:"rén",袁:"yuán",柳:"liǔ",酆:"fēng",鲍:"bào",史:"shǐ",唐:"táng",费:"fèi",廉:"lián",岑:"cén",薛:"xuē",雷:"léi",贺:"hè",倪:"ní",汤:"tāng",滕:"téng",殷:"yīn",罗:"luó",毕:"bì",郝:"hǎo",邬:"wū",安:"ān",常:"cháng",乐:"yuè",于:"yú",时:"shí",傅:"fù",皮:"pí",卞:"biàn",齐:"qí",康:"kāng",伍:"wǔ",余:"yú",元:"yuán",卜:"bǔ",顾:"gù",孟:"mèng",平:"píng",黄:"huáng",和:"hé",穆:"mù",萧:"xiāo",尹:"yǐn",姚:"yáo",邵:"shào",湛:"zhàn",汪:"wāng",祁:"qí",毛:"máo",禹:"yǔ",狄:"dí",米:"mǐ",贝:"bèi",明:"míng",臧:"zāng",计:"jì",伏:"fú",成:"chéng",戴:"dài",谈:"tán",宋:"sòng",茅:"máo",庞:"páng",熊:"xióng",纪:"jǐ",舒:"shū",屈:"qū",项:"xiàng",祝:"zhù",董:"dǒng",梁:"liáng",杜:"dù",阮:"ruǎn",蓝:"lán",闵:"mǐn",席:"xí",季:"jì",麻:"má",强:"qiáng",贾:"jiǎ",路:"lù",娄:"lóu",危:"wēi",江:"jiāng",童:"tóng",颜:"yán",郭:"guō",梅:"méi",盛:"shèng",林:"lín",刁:"diāo",钟:"zhōng",徐:"xú",邱:"qiū",骆:"luò",高:"gāo",夏:"xià",蔡:"cài",田:"tián",樊:"fán",胡:"hú",凌:"líng",霍:"huò",虞:"yú",万:"wàn",支:"zhī",柯:"kē",昝:"zǎn",管:"guǎn",卢:"lú",莫:"mò",经:"jīng",房:"fáng",裘:"qiú",缪:"miào",干:"gān",解:"xiè",应:"yīng",宗:"zōng",丁:"dīng",宣:"xuān",贲:"bēn",邓:"dèng",郁:"yù",单:"shàn",杭:"háng",洪:"hóng",包:"bāo",诸:"zhū",左:"zuǒ",石:"shí",崔:"cuī",吉:"jí",钮:"niǔ",龚:"gōng",程:"chéng",嵇:"jī",邢:"xíng",滑:"huá",裴:"péi",陆:"lù",荣:"róng",翁:"wēng",荀:"xún",羊:"yáng",於:"yū",惠:"huì",甄:"zhēn",曲:"qū",家:"jiā",封:"fēng",芮:"ruì",羿:"yì",储:"chǔ",靳:"jìn",汲:"jí",邴:"bǐng",糜:"mí",松:"sōng",井:"jǐng",段:"duàn",富:"fù",巫:"wū",乌:"wū",焦:"jiāo",巴:"bā",弓:"gōng",牧:"mù",隗:"wěi",山:"shān",谷:"gǔ",车:"chē",侯:"hóu",宓:"mì",蓬:"péng",全:"quán",郗:"xī",班:"bān",仰:"yǎng",秋:"qiū",仲:"zhòng",伊:"yī",宫:"gōng",宁:"nìng",仇:"qiú",栾:"luán",暴:"bào",甘:"gān",钭:"tǒu",厉:"lì",戎:"róng",祖:"zǔ",武:"wǔ",符:"fú",刘:"liú",景:"jǐng",詹:"zhān",束:"shù",龙:"lóng",叶:"yè",幸:"xìng",司:"sī",韶:"sháo",郜:"gào",黎:"lí",蓟:"jì",薄:"bó",印:"yìn",宿:"sù",白:"bái",怀:"huái",蒲:"pú",邰:"tái",从:"cóng",鄂:"è",索:"suǒ",咸:"xián",籍:"jí",赖:"lài",卓:"zhuó",蔺:"lìn",屠:"tú",蒙:"méng",池:"chí",乔:"qiáo",阴:"yīn",鬱:"yù",胥:"xū",能:"nài",苍:"cāng",双:"shuāng",闻:"wén",莘:"shēn",党:"dǎng",翟:"zhái",谭:"tán",贡:"gòng",劳:"láo",逄:"páng",姬:"jī",申:"shēn",扶:"fú",堵:"dǔ",冉:"rǎn",宰:"zǎi",郦:"lì",雍:"yōng",郤:"xì",璩:"qú",桑:"sāng",桂:"guì",濮:"pú",牛:"niú",寿:"shòu",通:"tōng",边:"biān",扈:"hù",燕:"yān",冀:"jì",郏:"jiá",浦:"pǔ",尚:"shàng",农:"nóng",温:"wēn",别:"bié",庄:"zhuāng",晏:"yàn",柴:"chái",瞿:"qú",阎:"yán",充:"chōng",慕:"mù",连:"lián",茹:"rú",习:"xí",宦:"huàn",艾:"ài",鱼:"yú",容:"róng",向:"xiàng",古:"gǔ",易:"yì",慎:"shèn",戈:"gē",廖:"liào",庾:"yǔ",终:"zhōng",暨:"jì",居:"jū",衡:"héng",步:"bù",都:"dū",耿:"gěng",满:"mǎn",弘:"hóng",匡:"kuāng",国:"guó",文:"wén",寇:"kòu",广:"guǎng",禄:"lù",阙:"quē",东:"dōng",欧:"ōu",殳:"shū",沃:"wò",利:"lì",蔚:"wèi",越:"yuè",夔:"kuí",隆:"lóng",师:"shī",巩:"gǒng",厍:"shè",聂:"niè",晁:"cháo",勾:"gōu",敖:"áo",融:"róng",冷:"lěng",訾:"zī",辛:"xīn",阚:"kàn",那:"nā",简:"jiǎn",饶:"ráo",空:"kōng",曾:"zēng",母:"mǔ",沙:"shā",乜:"niè",养:"yǎng",鞠:"jū",须:"xū",丰:"fēng",巢:"cháo",关:"guān",蒯:"kuǎi",相:"xiàng",查:"zhā",后:"hòu",荆:"jīng",红:"hóng",游:"yóu",竺:"zhú",权:"quán",逯:"lù",盖:"gě",益:"yì",桓:"huán",公:"gōng",牟:"móu",哈:"hǎ",言:"yán",福:"fú",肖:"xiāo",区:"ōu",覃:"qín",朴:"piáo",繁:"pó",员:"yùn",句:"gōu",要:"yāo",过:"guō",钻:"zuān",谌:"chén",折:"shé",召:"shào",郄:"qiè",撒:"sǎ",甯:"nìng",六:"lù",啜:"chuài",行:"xíng"},lle=Object.keys(qw).map(e=>({zh:e,pinyin:qw[e],probability:1+Fa(e),length:Fa(e),priority:Wl.Surname,dict:Symbol("surname")})),EI={"bǎng páng pāng":["膀"],líng:["〇","伶","凌","刢","囹","坽","夌","姈","婈","孁","岺","彾","掕","昤","朎","柃","棂","櫺","欞","泠","淩","澪","灵","燯","爧","狑","玲","琌","瓴","皊","砱","祾","秢","竛","笭","紷","綾","绫","羐","羚","翎","聆","舲","苓","菱","蓤","蔆","蕶","蛉","衑","裬","詅","跉","軨","輘","酃","醽","鈴","錂","铃","閝","陵","零","霊","霗","霛","霝","靈","駖","魿","鯪","鲮","鴒","鸰","鹷","麢","齡","齢","龄","龗","㥄"],yī:["一","乊","伊","依","医","吚","咿","噫","壱","壹","夁","嫛","嬄","弌","揖","撎","檹","毉","洢","渏","漪","瑿","畩","祎","禕","稦","繄","蛜","衤","譩","辷","郼","醫","銥","铱","鷖","鹥","黟","黳"],"dīng zhēng":["丁"],"kǎo qiǎo yú":["丂"],qī:["七","倛","僛","凄","嘁","墄","娸","悽","慼","慽","戚","捿","柒","桤","桼","棲","榿","欺","沏","淒","漆","紪","緀","萋","褄","諆","迉","郪","鏚","霋","魌","鶈"],shàng:["丄","尙","尚","恦","緔","绱"],xià:["丅","下","乤","圷","夏","夓","懗","梺","疜","睱","罅","鎼","鏬"],hǎn:["丆","喊","浫","罕","豃","㘎"],"wàn mò":["万"],zhàng:["丈","仗","墇","嶂","帐","帳","幛","扙","杖","涱","痮","瘬","瘴","瞕","粀","胀","脹","賬","账","障"],sān:["三","厁","叁","弎","毵","毶","毿","犙","鬖"],"shàng shǎng shang":["上"],"qí jī":["丌","其","奇"],"bù fǒu":["不"],"yǔ yù yú":["与"],miǎn:["丏","偭","免","冕","勉","勔","喕","娩","愐","汅","沔","湎","睌","緬","缅","腼","葂","靦","鮸","𩾃"],gài:["丐","乢","匃","匄","戤","概","槩","槪","溉","漑","瓂","葢","鈣","钙","𬮿"],chǒu:["丑","丒","侴","吜","杽","瞅","矁","醜","魗"],zhuān:["专","叀","嫥","専","專","瑼","甎","砖","磗","磚","蟤","諯","鄟","顓","颛","鱄","䏝"],"qiě jū":["且"],pī:["丕","伓","伾","噼","坯","岯","憵","批","披","炋","狉","狓","砒","磇","礔","礕","秛","秠","耚","豾","邳","鈚","鉟","銔","錃","錍","霹","駓","髬","魾","𬳵"],shì:["世","丗","亊","事","仕","侍","冟","势","勢","卋","呩","嗜","噬","士","奭","嬕","室","市","式","弑","弒","恀","恃","戺","拭","揓","是","昰","枾","柿","栻","澨","烒","煶","眂","眎","眡","睗","示","礻","筮","簭","舐","舓","襫","視","视","觢","試","誓","諡","謚","试","谥","貰","贳","軾","轼","逝","遾","釈","释","釋","鈰","鉃","鉽","铈","飾","餙","餝","饰","鰘","䏡","𬤊"],qiū:["丘","丠","坵","媝","恘","恷","楸","秋","秌","穐","篍","緧","萩","蘒","蚯","蝵","蟗","蠤","趥","邱","鞦","鞧","鰌","鰍","鳅","鶖","鹙","龝"],bǐng:["丙","屛","怲","抦","昞","昺","柄","棅","炳","禀","秉","稟","苪","蛃","邴","鈵","陃","鞆","餅","餠","饼"],yè:["业","亱","僷","墷","夜","嶪","嶫","抴","捙","擛","擪","擫","晔","曄","曅","曗","曳","曵","枼","枽","業","洂","液","澲","烨","燁","爗","璍","皣","瞱","瞸","礏","腋","葉","謁","谒","邺","鄴","鍱","鐷","靥","靨","頁","页","餣","饁","馌","驜","鵺","鸈"],cóng:["丛","从","叢","婃","孮","従","徔","徖","悰","樷","欉","淙","灇","爜","琮","藂","誴","賨","賩","錝"],dōng:["东","倲","冬","咚","埬","岽","崬","徚","昸","東","氡","氭","涷","笗","苳","菄","蝀","鮗","鯟","鶇","鶫","鸫","鼕","𬟽"],sī:["丝","俬","凘","厮","司","咝","嘶","噝","媤","廝","恖","撕","斯","楒","泀","澌","燍","禗","禠","私","糹","絲","緦","纟","缌","罳","蕬","虒","蛳","蜤","螄","蟖","蟴","鉰","銯","鍶","鐁","锶","颸","飔","騦","鷥","鸶","鼶","㟃"],chéng:["丞","呈","城","埕","堘","塍","塖","宬","峸","惩","懲","成","承","挰","掁","揨","枨","棖","橙","檙","洆","溗","澂","珵","珹","畻","程","窚","筬","絾","脭","荿","誠","诚","郕","酲","鋮","铖","騬","鯎"],diū:["丟","丢","銩","铥"],liǎng:["両","两","兩","唡","啢","掚","緉","脼","蜽","裲","魉","魎","𬜯"],yǒu:["丣","卣","友","梄","湵","牖","禉","羑","聈","苃","莠","蜏","酉","銪","铕","黝"],yán:["严","厳","啱","喦","嚴","塩","壛","壧","妍","姸","娫","娮","岩","嵒","嵓","巌","巖","巗","延","揅","昖","楌","檐","櫩","欕","沿","炎","炏","狿","琂","盐","碞","筵","簷","莚","蔅","虤","蜒","言","訁","訮","詽","讠","郔","閆","閻","闫","阎","顏","顔","颜","鹽","麣","𫄧"],bìng:["並","併","倂","傡","垪","摒","栤","病","窉","竝","誁","靐","鮩"],"sàng sāng":["丧"],gǔn:["丨","惃","滚","滾","磙","緄","绲","蓘","蔉","衮","袞","輥","辊","鮌","鯀","鲧"],jiū:["丩","勼","啾","揪","揫","朻","究","糾","纠","萛","赳","阄","鬏","鬮","鳩","鸠"],"gè gě":["个","個","各"],yā:["丫","圧","孲","庘","押","枒","桠","椏","錏","鐚","鴉","鴨","鵶","鸦","鸭"],pán:["丬","媻","幋","槃","洀","瀊","爿","盘","盤","磐","縏","蒰","蟠","蹒","蹣","鎜","鞶"],"zhōng zhòng":["中"],jǐ:["丮","妀","己","戟","挤","掎","撠","擠","橶","泲","犱","脊","虮","蟣","魢","鱾","麂"],jiè:["丯","介","借","唶","堺","屆","届","岕","庎","徣","戒","楐","犗","玠","琾","界","畍","疥","砎","蚧","蛶","衸","褯","誡","诫","鎅","骱","魪"],fēng:["丰","仹","偑","僼","凨","凬","凮","妦","寷","封","峯","峰","崶","枫","楓","檒","沣","沨","渢","灃","烽","犎","猦","琒","疯","瘋","盽","砜","碸","篈","蘴","蜂","蠭","豐","鄷","酆","鋒","鎽","鏠","锋","霻","靊","飌","麷"],"guàn kuàng":["丱"],chuàn:["串","汌","玔","賗","釧","钏"],chǎn:["丳","产","冁","剷","囅","嵼","旵","浐","滻","灛","產","産","簅","蒇","蕆","諂","譂","讇","谄","鏟","铲","閳","闡","阐","骣","𬊤"],lín:["临","冧","壣","崊","嶙","斴","晽","暽","林","潾","瀶","燐","琳","璘","瞵","碄","磷","粦","粼","繗","翷","臨","轔","辚","遴","邻","鄰","鏻","阾","隣","霖","驎","鱗","鳞","麐","麟","𬴊","𬭸"],zhuó:["丵","劅","卓","啄","圴","妰","娺","撯","擆","擢","斫","斮","斱","斲","斵","晫","椓","浊","浞","濁","灼","烵","琸","硺","禚","窡","籗","籱","罬","茁","蠗","蠿","諁","諑","謶","诼","酌","鐲","镯","鵫","鷟","䓬","𬸦"],zhǔ:["丶","主","劯","嘱","囑","宔","帾","拄","渚","濐","煑","煮","燝","瞩","矚","罜","詝","陼","鸀","麈","𬣞"],bā:["丷","仈","八","叭","哵","夿","岜","巴","捌","朳","玐","疤","笆","粑","羓","芭","蚆","豝","釟"],wán:["丸","刓","完","岏","抏","捖","汍","烷","玩","琓","笂","紈","纨","翫","芄","貦","頑","顽"],dān:["丹","勯","匰","単","妉","媅","殚","殫","甔","眈","砃","箪","簞","耼","耽","聃","聸","褝","襌","躭","郸","鄲","酖","頕"],"wèi wéi":["为"],"jǐng dǎn":["丼"],"lì lí":["丽"],jǔ:["举","弆","挙","擧","椇","榉","榘","櫸","欅","矩","筥","聥","舉","莒","蒟","襷","踽","齟","龃"],piě:["丿","苤","鐅","𬭯"],fú:["乀","伏","俘","凫","刜","匐","咈","哹","垘","孚","岪","巿","帗","幅","幞","弗","彿","怫","扶","柫","栿","桴","氟","泭","浮","涪","澓","炥","玸","甶","畉","癁","祓","福","稪","符","箙","紱","紼","絥","綍","绂","绋","罘","罦","翇","艀","芙","芣","苻","茀","茯","菔","葍","虙","蚨","蜉","蝠","袚","袱","襆","襥","諨","豧","踾","輻","辐","郛","鉘","鉜","韍","韨","颫","髴","鮄","鮲","鳧","鳬","鴔","鵩","黻"],"yí jí":["乁"],yì:["乂","义","亄","亦","亿","伇","伿","佾","俋","億","兿","刈","劓","劮","勚","勩","匇","呓","呭","呹","唈","囈","圛","坄","垼","埸","奕","嫕","嬑","寱","屹","峄","嶧","帟","帠","幆","廙","异","弈","弋","役","忆","怈","怿","悒","意","憶","懌","懿","抑","挹","敡","易","晹","曀","曎","杙","枍","棭","榏","槸","檍","歝","殔","殪","殹","毅","浂","浥","浳","湙","溢","潩","澺","瀷","炈","焲","熠","熤","熼","燚","燡","燱","獈","玴","異","疫","痬","瘗","瘞","瘱","癔","益","瞖","穓","竩","篒","縊","繶","繹","绎","缢","義","羿","翊","翌","翳","翼","耴","肄","肊","膉","臆","艗","艺","芅","苅","萟","蓺","薏","藙","藝","蘙","虉","蜴","螠","衪","袣","裔","裛","褹","襼","訲","訳","詍","詣","誼","譯","議","讛","议","译","诣","谊","豙","豛","豷","貖","贀","跇","轶","逸","邑","鄓","醷","釴","鈠","鎰","鐿","镒","镱","阣","隿","霬","饐","駅","驛","驿","骮","鮨","鶂","鶃","鶍","鷁","鷊","鷧","鷾","鸃","鹝","鹢","黓","齸","𬬩","㑊","𫄷","𬟁"],nǎi:["乃","倷","奶","嬭","廼","氖","疓","艿","迺","釢"],wǔ:["乄","五","仵","伍","侮","倵","儛","午","啎","妩","娬","嫵","庑","廡","忤","怃","憮","摀","武","潕","熓","牾","玝","珷","瑦","甒","碔","舞","躌","迕","逜","陚","鵡","鹉","𣲘"],jiǔ:["久","乆","九","乣","奺","杦","汣","灸","玖","紤","舏","酒","镹","韭","韮"],"tuō zhé":["乇","杔","馲"],"me mó ma yāo":["么"],zhī:["之","倁","卮","巵","搘","支","栀","梔","椥","榰","汁","泜","疷","祗","祬","秓","稙","綕","肢","胑","胝","脂","芝","蘵","蜘","衼","隻","鳷","鴲","鼅","𦭜"],"wū wù":["乌"],zhà:["乍","咤","宱","搾","榨","溠","痄","蚱","詐","诈","醡","霅","䃎"],hū:["乎","乯","匢","匫","呼","唿","嘑","垀","寣","幠","忽","惚","昒","歑","泘","淴","滹","烀","苸","虍","虖","謼","軤","轷","雐"],fá:["乏","伐","傠","坺","垡","墢","姂","栰","浌","瞂","笩","筏","罚","罰","罸","藅","閥","阀"],"lè yuè yào lào":["乐","樂"],yín:["乑","吟","噖","嚚","圁","垠","夤","婬","寅","峾","崟","崯","檭","殥","泿","淫","滛","烎","犾","狺","璌","硍","碒","荶","蔩","訔","訚","訡","誾","鄞","鈝","銀","银","霪","鷣","齦"],pīng:["乒","俜","娉","涄","甹","砯","聠","艵","頩"],pāng:["乓","滂","胮","膖","雱","霶"],qiáo:["乔","侨","僑","嫶","憔","桥","槗","樵","橋","櫵","犞","瞧","硚","礄","荍","荞","蕎","藮","譙","趫","鐈","鞒","鞽","顦"],hǔ:["乕","琥","萀","虎","虝","錿","鯱"],guāi:["乖"],"chéng shèng":["乗","乘","娍"],yǐ:["乙","乛","以","倚","偯","嬟","崺","已","庡","扆","攺","敼","旑","旖","檥","矣","礒","笖","舣","艤","苡","苢","蚁","螘","蟻","裿","踦","輢","轙","逘","酏","釔","鈘","鉯","钇","顗","鳦","齮","𫖮","𬺈"],"háo yǐ":["乚"],"niè miē":["乜"],qǐ:["乞","企","启","唘","啓","啔","啟","婍","屺","杞","棨","玘","盀","綺","绮","芑","諬","起","邔","闙"],yě:["也","冶","嘢","埜","壄","漜","野"],xí:["习","喺","媳","嶍","席","椺","檄","漝","習","蓆","袭","襲","覡","觋","謵","趘","郋","鎴","隰","霫","飁","騱","騽","驨","鰼","鳛","𠅤","𫘬"],xiāng:["乡","厢","廂","忀","楿","欀","湘","瓖","稥","箱","緗","缃","膷","芗","萫","葙","薌","襄","郷","鄉","鄊","鄕","鑲","镶","香","驤","骧","鱜","麘","𬙋"],shū:["书","倏","倐","儵","叔","姝","尗","抒","掓","摅","攄","書","枢","梳","樞","殊","殳","毹","毺","淑","瀭","焂","疎","疏","紓","綀","纾","舒","菽","蔬","踈","軗","輸","输","鄃","陎","鮛","鵨"],dǒu:["乧","抖","枓","蚪","鈄","阧","陡"],shǐ:["乨","使","兘","史","始","宩","屎","榁","矢","笶","豕","鉂","駛","驶"],jī:["乩","僟","击","刉","刏","剞","叽","唧","喞","嗘","嘰","圾","基","墼","姬","屐","嵆","嵇","撃","擊","朞","机","枅","樭","機","毄","激","犄","玑","璣","畸","畿","癪","矶","磯","积","積","笄","筓","箕","簊","緁","羁","羇","羈","耭","肌","芨","虀","覉","覊","譏","譤","讥","賫","賷","赍","跻","踑","躋","躸","銈","錤","鐖","鑇","鑙","隮","雞","鞿","韲","飢","饑","饥","魕","鳮","鶏","鶺","鷄","鸄","鸡","齎","齏","齑","𬯀","𫓯","𫓹","𫌀"],náng:["乪","嚢","欜","蠰","饢"],jiā:["乫","佳","傢","加","嘉","抸","枷","梜","毠","泇","浃","浹","犌","猳","珈","痂","笳","糘","耞","腵","葭","袈","豭","貑","跏","迦","鉫","鎵","镓","鴐","麚","𬂩"],jù:["乬","倨","倶","具","剧","劇","勮","埧","埾","壉","姖","屦","屨","岠","巨","巪","怇","惧","愳","懅","懼","拒","拠","昛","歫","洰","澽","炬","烥","犋","秬","窭","窶","簴","粔","耟","聚","虡","蚷","詎","讵","豦","距","踞","躆","遽","邭","醵","鉅","鐻","钜","颶","飓","駏","鮔"],shí:["乭","十","埘","塒","姼","实","実","寔","實","峕","嵵","时","旹","時","榯","湜","溡","炻","祏","竍","蚀","蝕","辻","遈","鉐","飠","饣","鮖","鰣","鲥","鼫","鼭"],mǎo:["乮","冇","卯","峁","戼","昴","泖","笷","蓩","鉚","铆"],mǎi:["买","嘪","荬","蕒","買","鷶"],luàn:["乱","亂","釠"],rǔ:["乳","擩","汝","肗","辱","鄏"],xué:["乴","学","學","峃","嶨","斈","泶","澩","燢","穴","茓","袕","踅","鷽","鸴"],yǎn:["䶮","乵","俨","偃","儼","兖","兗","厣","厴","噞","孍","嵃","巘","巚","弇","愝","戭","扊","抁","掩","揜","曮","椼","檿","沇","渷","演","琰","甗","眼","罨","萒","蝘","衍","褗","躽","遃","郾","隒","顩","魇","魘","鰋","鶠","黡","黤","黬","黭","黶","鼴","鼹","齴","龑","𬸘","𬙂","𪩘"],fǔ:["乶","俌","俛","俯","府","弣","抚","拊","撫","斧","椨","滏","焤","甫","盙","簠","腐","腑","蜅","輔","辅","郙","釜","釡","阝","頫","鬴","黼","㕮","𫖯"],shā:["乷","唦","杀","桬","殺","毮","猀","痧","砂","硰","紗","繺","纱","蔱","裟","鎩","铩","閷","髿","魦","鯊","鯋","鲨"],nǎ:["乸","雫"],qián:["乹","亁","仱","偂","前","墘","媊","岒","拑","掮","榩","橬","歬","潛","潜","濳","灊","箝","葥","虔","軡","鈐","鉗","銭","錢","鎆","钤","钱","钳","靬","騚","騝","鰬","黔","黚"],suǒ:["乺","唢","嗩","所","暛","溑","溹","琐","琑","瑣","索","褨","鎖","鎻","鏁","锁"],yú:["乻","于","亐","伃","余","堣","堬","妤","娛","娯","娱","嬩","崳","嵎","嵛","愚","扵","揄","旟","楡","楰","榆","欤","歈","歟","歶","渔","渝","湡","漁","澞","牏","狳","玗","玙","瑜","璵","盂","睮","窬","竽","籅","羭","腴","臾","舁","舆","艅","茰","萮","萸","蕍","蘛","虞","虶","蝓","螸","衧","褕","覦","觎","諛","謣","谀","踰","輿","轝","逾","邘","酑","鍝","隅","雓","雩","餘","馀","騟","骬","髃","魚","魣","鮽","鯲","鰅","鱼","鷠","鸆","齵"],zhù:["乼","伫","佇","住","坾","墸","壴","嵀","拀","杼","柱","樦","殶","注","炷","疰","眝","祝","祩","竚","筯","箸","篫","簗","紵","紸","纻","羜","翥","苎","莇","蛀","註","貯","贮","跓","軴","鉒","鋳","鑄","铸","馵","駐","驻"],zhě:["乽","者","褶","襵","赭","踷","鍺","锗"],"qián gān":["乾"],"zhì luàn":["乿"],guī:["亀","圭","妫","媯","嫢","嬀","帰","归","摫","椝","槻","槼","櫷","歸","珪","瑰","璝","瓌","皈","瞡","硅","茥","蘬","規","规","邽","郌","閨","闺","騩","鬶","鬹"],"lǐn lìn":["亃"],jué:["亅","决","刔","劂","匷","厥","噊","孒","孓","崛","崫","嶥","彏","憠","憰","戄","抉","挗","掘","攫","桷","橛","橜","欮","氒","決","灍","焳","熦","爑","爴","爵","獗","玃","玦","玨","珏","瑴","瘚","矍","矡","砄","絕","絶","绝","臄","芵","蕝","蕨","虳","蟨","蟩","觖","觮","觼","訣","譎","诀","谲","貜","赽","趉","蹷","躩","鈌","鐍","鐝","钁","镢","鴂","鴃","鷢","𫘝","㵐","𫔎"],"le liǎo":["了"],"gè mā":["亇"],"yǔ yú":["予","懙"],zhēng:["争","佂","凧","姃","媜","峥","崝","崢","征","徰","炡","烝","爭","狰","猙","癥","眐","睁","睜","筝","箏","篜","聇","脀","蒸","踭","鉦","錚","鏳","鬇"],èr:["二","刵","咡","弍","弐","樲","誀","貮","貳","贰","髶"],chù:["亍","傗","儊","怵","憷","搐","斶","歜","珿","琡","矗","竌","絀","绌","臅","触","觸","豖","鄐","閦","黜"],kuī:["亏","刲","岿","巋","盔","窥","窺","聧","虧","闚","顝"],yún:["云","伝","勻","匀","囩","妘","愪","抣","昀","橒","沄","涢","溳","澐","熉","畇","秐","筼","篔","紜","縜","纭","耘","芸","蒷","蕓","郧","鄖","鋆","雲"],hù:["互","冱","嗀","嚛","婟","嫭","嫮","岵","帍","弖","怙","戶","户","戸","戽","扈","护","昈","槴","沍","沪","滬","熩","瓠","祜","笏","簄","粐","綔","蔰","護","豰","鄠","鍙","頀","鱯","鳠","鳸","鸌","鹱"],qí:["亓","剘","埼","岐","岓","崎","嵜","愭","掑","斉","斊","旂","旗","棊","棋","檱","櫀","歧","淇","濝","猉","玂","琦","琪","璂","畦","疧","碁","碕","祁","祈","祺","禥","竒","簯","簱","籏","粸","綥","綦","肵","脐","臍","艩","芪","萁","萕","蕲","藄","蘄","蚑","蚚","蛴","蜝","蜞","螧","蠐","褀","軝","鄿","釮","錡","锜","陭","頎","颀","騎","騏","騹","骐","骑","鬐","鬿","鯕","鰭","鲯","鳍","鵸","鶀","麒","麡","𨙸","𬨂","䓫"],jǐng:["井","儆","刭","剄","坓","宑","幜","憬","暻","殌","汫","汬","澋","璄","璟","璥","穽","肼","蟼","警","阱","頚","頸"],sì:["亖","佀","価","儩","兕","嗣","四","姒","娰","孠","寺","巳","柶","榹","汜","泗","泤","洍","洠","涘","瀃","牭","祀","禩","竢","笥","耜","肂","肆","蕼","覗","貄","釲","鈶","鈻","飤","飼","饲","駟","騃","驷"],suì:["亗","嬘","岁","嵗","旞","檖","歲","歳","澻","煫","燧","璲","砕","碎","祟","禭","穂","穗","穟","繀","繐","繸","襚","誶","譢","谇","賥","邃","鐆","鐩","隧","韢","𫟦","𬭼"],gèn:["亘","亙","揯","搄","茛"],yà:["亚","亜","俹","冴","劜","圔","圠","埡","娅","婭","揠","氩","氬","犽","砑","稏","聐","襾","覀","訝","讶","迓","齾"],"xiē suò":["些"],"qí zhāi":["亝","齊"],"yā yà":["亞","压","垭","壓","铔"],"jí qì":["亟","焏"],tóu:["亠","投","頭","骰"],"wáng wú":["亡"],"kàng háng gāng":["亢"],dà:["亣","眔"],jiāo:["交","僬","娇","嬌","峧","嶕","嶣","憍","椒","浇","澆","焦","礁","穚","簥","胶","膠","膲","茭","茮","蕉","虠","蛟","蟭","跤","轇","郊","鐎","驕","骄","鮫","鲛","鵁","鷦","鷮","鹪","䴔"],hài:["亥","嗐","害","氦","餀","饚","駭","駴","骇"],"hēng pēng":["亨"],mǔ:["亩","姆","峔","拇","母","牡","牳","畂","畆","畒","畝","畞","畮","砪","胟","踇","鉧","𬭁","𧿹"],ye:["亪"],xiǎng:["享","亯","响","想","晑","蚃","蠁","響","飨","餉","饗","饷","鮝","鯗","鱶","鲞"],jīng:["京","亰","兢","坕","坙","婛","惊","旌","旍","晶","橸","泾","涇","猄","睛","秔","稉","粳","精","経","經","綡","聙","腈","茎","荆","荊","菁","葏","驚","鯨","鲸","鶁","鶄","麖","麠","鼱","䴖"],tíng:["亭","停","婷","嵉","庭","廷","楟","榳","筳","聤","莛","葶","蜓","蝏","諪","邒","霆","鼮","䗴"],liàng:["亮","喨","悢","晾","湸","諒","谅","輌","輛","辆","鍄"],"qīn qìng":["亲","親"],bó:["亳","仢","侼","僰","博","帛","愽","懪","挬","搏","欂","浡","淿","渤","煿","牔","狛","瓝","礴","秡","箔","簙","糪","胉","脖","膊","舶","艊","萡","葧","袯","襏","襮","謈","踣","郣","鈸","鉑","鋍","鎛","鑮","钹","铂","镈","餺","馎","馛","馞","駁","駮","驳","髆","鵓","鹁"],yòu:["亴","佑","佦","侑","又","右","哊","唀","囿","姷","宥","峟","幼","狖","祐","蚴","誘","诱","貁","迶","酭","釉","鼬"],xiè:["亵","伳","偞","偰","僁","卨","卸","噧","塮","夑","媟","屑","屧","廨","徢","懈","暬","械","榍","榭","泻","洩","渫","澥","瀉","瀣","灺","炧","炨","燮","爕","獬","祄","禼","糏","紲","絏","絬","繲","纈","绁","缷","薢","薤","蟹","蠏","褉","褻","謝","谢","躞","邂","靾","韰","齂","齘","齛","齥","𬹼","𤫉"],"dǎn dàn":["亶","馾"],lián:["亷","劆","匲","匳","嗹","噒","奁","奩","嫾","帘","廉","怜","憐","涟","漣","濂","濓","瀮","熑","燫","簾","籢","籨","縺","翴","联","聨","聫","聮","聯","臁","莲","蓮","薕","螊","蠊","裢","褳","覝","謰","蹥","连","連","鎌","鐮","镰","鬑","鰱","鲢"],duǒ:["亸","哚","嚲","埵","崜","朵","朶","綞","缍","趓","躱","躲","軃"],"wěi mén":["亹","斖"],rén:["人","亻","仁","壬","忈","忎","朲","秂","芢","魜","鵀"],jí:["亼","亽","伋","佶","偮","卙","即","卽","及","叝","吉","堲","塉","姞","嫉","岌","嵴","嶯","彶","忣","急","愱","戢","揤","极","棘","楫","極","槉","檝","殛","汲","湒","潗","疾","瘠","皍","笈","箿","籍","級","级","膌","艥","蒺","蕀","蕺","蝍","螏","襋","觙","谻","踖","蹐","躤","輯","轚","辑","郆","銡","鍓","鏶","集","雧","霵","鹡","㴔"],wáng:["亾","仼","兦","莣","蚟"],"shén shí":["什"],lè:["仂","叻","忇","氻","泐","玏","砳","簕","艻","阞","韷","餎","鰳","鱳","鳓"],dīng:["仃","叮","帄","玎","疔","盯","耵","虰","靪"],zè:["仄","崱","庂","捑","昃","昗","汄"],"jǐn jìn":["仅","僅","嫤"],"pú pū":["仆"],"chóu qiú":["仇"],zhǎng:["仉","幥","掌","礃"],jīn:["今","堻","巾","惍","斤","津","珒","琻","璡","砛","筋","荕","衿","襟","觔","金","釒","釿","钅","鹶","黅","𬬱"],bīng:["仌","仒","兵","冫","冰","掤","氷","鋲"],réng:["仍","礽","芿","辸","陾"],fó:["仏","坲","梻"],"jīn sǎn":["仐"],lún:["仑","伦","侖","倫","囵","圇","婨","崘","崙","棆","沦","淪","磮","腀","菕","蜦","踚","輪","轮","錀","陯","鯩","𬬭"],cāng:["仓","仺","倉","凔","嵢","沧","滄","濸","獊","舱","艙","苍","蒼","螥","鸧"],"zǎi zǐ zī":["仔"],tā:["他","塌","它","榙","溻","牠","祂","褟","趿","遢","闧"],fù:["付","偩","傅","冨","副","咐","坿","复","妇","婦","媍","嬔","富","復","椱","祔","禣","竎","緮","縛","缚","腹","萯","蕧","蚹","蛗","蝜","蝮","袝","複","覄","覆","訃","詂","讣","負","賦","賻","负","赋","赙","赴","輹","鍑","鍢","阜","附","馥","駙","驸","鮒","鰒","鲋","鳆","㳇"],xiān:["仙","仚","佡","僊","僲","先","嘕","奾","屳","廯","忺","憸","掀","暹","杴","氙","珗","祆","秈","籼","繊","纎","纖","苮","褼","襳","跹","蹮","躚","酰","鍁","锨","韯","韱","馦","鱻","鶱","𬸣"],"tuō chà duó":["仛"],hóng:["仜","吰","垬","妅","娂","宏","宖","弘","彋","汯","泓","洪","浤","渱","潂","玒","玜","竑","竤","篊","粠","紘","紭","綋","纮","翃","翝","耾","苰","荭","葒","葓","谹","谼","鈜","鉷","鋐","閎","闳","霐","霟","鞃","魟","鴻","鸿","黉","黌","𫟹","𬭎"],tóng:["仝","佟","哃","峂","峝","庝","彤","晍","曈","桐","氃","浵","潼","犝","獞","眮","瞳","砼","秱","童","粡","膧","茼","蚒","詷","赨","酮","鉖","鉵","銅","铜","餇","鮦","鲖","𫍣","𦒍"],rèn:["仞","仭","刃","刄","妊","姙","屻","岃","扨","牣","祍","紉","紝","絍","纫","纴","肕","腍","衽","袵","訒","認","认","讱","軔","轫","鈓","靭","靱","韌","韧","飪","餁","饪"],qiān:["仟","佥","僉","千","圲","奷","孯","岍","悭","愆","慳","扦","拪","搴","撁","攐","攑","攓","杄","櫏","汘","汧","牵","牽","竏","签","簽","籖","籤","粁","芊","茾","蚈","褰","諐","謙","谦","谸","迁","遷","釺","鈆","鉛","鏲","钎","阡","韆","顅","騫","骞","鬜","鬝","鵮","鹐"],"gǎn hàn":["仠"],"yì gē":["仡"],dài:["代","侢","叇","垈","埭","岱","帒","带","帯","帶","廗","怠","戴","曃","柋","殆","瀻","玳","瑇","甙","簤","紿","緿","绐","艜","蝳","袋","襶","貣","贷","蹛","軑","軚","軩","轪","迨","霴","靆","鴏","黛","黱"],"lìng líng lǐng":["令"],chào:["仦","耖","觘"],"cháng zhǎng":["仧","兏","長","长"],sā:["仨"],cháng:["仩","偿","償","嘗","嚐","嫦","尝","常","徜","瑺","瓺","甞","肠","腸","膓","苌","萇","镸","鱨","鲿"],yí:["仪","侇","儀","冝","匜","咦","圯","夷","姨","宐","宜","宧","寲","峓","嶬","嶷","巸","彛","彜","彝","彞","怡","恞","扅","暆","栘","椬","椸","沂","洟","熪","瓵","痍","移","簃","籎","羠","胰","萓","蛦","螔","觺","謻","貽","贻","跠","迻","遺","鏔","頉","頤","頥","顊","颐","饴","鮧","鴺"],mù:["仫","凩","募","墓","幕","幙","慔","慕","暮","暯","木","楘","毣","沐","炑","牧","狇","目","睦","穆","艒","苜","莯","蚞","鉬","钼","雮","霂"],"men mén":["们"],fǎn:["仮","反","橎","返"],"chào miǎo":["仯"],"yǎng áng":["仰"],zhòng:["仲","众","堹","妕","媑","狆","眾","祌","筗","茽","蚛","衆","衶","諥"],"pǐ pí":["仳"],wò:["仴","偓","卧","媉","幄","握","楃","沃","渥","濣","瓁","瞃","硪","肟","腛","臥","齷","龌"],jiàn:["件","俴","健","僭","剑","剣","剱","劍","劎","劒","劔","墹","寋","建","徤","擶","旔","楗","毽","洊","涧","澗","牮","珔","瞷","磵","礀","箭","糋","繝","腱","臶","舰","艦","荐","薦","覸","諓","諫","譛","谏","賎","賤","贱","趝","践","踐","踺","轞","鉴","鍳","鍵","鐱","鑑","鑒","鑬","鑳","键","間","餞","饯","𬣡"],"jià jiè jie":["价"],"yǎo fó":["仸"],"rèn rén":["任"],"fèn bīn":["份"],dī:["仾","低","啲","埞","堤","岻","彽","樀","滴","磾","秪","羝","袛","趆","隄","鞮","䃅"],fǎng:["仿","倣","旊","昉","昘","瓬","眆","紡","纺","舫","訪","访","髣","鶭"],zhōng:["伀","刣","妐","幒","彸","忠","柊","汷","泈","炂","盅","籦","終","终","舯","蔠","蜙","螤","螽","衳","衷","蹱","鈡","鍾","鐘","钟","锺","鴤","鼨"],pèi:["伂","佩","姵","帔","斾","旆","沛","浿","珮","蓜","轡","辔","配","霈","馷"],diào:["伄","吊","弔","掉","瘹","盄","窎","窵","竨","訋","釣","鈟","銱","鋽","鑃","钓","铞","雿","魡"],dùn:["伅","潡","炖","燉","盾","砘","碷","踲","逇","遁","遯","鈍","钝"],wěn:["伆","刎","吻","呅","抆","桽","稳","穏","穩","紊","肳","脗"],xǐn:["伈"],kàng:["伉","匟","囥","抗","炕","鈧","钪"],ài:["伌","僾","塧","壒","嫒","嬡","愛","懓","暧","曖","爱","瑷","璦","皧","瞹","砹","硋","碍","礙","薆","譺","賹","鑀","隘","靉","餲","馤","鱫","鴱"],"jì qí":["伎","薺"],"xiū xǔ":["休"],"jìn yín":["伒"],dǎn:["伔","刐","撢","玬","瓭","紞","胆","膽","衴","賧","赕","黕","𬘘"],fū:["伕","呋","娐","孵","尃","怤","懯","敷","旉","玞","砆","稃","筟","糐","綒","肤","膚","荂","荴","衭","趺","跗","邞","鄜","酜","鈇","麩","麬","麱","麸","𫓧"],tǎng:["伖","傥","儻","埫","戃","曭","爣","矘","躺","鎲","钂","镋"],yōu:["优","優","呦","嚘","峳","幽","忧","悠","憂","攸","櫌","滺","瀀","纋","羪","耰","逌","鄾","麀"],huǒ:["伙","夥","火","煷","邩","鈥","钬"],"huì kuài":["会","會","浍","璯"],yǔ:["伛","俁","俣","偊","傴","匬","噳","圄","圉","宇","寙","屿","嶼","庾","挧","敔","斞","楀","瑀","瘐","祤","禹","穥","窳","羽","與","萭","貐","鄅","頨","麌","齬","龉","㺄"],cuì:["伜","啛","忰","悴","毳","淬","焠","疩","瘁","竁","粋","粹","紣","綷","翆","翠","脃","脆","脺","膬","膵","臎","萃","襊","顇"],sǎn:["伞","傘","糤","繖","饊","馓"],wěi:["伟","伪","偉","偽","僞","儰","娓","寪","屗","崣","嶉","徫","愇","捤","暐","梶","洧","浘","渨","炜","煒","猥","玮","瑋","痿","緯","纬","腲","艉","芛","苇","荱","萎","葦","蒍","蔿","蜼","諉","诿","踓","鍡","韑","韙","韡","韪","頠","颹","骩","骪","骫","鮪","鲔","𫇭","𬀩","𬱟"],"chuán zhuàn":["传","傳"],"chē jū":["伡","俥","车"],"jū chē":["車"],yá:["伢","厑","厓","堐","岈","崕","崖","涯","漄","牙","玡","琊","睚","笌","芽","蚜","衙","齖"],qiàn:["伣","俔","倩","儙","刋","壍","嬱","悓","棈","椠","槧","欠","歉","皘","篏","篟","縴","芡","蒨","蔳","輤","𬘬"],shāng:["伤","傷","商","墒","慯","殇","殤","滳","漡","熵","蔏","螪","觞","觴","謪","鬺"],chāng:["伥","倀","娼","昌","椙","淐","猖","琩","菖","裮","錩","锠","閶","阊","鯧","鲳","鼚"],"chen cāng":["伧"],xùn:["伨","侚","卂","噀","巺","巽","徇","愻","殉","殾","汛","潠","狥","蕈","訊","訓","訙","训","讯","迅","迿","逊","遜","鑂","顨","馴","驯"],xìn:["伩","囟","孞","脪","舋","衅","訫","釁","阠","顖"],chǐ:["伬","侈","卶","叺","呎","垑","恥","歯","耻","肔","胣","蚇","裭","褫","豉","鉹","齒","齿"],"xián xuán":["伭"],"nú nǔ":["伮"],"bó bǎi":["伯"],"gū gù":["估"],nǐ:["伱","你","儞","孴","拟","擬","旎","晲","狔","苨","薿","隬"],"nì ní":["伲"],bàn:["伴","办","半","姅","怑","扮","瓣","秚","絆","绊","辦","鉡","靽"],xù:["伵","侐","勖","勗","卹","叙","垿","壻","婿","序","恤","敍","敘","旭","昫","朂","槒","欰","殈","汿","沀","洫","溆","漵","潊","烅","烼","煦","獝","珬","盢","瞁","稸","絮","続","緒","緖","續","绪","续","聓","聟","蓄","藚","訹","賉","酗","頊","鱮","㳚"],zhòu:["伷","僽","冑","呪","咒","咮","宙","昼","晝","甃","皱","皺","籀","籒","籕","粙","紂","縐","纣","绉","胄","荮","葤","詋","酎","駎","驟","骤","㤘","㑇"],shēn:["伸","侁","兟","呻","堔","妽","娠","屾","峷","扟","敒","曑","柛","氠","深","燊","珅","甡","甧","申","眒","砷","穼","籶","籸","糂","紳","绅","罙","罧","葠","蓡","蔘","薓","裑","訷","詵","诜","身","駪","鯓","鯵","鰺","鲹","鵢","𬳽"],qū:["伹","佉","匤","呿","坥","屈","岖","岴","嶇","憈","抾","敺","浀","煀","祛","筁","粬","胠","蛆","蛐","袪","覻","詘","诎","趍","躯","軀","阹","駆","駈","驅","驱","髷","魼","鰸","鱋","鶌","麯","麴","麹","黢","㭕","𪨰","䓛"],"sì cì":["伺"],bēng:["伻","嘣","奟","崩","嵭","閍"],"sì shì":["似"],"jiā qié gā":["伽"],"yǐ chì":["佁"],"diàn tián":["佃","钿"],"hān gàn":["佄"],mài:["佅","劢","勱","卖","唛","売","脈","衇","賣","迈","邁","霡","霢","麥","麦","鿏"],dàn:["但","僤","啖","啗","啿","噉","嚪","帎","憺","旦","柦","氮","沊","泹","淡","狚","疍","癚","禫","窞","腅","萏","蓞","蛋","蜑","觛","訑","誕","诞","贉","霮","餤","饏","駳","髧","鴠","𫢸"],bù:["佈","勏","吥","咘","埗","埠","布","廍","怖","悑","步","歨","歩","瓿","篰","荹","蔀","踄","部","郶","鈈","钚","餢"],bǐ:["佊","俾","匕","夶","妣","彼","朼","柀","比","毞","沘","疕","秕","笔","筆","粃","聛","舭","貏","鄙"],"zhāo shào":["佋"],cǐ:["佌","此","泚","皉","𫚖"],wèi:["位","卫","味","喂","墛","媦","慰","懀","未","渭","煟","熭","犚","猬","畏","緭","罻","胃","苿","菋","藯","蘶","蝟","螱","衛","衞","褽","謂","讆","讏","谓","躗","躛","軎","轊","鏏","霨","餧","餵","饖","魏","鮇","鳚"],zuǒ:["佐","左","繓"],yǎng:["佒","傟","养","坱","岟","慃","懩","攁","氧","氱","炴","痒","癢","礢","紻","蝆","軮","養","駚"],"tǐ tī":["体","體"],zhàn:["佔","偡","嶘","战","戦","戰","栈","桟","棧","湛","站","綻","绽","菚","蘸","虥","虦","譧","轏","驏"],"hé hē hè":["何"],bì:["佖","咇","哔","嗶","坒","堛","壁","奰","妼","婢","嬖","币","幣","幤","庇","庳","廦","弊","弻","弼","彃","必","怭","愊","愎","敝","斃","梐","毕","毖","毙","湢","滗","滭","潷","煏","熚","狴","獘","獙","珌","璧","畀","畢","疪","痹","痺","皕","睤","碧","筚","箅","箆","篦","篳","粊","綼","縪","繴","罼","腷","苾","荜","萆","萞","蓖","蓽","蔽","薜","蜌","袐","襅","襞","襣","觱","詖","诐","貱","贔","赑","跸","蹕","躃","躄","避","邲","鄨","鄪","鉍","鏎","鐴","铋","閇","閉","閟","闭","陛","韠","飶","饆","馝","駜","驆","髀","魓","鮅","鷝","鷩","鼊"],tuó:["佗","坨","堶","岮","槖","橐","沱","砣","砤","碢","紽","詑","跎","酡","阤","陀","陁","駝","駞","騨","驒","驝","驼","鮀","鴕","鸵","鼉","鼍","鼧","𬶍"],shé:["佘","舌","虵","蛥"],"yì dié":["佚","昳","泆","軼"],"fó fú bì bó":["佛"],"zuò zuō":["作"],gōu:["佝","沟","溝","痀","篝","簼","緱","缑","袧","褠","鈎","鉤","钩","鞲","韝"],nìng:["佞","侫","倿","寕","泞","澝","濘"],qú:["佢","劬","戵","斪","欋","欔","氍","淭","灈","爠","璖","璩","癯","磲","籧","絇","胊","臞","菃","葋","蕖","蘧","蟝","蠷","蠼","衐","衢","躣","軥","鑺","鴝","鸜","鸲","鼩"],"yōng yòng":["佣"],wǎ:["佤","咓","砙","邷"],kǎ:["佧","垰","胩","裃","鉲"],bāo:["佨","勹","包","孢","煲","笣","胞","苞","蕔","裦","褒","襃","闁","齙","龅"],"huái huí":["佪"],"gé hè":["佫"],lǎo:["佬","咾","恅","栳","狫","珯","硓","老","耂","荖","蛯","轑","銠","铑","鮱"],xiáng:["佭","庠","栙","祥","絴","翔","詳","跭"],gé:["佮","匌","呄","嗝","塥","愅","挌","搿","槅","櫊","滆","膈","臵","茖","觡","諽","輵","轕","閣","阁","隔","鞷","韐","韚","騔","骼","鮯"],yáng:["佯","劷","垟","崸","徉","扬","揚","敭","旸","昜","暘","杨","楊","洋","炀","珜","疡","瘍","眻","蛘","諹","輰","鍚","钖","阦","阳","陽","霷","颺","飏","鰑","鴹","鸉"],bǎi:["佰","捭","摆","擺","栢","百","竡","粨","襬"],fǎ:["佱","峜","法","灋","砝","鍅"],mǐng:["佲","凕","姳","慏","酩"],"èr nài":["佴"],hěn:["佷","很","狠","詪","𬣳"],huó:["佸","活"],guǐ:["佹","匦","匭","厬","垝","姽","宄","庋","庪","恑","晷","湀","癸","祪","簋","蛫","蟡","觤","詭","诡","軌","轨","陒","鬼"],quán:["佺","全","啳","埢","姾","峑","巏","拳","搼","权","楾","権","權","泉","洤","湶","牷","犈","瑔","痊","硂","筌","縓","荃","葲","蜷","蠸","觠","詮","诠","跧","踡","輇","辁","醛","銓","铨","闎","顴","颧","駩","騡","鬈","鰁","鳈","齤"],tiāo:["佻","庣","旫","祧","聎"],jiǎo:["佼","儌","孂","挢","搅","撟","撹","攪","敫","敽","敿","晈","暞","曒","灚","燞","狡","璬","皎","皦","絞","纐","绞","腳","臫","蟜","譑","賋","踋","鉸","铰","餃","饺","鱎","龣"],cì:["佽","刾","庛","朿","栨","次","絘","茦","莿","蛓","螆","賜","赐"],xíng:["侀","刑","哘","型","娙","形","洐","硎","蛵","邢","郉","鈃","鉶","銒","钘","铏","陉","陘","餳","𫰛"],tuō:["侂","咃","咜","圫","托","拕","拖","汑","脫","脱","莌","袥","託","讬","飥","饦","魠","鮵"],kǎn:["侃","偘","冚","坎","惂","砍","莰","輡","轗","顑"],zhí:["侄","値","值","埴","執","姪","嬂","戠","执","摭","植","樴","淔","漐","直","禃","絷","縶","聀","职","職","膱","蟙","跖","踯","蹠","躑","軄","釞","馽"],gāi:["侅","垓","姟","峐","晐","畡","祴","荄","該","该","豥","賅","賌","赅","陔"],lái:["來","俫","倈","崃","崍","庲","来","梾","棶","涞","淶","猍","琜","筙","箂","莱","萊","逨","郲","錸","铼","騋","鯠","鶆","麳"],kuǎ:["侉","咵","垮","銙"],gōng:["侊","公","功","匑","匔","塨","宫","宮","工","幊","弓","恭","攻","杛","碽","糼","糿","肱","觥","觵","躬","躳","髸","龔","龚","䢼"],lì:["例","俐","俪","傈","儮","儷","凓","利","力","励","勵","历","厉","厤","厯","厲","叓","吏","呖","唎","唳","嚦","囇","坜","塛","壢","娳","婯","屴","岦","悧","悷","慄","戾","搮","暦","曆","曞","朸","枥","栃","栗","栛","檪","櫔","櫪","欐","歴","歷","沥","沴","涖","溧","濿","瀝","爏","犡","猁","珕","瑮","瓅","瓑","瓥","疬","痢","癧","盭","睙","砅","砺","砾","磿","礪","礫","礰","禲","秝","立","笠","篥","粒","粝","糲","脷","苈","茘","荔","莅","莉","蒚","蒞","藶","蚸","蛎","蛠","蜧","蝷","蠇","蠣","詈","讈","赲","轢","轣","轹","酈","鉝","隶","隷","雳","靂","靋","鬁","鳨","鴗","鷅","麜","𫵷","𬍛"],yīn:["侌","凐","喑","噾","囙","因","垔","堙","姻","婣","愔","慇","栶","氤","洇","溵","濦","瘖","禋","秵","筃","絪","緸","茵","蒑","蔭","裀","諲","銦","铟","闉","阥","阴","陰","陻","隂","霒","霠","鞇","音","韾","駰","骃","齗","𬘡","𬤇","𬮱"],mǐ:["侎","孊","弭","敉","洣","渳","灖","米","粎","羋","脒","芈","葞","蔝","銤"],zhū:["侏","株","槠","橥","櫧","櫫","洙","潴","瀦","猪","珠","硃","秼","絑","茱","蕏","蛛","蝫","蠩","袾","誅","諸","诛","诸","豬","跦","邾","銖","铢","駯","鮢","鯺","鴸","鼄"],ān:["侒","偣","媕","安","峖","庵","桉","氨","盦","盫","腤","菴","萻","葊","蓭","誝","諳","谙","鞌","鞍","韽","馣","鮟","鵪","鶕","鹌","𩽾"],lù:["侓","僇","勎","勠","圥","坴","塶","娽","峍","廘","彔","录","戮","摝","椂","樚","淕","淥","渌","漉","潞","琭","璐","甪","盝","睩","硉","祿","禄","稑","穋","箓","簏","簬","簵","簶","籙","粶","蔍","蕗","虂","螰","賂","赂","趢","路","踛","蹗","輅","轆","辂","辘","逯","醁","錄","録","錴","鏴","陸","騄","騼","鯥","鴼","鵦","鵱","鷺","鹭","鹿","麓","𫘧"],móu:["侔","劺","恈","眸","蛑","謀","谋","踎","鍪","鴾","麰"],ér:["侕","儿","児","兒","峏","栭","洏","粫","而","胹","荋","袻","輀","轜","陑","隭","髵","鮞","鲕","鴯","鸸"],"dòng tǒng tóng":["侗"],chà:["侘","奼","姹","岔","汊","詫","诧"],chì:["侙","傺","勅","勑","叱","啻","彳","恜","慗","憏","懘","抶","敕","斥","杘","湁","灻","炽","烾","熾","痓","痸","瘛","翄","翅","翤","翨","腟","赤","趩","遫","鉓","雴","飭","饬","鶒","鷘"],"gòng gōng":["供","共"],zhōu:["侜","周","喌","州","徟","洲","淍","炿","烐","珘","矪","舟","謅","譸","诌","賙","赒","輈","輖","辀","週","郮","銂","霌","駲","騆","鵃","鸼"],rú:["侞","儒","嚅","如","嬬","孺","帤","曘","桇","渪","濡","筎","茹","蕠","薷","蝡","蠕","袽","襦","邚","醹","銣","铷","顬","颥","鱬","鴑","鴽"],"jiàn cún":["侟"],xiá:["侠","俠","匣","峡","峽","敮","暇","柙","炠","烚","狎","狭","狹","珨","瑕","硖","硤","碬","祫","筪","縖","翈","舝","舺","蕸","赮","轄","辖","遐","鍜","鎋","陜","陿","霞","騢","魻","鶷","黠"],lǚ:["侣","侶","儢","吕","呂","屡","屢","履","挔","捛","旅","梠","焒","祣","稆","穭","絽","縷","缕","膂","膐","褛","褸","郘","鋁","铝"],ta:["侤"],"jiǎo yáo":["侥","僥","徺"],zhēn:["侦","偵","寊","帧","帪","幀","搸","斟","桢","楨","榛","樼","殝","浈","湞","潧","澵","獉","珍","珎","瑧","甄","眞","真","砧","碪","祯","禎","禛","箴","胗","臻","葴","蒖","蓁","薽","貞","贞","轃","遉","酙","針","鉁","錱","鍼","针","鱵"],"cè zè zhāi":["侧","側"],kuài:["侩","儈","凷","哙","噲","圦","块","塊","巜","廥","快","旝","欳","狯","獪","筷","糩","脍","膾","郐","鄶","鱠","鲙"],chái:["侪","儕","喍","柴","犲","祡","豺"],nóng:["侬","儂","农","哝","噥","檂","欁","浓","濃","燶","禯","秾","穠","脓","膿","蕽","襛","譨","農","辳","醲","鬞","𬪩"],jǐn:["侭","儘","卺","厪","巹","槿","漌","瑾","紧","緊","菫","蓳","謹","谨","錦","锦","饉","馑"],"hóu hòu":["侯","矦"],jiǒng:["侰","僒","冏","囧","泂","澃","炯","烱","煚","煛","熲","燛","窘","綗","褧","迥","逈","顈","颎","䌹"],"chěng tǐng":["侱"],"zhèn zhēn":["侲","揕"],zuò:["侳","做","唑","坐","岝","岞","座","祚","糳","胙","葃","葄","蓙","袏","阼"],qīn:["侵","兓","媇","嵚","嶔","欽","衾","誛","钦","顉","駸","骎","鮼"],jú:["侷","啹","婅","局","巈","椈","橘","泦","淗","湨","焗","犑","狊","粷","菊","蘜","趜","跼","蹫","輂","郹","閰","駶","驧","鵙","鵴","鶪","鼰","鼳","䴗"],"shù dōu":["侸"],tǐng:["侹","圢","娗","挺","涏","烶","珽","脡","艇","誔","頲","颋"],shèn:["侺","愼","慎","昚","涁","渗","滲","瘆","瘮","眘","祳","肾","胂","脤","腎","蜃","蜄","鋠"],"tuì tuó":["侻"],nán:["侽","喃","娚","抩","暔","枏","柟","楠","男","畘","莮","萳","遖"],xiāo:["侾","哓","嘵","嚻","囂","婋","宯","宵","庨","彇","揱","枭","枵","梟","櫹","歊","毊","消","潇","瀟","灱","灲","烋","焇","猇","獢","痚","痟","硝","硣","窙","箫","簘","簫","綃","绡","翛","膮","萧","蕭","虈","虓","蟂","蟏","蟰","蠨","踃","逍","銷","销","霄","颵","驍","骁","髇","髐","魈","鴞","鴵","鷍","鸮"],"biàn pián":["便","緶","缏"],tuǐ:["俀","腿","蹆","骽"],xì:["係","匸","卌","呬","墍","屃","屓","屭","忥","怬","恄","椞","潝","潟","澙","熂","犔","磶","禊","細","綌","縘","细","绤","舃","舄","蕮","虩","衋","覤","赩","趇","郤","釳","阋","隙","隟","霼","餼","饩","鬩","黖"],cù:["促","媨","憱","猝","瘄","瘯","簇","縬","脨","蔟","誎","趗","踧","踿","蹙","蹴","蹵","醋","顣","鼀"],é:["俄","囮","娥","峉","峨","峩","涐","珴","皒","睋","磀","莪","訛","誐","譌","讹","迗","鈋","鋨","锇","頟","額","额","魤","鵝","鵞","鹅"],qiú:["俅","叴","唒","囚","崷","巯","巰","扏","梂","殏","毬","求","汓","泅","浗","湭","煪","犰","玌","球","璆","皳","盚","紌","絿","肍","芁","莍","虬","虯","蛷","裘","觓","觩","訄","訅","賕","赇","逎","逑","遒","酋","釚","釻","銶","頄","鮂","鯄","鰽","鼽","𨱇"],xú:["俆","徐","禑"],"guàng kuāng":["俇"],kù:["俈","喾","嚳","库","庫","廤","瘔","絝","绔","袴","裤","褲","酷"],wù:["俉","务","務","勿","卼","坞","塢","奦","婺","寤","屼","岉","嵨","忢","悞","悟","悮","戊","扤","晤","杌","溩","焐","熃","物","痦","矹","窹","粅","蘁","誤","误","鋈","阢","隖","雾","霚","霧","靰","騖","骛","鶩","鹜","鼿","齀"],jùn:["俊","儁","呁","埈","寯","峻","懏","捃","攟","晙","棞","燇","珺","畯","竣","箟","蜠","賐","郡","陖","餕","馂","駿","骏","鵔","鵕","鵘","䐃"],liáng:["俍","墚","梁","椋","樑","粮","粱","糧","良","輬","辌","𫟅"],zǔ:["俎","唨","爼","祖","組","组","詛","诅","鎺","阻","靻"],"qiào xiào":["俏"],yǒng:["俑","勇","勈","咏","埇","塎","嵱","彮","怺","恿","悀","惥","愑","愹","慂","柡","栐","永","泳","湧","甬","蛹","詠","踊","踴","鯒","鲬"],hùn:["俒","倱","圂","尡","慁","掍","溷","焝","睴","觨","諢","诨"],jìng:["俓","傹","境","妌","婙","婧","弪","弳","径","徑","敬","曔","桱","梷","浄","瀞","獍","痉","痙","竞","竟","竫","競","竸","胫","脛","莖","誩","踁","迳","逕","鏡","镜","靖","静","靜","鵛"],sàn:["俕","閐"],pěi:["俖"],sú:["俗"],xī:["俙","僖","兮","凞","卥","厀","吸","唏","唽","嘻","噏","嚱","夕","奚","嬆","嬉","屖","嵠","巇","希","徆","徯","息","悉","悕","惁","惜","昔","晞","晰","晳","曦","析","桸","榽","樨","橀","欷","氥","汐","浠","淅","渓","溪","烯","焁","焈","焟","熄","熈","熙","熹","熺","熻","燨","爔","牺","犀","犠","犧","琋","瘜","皙","睎","瞦","矽","硒","磎","礂","稀","穸","窸","粞","糦","緆","繥","羲","翕","翖","肸","肹","膝","舾","莃","菥","蒠","蜥","螅","蟋","蠵","西","觹","觽","觿","譆","谿","豀","豨","豯","貕","赥","邜","鄎","酅","醯","釸","錫","鏭","鐊","鑴","锡","隵","餏","饎","饻","鯑","鵗","鸂","鼷"],lǐ:["俚","娌","峢","峲","李","欚","浬","澧","理","礼","禮","粴","裏","裡","豊","逦","邐","醴","鋰","锂","鯉","鱧","鱱","鲤","鳢"],bǎo:["保","堢","媬","宝","寚","寳","寶","珤","緥","葆","藵","褓","賲","靌","飹","飽","饱","駂","鳵","鴇","鸨"],"yú shù yù":["俞"],"sì qí":["俟"],"xìn shēn":["信"],xiū:["俢","修","咻","庥","樇","烌","羞","脙","脩","臹","貅","銝","鎀","飍","饈","馐","髤","髹","鮴","鱃","鵂","鸺","䗛"],dì:["俤","偙","僀","埊","墑","墬","娣","帝","怟","旳","梊","焍","玓","甋","眱","睇","碲","祶","禘","第","締","缔","腣","菂","蒂","蔕","蝃","蝭","螮","諦","谛","踶","递","逓","遞","遰","鉪","𤧛","䗖"],chóu:["俦","儔","嬦","惆","愁","懤","栦","燽","畴","疇","皗","稠","筹","籌","絒","綢","绸","菗","詶","讎","讐","踌","躊","酧","酬","醻","雔","雠","雦"],zhì:["俧","偫","儨","制","劕","垁","娡","寘","帙","帜","幟","庢","庤","廌","彘","徏","徝","志","忮","懥","懫","挃","挚","掷","摯","擲","旘","晊","智","栉","桎","梽","櫍","櫛","治","洷","滍","滞","滯","潌","瀄","炙","熫","狾","猘","璏","瓆","痔","痣","礩","祑","秩","秷","稚","稺","穉","窒","紩","緻","置","翐","膣","至","致","芖","蛭","袟","袠","製","覟","觗","觯","觶","誌","豑","豒","貭","質","贄","质","贽","跱","踬","躓","輊","轾","郅","銍","鋕","鑕","铚","锧","陟","隲","雉","駤","騭","騺","驇","骘","鯯","鴙","鷙","鸷","𬃊"],"liǎ liǎng":["俩"],jiǎn:["俭","倹","儉","减","剪","堿","弿","彅","戩","戬","拣","挸","捡","揀","撿","枧","柬","梘","检","検","檢","減","湕","瀽","瑐","睑","瞼","硷","碱","礆","笕","筧","简","簡","絸","繭","翦","茧","藆","蠒","裥","襇","襉","襺","詃","謇","謭","譾","谫","趼","蹇","鐗","鬋","鰎","鹸","鹻","鹼"],huò:["俰","咟","嚯","嚿","奯","彠","惑","或","擭","旤","曤","檴","沎","湱","瀖","獲","癨","眓","矐","祸","禍","穫","窢","耯","臛","艧","获","蒦","藿","蠖","謋","貨","货","鍃","鑊","镬","雘","霍","靃","韄","㸌"],"jù jū":["俱","据","鋸","锯"],xiào:["俲","傚","効","咲","哮","啸","嘋","嘨","嘯","孝","效","斅","斆","歗","涍","熽","笑","詨","誟"],pái:["俳","徘","牌","犤","猅","簰","簲","輫"],biào:["俵","鰾","鳔"],"chù tì":["俶"],fèi:["俷","剕","厞","吠","屝","废","廃","廢","昲","曊","櫠","沸","濷","狒","癈","肺","萉","費","费","鐨","镄","陫","靅","鼣"],fèng:["俸","凤","奉","湗","焨","煈","賵","赗","鳯","鳳","鴌"],ǎn:["俺","唵","埯","揞","罯","銨","铵"],bèi:["俻","倍","偝","偹","備","僃","备","悖","惫","愂","憊","昁","梖","焙","牬","犕","狈","狽","珼","琲","碚","禙","糒","苝","蓓","蛽","褙","貝","贝","軰","輩","辈","邶","郥","鄁","鋇","鐾","钡","鞁","鞴","𬇙"],yù:["俼","儥","喅","喩","喻","域","堉","妪","嫗","寓","峪","嶎","庽","彧","御","愈","慾","戫","昱","棛","棜","棫","櫲","欎","欝","欲","毓","浴","淯","滪","潏","澦","灪","焴","煜","燏","燠","爩","狱","獄","玉","琙","瘉","癒","砡","硢","硲","礇","礖","礜","禦","秗","稢","稶","篽","籞","籲","粖","緎","罭","聿","肀","艈","芋","芌","茟","蒮","蓣","蓹","蕷","蘌","蜟","蜮","袬","裕","誉","諭","譽","谕","豫","軉","輍","逳","遇","遹","郁","醧","鈺","鋊","錥","鐭","钰","閾","阈","雤","霱","預","预","飫","饇","饫","馭","驈","驭","鬰","鬱","鬻","魊","鱊","鳿","鴥","鴧","鴪","鵒","鷸","鸒","鹆","鹬"],xīn:["俽","噺","妡","嬜","廞","心","忄","忻","惞","新","昕","杺","欣","歆","炘","盺","薪","訢","辛","邤","鈊","鋅","鑫","锌","馨","馫","䜣","𫷷"],"hǔ chí":["俿"],jiù:["倃","僦","匓","匛","匶","厩","咎","就","廄","廏","廐","慦","捄","救","旧","柩","柾","桕","欍","殧","疚","臼","舅","舊","鯦","鷲","鹫","麔","齨","㠇"],yáo:["倄","傜","嗂","垚","堯","姚","媱","尧","尭","峣","嶢","嶤","徭","揺","搖","摇","摿","暚","榣","烑","爻","猺","珧","瑤","瑶","磘","窑","窯","窰","肴","蘨","謠","謡","谣","軺","轺","遙","遥","邎","顤","颻","飖","餆","餚","鰩","鱙","鳐"],"cuì zú":["倅"],"liǎng liǎ":["倆"],wǎn:["倇","唍","婉","惋","挽","晚","晥","晩","晼","梚","椀","琬","畹","皖","盌","碗","綩","綰","绾","脘","萖","踠","輓","鋔"],zǒng:["倊","偬","傯","嵸","总","惣","捴","搃","摠","燪","総","緫","縂","總","蓗"],guān:["倌","关","官","棺","瘝","癏","窤","蒄","関","闗","關","鰥","鱞","鳏"],tiǎn:["倎","唺","忝","悿","晪","殄","淟","睓","腆","舔","覥","觍","賟","錪","餂"],mén:["們","扪","捫","璊","菛","虋","鍆","钔","門","閅","门","𫞩"],"dǎo dào":["倒"],"tán tàn":["倓","埮"],"juè jué":["倔"],chuí:["倕","垂","埀","捶","搥","桘","棰","槌","箠","腄","菙","錘","鎚","锤","陲","顀"],xìng:["倖","姓","婞","嬹","幸","性","悻","杏","涬","緈","臖","荇","莕","葕"],péng:["倗","傰","塜","塳","弸","憉","捀","朋","棚","椖","樥","硼","稝","竼","篷","纄","膨","芃","蓬","蘕","蟚","蟛","袶","輣","錋","鑝","韸","韼","騯","髼","鬅","鬔","鵬","鹏"],"tǎng cháng":["倘"],hòu:["候","厚","后","垕","堠","後","洉","茩","豞","逅","郈","鮜","鱟","鲎","鲘"],tì:["倜","剃","嚏","嚔","屉","屜","悌","悐","惕","惖","戻","掦","替","朑","歒","殢","涕","瓋","笹","籊","薙","褅","逖","逷","髰","鬀","鬄"],gàn:["倝","凎","幹","榦","檊","淦","灨","盰","紺","绀","詌","贑","赣","骭","㽏"],"liàng jìng":["倞","靓"],suī:["倠","哸","夊","滖","濉","眭","睢","芕","荽","荾","虽","雖","鞖"],"chàng chāng":["倡"],jié:["倢","偼","傑","刦","刧","刼","劫","劼","卩","卪","婕","媫","孑","岊","崨","嵥","嶻","巀","幯","截","捷","掶","擮","昅","杢","杰","桀","桝","楬","楶","榤","洁","滐","潔","狤","睫","礍","竭","節","羯","莭","蓵","蛣","蜐","蠘","蠞","蠽","衱","袺","訐","詰","誱","讦","踕","迼","鉣","鍻","镼","頡","鮚","鲒","㛃"],"kǒng kōng":["倥"],juàn:["倦","劵","奆","慻","桊","淃","狷","獧","眷","睊","睠","絭","絹","绢","罥","羂","腃","蔨","鄄","餋"],zōng:["倧","堫","宗","嵏","嵕","惾","朡","棕","椶","熧","猣","磫","緃","翪","腙","葼","蝬","豵","踨","踪","蹤","鍐","鑁","騌","騣","骔","鬃","鬉","鬷","鯮","鯼"],ní:["倪","坭","埿","尼","屔","怩","淣","猊","籾","聣","蚭","蜺","觬","貎","跜","輗","郳","鈮","铌","霓","馜","鯢","鲵","麑","齯","𫐐","𫠜"],zhuō:["倬","拙","捉","桌","梲","棁","棳","槕","涿","窧","鐯","䦃"],"wō wēi":["倭"],luǒ:["倮","剆","曪","瘰","癳","臝","蓏","蠃","裸","躶"],sōng:["倯","凇","娀","崧","嵩","庺","憽","松","枀","枩","柗","梥","檧","淞","濍","硹","菘","鬆"],lèng:["倰","堎","愣","睖","踜"],zì:["倳","剚","字","恣","渍","漬","牸","眥","眦","胔","胾","自","茡","荢"],bèn:["倴","坌","捹","撪","渀","笨","逩"],cǎi:["倸","啋","婇","彩","採","棌","毝","睬","綵","跴","踩"],zhài:["债","債","寨","瘵","砦"],yē:["倻","吔","噎","擨","暍","椰","歋","潱","蠮"],shà:["倽","唼","喢","歃","箑","翜","翣","萐","閯","霎"],qīng:["倾","傾","卿","圊","寈","氢","氫","淸","清","蜻","軽","輕","轻","郬","錆","鑋","靑","青","鯖"],yīng:["偀","嘤","噟","嚶","婴","媖","嫈","嬰","孆","孾","愥","撄","攖","朠","桜","樱","櫻","渶","煐","珱","瑛","璎","瓔","甇","甖","碤","礯","緓","纓","绬","缨","罂","罃","罌","膺","英","莺","蘡","蝧","蠳","褮","譻","賏","軈","鑍","锳","霙","韺","鴬","鶑","鶧","鶯","鷪","鷹","鸎","鸚","鹦","鹰","䓨"],"chēng chèn":["偁","爯"],ruǎn:["偄","朊","瑌","瓀","碝","礝","腝","軟","輭","软","阮"],"zhòng tóng":["偅"],chǔn:["偆","惷","睶","萶","蠢","賰"],"jiǎ jià":["假"],"jì jié":["偈"],"bǐng bìng":["偋"],ruò:["偌","叒","嵶","弱","楉","焫","爇","箬","篛","蒻","鄀","鰙","鰯","鶸"],tí:["偍","厗","啼","嗁","崹","漽","瑅","睼","禵","稊","緹","缇","罤","蕛","褆","謕","趧","蹄","蹏","醍","鍗","題","题","騠","鮷","鯷","鳀","鵜","鷤","鹈","𫘨"],wēi:["偎","危","喴","威","媙","嶶","巍","微","愄","揋","揻","椳","楲","溦","烓","煨","燰","癓","縅","葨","葳","薇","蜲","蝛","覣","詴","逶","隇","隈","霺","鰃","鰄","鳂"],piān:["偏","囨","媥","楄","犏","篇","翩","鍂"],yàn:["偐","厌","厭","唁","喭","嚈","嚥","堰","妟","姲","嬊","嬿","宴","彥","彦","敥","晏","暥","曕","曣","滟","灎","灔","灧","灩","焔","焰","焱","熖","燄","牪","猒","砚","硯","艳","艶","艷","覎","觃","觾","諺","讌","讞","谚","谳","豓","豔","贋","贗","赝","軅","酀","酽","醼","釅","雁","餍","饜","騐","験","騴","驗","驠","验","鬳","鳫","鴈","鴳","鷃","鷰","齞"],"tǎng dàng":["偒"],è:["偔","匎","卾","厄","呝","咢","噩","垩","堊","堮","岋","崿","廅","悪","愕","戹","扼","搤","搹","擜","櫮","歞","歺","湂","琧","砈","砐","硆","腭","苊","萼","蕚","蚅","蝁","覨","諤","讍","谔","豟","軛","軶","轭","遌","遏","遻","鄂","鈪","鍔","鑩","锷","阨","阸","頞","顎","颚","餓","餩","饿","鰐","鰪","鱷","鳄","鶚","鹗","齃","齶","𫫇","𥔲"],xié:["偕","勰","协","協","嗋","垥","奊","恊","愶","拹","携","撷","擕","擷","攜","斜","旪","熁","燲","綊","緳","縀","缬","翓","胁","脅","脇","脋","膎","蝢","衺","襭","諧","讗","谐","鞋","鞵","龤","㙦"],chě:["偖","扯","撦"],shěng:["偗","渻","眚"],chā:["偛","嗏","扠","挿","插","揷","疀","臿","艖","銟","鍤","锸","餷"],huáng:["偟","凰","喤","堭","墴","媓","崲","徨","惶","楻","湟","煌","獚","瑝","璜","癀","皇","磺","穔","篁","簧","艎","葟","蝗","蟥","諻","趪","遑","鍠","鐄","锽","隍","韹","餭","騜","鰉","鱑","鳇","鷬","黃","黄","𨱑"],yǎo:["偠","咬","婹","宎","岆","杳","柼","榚","溔","狕","窅","窈","舀","苭","闄","騕","鷕","齩"],"chǒu qiào":["偢"],yóu:["偤","尤","庮","怣","沋","油","浟","游","犹","猶","猷","由","疣","秞","肬","莜","莸","蕕","蚰","蝣","訧","輏","輶","逰","遊","邮","郵","鈾","铀","駀","魷","鮋","鱿","鲉","𬨎"],xū:["偦","墟","媭","嬃","楈","欨","歔","燸","疞","盱","綇","縃","繻","胥","蕦","虗","虚","虛","蝑","裇","訏","許","諝","譃","谞","鑐","需","須","须","顼","驉","鬚","魆","魖","𬣙","𦈡"],zhā:["偧","哳","抯","挓","揸","摣","樝","渣","皶","觰","譇","齄","齇"],cī:["偨","疵","蠀","趀","骴","髊","齹"],bī:["偪","屄","楅","毴","豍","逼","鰏","鲾","鵖"],xún:["偱","噚","寻","尋","峋","巡","廵","循","恂","揗","攳","旬","杊","栒","桪","樳","洵","浔","潯","燅","燖","珣","璕","畃","紃","荀","蟳","詢","询","鄩","鱏","鱘","鲟","𬘓","𬩽","𬍤","𬊈"],"cāi sī":["偲"],duān:["偳","媏","端","褍","鍴"],ǒu:["偶","吘","嘔","耦","腢","蕅","藕","𬉼","𠙶"],tōu:["偷","偸","鍮"],"zán zá zǎ":["偺"],"lǚ lóu":["偻","僂"],fèn:["偾","僨","奋","奮","弅","忿","愤","憤","瀵","瞓","秎","粪","糞","膹","鱝","鲼"],"kuǐ guī":["傀"],sǒu:["傁","叜","叟","嗾","櫢","瞍","薮","藪"],"zhì sī tí":["傂"],sù:["傃","僳","嗉","塐","塑","夙","嫊","愫","憟","榡","樎","樕","殐","泝","涑","溯","溸","潚","潥","玊","珟","璛","簌","粛","粟","素","縤","肃","肅","膆","蔌","藗","觫","訴","謖","诉","谡","趚","蹜","速","遡","遬","鋉","餗","驌","骕","鱐","鷫","鹔","𫗧"],xiā:["傄","煆","瞎","虲","谺","颬","鰕"],"yuàn yuán":["傆","媛"],rǒng:["傇","冗","宂","氄","軵"],nù:["傉","怒"],yùn:["傊","孕","恽","惲","愠","慍","枟","腪","蕴","薀","藴","蘊","褞","貟","运","運","郓","鄆","酝","醖","醞","韗","韞","韵","韻","餫"],"gòu jiǎng":["傋"],mà:["傌","嘜","榪","睰","祃","禡","罵","閁","駡","骂","鬕"],bàng:["傍","塝","棒","玤","稖","艕","蒡","蜯","謗","谤","鎊","镑"],diān:["傎","厧","嵮","巅","巓","巔","掂","攧","敁","槇","滇","癫","癲","蹎","顚","顛","颠","齻"],táng:["傏","唐","啺","坣","堂","塘","搪","棠","榶","溏","漟","煻","瑭","磄","禟","篖","糃","糖","糛","膅","膛","蓎","螗","螳","赯","踼","鄌","醣","鎕","隚","餹","饄","鶶","䣘"],hào:["傐","哠","恏","昊","昦","晧","暠","暤","暭","曍","浩","淏","澔","灏","灝","皓","皜","皞","皡","皥","耗","聕","薃","號","鄗","顥","颢","鰝"],"xī xì":["傒"],shān:["傓","删","刪","剼","圸","山","挻","搧","柵","檆","潸","澘","煽","狦","珊","笘","縿","羴","羶","脠","舢","芟","衫","跚","軕","邖","閊","鯅"],"qiàn jiān":["傔"],"què jué":["傕","埆"],"cāng chen":["傖"],róng:["傛","媶","嫆","嬫","容","峵","嵘","嶸","戎","搈","曧","栄","榕","榮","榵","毧","溶","瀜","烿","熔","狨","瑢","穁","絨","绒","羢","肜","茙","茸","荣","蓉","蝾","融","螎","蠑","褣","鎔","镕","駥"],"tà tàn":["傝"],suō:["傞","唆","嗍","嗦","娑","摍","桫","梭","睃","簑","簔","羧","莏","蓑","趖","鮻"],dǎi:["傣","歹"],zài:["傤","儎","再","在","扗","洅","載","酨"],gǔ:["傦","古","啒","尳","愲","榖","榾","汩","淈","濲","瀔","牯","皷","皼","盬","瞽","穀","罟","羖","股","脵","臌","薣","蛊","蠱","詁","诂","轂","逧","鈷","钴","餶","馉","鼓","鼔","𦙶"],bīn:["傧","宾","彬","斌","椕","滨","濒","濱","濵","瀕","繽","缤","虨","豩","豳","賓","賔","邠","鑌","镔","霦","顮"],chǔ:["储","儲","杵","椘","楚","楮","檚","濋","璴","础","礎","禇","處","齭","齼","𬺓"],nuó:["傩","儺","挪","梛","橠"],"cān càn":["傪"],lěi:["傫","儡","厽","垒","塁","壘","壨","櫐","灅","癗","矋","磊","礨","耒","蕌","蕾","藟","蘽","蠝","誄","讄","诔","鑸","鸓"],cuī:["催","凗","墔","崔","嵟","慛","摧","榱","獕","磪","鏙"],yōng:["傭","嗈","墉","壅","嫞","庸","廱","慵","拥","擁","滽","灉","牅","痈","癕","癰","臃","邕","郺","鄘","鏞","镛","雍","雝","饔","鱅","鳙","鷛"],"zāo cáo":["傮"],sǒng:["傱","嵷","怂","悚","愯","慫","竦","耸","聳","駷","㧐"],ào:["傲","坳","垇","墺","奡","嫯","岙","岰","嶴","懊","擙","澳","鏊","驁","骜"],"qī còu":["傶"],chuǎng:["傸","磢","闖","闯"],shǎ:["傻","儍"],hàn:["傼","垾","悍","憾","扞","捍","撖","撼","旱","晘","暵","汉","涆","漢","瀚","焊","猂","皔","睅","翰","莟","菡","蛿","蜭","螒","譀","輚","釬","銲","鋎","雗","頷","顄","颔","駻","鶾"],zhāng:["傽","嫜","张","張","彰","慞","暲","樟","漳","獐","璋","章","粻","蔁","蟑","遧","鄣","鏱","餦","騿","鱆","麞"],"yān yàn":["傿","墕","嬮"],"piào biāo":["僄","骠"],liàn:["僆","堜","媡","恋","戀","楝","殓","殮","湅","潋","澰","瀲","炼","煉","瑓","練","纞","练","萰","錬","鍊","鏈","链","鰊","𬶠"],màn:["㵘","僈","墁","幔","慢","曼","漫","澷","熳","獌","縵","缦","蔄","蘰","鄤","鏝","镘","𬜬"],"tàn tǎn":["僋"],yíng:["僌","営","塋","嬴","攍","楹","櫿","溁","溋","滢","潆","濙","濚","濴","瀅","瀛","瀠","瀯","灐","灜","熒","營","瑩","盁","盈","禜","籝","籯","縈","茔","荧","莹","萤","营","萦","萾","蓥","藀","蛍","蝇","蝿","螢","蠅","謍","贏","赢","迎","鎣"],dòng:["働","冻","凍","动","動","姛","戙","挏","栋","棟","湩","硐","胨","胴","腖","迵","霘","駧"],zhuàn:["僎","啭","囀","堟","撰","灷","瑑","篆","腞","蒃","襈","譔","饌","馔"],xiàng:["像","勨","向","嚮","姠","嶑","曏","橡","珦","缿","蟓","衖","襐","象","鐌","項","项","鱌"],shàn:["僐","善","墠","墡","嬗","擅","敾","椫","樿","歚","汕","灗","疝","磰","繕","缮","膳","蟮","蟺","訕","謆","譱","讪","贍","赡","赸","鄯","鐥","饍","騸","骟","鱓","鱔","鳝","𫮃"],"tuí tuǐ":["僓"],zǔn:["僔","噂","撙","譐"],pú:["僕","匍","圤","墣","濮","獛","璞","瞨","穙","莆","菐","菩","葡","蒱","蒲","贌","酺","鏷","镤"],láo:["僗","劳","労","勞","哰","崂","嶗","憥","朥","浶","牢","痨","癆","窂","簩","醪","鐒","铹","顟","髝","𫭼"],chǎng:["僘","厰","廠","敞","昶","氅","鋹","𬬮"],guāng:["僙","光","咣","垙","姯","洸","灮","炗","炚","炛","烡","珖","胱","茪","輄","銧","黆","𨐈"],liáo:["僚","嘹","嫽","寥","寮","尞","屪","嵺","嶚","嶛","廫","憀","敹","暸","橑","獠","璙","疗","療","竂","簝","繚","缭","聊","膋","膫","藔","蟟","豂","賿","蹘","辽","遼","飉","髎","鷯","鹩"],dèng:["僜","凳","墱","嶝","櫈","瞪","磴","覴","邓","鄧","隥"],"chán zhàn zhuàn":["僝"],bō:["僠","嶓","拨","撥","播","波","溊","玻","癶","盋","砵","碆","礡","缽","菠","袰","蹳","鉢","钵","餑","饽","驋","鱍","𬭛"],huì:["僡","匯","卉","喙","嘒","嚖","圚","嬒","寭","屶","屷","彗","彙","彚","徻","恚","恵","惠","慧","憓","懳","晦","暳","槥","橞","檅","櫘","汇","泋","滙","潓","烩","燴","獩","璤","瞺","硊","秽","穢","篲","絵","繪","绘","翙","翽","荟","蔧","蕙","薈","薉","蟪","詯","誨","諱","譓","譿","讳","诲","賄","贿","鐬","闠","阓","靧","頮","顪","颒","餯","𬤝","𬭬"],chuǎn:["僢","喘","舛","荈","踳"],"tiě jiàn":["僣"],sēng:["僧","鬙"],xiàn:["僩","僴","哯","垷","塪","姭","娊","宪","岘","峴","憲","撊","晛","橌","橺","涀","瀗","献","獻","现","現","県","睍","粯","糮","絤","綫","線","线","缐","羡","羨","腺","臔","臽","苋","莧","誢","豏","鋧","錎","限","陥","陷","霰","餡","馅","麲","鼸","𬀪","𪾢"],"yù jú":["僪"],"è wū":["僫"],"tóng zhuàng":["僮"],lǐn:["僯","凛","凜","廩","廪","懍","懔","撛","檁","檩","澟","癛","癝"],gù:["僱","凅","固","堌","崓","崮","故","梏","棝","牿","痼","祻","錮","锢","雇","顧","顾","鯝","鲴"],jiāng:["僵","壃","姜","橿","殭","江","畕","疅","礓","繮","缰","翞","茳","葁","薑","螀","螿","豇","韁","鱂","鳉"],mǐn:["僶","冺","刡","勄","悯","惽","愍","慜","憫","抿","敃","敏","敯","泯","潣","皿","笢","笽","簢","蠠","閔","閩","闵","闽","鰵","鳘","黽"],jìn:["僸","凚","噤","嚍","墐","壗","妗","嬧","搢","晉","晋","枃","殣","浕","浸","溍","濅","濜","烬","煡","燼","琎","瑨","璶","盡","祲","縉","缙","荩","藎","覲","觐","賮","贐","赆","近","进","進","靳","齽"],"jià jie":["價"],qiào:["僺","峭","帩","撬","殻","窍","竅","誚","诮","躈","陗","鞩","韒","髚"],pì:["僻","媲","嫓","屁","澼","甓","疈","譬","闢","鷿","鸊","䴙"],sài:["僿","簺","賽","赛"],"chán tǎn shàn":["儃"],"dāng dàng":["儅","当","闣"],xuān:["儇","喧","塇","媗","宣","愃","愋","揎","昍","暄","煊","煖","瑄","睻","矎","禤","箮","翧","翾","萱","萲","蓒","蕿","藼","蘐","蝖","蠉","諠","諼","譞","谖","軒","轩","鍹","駽","鰚","𫓶","𫍽"],"dān dàn":["儋","擔","瘅"],càn:["儏","澯","灿","燦","璨","粲","薒","謲"],"bīn bìn":["儐"],"án àn":["儑"],tái:["儓","坮","嬯","抬","擡","檯","炱","炲","籉","臺","薹","跆","邰","颱","鮐","鲐"],lán:["儖","兰","囒","婪","岚","嵐","幱","拦","攔","斓","斕","栏","欄","欗","澜","瀾","灆","灡","燣","燷","璼","篮","籃","籣","繿","葻","蓝","藍","蘫","蘭","褴","襕","襤","襴","襽","譋","讕","谰","躝","鑭","镧","闌","阑","韊","𬒗"],"nǐ yì ài yí":["儗"],méng:["儚","幪","曚","朦","橗","檬","氋","溕","濛","甍","甿","盟","礞","艨","莔","萌","蕄","虻","蝱","鄳","鄸","霿","靀","顭","饛","鯍","鸏","鹲","𫑡","㠓"],níng:["儜","凝","咛","嚀","嬣","柠","橣","檸","狞","獰","聍","聹","薴","鑏","鬡","鸋"],qióng:["儝","卭","宆","惸","憌","桏","橩","焪","焭","煢","熍","琼","瓊","睘","穷","穹","窮","竆","笻","筇","舼","茕","藑","藭","蛩","蛬","赹","跫","邛","銎","䓖"],liè:["儠","冽","列","劣","劽","埒","埓","姴","峛","巤","挒","捩","栵","洌","浖","烈","烮","煭","犣","猎","猟","獵","聗","脟","茢","蛚","趔","躐","迾","颲","鬛","鬣","鮤","鱲","鴷","䴕","𫚭"],kuǎng:["儣","夼","懭"],bào:["儤","勽","報","忁","报","抱","曓","爆","犦","菢","虣","蚫","豹","鉋","鑤","铇","骲","髱","鮑","鲍"],biāo:["儦","墂","幖","彪","标","標","滮","瀌","熛","爂","猋","瘭","磦","膘","臕","謤","贆","鏢","鑣","镖","镳","颮","颷","飆","飇","飈","飊","飑","飙","飚","驫","骉","髟"],zǎn:["儧","儹","噆","攅","昝","趱","趲"],háo:["儫","嗥","嘷","噑","嚎","壕","椃","毜","毫","濠","獆","獔","竓","籇","蚝","蠔","譹","豪"],qìng:["儬","凊","庆","慶","櫦","濪","碃","磬","罄","靘"],chèn:["儭","嚫","榇","櫬","疢","衬","襯","讖","谶","趁","趂","齓","齔","龀"],téng:["儯","幐","滕","漛","疼","籐","籘","縢","腾","藤","虅","螣","誊","謄","邆","駦","騰","驣","鰧","䲢"],"lǒng lóng lòng":["儱"],"chán chàn":["儳"],"ráng xiāng":["儴","勷"],"huì xié":["儶"],luó:["儸","攞","椤","欏","猡","玀","箩","籮","罗","羅","脶","腡","萝","蘿","螺","覼","逻","邏","鏍","鑼","锣","镙","饠","騾","驘","骡","鸁"],léi:["儽","嫘","檑","欙","瓃","畾","縲","纍","纝","缧","罍","羸","蔂","蘲","虆","轠","鐳","鑘","镭","雷","靁","鱩","鼺"],"nàng nāng":["儾"],"wù wū":["兀"],yǔn:["允","喗","夽","抎","殒","殞","狁","磒","荺","賱","鈗","阭","陨","隕","霣","馻","齫","齳"],zān:["兂","橵","簪","簮","糌","鐕","鐟","鵤"],yuán:["元","円","原","厡","厵","园","圆","圎","園","圓","垣","塬","媴","嫄","援","榞","榬","橼","櫞","沅","湲","源","溒","爰","猨","猿","笎","緣","縁","缘","羱","茒","薗","蝝","蝯","螈","袁","褤","謜","轅","辕","邍","邧","酛","鈨","鎱","騵","魭","鶢","鶰","黿","鼋","𫘪"],xiōng:["兄","兇","凶","匂","匈","哅","忷","恟","汹","洶","胷","胸","芎","訩","詾","讻"],chōng:["充","嘃","忡","憃","憧","摏","沖","浺","珫","罿","翀","舂","艟","茺","衝","蹖","㳘"],zhào:["兆","垗","旐","曌","枛","櫂","照","燳","狣","瞾","笊","罀","罩","羄","肁","肇","肈","詔","诏","赵","趙","鮡","𬶐"],"duì ruì yuè":["兊","兌","兑"],kè:["克","刻","勀","勊","堁","娔","客","恪","愙","氪","溘","碦","緙","缂","艐","衉","課","课","錁","锞","騍","骒"],tù:["兎","兔","堍","迌","鵵"],dǎng:["党","攩","欓","譡","讜","谠","黨","𣗋"],dōu:["兜","兠","唗","橷","篼","蔸"],huǎng:["兤","奛","幌","怳","恍","晄","炾","熀","縨","詤","謊","谎"],rù:["入","嗕","媷","扖","杁","洳","溽","縟","缛","蓐","褥","鳰"],nèi:["內","氝","氞","錗"],"yú shù":["兪"],"liù lù":["六"],han:["兯","爳"],tiān:["兲","天","婖","添","酟","靔","靝","黇"],"xīng xìng":["兴"],diǎn:["典","嚸","奌","婰","敟","椣","点","碘","蒧","蕇","踮","點"],"zī cí":["兹"],jiān:["兼","冿","囏","坚","堅","奸","姦","姧","尖","幵","惤","戋","戔","搛","椾","樫","櫼","歼","殱","殲","湔","瀐","瀸","煎","熞","熸","牋","瑊","睷","礛","礷","笺","箋","緘","縑","缄","缣","肩","艰","艱","菅","菺","葌","蒹","蔪","蕑","蕳","虃","譼","豜","鑯","雃","鞯","韀","韉","餰","馢","鰔","鰜","鰹","鲣","鳒","鵑","鵳","鶼","鹣","麉"],shòu:["兽","受","售","壽","夀","寿","授","狩","獣","獸","痩","瘦","綬","绶","膄"],jì:["兾","冀","剂","剤","劑","勣","坖","垍","塈","妓","季","寂","寄","廭","彑","徛","忌","悸","惎","懻","技","旡","既","旣","暨","暩","曁","梞","檕","檵","洎","漃","漈","瀱","痵","癠","禝","稩","稷","穄","穊","穧","紀","継","績","繋","繼","继","绩","罽","臮","芰","茍","茤","葪","蓟","蔇","薊","蘎","蘮","蘻","裚","襀","覬","觊","計","記","誋","计","记","跡","跽","蹟","迹","际","際","霁","霽","驥","骥","髻","鬾","魝","魥","鯚","鯽","鰶","鰿","鱀","鱭","鲚","鲫","鵋","鷑","齌","𪟝","𬶨","𬶭"],jiōng:["冂","冋","坰","埛","扃","蘏","蘔","駉","駫","𬳶"],mào:["冃","冐","媢","帽","愗","懋","暓","柕","楙","毷","瑁","皃","眊","瞀","耄","茂","萺","蝐","袤","覒","貌","貿","贸","鄚","鄮"],rǎn:["冄","冉","姌","媣","染","珃","苒","蒅","䎃"],"nèi nà":["内"],gāng:["冈","冮","刚","剛","堈","堽","岡","掆","摃","棡","牨","犅","疘","綱","纲","缸","罁","罡","肛","釭","鎠","㭎"],cè:["冊","册","厕","厠","夨","廁","恻","惻","憡","敇","测","測","笧","策","筞","筴","箣","荝","萗","萴","蓛"],guǎ:["冎","剐","剮","叧","寡"],"mào mò":["冒"],gòu:["冓","啂","坸","垢","够","夠","媾","彀","搆","撀","构","構","煹","覯","觏","訽","詬","诟","購","购","遘","雊"],xǔ:["冔","喣","暊","栩","珝","盨","糈","詡","諿","诩","鄦","醑"],mì:["冖","冪","嘧","塓","宻","密","峚","幂","幎","幦","怽","榓","樒","櫁","汨","淧","滵","漞","濗","熐","羃","蔤","蜜","覓","覔","覛","觅","謐","谧","鼏"],"yóu yín":["冘"],xiě:["写","冩","藛"],jūn:["军","君","均","桾","汮","皲","皸","皹","碅","莙","蚐","袀","覠","軍","鈞","銁","銞","鍕","钧","頵","鮶","鲪","麏"],mí:["冞","擟","瀰","爢","猕","獼","祢","禰","縻","蒾","藌","蘪","蘼","袮","詸","謎","迷","醚","醾","醿","釄","镾","鸍","麊","麋","麛"],"guān guàn":["冠","覌","観","觀","观"],měng:["冡","勐","懵","掹","猛","獴","艋","蜢","蠓","錳","锰","鯭","鼆"],zhǒng:["冢","塚","尰","歱","煄","瘇","肿","腫","踵"],zuì:["冣","嶵","晬","最","栬","槜","檇","檌","祽","絊","罪","蕞","辠","酔","酻","醉","錊"],yuān:["冤","剈","囦","嬽","寃","棩","淵","渁","渆","渊","渕","灁","眢","肙","葾","蒬","蜎","蜵","駌","鳶","鴛","鵷","鸢","鸳","鹓","鼘","鼝"],míng:["冥","名","明","暝","朙","榠","洺","溟","猽","眀","眳","瞑","茗","螟","覭","詺","鄍","銘","铭","鳴","鸣"],kòu:["冦","叩","宼","寇","扣","敂","滱","窛","筘","簆","蔲","蔻","釦","鷇"],tài:["冭","太","夳","忲","态","態","汰","汱","泰","溙","肽","舦","酞","鈦","钛"],"féng píng":["冯","馮"],"chōng chòng":["冲"],kuàng:["况","圹","壙","岲","懬","旷","昿","曠","框","況","爌","眖","眶","矿","砿","礦","穬","絋","絖","纊","纩","貺","贶","軦","邝","鄺","鉱","鋛","鑛","黋"],lěng:["冷"],pàn:["冸","判","叛","沜","泮","溿","炍","牉","畔","盼","聁","袢","襻","詊","鋬","鑻","頖","鵥"],fā:["冹","彂","沷","発","發"],xiǎn:["冼","尟","尠","崄","嶮","幰","攇","显","櫶","毨","灦","烍","燹","狝","猃","獫","獮","玁","禒","筅","箲","藓","蘚","蚬","蜆","譣","赻","跣","鍌","险","険","險","韅","顕","顯","㬎"],qià:["冾","圶","帢","恰","殎","洽","硈","胢","髂"],"jìng chēng":["净","凈","淨"],sōu:["凁","嗖","廀","廋","捜","搜","摉","溲","獀","艘","蒐","螋","鄋","醙","鎪","锼","颼","飕","餿","馊","騪"],měi:["凂","媄","媺","嬍","嵄","挴","毎","每","浼","渼","燘","美","躾","鎂","镁","黣"],tú:["凃","図","图","圖","圗","塗","屠","峹","嵞","庩","廜","徒","悇","揬","涂","瘏","筡","腯","荼","蒤","跿","途","酴","鈯","鍎","馟","駼","鵌","鶟","鷋","鷵","𬳿"],zhǔn:["准","凖","埻","準","𬘯"],"liáng liàng":["凉","涼","量"],diāo:["凋","刁","刟","叼","奝","弴","彫","汈","琱","碉","簓","虭","蛁","貂","錭","雕","鮉","鯛","鲷","鵰","鼦"],còu:["凑","湊","腠","輳","辏"],ái:["凒","啀","嘊","捱","溰","癌","皑","皚"],duó:["凙","剫","夺","奪","痥","踱","鈬","鐸","铎"],dú:["凟","匵","嬻","椟","櫝","殰","涜","牍","牘","犊","犢","独","獨","瓄","皾","裻","読","讀","讟","豄","贕","錖","鑟","韇","韣","韥","騳","髑","黩","黷"],"jǐ jī":["几"],fán:["凡","凢","凣","匥","墦","杋","柉","棥","樊","瀿","烦","煩","燔","璠","矾","礬","笲","籵","緐","羳","舤","舧","薠","蘩","蠜","襎","蹯","釩","鐇","鐢","钒","鷭","𫔍","𬸪"],jū:["凥","匊","娵","婮","居","崌","抅","挶","掬","梮","椐","檋","毩","毱","泃","涺","狙","琚","疽","砠","罝","腒","艍","蜛","裾","諊","跔","踘","躹","陱","雎","鞠","鞫","駒","驹","鮈","鴡","鶋","𬶋"],"chù chǔ":["処","处"],zhǐ:["凪","劧","咫","址","坧","帋","恉","扺","指","旨","枳","止","汦","沚","洔","淽","疻","砋","祉","秖","紙","纸","芷","藢","衹","襧","訨","趾","軹","轵","酯","阯","黹"],píng:["凭","凴","呯","坪","塀","岼","帡","帲","幈","平","慿","憑","枰","洴","焩","玶","瓶","甁","竮","箳","簈","缾","荓","萍","蓱","蚲","蛢","評","评","軿","輧","郱","鮃","鲆"],kǎi:["凯","凱","剀","剴","垲","塏","恺","愷","慨","暟","蒈","輆","鍇","鎧","铠","锴","闓","闿","颽"],gān:["凲","坩","尲","尴","尶","尷","柑","泔","漧","玕","甘","疳","矸","竿","筸","粓","肝","苷","迀","酐","魐"],"kǎn qiǎn":["凵"],tū:["凸","堗","嶀","捸","涋","湥","痜","禿","秃","突","葖","鋵","鵚","鼵","㻬"],"āo wā":["凹"],chū:["出","初","岀","摴","榋","樗","貙","齣","䢺","䝙"],dàng:["凼","圵","垱","壋","档","檔","氹","璗","瓽","盪","瞊","砀","碭","礑","簜","荡","菪","蕩","蘯","趤","逿","雼","𬍡"],hán:["函","凾","含","圅","娢","寒","崡","晗","梒","浛","涵","澏","焓","琀","甝","筨","蜬","邗","邯","鋡","韓","韩"],záo:["凿","鑿"],dāo:["刀","刂","忉","氘","舠","螩","釖","魛","鱽"],chuāng:["刅","摐","牎","牕","疮","瘡","窓","窗","窻"],"fēn fèn":["分"],"qiè qiē":["切"],kān:["刊","勘","堪","戡","栞","龕","龛"],cǔn:["刌","忖"],chú:["刍","厨","幮","廚","橱","櫉","櫥","滁","犓","篨","耡","芻","蒢","蒭","蜍","蟵","豠","趎","蹰","躇","躕","鉏","鋤","锄","除","雏","雛","鶵"],"huà huá":["划"],lí:["刕","剓","剺","劙","厘","喱","嚟","囄","嫠","孷","廲","悡","梨","梸","棃","漓","灕","犁","犂","狸","琍","璃","瓈","盠","睝","离","穲","竰","筣","篱","籬","糎","縭","缡","罹","艃","荲","菞","蓠","蔾","藜","蘺","蜊","蟍","蟸","蠫","褵","謧","貍","醨","鋫","錅","鏫","鑗","離","驪","骊","鯏","鯬","鱺","鲡","鵹","鸝","鹂","黎","黧","㰀"],yuè:["刖","嬳","岄","岳","嶽","恱","悅","悦","戉","抈","捳","月","樾","瀹","爚","玥","礿","禴","篗","籆","籥","籰","粤","粵","蘥","蚎","蚏","説","越","跀","跃","躍","軏","鈅","鉞","鑰","钺","閱","閲","阅","鸑","鸙","黦","龠","𫐄","𬸚"],liú:["刘","劉","嚠","媹","嵧","旈","旒","榴","橊","流","浏","瀏","琉","瑠","瑬","璢","畄","留","畱","疁","瘤","癅","硫","蒥","蓅","蟉","裗","鎏","鏐","鐂","镠","飀","飅","飗","駠","駵","騮","驑","骝","鰡","鶹","鹠","麍"],zé:["则","則","啧","嘖","嫧","帻","幘","択","樍","歵","沢","泎","溭","皟","瞔","矠","礋","箦","簀","舴","蔶","蠌","襗","謮","賾","赜","迮","鸅","齚","齰"],"chuàng chuāng":["创","創"],qù:["刞","厺","去","閴","闃","阒","麮","鼁"],"bié biè":["別","别"],"páo bào":["刨"],"chǎn chàn":["刬","剗","幝"],guā:["刮","劀","桰","歄","煱","瓜","胍","踻","颪","颳","騧","鴰","鸹"],gēng:["刯","庚","椩","浭","焿","畊","絚","羮","羹","耕","菮","賡","赓","鶊","鹒"],dào:["到","噵","悼","椡","檤","燾","瓙","盗","盜","稲","稻","纛","翿","艔","菿","衜","衟","軇","道"],chuàng:["刱","剏","剙","怆","愴"],kū:["刳","哭","圐","堀","枯","桍","矻","窟","跍","郀","骷","鮬"],duò:["刴","剁","墯","尮","惰","憜","挅","桗","舵","跥","跺","陊","陏","飿","饳","鵽"],"shuā shuà":["刷"],"quàn xuàn":["券"],"chà shā":["刹","剎"],"cì cī":["刺"],guì:["刽","刿","劊","劌","撌","攰","昋","桂","椢","槶","樻","櫃","猤","禬","筀","蓕","襘","貴","贵","跪","鐀","鑎","鞼","鱖","鱥"],lóu:["剅","娄","婁","廔","楼","樓","溇","漊","熡","耧","耬","艛","蒌","蔞","蝼","螻","謱","軁","遱","鞻","髅","髏","𪣻"],cuò:["剉","剒","厝","夎","挫","措","棤","莝","莡","蓌","逪","銼","錯","锉","错"],"xiāo xuē":["削"],"kēi kè":["剋","尅"],"là lá":["剌"],tī:["剔","梯","踢","銻","锑","鷈","鷉","䏲","䴘"],pōu:["剖"],wān:["剜","塆","壪","帵","弯","彎","湾","潫","灣","睕","蜿","豌"],"bāo bō":["剝","剥"],duō:["剟","咄","哆","嚉","多","夛","掇","毲","畓","裰","㙍"],qíng:["剠","勍","夝","情","擎","晴","暒","棾","樈","檠","氰","甠","硘","葝","黥"],"yǎn shàn":["剡"],"dū zhuó":["剢"],yān:["剦","嫣","崦","嶖","恹","懕","懨","樮","淊","淹","漹","烟","焉","焑","煙","珚","篶","胭","臙","菸","鄢","醃","閹","阉","黫"],huō:["剨","劐","吙","攉","秴","耠","锪","騞","𬴃"],shèng:["剩","剰","勝","圣","墭","嵊","晠","榺","橳","琞","聖","蕂","貹","賸"],"duān zhì":["剬"],wū:["剭","呜","嗚","圬","屋","巫","弙","杇","歍","汙","汚","污","洿","烏","窏","箼","螐","誈","誣","诬","邬","鄔","鎢","钨","鰞","鴮"],gē:["割","哥","圪","彁","戈","戓","戨","歌","滒","犵","肐","袼","謌","鎶","鴚","鴿","鸽"],"dá zhá":["剳"],chuán:["剶","暷","椽","篅","舡","舩","船","輲","遄"],"tuán zhuān":["剸","漙","篿"],"lù jiū":["剹"],pēng:["剻","匉","嘭","怦","恲","抨","梈","烹","砰","軯","駍"],piāo:["剽","勡","慓","旚","犥","翲","螵","飃","飄","飘","魒"],kōu:["剾","彄","抠","摳","眍","瞘","芤","𫸩"],"jiǎo chāo":["剿","劋","勦","摷"],qiāo:["劁","勪","墝","幧","敲","橇","毃","燆","硗","磽","繑","趬","跷","踍","蹺","蹻","郻","鄡","鄥","鍫","鍬","鐰","锹","頝"],"huá huà":["劃"],"zhā zhá":["劄"],"pī pǐ":["劈","悂"],tāng:["劏","嘡","羰","薚","蝪","蹚","鞺","鼞"],chán:["劖","嚵","壥","婵","嬋","巉","廛","棎","毚","湹","潹","潺","澶","瀍","瀺","煘","獑","磛","緾","纏","纒","缠","艬","蝉","蟐","蟬","蟾","誗","讒","谗","躔","鄽","酁","鋋","鑱","镵","饞","馋"],zuān:["劗","躜","躦","鉆","鑚"],mó:["劘","嫫","嬤","嬷","尛","摹","擵","橅","糢","膜","藦","蘑","謨","謩","谟","饃","饝","馍","髍","魔","魹"],zhú:["劚","斸","曯","欘","灟","炢","烛","燭","爥","瘃","竹","笁","笜","舳","茿","蓫","蠋","蠾","躅","逐","逫","钃","鱁"],quàn:["劝","勧","勸","牶","韏"],"jìn jìng":["劤","劲","勁"],kēng:["劥","坑","牼","硁","硜","誙","銵","鍞","鏗","铿","阬"],"xié liè":["劦"],"zhù chú":["助"],nǔ:["努","弩","砮","胬"],shào:["劭","卲","哨","潲","紹","綤","绍","袑","邵"],miǎo:["劰","杪","淼","渺","眇","秒","篎","緲","缈","藐","邈"],kǒu:["劶","口"],wā:["劸","娲","媧","屲","挖","攨","洼","溛","漥","瓾","畖","穵","窊","窪","蛙","韈","鼃"],kuāng:["劻","匡","匩","哐","恇","洭","筐","筺","誆","诓","軭","邼"],hé:["劾","咊","啝","姀","峆","敆","曷","柇","楁","毼","河","涸","渮","澕","熆","皬","盇","盉","盍","盒","禾","篕","籺","粭","翮","菏","萂","覈","訸","詥","郃","釛","鉌","鑉","閡","闔","阂","阖","鞨","頜","餄","饸","魺","鹖","麧","齕","龁","龢","𬌗"],gào:["勂","吿","告","峼","祮","祰","禞","筶","誥","诰","郜","鋯","锆"],"bó bèi":["勃"],láng:["勆","嫏","廊","斏","桹","榔","樃","欴","狼","琅","瑯","硠","稂","艆","蓈","蜋","螂","躴","郒","郞","鋃","鎯","锒"],xūn:["勋","勛","勲","勳","嚑","坃","埙","塤","壎","壦","曛","燻","獯","矄","纁","臐","薫","薰","蘍","醺","𫄸"],"juàn juān":["勌","瓹"],"lè lēi":["勒"],kài:["勓","炌","烗","鎎"],"wěng yǎng":["勜"],qín:["勤","嗪","噙","嶜","庈","懃","懄","捦","擒","斳","檎","澿","珡","琴","琹","瘽","禽","秦","耹","芩","芹","菦","螓","蠄","鈙","鈫","雂","靲","鳹","鵭"],jiàng:["勥","匞","匠","嵹","弜","弶","摾","櫤","洚","滰","犟","糡","糨","絳","绛","謽","酱","醤","醬"],fān:["勫","嬏","帆","幡","忛","憣","旙","旛","繙","翻","藩","轓","颿","飜","鱕"],juān:["勬","姢","娟","捐","涓","蠲","裐","鎸","鐫","镌","鹃"],"tóng dòng":["勭","烔","燑","狪"],lǜ:["勴","垏","嵂","律","慮","氯","滤","濾","爈","箻","綠","繂","膟","葎","虑","鑢"],chè:["勶","坼","彻","徹","掣","撤","澈","烢","爡","瞮","硩","聅","迠","頙","㬚"],sháo:["勺","玿","韶"],"gōu gòu":["勾"],cōng:["匆","囪","囱","忩","怱","悤","暰","樬","漗","瑽","璁","瞛","篵","繱","聡","聦","聪","聰","苁","茐","葱","蓯","蔥","蟌","鍯","鏓","鏦","騘","驄","骢"],"táo yáo":["匋","陶"],páo:["匏","咆","垉","庖","爮","狍","袍","褜","軳","鞄","麅"],dá:["匒","妲","怛","炟","燵","畣","笪","羍","荙","薘","蟽","詚","达","迏","迖","迚","逹","達","鐽","靼","鞑","韃","龖","龘","𫟼"],"huà huā":["化"],"běi bèi":["北"],nǎo:["匘","垴","堖","嫐","恼","悩","惱","瑙","碯","脑","脳","腦"],"chí shi":["匙"],fāng:["匚","堏","方","淓","牥","芳","邡","鈁","錺","钫","鴋"],zā:["匝","咂","帀","沞","臜","臢","迊","鉔","魳"],qiè:["匧","厒","妾","怯","悏","惬","愜","挈","穕","窃","竊","笡","箧","篋","籡","踥","鍥","锲","鯜"],"zāng cáng":["匨"],fěi:["匪","奜","悱","棐","榧","篚","翡","蕜","誹","诽"],"kuì guì":["匮","匱"],suǎn:["匴"],pǐ:["匹","噽","嚭","圮","庀","痞","癖","脴","苉","銢","鴄"],"qū ōu":["区","區"],"kē qià":["匼"],"yǎn yàn":["匽","棪"],biǎn:["匾","惼","揙","碥","稨","窆","藊","褊","貶","贬","鴘"],nì:["匿","堄","嫟","嬺","惄","愵","昵","暱","氼","眤","睨","縌","胒","腻","膩","逆","𨺙"],niàn:["卄","唸","埝","廿","念","惗","艌"],sà:["卅","櫒","脎","萨","蕯","薩","鈒","隡","颯","飒","馺"],zú:["卆","哫","崪","族","箤","足","踤","镞"],shēng:["升","呏","声","斘","昇","曻","枡","殅","泩","湦","焺","牲","珄","生","甥","竔","笙","聲","鉎","鍟","阩","陞","陹","鵿","鼪"],wàn:["卍","卐","忨","杤","瞣","脕","腕","萬","蟃","贎","輐","錽","𬇕"],"huá huà huā":["华","華"],bēi:["卑","悲","揹","杯","桮","盃","碑","藣","鵯","鹎"],"zú cù":["卒"],"dān shàn chán":["单","單"],"nán nā":["南"],"shuài lǜ":["卛"],"bǔ bo pú":["卜"],"kuàng guàn":["卝"],biàn:["卞","变","変","峅","弁","徧","忭","抃","昪","汳","汴","玣","艑","苄","覍","諚","變","辡","辧","辨","辩","辫","辮","辯","遍","釆","𨚕"],bǔ:["卟","哺","捕","补","補","鸔","𬷕"],"zhàn zhān":["占","覱"],"kǎ qiǎ":["卡"],lú:["卢","嚧","垆","壚","庐","廬","曥","枦","栌","櫨","泸","瀘","炉","爐","獹","玈","瓐","盧","矑","籚","纑","罏","胪","臚","舮","舻","艫","芦","蘆","蠦","轤","轳","鈩","鑪","顱","颅","馿","髗","魲","鱸","鲈","鸕","鸬","黸","𬬻"],lǔ:["卤","塷","掳","擄","樐","橹","櫓","氌","滷","澛","瀂","硵","磠","穞","艣","艪","蓾","虏","虜","鏀","鐪","鑥","镥","魯","鲁","鹵"],guà:["卦","啩","挂","掛","罣","褂","詿","诖"],"áng yǎng":["卬"],yìn:["印","垽","堷","廕","慭","憖","憗","懚","洕","湚","猌","癊","胤","茚","酳","鮣","䲟"],què:["却","卻","塙","崅","悫","愨","慤","搉","榷","燩","琷","皵","确","確","礭","闋","阕","鵲","鹊","𬒈"],luǎn:["卵"],"juàn juǎn":["卷","巻"],"chǎng ān hàn":["厂"],"wěi yán":["厃"],tīng:["厅","厛","听","庁","廰","廳","汀","烃","烴","綎","耓","聴","聼","聽","鞓","𬘩"],"zhé zhái":["厇"],"hàn àn":["厈","屽"],yǎ:["厊","唖","庌","痖","瘂","蕥"],shè:["厍","厙","弽","慑","慴","懾","摂","欇","涉","涻","渉","滠","灄","社","舎","蔎","蠂","設","设","赦","騇","麝"],dǐ:["厎","呧","坘","弤","抵","拞","掋","牴","砥","菧","觝","詆","诋","軧","邸","阺","骶","鯳"],"zhǎ zhǎi":["厏"],páng:["厐","嫎","庞","徬","舽","螃","逄","鰟","鳑","龎","龐"],"zhì shī":["厔"],máng:["厖","吂","哤","娏","忙","恾","杗","杧","汒","浝","牻","痝","盲","硭","笀","芒","茫","蘉","邙","釯","鋩","铓","駹"],zuī:["厜","樶","纗","蟕"],"shà xià":["厦","廈"],áo:["厫","嗷","嗸","廒","敖","滶","獒","獓","璈","翱","翶","翺","聱","蔜","螯","謷","謸","遨","鏖","隞","鰲","鳌","鷔","鼇"],"lán qiān":["厱"],"sī mǒu":["厶"],"gōng hóng":["厷"],"lín miǎo":["厸"],"qiú róu":["厹"],dū:["厾","嘟","督","醏"],"xiàn xuán":["县","縣"],"cān shēn cēn sān":["参","參","叄","叅"],"ài yǐ":["叆"],"chā chà chǎ chá":["叉"],shuāng:["双","孀","孇","欆","礵","艭","雙","霜","騻","驦","骦","鷞","鸘","鹴"],shōu:["収","收"],guái:["叏"],bá:["叐","妭","抜","拔","炦","癹","胈","茇","菝","詙","跋","軷","魃","鼥"],"fā fà":["发"],"zhuó yǐ lì jué":["叕"],qǔ:["取","娶","竬","蝺","詓","齲","龋"],"jiǎ xiá":["叚","徦"],"wèi yù":["叞","尉","蔚"],dié:["叠","垤","堞","峌","幉","恎","惵","戜","曡","殜","氎","牃","牒","瓞","畳","疂","疉","疊","碟","絰","绖","耊","耋","胅","艓","苵","蜨","蝶","褋","詄","諜","谍","跮","蹀","迭","镻","鰈","鲽","鴩","𫶇"],ruì:["叡","枘","汭","瑞","睿","芮","蚋","蜹","銳","鋭","锐"],"jù gōu":["句"],lìng:["另","呤","炩","蘦"],"dāo dáo tāo":["叨"],"zhī zhǐ":["只"],jiào:["叫","呌","嘂","嘦","噍","嬓","斍","斠","滘","漖","獥","珓","皭","窖","藠","訆","譥","趭","較","轎","轿","较","酵","醮","釂"],"zhào shào":["召"],"kě kè":["可"],"tái tāi":["台","苔"],pǒ:["叵","尀","笸","箥","鉕","钷","駊"],"yè xié":["叶"],"hào háo":["号"],tàn:["叹","嘆","探","歎","湠","炭","碳","舕"],"hōng hóng":["叿"],miē:["吀","咩","哶","孭"],"xū yū yù":["吁"],chī:["吃","哧","喫","嗤","噄","妛","媸","彨","彲","摛","攡","殦","瓻","痴","癡","眵","瞝","笞","粚","胵","蚩","螭","訵","魑","鴟","鵄","鸱","黐","齝","𫄨"],"xuān sòng":["吅"],yāo:["吆","喓","夭","妖","幺","楆","殀","祅","腰","葽","訞","邀","鴁","鴢","㙘"],zǐ:["吇","姉","姊","子","杍","梓","榟","橴","滓","矷","秭","笫","籽","紫","耔","虸","訿","釨"],"hé gě":["合","鲄"],"cùn dòu":["吋"],"tóng tòng":["同"],"tǔ tù":["吐","唋"],"zhà zhā":["吒","奓"],"xià hè":["吓"],"ā yā":["吖"],"ma má mǎ":["吗"],lìn:["吝","恡","悋","橉","焛","甐","膦","蔺","藺","賃","赁","蹸","躏","躙","躪","轥","閵"],tūn:["吞","暾","朜","焞"],"bǐ pǐ":["吡"],qìn:["吢","吣","唚","抋","揿","搇","撳","沁","瀙","菣","藽"],"jiè gè":["吤"],"fǒu pǐ":["否"],"ba bā":["吧"],dūn:["吨","噸","墩","墪","惇","撉","撴","犜","獤","礅","蜳","蹾","驐"],fēn:["吩","帉","昐","朆","梤","棻","氛","竕","紛","纷","翂","芬","衯","訜","躮","酚","鈖","雰","餴","饙","馚"],"é huā":["吪"],"kēng háng":["吭","妔"],shǔn:["吮"],"zhī zī":["吱"],"yǐn shěn":["吲"],wú:["吳","吴","呉","墲","峿","梧","橆","毋","洖","浯","無","珸","璑","祦","芜","茣","莁","蕪","蜈","蟱","譕","郚","鋙","铻","鯃","鵐","鷡","鹀","鼯"],"chǎo chāo":["吵"],"nà nè":["吶"],"xuè chuò jué":["吷"],chuī:["吹","炊","龡"],"dōu rú":["吺"],hǒu:["吼","犼"],"hōng hǒu ōu":["吽"],"wú yù":["吾"],"ya yā":["呀"],"è e":["呃"],dāi:["呆","懛","獃"],"mèn qǐ":["呇"],hōng:["呍","嚝","揈","灴","烘","焢","硡","薨","訇","谾","軣","輷","轟","轰","鍧"],nà:["呐","捺","笝","納","纳","肭","蒳","衲","豽","貀","軜","郍","鈉","钠","靹","魶"],"tūn tiān":["呑"],"fǔ ḿ":["呒","嘸"],"dāi tǎi":["呔"],"ǒu ōu òu":["呕"],"bài bei":["呗"],"yuán yún yùn":["员","員"],guō:["呙","啯","嘓","埚","堝","墎","崞","彉","彍","懖","猓","瘑","聒","蝈","蟈","郭","鈛","鍋","锅"],"huá qì":["呚"],"qiàng qiāng":["呛","跄"],shī:["呞","失","尸","屍","师","師","施","浉","湤","湿","溮","溼","濕","狮","獅","瑡","絁","葹","蒒","蓍","虱","蝨","褷","襹","詩","诗","邿","釃","鉇","鍦","鯴","鰤","鲺","鳲","鳾","鶳","鸤","䴓","𫚕"],juǎn:["呟","埍","臇","菤","錈","锩"],pěn:["呠","翸"],"wěn mǐn":["呡"],"ne ní":["呢"],"ḿ m̀ móu":["呣"],rán:["呥","嘫","然","燃","繎","肰","蚦","蚺","衻","袇","袡","髥","髯"],"tiè chè":["呫"],"qì zhī":["呮"],"zǐ cī":["呰"],"guā gū guǎ":["呱"],"cī zī":["呲"],"hǒu xǔ gòu":["呴"],"hē ā á ǎ à a":["呵"],náo:["呶","夒","峱","嶩","巎","挠","撓","猱","硇","蛲","蟯","詉","譊","鐃","铙"],"xiā gā":["呷"],pēi:["呸","怌","肧","胚","衃","醅"],"háo xiāo":["呺"],mìng:["命","掵"],"dá dàn":["呾"],"zuǐ jǔ":["咀"],"xián gān":["咁"],pǒu:["咅","哣","犃"],"yǎng yāng":["咉"],"zǎ zé zhā":["咋"],"hé hè huó huò hú":["和"],hāi:["咍"],dā:["咑","哒","噠","墶","搭","撘","耷","褡","鎝","𨱏"],"kǎ kā":["咔"],gū:["咕","唂","唃","姑","嫴","孤","巬","巭","柧","橭","沽","泒","稒","笟","箍","箛","篐","罛","苽","菇","菰","蓇","觚","軱","軲","轱","辜","酤","鈲","鮕","鴣","鸪"],"kā gā":["咖"],zuo:["咗"],lóng:["咙","嚨","嶐","巃","巄","昽","曨","朧","栊","槞","櫳","湰","滝","漋","爖","珑","瓏","癃","眬","矓","砻","礱","礲","窿","竜","聋","聾","胧","茏","蘢","蠪","蠬","襱","豅","鏧","鑨","霳","靇","驡","鸗","龍","龒","龙"],"xiàn xián":["咞"],qì:["咠","唭","噐","器","夡","弃","憇","憩","暣","棄","欫","气","気","氣","汔","汽","泣","湆","湇","炁","甈","盵","矵","碛","碶","磜","磧","罊","芞","葺","藒","蟿","訖","讫","迄","鐑"],"xì dié":["咥"],"liē liě lié lie":["咧"],zī:["咨","嗞","姕","姿","孜","孳","孶","崰","嵫","栥","椔","淄","湽","滋","澬","玆","禌","秶","粢","紎","緇","緕","纃","缁","茊","茲","葘","諮","谘","貲","資","赀","资","赼","趑","趦","輜","輺","辎","鄑","鈭","錙","鍿","鎡","锱","镃","頾","頿","髭","鯔","鰦","鲻","鶅","鼒","齍","齜","龇"],mī:["咪"],"jī xī qià":["咭"],"gē luò kǎ lo":["咯"],"shù xún":["咰"],"zán zá zǎ zan":["咱"],"hāi ké":["咳"],huī:["咴","噅","噕","婎","媈","幑","徽","恢","拻","挥","揮","晖","暉","楎","洃","瀈","灰","灳","烣","睳","禈","翚","翬","蘳","袆","褘","詼","诙","豗","輝","辉","鰴","麾","㧑"],"huài shì":["咶"],táo:["咷","啕","桃","檮","洮","淘","祹","綯","绹","萄","蜪","裪","迯","逃","醄","鋾","鞀","鞉","饀","駣","騊","鼗","𫘦"],xián:["咸","啣","娴","娹","婱","嫌","嫺","嫻","弦","挦","撏","涎","湺","澖","甉","痫","癇","癎","絃","胘","舷","藖","蚿","蛝","衔","衘","誸","諴","賢","贒","贤","輱","醎","銜","鑦","閑","闲","鷳","鷴","鷼","鹇","鹹","麙","𫍯"],"è àn":["咹"],"xuān xuǎn":["咺","烜"],"wāi hé wǒ guǎ guō":["咼"],"yàn yè yān":["咽"],āi:["哀","哎","埃","溾","銰","鎄","锿"],pǐn:["品","榀"],shěn:["哂","婶","嬸","审","宷","審","弞","曋","渖","瀋","瞫","矤","矧","覾","訠","諗","讅","谂","谉","邥","頣","魫"],"hǒng hōng hòng":["哄"],"wā wa":["哇"],"hā hǎ hà":["哈"],zāi:["哉","栽","渽","溨","災","灾","烖","睵","賳"],"dì diè":["哋"],pài:["哌","沠","派","渒","湃","蒎","鎃"],"gén hěn":["哏"],"yǎ yā":["哑","雅"],"yuě huì":["哕","噦"],nián:["哖","年","秊","秥","鮎","鯰","鲇","鲶","鵇","黏"],"huá huā":["哗","嘩"],"jì jiē zhāi":["哜","嚌"],mōu:["哞"],"yō yo":["哟","喲"],lòng:["哢","梇","贚"],"ò ó é":["哦"],"lī lǐ li":["哩"],"nǎ na nǎi né něi":["哪"],hè:["哬","垎","壑","寉","惒","焃","煂","燺","爀","癋","碋","翯","褐","謞","賀","贺","赫","靍","靎","靏","鶴","鸖","鹤"],"bō pò bā":["哱"],zhé:["哲","啠","喆","嚞","埑","悊","摺","晢","晣","歽","矺","砓","磔","籷","粍","虴","蛰","蟄","袩","詟","謫","謺","讁","讋","谪","輒","輙","轍","辄","辙","鮿"],"liàng láng":["哴"],"liè lǜ":["哷"],hān:["哻","憨","蚶","谽","酣","頇","顸","馠","魽","鼾"],"hēng hng":["哼"],gěng:["哽","埂","峺","挭","梗","綆","绠","耿","莄","郠","骾","鯁","鲠","𬒔"],"chuò yuè":["哾"],"gě jiā":["哿"],"bei bài":["唄"],"hán hàn":["唅"],chún:["唇","浱","湻","滣","漘","犉","純","纯","脣","莼","蒓","蓴","醇","醕","錞","陙","鯙","鶉","鹑","𬭚"],"ài āi":["唉"],"jiá qiǎn":["唊"],"yán dàn xián":["唌"],chē:["唓","砗","硨","莗","蛼"],"wú ńg ń":["唔"],zào:["唕","唣","噪","慥","梍","灶","煰","燥","皁","皂","竃","竈","簉","艁","譟","趮","躁","造","𥖨"],dí:["唙","啇","嘀","嚁","嫡","廸","敌","敵","梑","涤","滌","狄","笛","籴","糴","苖","荻","蔋","蔐","藡","覿","觌","豴","迪","靮","頔","馰","髢","鸐","𬱖"],"gòng hǒng gǒng":["唝","嗊"],dóu:["唞"],"lào láo":["唠","嘮","憦"],huàn:["唤","喚","奂","奐","宦","嵈","幻","患","愌","换","換","擐","攌","梙","槵","浣","涣","渙","漶","澣","烉","焕","煥","瑍","痪","瘓","睆","肒","藧","豢","轘","逭","鯇","鯶","鰀","鲩"],léng:["唥","塄","楞","碐","薐"],"wō wěi":["唩"],fěng:["唪","覂","諷","讽"],"yín jìn":["唫"],"hǔ xià":["唬"],wéi:["唯","围","圍","壝","峗","峞","嵬","帏","帷","幃","惟","桅","沩","洈","涠","湋","溈","潍","潙","潿","濰","犩","矀","維","维","蓶","覹","违","違","鄬","醀","鍏","闈","闱","韋","韦","鮠","𣲗","𬶏"],shuā:["唰"],chàng:["唱","怅","悵","暢","焻","畅","畼","誯","韔","鬯"],"ér wā":["唲"],qiàng:["唴","炝","熗","羻"],yō:["唷"],yū:["唹","淤","瘀","盓","箊","紆","纡","込","迂","迃","陓"],lài:["唻","濑","瀨","瀬","癞","癩","睐","睞","籁","籟","藾","賚","賴","赉","赖","頼","顂","鵣"],tuò:["唾","嶞","柝","毤","毻","箨","籜","萚","蘀","跅"],"zhōu zhāo tiào":["啁"],kěn:["啃","垦","墾","恳","懇","肎","肯","肻","豤","錹"],"zhuó zhào":["啅","濯"],"hēng hèng":["啈","悙"],"lín lán":["啉"],"a ā á ǎ à":["啊"],qiāng:["啌","嗴","嶈","戕","摤","斨","枪","槍","溬","牄","猐","獇","羌","羗","腔","蜣","謒","鏘","锖","锵"],"tūn zhūn xiāng duǐ":["啍"],wèn:["問","妏","揾","搵","璺","问","顐"],"cuì qi":["啐"],"dié shà jié tì":["啑"],"yuē wā":["啘"],"zǐ cǐ":["啙"],"bǐ tú":["啚"],"chuò chuài":["啜"],"yǎ yā è":["啞"],fēi:["啡","婓","婔","扉","暃","渄","猆","緋","绯","裶","霏","非","靟","飛","飝","飞","餥","馡","騑","騛","鯡","鲱","𬴂"],pí:["啤","壀","枇","毗","毘","焷","琵","疲","皮","篺","罴","羆","脾","腗","膍","蚍","蚽","蜱","螷","蠯","豼","貔","郫","鈹","阰","陴","隦","魮","鮍","鲏","鵧","鼙"],shá:["啥"],"lā la":["啦"],"yīng qíng":["啨"],pā:["啪","妑","舥","葩","趴"],"zhě shì":["啫"],sè:["啬","嗇","懎","擌","栜","歮","涩","渋","澀","澁","濇","濏","瀒","瑟","璱","瘷","穑","穡","穯","繬","譅","轖","銫","鏼","铯","飋"],niè:["啮","嗫","噛","嚙","囁","囓","圼","孼","孽","嵲","嶭","巕","帇","敜","枿","槷","櫱","涅","湼","痆","篞","籋","糱","糵","聂","聶","臬","臲","蘖","蠥","讘","踂","踗","踙","蹑","躡","錜","鎳","鑈","鑷","钀","镊","镍","闑","陧","隉","顳","颞","齧","𫔶"],"luō luó luo":["啰","囉"],"tān chǎn tuō":["啴"],bo:["啵","蔔"],dìng:["啶","定","椗","矴","碇","碠","磸","聢","腚","萣","蝊","訂","订","錠","锭","顁","飣","饤"],lāng:["啷"],"án ān":["啽"],kā:["喀","擖"],"yóng yú":["喁"],"lā lá lǎ":["喇"],jiē:["喈","喼","嗟","堦","媘","接","掲","擑","湝","煯","疖","痎","癤","皆","秸","稭","脻","蝔","街","謯","阶","階","鞂","鶛"],hóu:["喉","帿","猴","瘊","睺","篌","糇","翭","葔","鄇","鍭","餱","骺","鯸","𬭤"],"dié zhá":["喋"],wāi:["喎","歪","竵"],"nuò rě":["喏"],"xù huò guó":["喐"],zán:["喒"],"wō ō":["喔"],hú:["喖","嘝","囫","壶","壷","壺","媩","弧","搰","斛","楜","槲","湖","瀫","焀","煳","狐","猢","瑚","瓳","箶","絗","縠","胡","葫","蔛","蝴","螜","衚","觳","醐","鍸","頶","餬","鬍","魱","鰗","鵠","鶘","鶦","鹕"],"huàn yuán xuǎn hé":["喛"],xǐ:["喜","囍","壐","屣","徙","憙","枲","橲","歖","漇","玺","璽","矖","禧","縰","葈","葸","蓰","蟢","謑","蹝","躧","鈢","鉨","鉩","鱚","𬭳","𬶮"],"hē hè yè":["喝"],kuì:["喟","嘳","媿","嬇","愦","愧","憒","篑","簣","籄","聩","聭","聵","膭","蕢","謉","餽","饋","馈"],"zhǒng chuáng":["喠"],"wéi wèi":["喡","為","爲"],"duó zhà":["喥"],"sāng sàng":["喪"],"qiáo jiāo":["喬"],"pèn bēn":["喯"],"cān sūn qī":["喰"],"zhā chā":["喳"],miāo:["喵"],"pēn pèn":["喷"],kuí:["喹","夔","奎","巙","戣","揆","晆","暌","楏","楑","櫆","犪","睽","葵","藈","蘷","虁","蝰","躨","逵","鄈","鍨","鍷","頯","馗","騤","骙","魁"],"lou lóu":["喽"],"zào qiāo":["喿"],"hè xiāo xiào hù":["嗃"],"á shà":["嗄"],xiù:["嗅","岫","峀","溴","珛","琇","璓","秀","綉","繍","繡","绣","螑","袖","褎","褏","銹","鏥","鏽","锈","齅"],"qiāng qiàng":["嗆","戗","戧","蹌","蹡"],"ài yì":["嗌","艾"],"má mǎ ma":["嗎"],"kè kē":["嗑"],"dā tà":["嗒","鎉"],sǎng:["嗓","搡","磉","褬","鎟","顙","颡"],chēn:["嗔","抻","琛","瞋","諃","謓","賝","郴","𬘭"],"wā gǔ":["嗗"],"pǎng bēng":["嗙"],"xián qiǎn qiān":["嗛"],lào:["嗠","嫪","橯","涝","澇","耢","耮","躼","軂","酪"],wēng:["嗡","翁","聬","螉","鎓","鶲","鹟","𬭩"],wà:["嗢","腽","膃","袜","襪","韤"],"hēi hāi":["嗨"],hē:["嗬","欱","蠚","訶","诃"],zi:["嗭"],sǎi:["嗮"],"ǹg ńg ňg":["嗯"],gě:["嗰","舸"],ná:["嗱","拏","拿","鎿","镎"],diǎ:["嗲"],"ài ǎi āi":["嗳"],tōng:["嗵","樋","炵","蓪"],"zuī suī":["嗺"],"zhē zhè zhù zhe":["嗻"],mò:["嗼","圽","塻","墨","妺","嫼","寞","帞","昩","末","枺","歿","殁","沫","漠","爅","獏","瘼","皌","眽","眿","瞐","瞙","砞","礳","秣","絈","纆","耱","茉","莈","蓦","蛨","蟔","貃","貊","貘","銆","鏌","镆","陌","靺","驀","魩","默","黙","𬙊"],sòu:["嗽","瘶"],tǎn:["嗿","坦","忐","憳","憻","暺","毯","璮","菼","袒","襢","醓","鉭","钽"],"jiào dǎo":["嘄"],"kǎi gě":["嘅"],"shān càn":["嘇"],cáo:["嘈","嶆","曹","曺","槽","漕","艚","蓸","螬","褿","鏪","𥕢"],piào:["嘌","徱","蔈","驃"],"lóu lou":["嘍"],gǎ:["尕","玍"],"gǔ jiǎ":["嘏"],"jiāo xiāo":["嘐"],"xū shī":["嘘","噓"],pó:["嘙","嚩","婆","櫇","皤","鄱"],"dē dēi":["嘚"],"ma má":["嘛"],"lē lei":["嘞"],"gā gá gǎ":["嘠"],sāi:["嘥","噻","毢","腮","顋","鰓"],"zuō chuài":["嘬"],"cháo zhāo":["嘲","朝","鼂"],zuǐ:["嘴","噿","嶊","璻"],"qiáo qiào":["嘺","翹","谯"],"chù xù shòu":["嘼"],"tān chǎn":["嘽"],"dàn tán":["嘾","弾","彈","惔","澹"],"hēi mò":["嘿"],ě:["噁","砨","頋","騀","鵈"],"fān bo":["噃"],chuáng:["噇","床","牀"],"cù zā hé":["噈"],"tūn kuò":["噋"],"cēng chēng":["噌"],dēng:["噔","嬁","灯","燈","璒","登","竳","簦","艠","豋"],pū:["噗","扑","撲","攴","攵","潽","炇","陠"],juē:["噘","屩","屫","撧"],lū:["噜","嚕","撸","擼","謢"],zhān:["噡","岾","惉","旃","旜","枬","栴","毡","氈","氊","沾","瞻","薝","蛅","詀","詹","譫","谵","趈","邅","閚","霑","飦","饘","驙","魙","鱣","鸇","鹯","𫗴"],ō:["噢"],"zhòu zhuó":["噣"],"jiào qiào chī":["噭"],yuàn:["噮","妴","怨","愿","掾","瑗","禐","苑","衏","裫","褑","院","願"],"ǎi ài āi":["噯"],"yōng yǒng":["噰","澭"],"jué xué":["噱"],"pēn pèn fèn":["噴"],gá:["噶","尜","釓","錷","钆"],"xīn hěn hèn":["噷"],dāng:["噹","澢","珰","璫","筜","簹","艡","蟷","裆","襠"],làn:["嚂","滥","濫","烂","燗","爁","爛","爤","瓓","糷","钄"],tà:["嚃","嚺","崉","挞","搨","撻","榻","橽","毾","涾","澾","濌","禢","粏","誻","譶","蹋","蹹","躂","躢","遝","錔","闒","闥","闼","阘","鞜","鞳"],"huō huò ǒ":["嚄"],hāo:["嚆","茠","蒿","薅"],"hè xià":["嚇"],"xiù pì":["嚊"],"zhōu chóu":["嚋","盩","诪"],mē:["嚒"],"chā cā":["嚓"],"bó pào bào":["嚗"],"me mèi mò":["嚜"],"xié hái":["嚡"],"áo xiāo":["嚣"],mō:["嚤","摸"],pín:["嚬","娦","嫔","嬪","玭","矉","薲","蠙","貧","贫","顰","颦","𬞟"],mè:["嚰","濹"],"rǎng rāng":["嚷"],lá:["嚹","旯"],"jiáo jué jiào":["嚼"],chuò:["嚽","娖","擉","歠","涰","磭","踀","輟","辍","辵","辶","酫","鑡","餟","齪","龊"],"huān huàn":["嚾"],"zá cà":["囃"],chài:["囆","虿","蠆","袃","訍"],"náng nāng":["囊"],"zá zàn cān":["囋"],sū:["囌","櫯","甦","稣","穌","窣","蘇","蘓","酥","鯂"],zèng:["囎","熷","甑","贈","赠","鋥","锃"],"zá niè yàn":["囐"],nāng:["囔"],"luó luō luo":["囖"],"wéi guó":["囗"],huí:["囘","回","囬","廻","廽","恛","洄","痐","茴","蚘","蛔","蛕","蜖","迴","逥","鮰"],nín:["囜","您","脌"],"jiǎn nān":["囝"],nān:["囡"],tuán:["团","団","團","慱","抟","摶","檲","糰","鏄","鷒","鷻"],"tún dùn":["囤","坉"],guó:["囯","囶","囻","国","圀","國","帼","幗","慖","摑","漍","聝","腘","膕","蔮","虢","馘","𬇹"],kùn:["困","涃","睏"],"wéi tōng":["囲"],qūn:["囷","夋","逡"],rì:["囸","日","衵","鈤","馹","驲"],tāi:["囼","孡","胎"],pǔ:["圃","圑","擈","普","暜","樸","檏","氆","浦","溥","烳","諩","譜","谱","蹼","鐠","镨"],"quān juàn juān":["圈","圏"],"chuí chuán":["圌"],tuǎn:["圕","畽","疃"],lüè:["圙","掠","略","畧","稤","鋝","鋢","锊","䂮"],"huán yuán":["圜"],luán:["圝","圞","奱","娈","孌","孪","孿","峦","巒","挛","攣","曫","栾","欒","滦","灤","癴","癵","羉","脔","臠","虊","銮","鑾","鵉","鸞","鸾"],tǔ:["土","圡","釷","钍"],"xū wéi":["圩"],"dì de":["地","嶳"],"qiān sú":["圱"],zhèn:["圳","塦","挋","振","朕","栚","甽","眹","紖","絼","纼","誫","賑","赈","鋴","鎭","鎮","镇","阵","陣","震","鴆","鸩"],"chǎng cháng":["场","場","塲"],"qí yín":["圻"],jiá:["圿","忦","恝","戞","扴","脥","荚","莢","蛱","蛺","裌","跲","郏","郟","鋏","铗","頬","頰","颊","鴶","鵊"],"zhǐ zhì":["坁"],bǎn:["坂","岅","昄","板","版","瓪","粄","舨","蝂","鈑","钣","阪","魬"],qǐn:["坅","寑","寝","寢","昑","梫","笉","螼","赾","鋟","锓"],"méi fén":["坆"],"rǒng kēng":["坈"],"fāng fáng":["坊"],"fèn bèn":["坋"],tān:["坍","怹","摊","擹","攤","滩","灘","瘫","癱","舑","貪","贪"],"huài pēi pī péi":["坏"],"dì làn":["坔"],tán:["坛","墰","墵","壇","壜","婒","憛","昙","曇","榃","檀","潭","燂","痰","磹","罈","罎","藫","談","譚","譠","谈","谭","貚","郯","醰","錟","顃"],bà:["坝","垻","壩","弝","欛","灞","爸","矲","覇","霸","鮁","鲅"],fén:["坟","墳","妢","岎","幩","枌","棼","汾","焚","燌","燓","羒","羵","蒶","蕡","蚠","蚡","豮","豶","轒","鐼","隫","馩","魵","黂","鼖","鼢","𣸣"],zhuì:["坠","墜","惴","甀","畷","礈","綴","縋","缀","缒","腏","膇","諈","贅","赘","醊","錣","鑆"],pō:["坡","岥","泼","溌","潑","釙","鏺","钋","頗","颇","䥽"],"pǎn bàn":["坢"],kūn:["坤","堃","堒","崐","崑","昆","晜","潉","焜","熴","猑","琨","瑻","菎","蜫","裈","裩","褌","醌","錕","锟","騉","髠","髡","髨","鯤","鲲","鵾","鶤","鹍"],diàn:["坫","垫","墊","壂","奠","婝","店","惦","扂","橂","殿","淀","澱","玷","琔","电","癜","簟","蜔","鈿","電","靛","驔"],"mù mǔ":["坶"],"kē kě":["坷","軻"],xuè:["坹","岤","桖","瀥","狘","瞲","謔","谑","趐"],"dǐ chí":["坻","柢"],lā:["垃","柆","菈","邋"],lǒng:["垄","垅","壟","壠","拢","攏","竉","陇","隴","𬕂"],mín:["垊","姄","岷","崏","捪","旻","旼","民","珉","琘","琝","瑉","痻","盿","砇","緍","緡","缗","罠","苠","鈱","錉","鍲","鴖"],"dòng tóng":["垌","峒","洞"],cí:["垐","嬨","慈","柌","濨","珁","瓷","甆","磁","礠","祠","糍","茨","詞","词","辝","辞","辤","辭","雌","飺","餈","鴜","鶿","鷀","鹚"],duī:["垖","堆","塠","痽","磓","鐓","鐜","鴭"],"duò duǒ":["垛"],"duǒ duò":["垜","挆"],chá:["垞","察","嵖","搽","槎","檫","猹","茬","茶","詧","靫","𥻗"],shǎng:["垧","晌","樉","賞","贘","赏","鋿","鏛","鑜"],shǒu:["垨","守","手","扌","艏","首"],da:["垯","繨","跶"],háng:["垳","斻","杭","筕","絎","绗","航","苀","蚢","裄","貥","迒","頏","颃","魧"],"ān ǎn":["垵"],xīng:["垶","惺","星","曐","煋","猩","瑆","皨","篂","腥","興","觪","觲","謃","騂","骍","鮏","鯹"],"yuàn huán":["垸"],bāng:["垹","帮","幇","幚","幫","捠","梆","浜","邦","邫","鞤","𠳐"],"póu fú":["垺"],cén:["埁","岑","涔"],"běng fēng":["埄"],"dì fáng":["埅"],"xiá jiā":["埉"],"mái mán":["埋"],làng:["埌","崀","浪","蒗","閬","㫰"],"shān yán":["埏"],"qín jīn":["埐"],"pǔ bù":["埔"],huā:["埖","婲","椛","硴","糀","花","蒊","蘤","誮","錵"],"suì sù":["埣"],"pí pì":["埤"],"qīng zhēng":["埥","鲭"],"wǎn wān":["埦"],lǔn:["埨","稐","𫭢"],"zhēng chéng":["埩"],kōng:["埪","崆","箜","躻","錓","鵼"],"cǎi cài":["埰","寀","采"],"chù tòu":["埱"],běng:["埲","琫","菶","鞛"],"kǎn xiàn":["埳"],"yì shì":["埶","醳"],péi:["培","毰","裴","裵","賠","赔","錇","锫","阫","陪"],"sào sǎo":["埽"],"jǐn qīn jìn":["堇"],"péng bèng":["堋"],"qiàn zàn jiàn":["堑"],àn:["堓","屵","岸","按","暗","案","胺","荌","豻","貋","錌","闇","隌","黯"],"duò huī":["堕","墮"],huán:["堚","寏","寰","峘","桓","洹","澴","獂","环","環","糫","繯","缳","羦","荁","萈","萑","豲","鍰","鐶","锾","镮","闤","阛","雈","鬟","鹮","𬘫","𤩽"],"bǎo bǔ pù":["堡"],"máo móu wǔ":["堥"],ruán:["堧","壖","撋"],"ài è yè":["堨"],gèng:["堩","暅"],méi:["堳","塺","媒","嵋","徾","攗","枚","栂","梅","楣","楳","槑","湄","湈","煤","猸","玫","珻","瑂","眉","睂","禖","脄","脢","腜","苺","莓","葿","郿","酶","鎇","镅","霉","鶥","鹛","黴"],dǔ:["堵","琽","睹","笃","篤","覩","賭","赌"],féng:["堸","綘","艂","逢"],hèng:["堼"],chūn:["堾","媋","旾","春","暙","杶","椿","槆","橁","櫄","瑃","箺","萅","蝽","輴","鰆","鶞","䲠"],jiǎng:["塂","奖","奨","奬","桨","槳","獎","耩","膙","蒋","蔣","講","讲","顜"],huāng:["塃","巟","慌","肓","荒","衁"],duàn:["塅","断","斷","椴","段","毈","煅","瑖","碫","簖","籪","緞","缎","腶","葮","躖","鍛","锻"],tǎ:["塔","墖","獭","獺","鮙","鰨","鳎"],wěng:["塕","奣","嵡","攚","暡","瞈","蓊"],"sāi sài sè":["塞"],zàng:["塟","弉","臓","臟","葬","蔵","銺"],tián:["塡","屇","恬","沺","湉","璳","甛","甜","田","畋","畑","碵","磌","胋","闐","阗","鴫","鷆","鷏"],zhèng:["塣","幁","政","証","諍","證","证","诤","郑","鄭","靕","鴊"],"tián zhèn":["填"],wēn:["塭","昷","榲","殟","温","溫","瑥","瘟","蕰","豱","輼","轀","辒","鎾","饂","鰛","鰮","鳁"],liù:["塯","廇","磟","翏","雡","霤","餾","鬸","鷚","鹨"],hǎi:["塰","海","烸","酼","醢"],lǎng:["塱","朖","朗","朤","烺","蓢","㮾"],bèng:["塴","揼","泵","甏","綳","蹦","迸","逬","鏰","镚"],chén:["塵","宸","尘","忱","敐","敶","晨","曟","栕","樄","沉","煁","瘎","臣","茞","莀","莐","蔯","薼","螴","訦","諶","軙","辰","迧","鈂","陈","陳","霃","鷐","麎"],"ōu qiū":["塸"],"qiàn jiàn":["塹"],"zhuān tuán":["塼"],shuǎng:["塽","慡","漺","爽","縔","鏯"],shú:["塾","婌","孰","璹","秫","贖","赎"],lǒu:["塿","嵝","嶁","甊","篓","簍"],chí:["墀","弛","持","池","漦","竾","筂","箎","篪","茌","荎","蚳","謘","貾","赿","踟","迟","迡","遅","遟","遲","鍉","馳","驰"],shù:["墅","庶","庻","怷","恕","戍","束","树","樹","沭","漱","潄","濖","竖","竪","絉","腧","荗","蒁","虪","術","裋","豎","述","鉥","錰","鏣","霔","鶐","𬬸"],"dì zhì":["墆","疐"],kàn:["墈","崁","瞰","矙","磡","衎","鬫"],chěn:["墋","夦","硶","碜","磣","贂","趻","踸","鍖"],"zhǐ zhuó":["墌"],qiǎng:["墏","繈","繦","羥","襁"],zēng:["増","增","憎","璔","矰","磳","罾","譄","鄫","鱛","䎖"],qiáng:["墙","墻","嫱","嬙","樯","檣","漒","牆","艢","蔃","蔷","蘠"],"kuài tuí":["墤"],"tuǎn dǒng":["墥"],"qiáo què":["墧"],"zūn dūn":["墫"],"qiāo áo":["墽"],"yì tú":["墿"],"xué bó jué":["壆"],lǎn:["壈","嬾","孄","孏","懒","懶","揽","擥","攬","榄","欖","浨","漤","灠","纜","缆","罱","覧","覽","览","醂","顲"],huài:["壊","壞","蘾"],rǎng:["壌","壤","攘","爙"],"làn xiàn":["壏"],dǎo:["壔","导","導","岛","島","嶋","嶌","嶹","捣","搗","擣","槝","祷","禂","禱","蹈","陦","隝","隯"],ruǐ:["壡","桵","橤","繠","蕊","蕋","蘂","蘃"],san:["壭"],zhuàng:["壮","壯","壵","撞","焋","状","狀"],"ké qiào":["壳","殼"],kǔn:["壸","壼","悃","捆","梱","硱","祵","稇","稛","綑","裍","閫","閸","阃"],mǎng:["壾","漭","茻","莽","莾","蠎"],cún:["壿","存"],"zhǐ zhōng":["夂"],"gǔ yíng":["夃"],"jiàng xiáng":["夅","降"],"páng féng fēng":["夆"],zhāi:["夈","捚","摘","斋","斎","榸","粂","齋"],"xuàn xiòng":["夐"],wài:["外","顡"],"wǎn yuàn wān yuān":["夗"],"mǎo wǎn":["夘"],mèng:["夢","夣","孟","梦","癦","霥"],"dà dài":["大"],"fū fú":["夫","姇","枎","粰"],guài:["夬","怪","恠"],yāng:["央","姎","抰","殃","泱","秧","胦","鉠","鍈","雵","鴦","鸯"],"hāng bèn":["夯"],gǎo:["夰","搞","杲","槀","槁","檺","稁","稾","稿","縞","缟","菒","藁","藳"],"tāo běn":["夲"],"tóu tou":["头"],"yǎn tāo":["夵"],"kuā kuà":["夸","誇"],"jiá jiā gā xiá":["夹"],huà:["夻","婳","嫿","嬅","崋","摦","杹","枠","桦","槬","樺","澅","画","畫","畵","繣","舙","話","諙","譮","话","黊"],"jiā jiá gā xiá":["夾"],ēn:["奀","恩","蒽"],"dī tì":["奃"],"yǎn yān":["奄","渰"],pào:["奅","疱","皰","砲","礟","礮","靤","麭"],nài:["奈","柰","渿","耐","萘","褦","錼","鼐"],"quān juàn":["奍","弮","棬"],zòu:["奏","揍"],"qì qiè xiè":["契"],kāi:["奒","开","揩","鐦","锎","開"],"bēn bèn":["奔","泍"],tào:["套"],"zàng zhuǎng":["奘"],běn:["奙","本","楍","畚","翉","苯"],"xùn zhuì":["奞"],shē:["奢","檨","猞","畭","畲","賒","賖","赊","輋","𪨶"],"hǎ pò tǎi":["奤"],"ào yù":["奥","奧","澚"],yūn:["奫","氲","氳","蒀","蒕","蝹","贇","赟","𫖳"],"duǒ chě":["奲"],"nǚ rǔ":["女"],nú:["奴","孥","笯","駑","驽"],"dīng dǐng tiǎn":["奵"],"tā jiě":["她"],nuán:["奻"],"hǎo hào":["好"],fàn:["奿","嬎","梵","汎","泛","滼","瀪","犯","畈","盕","笵","範","范","訉","販","贩","軬","輽","飯","飰","饭"],shuò:["妁","搠","朔","槊","烁","爍","矟","蒴","鎙","鑠","铄"],"fēi pèi":["妃"],wàng:["妄","忘","旺","望","朢"],zhuāng:["妆","妝","娤","庄","庒","桩","梉","樁","粧","糚","荘","莊","装","裝"],mā:["妈","媽"],"fū yōu":["妋"],"hài jiè":["妎"],dù:["妒","妬","杜","殬","渡","秺","芏","荰","螙","蠧","蠹","鍍","镀","靯","𬭊"],miào:["妙","庙","庿","廟","玅","竗"],"fǒu pēi pī":["妚"],"yuè jué":["妜"],niū:["妞"],"nà nàn":["妠"],tuǒ:["妥","嫷","庹","椭","楕","橢","鬌","鰖","鵎"],"wàn yuán":["妧"],fáng:["妨","房","肪","防","魴","鲂"],nī:["妮"],zhóu:["妯","碡"],zhāo:["妱","巶","招","昭","釗","鉊","鍣","钊","駋","𬬿"],"nǎi nǐ":["妳"],tǒu:["妵","敨","紏","蘣","黈"],"xián xuán xù":["妶"],"zhí yì":["妷","秇"],ē:["妸","妿","婀","屙"],mèi:["妹","媚","寐","抺","旀","昧","沬","煝","痗","眛","睸","祙","篃","蝞","袂","跊","鬽","魅"],"qī qì":["妻"],"xū xǔ":["姁","稰"],"shān shàn":["姍","姗","苫","釤","钐"],mán:["姏","慲","樠","蛮","蠻","謾","饅","馒","鬗","鬘","鰻","鳗"],jiě:["姐","媎","檞","毑","飷"],"wěi wēi":["委"],pīn:["姘","拼","礗","穦","馪","驞"],"huá huó":["姡"],"jiāo xiáo":["姣"],"gòu dù":["姤"],"lǎo mǔ":["姥"],"nián niàn":["姩"],zhěn:["姫","屒","弫","抮","昣","枕","畛","疹","眕","稹","縝","縥","缜","聄","萙","袗","裖","覙","診","诊","軫","轸","辴","駗","鬒"],héng:["姮","恆","恒","烆","珩","胻","蘅","衡","鑅","鴴","鵆","鸻"],"jūn xún":["姰"],"kuā hù":["姱"],"è yà":["姶"],"xiān shēn":["姺"],wá:["娃"],"ráo rǎo":["娆","嬈"],"shào shāo":["娋"],xiē:["娎","揳","楔","歇","蝎","蠍"],"wǔ méi mǔ":["娒"],"chuò lài":["娕"],niáng:["娘","嬢","孃"],"nà nuó":["娜","𦰡"],"pōu bǐ":["娝"],"něi suī":["娞"],tuì:["娧","煺","蛻","蜕","退","駾"],mǎn:["娨","屘","満","满","滿","螨","蟎","襔","鏋"],"wú wù yú":["娪"],"xī āi":["娭"],"zhuì shuì":["娷"],"dōng dòng":["娻"],"ǎi ái è":["娾"],"ē ě":["娿"],mián:["婂","嬵","宀","杣","棉","檰","櫋","眠","矈","矊","矏","綿","緜","绵","芇","蝒"],"pǒu péi bù":["婄"],biǎo:["婊","脿","表","裱","褾","諘","錶"],"fù fàn":["婏"],wǒ:["婐","婑","我"],"ní nǐ":["婗","棿"],"quán juàn":["婘","惓"],hūn:["婚","昏","昬","棔","涽","睧","睯","碈","荤","葷","蔒","轋","閽","阍"],"qiān jǐn":["婜"],"wān wà":["婠"],"lái lài":["婡","徕","徠"],"zhōu chōu":["婤"],"chuò nào":["婥"],"nüè àn":["婩"],"hùn kūn":["婫"],"dàng yáng":["婸"],nàn:["婻"],"ruò chuò":["婼"],jiǎ:["婽","岬","斚","斝","榎","槚","檟","玾","甲","胛","鉀","钾"],"tōu yú":["婾","媮"],"yù yú":["媀"],"wéi wěi":["媁"],"dì tí":["媂","珶","苐"],róu:["媃","揉","柔","渘","煣","瑈","瓇","禸","粈","糅","脜","腬","葇","蝚","蹂","輮","鍒","鞣","騥","鰇","鶔","𫐓"],"ruǎn nèn":["媆"],miáo:["媌","嫹","描","瞄","苗","鶓","鹋"],"yí pèi":["媐"],"mián miǎn":["媔"],"tí shì":["媞","惿"],"duò tuó":["媠","沲"],ǎo:["媪","媼","艹","芺","袄","襖","镺"],"chú zòu":["媰"],yìng:["媵","映","暎","硬","膡","鱦"],"qín shēn":["嫀"],jià:["嫁","幏","架","榢","稼","駕","驾"],sǎo:["嫂"],"zhēn zhěn":["嫃"],"jiē suǒ":["嫅"],"míng mǐng":["嫇"],niǎo:["嫋","嬝","嬲","茑","蔦","袅","裊","褭","鸟"],tāo:["嫍","幍","弢","慆","掏","搯","槄","涛","滔","濤","瑫","絛","縚","縧","绦","詜","謟","轁","鞱","韜","韬","飸","饕"],biáo:["嫑"],"piáo piāo":["嫖","薸"],xuán:["嫙","悬","懸","暶","檈","漩","玄","璇","璿","痃","蜁","𫠊"],"màn mān":["嫚"],kāng:["嫝","嵻","康","慷","槺","漮","砊","穅","糠","躿","鏮","鱇","𡐓","𩾌"],"hān nǎn":["嫨"],nèn:["嫩","嫰"],zhē:["嫬","遮"],"mā má":["嫲"],piè:["嫳"],zhǎn:["嫸","展","搌","斩","斬","琖","盏","盞","輾","醆","颭","飐"],"xiān yǎn jìn":["嬐"],liǎn:["嬚","敛","斂","琏","璉","羷","脸","臉","蔹","蘝","蘞","裣","襝","鄻"],"qióng huán xuān":["嬛"],dǒng:["嬞","懂","箽","董","蕫","諌"],cān:["嬠","湌","爘","飡","餐","驂","骖"],tiǎo:["嬥","宨","晀","朓","窱","脁"],bí:["嬶","荸","鼻"],liǔ:["嬼","柳","栁","桞","桺","橮","熮","珋","綹","绺","罶","羀","鋶","锍"],"qiān xiān":["孅","欦"],"xié huī":["孈"],"huān quán":["孉"],"lí lì":["孋","麗"],"zhú chuò":["孎"],kǒng:["孔","恐"],"mā zī":["孖"],"sūn xùn":["孙","孫"],"bèi bó":["孛","誖"],"yòu niū":["孧"],zhuǎn:["孨","竱","轉"],hái:["孩","骸"],nāo:["孬"],"chán càn":["孱"],bò:["孹","檗","蘗","譒"],nái:["孻","腉"],"níng nìng":["宁","寍","寗","寜","寧","甯"],zhái:["宅"],"tū jiā":["宊"],sòng:["宋","訟","誦","讼","诵","送","鎹","頌","颂","餸"],ròu:["宍","肉","譳"],zhūn:["宒","窀","衠","諄","谆","迍"],"mì fú":["宓"],"dàng tàn":["宕"],"wǎn yuān":["宛"],chǒng:["宠","寵"],qún:["宭","峮","帬","羣","群","裙","裠"],zǎi:["宰","崽"],"bǎo shí":["宲"],"jiā jia jie":["家"],"huāng huǎng":["宺"],kuān:["宽","寛","寬","臗","鑧","髋","髖"],"sù xiǔ xiù":["宿"],"jié zǎn":["寁"],"bìng bǐng":["寎"],"jìn qǐn":["寖"],"lóu jù":["寠"],"xiě xiè":["寫"],"qīn qìn":["寴"],cùn:["寸","籿"],duì:["对","対","對","怼","憝","懟","濧","瀩","碓","祋","綐","薱","譈","譵","轛","队","陮"],"lüè luó":["寽"],"shè yè yì":["射"],"jiāng jiàng qiāng":["将"],"jiāng jiàng":["將","浆","漿","畺"],zūn:["尊","嶟","樽","罇","遵","鐏","鱒","鳟","鶎","鷷","𨱔"],"shù zhù":["尌","澍"],xiǎo:["小","晓","暁","曉","皛","皢","筱","筿","篠","謏","𫍲"],"jié jí":["尐","诘","鞊"],"shǎo shào":["少"],ěr:["尒","尓","尔","栮","毦","洱","爾","珥","耳","薾","衈","趰","迩","邇","鉺","铒","餌","饵","駬"],"wāng yóu":["尢"],wāng:["尣","尩","尪","尫","汪"],liào:["尥","尦","廖","撂","料","炓","窷","鐐","镣","𪤗"],"méng máng lóng páng":["尨"],gà:["尬","魀"],"kuì kuǐ":["尯"],tuí:["尵","弚","穨","蘈","蹪","隤","頹","頺","頽","颓","魋","𬯎"],yǐn:["尹","嶾","引","朄","檃","檼","櫽","淾","濥","瘾","癮","粌","蘟","蚓","螾","讔","赺","趛","輑","鈏","靷"],"chǐ chě":["尺"],kāo:["尻","髛"],"jìn jǐn":["尽"],"wěi yǐ":["尾"],"niào suī":["尿"],céng:["层","層","嶒","驓"],diǎo:["屌"],"píng bǐng bīng":["屏"],lòu:["屚","漏","瘘","瘺","瘻","鏤","镂","陋"],"shǔ zhǔ":["属","屬"],"xiè tì":["屟"],"chè cǎo":["屮"],"tún zhūn":["屯"],"nì jǐ":["屰"],"hóng lóng":["屸"],"qǐ kǎi":["岂","豈"],áng:["岇","昂","昻"],"gǎng gāng":["岗","崗"],kě:["岢","敤","渇","渴","炣"],gǒu:["岣","狗","玽","笱","耇","耈","耉","苟","豿"],tiáo:["岧","岹","樤","祒","笤","芀","萔","蓚","蓨","蜩","迢","鋚","鎥","鞗","髫","鯈","鰷","鲦","齠","龆"],"qū jū":["岨"],lǐng:["岭","嶺","領","领"],pò:["岶","敀","洦","湐","烞","珀","破","砶","粕","蒪","魄"],"bā kè":["峇"],luò:["峈","摞","洛","洜","犖","珞","笿","纙","荦","詻","雒","駱","骆","鵅"],"fù niè":["峊"],ěn:["峎"],"zhì shì":["峙","崻"],qiǎ:["峠","跒","酠","鞐"],"qiáo jiào":["峤","癄"],"xié yé":["峫"],bū:["峬","庯","晡","誧","逋","鈽","錻","钸","餔","鵏"],chóng:["崇","崈","爞","虫","蝩","蟲","褈","隀"],"zú cuì":["崒","椊"],"líng léng":["崚"],"dòng dōng":["崠"],xiáo:["崤","洨","淆","訤","誵"],"pí bǐ":["崥","芘"],"zhǎn chán":["崭","嶃","嶄"],"wǎi wēi":["崴"],"yáng dàng":["崵"],"shì dié":["崼"],yào:["崾","曜","熎","燿","矅","穾","窔","筄","耀","艞","药","葯","薬","藥","袎","覞","詏","讑","靿","鷂","鹞","鼼"],"kān zhàn":["嵁"],"hán dǎng":["嵅"],"qiàn kàn":["嵌"],"wù máo":["嵍"],"kě jié":["嵑","嶱"],"wēi wěi":["嵔"],kē:["嵙","柯","棵","榼","樖","牁","牱","犐","珂","疴","瞌","磕","礚","科","稞","窠","萪","薖","蚵","蝌","趷","轲","醘","鈳","钶","頦","顆","颗","髁"],"dàng táng":["嵣"],"róng yíng":["嵤","爃"],"ái kǎi":["嵦"],"kāo qiāo":["嵪"],cuó:["嵯","嵳","痤","矬","蒫","蔖","虘","鹺","鹾"],"qiǎn qīn":["嵰"],"dì dié":["嵽"],cēn:["嵾"],dǐng:["嵿","艼","薡","鐤","頂","顶","鼎","鼑"],"áo ào":["嶅"],"pǐ pèi":["嶏"],"jiào qiáo":["嶠","潐"],"jué guì":["嶡","鳜"],"zhān shàn":["嶦","鳣"],"xiè jiè":["嶰"],"guī xī juàn":["嶲"],rū:["嶿"],"lì liè":["巁","棙","爄","綟"],"xī guī juàn":["巂"],"yíng hōng":["巆"],yǐng:["巊","廮","影","摬","梬","潁","瘿","癭","矨","穎","郢","鐛","頴","颍","颕","颖"],chǎo:["巐","炒","煼","眧","麨"],cuán:["巑","櫕","欑"],chuān:["巛","川","氚","瑏","穿"],"jīng xíng":["巠"],cháo:["巢","巣","晁","漅","潮","牊","窲","罺","謿","轈","鄛","鼌"],qiǎo:["巧","愀","髜"],gǒng:["巩","廾","拱","拲","栱","汞","珙","輁","鞏"],"chà chā chāi cī":["差"],"xiàng hàng":["巷"],shuài:["帅","帥","蟀"],pà:["帊","帕","怕","袙"],"tǎng nú":["帑"],"mò wà":["帓"],"tiē tiě tiè":["帖"],zhǒu:["帚","晭","疛","睭","箒","肘","菷","鯞"],"juǎn juàn":["帣"],shuì:["帨","涗","涚","睡","稅","税","裞"],"chóu dào":["帱","幬"],"jiǎn jiān sàn":["帴"],"shà qiè":["帹"],"qí jì":["帺","荠"],"shān qiāo shēn":["幓"],"zhuàng chuáng":["幢"],"chān chàn":["幨"],miè:["幭","懱","搣","滅","灭","烕","礣","篾","蔑","薎","蠛","衊","鑖","鱴","鴓"],"gān gàn":["干"],"bìng bīng":["并","幷"],"jī jǐ":["幾"],"guǎng ān":["广"],guǎng:["広","廣","犷","獷"],me:["庅"],"dùn tún":["庉"],"bài tīng":["庍"],"yìng yīng":["应"],"dǐ de":["底"],"dù duó":["度"],"máng méng páng":["庬"],"bìng píng":["庰"],chěng:["庱","悜","睈","逞","騁","骋"],"jī cuò":["庴"],qǐng:["庼","廎","檾","漀","苘","請","謦","请","頃","顷"],"guī wěi huì":["廆"],"jǐn qín":["廑"],kuò:["廓","扩","拡","擴","濶","筈","萿","葀","蛞","闊","阔","霩","鞟","鞹","韕","頢","鬠"],"qiáng sè":["廧","薔"],"yǐn yìn":["廴","隐","隠","隱","飮","飲","饮"],"pò pǎi":["廹","迫"],"nòng lòng":["弄"],"dì tì tuí":["弟"],"jué zhāng":["弡"],"mí mǐ":["弥","彌","靡"],chāo:["弨","怊","抄","欩","訬","超","鈔","钞"],yi:["弬"],shāo:["弰","旓","烧","焼","燒","筲","艄","萷","蕱","輎","髾","鮹"],"xuān yuān":["弲"],"qiáng qiǎng jiàng":["強","强"],"tán dàn":["弹","醈"],biè:["彆"],"qiáng jiàng qiǎng":["彊"],"jì xuě":["彐"],tuàn:["彖","褖"],yuē:["彟","曰","曱","矱"],"shān xiǎn":["彡"],wén:["彣","文","炆","珳","瘒","繧","聞","芠","蚉","蚊","螡","蟁","閺","閿","闅","闦","闻","阌","雯","馼","駇","魰","鳼","鴍","鼤","𫘜"],"péng bāng":["彭"],"piāo piào":["彯"],"zhuó bó":["彴"],"tuǒ yí":["彵"],"páng fǎng":["彷"],wǎng:["彺","往","徃","惘","枉","棢","網","网","罒","罓","罔","罖","菵","蛧","蝄","誷","輞","辋","魍"],cú:["徂","殂"],"dài dāi":["待"],huái:["徊","怀","懐","懷","槐","淮","耲","蘹","褢","褱","踝"],"wā wàng jiā":["徍"],"chěng zhèng":["徎"],"dé děi de":["得"],"cóng zòng":["從"],"shì tǐ":["徥"],"tí chí":["徲","鶗","鶙"],dé:["徳","德","恴","悳","惪","淂","鍀","锝"],"zhǐ zhēng":["徴","徵"],bié:["徶","癿","莂","蛂","襒","蹩"],"chōng zhǒng":["徸"],"jiǎo jiào":["徼","笅","筊"],"lòng lǒng":["徿"],"qú jù":["忂","渠","瞿","螶"],"dìng tìng":["忊"],gǎi:["忋","改"],rěn:["忍","栠","栣","秹","稔","綛","荏","荵","躵"],chàn:["忏","懴","懺","硟","羼","韂","顫"],tè:["忑","慝","特","蟘","鋱","铽"],"tè tēi tuī":["忒"],"gān hàn":["忓","攼"],"yì qì":["忔"],"tài shì":["忕"],"xī liě":["忚"],"yīng yìng":["応","應","譍"],"mǐn wěn mín":["忞","忟"],"sōng zhōng":["忪"],"yù shū":["忬","悆"],"qí shì":["忯","耆"],"tún zhūn dùn":["忳"],"qián qín":["忴","扲"],hún:["忶","浑","渾","餛","馄","魂","鼲"],niǔ:["忸","扭","炄","狃","紐","纽","莥","鈕","钮","靵"],"kuáng wǎng":["忹"],"kāng hàng":["忼"],"kài xì":["忾","愾"],òu:["怄","慪"],"bǎo bào":["怉"],"mín mén":["怋"],"zuò zhà":["怍"],zěn:["怎"],yàng:["怏","恙","样","様","樣","漾","羕","詇"],"kòu jù":["怐"],"náo niú":["怓"],"zhēng zhèng":["怔","掙","钲","铮"],"tiē zhān":["怗"],"hù gù":["怘"],"cū jù zū":["怚"],"sī sāi":["思"],"yóu chóu":["怞"],"tū dié":["怢"],"yōu yào":["怮"],xuàn:["怰","昡","楦","泫","渲","炫","琄","眩","碹","絢","縼","繏","绚","蔙","衒","袨","贙","鉉","鏇","铉","镟","颴"],"xù xuè":["怴"],"bì pī":["怶"],"xī shù":["怸"],"nèn nín":["恁"],"tiāo yáo":["恌"],"xī qī xù":["恓"],"xiào jiǎo":["恔"],"hū kuā":["恗"],nǜ:["恧","朒","衂","衄"],hèn:["恨"],"dòng tōng":["恫"],"quán zhuān":["恮"],"è wù ě wū":["恶","惡"],tòng:["恸","慟","憅","痛","衕"],"yuān juàn":["悁"],"qiāo qiǎo":["悄"],"jiè kè":["悈"],"hào jiào":["悎"],huǐ:["悔","檓","毀","毁","毇","燬","譭"],"mán mèn":["悗","鞔"],"yī yì":["悘","衣"],quān:["悛","箞","鐉","𨟠"],"kuī lǐ":["悝"],"yì niàn":["悥"],"mèn mēn":["悶"],guàn:["悹","悺","惯","慣","掼","摜","樌","欟","泴","涫","潅","灌","爟","瓘","盥","礶","祼","罆","罐","貫","贯","躀","遦","鏆","鑵","鱹","鸛","鹳"],"kōng kǒng":["悾"],"lǔn lùn":["惀"],guǒ:["惈","果","椁","槨","粿","綶","菓","蜾","裹","褁","輠","餜","馃"],"yuān wǎn":["惌","箢"],"lán lín":["惏"],"yù xù":["惐","淢"],"chuò chuì":["惙"],"hūn mèn":["惛"],"chǎng tǎng":["惝"],"suǒ ruǐ":["惢"],cǎn:["惨","慘","憯","黪","黲","䅟"],cán:["惭","慙","慚","残","殘","蚕","蝅","蠶","蠺"],"dàn dá":["惮","憚"],rě:["惹"],"yú tōu":["愉"],"kài qì":["愒"],"dàng táng shāng yáng":["愓"],"chén xìn dān":["愖"],"kè qià":["愘"],nuò:["愞","懦","懧","掿","搦","榒","稬","穤","糑","糥","糯","諾","诺","蹃","逽","鍩","锘"],gǎn:["感","擀","敢","桿","橄","澉","澸","皯","秆","稈","笴","芉","衦","赶","趕","鱤","鳡"],"còng sōng":["愡"],"sāi sī sǐ":["愢"],"gōng gòng hǒng":["愩","慐"],"shuò sù":["愬","洬"],"yáo yào":["愮"],huàng:["愰","曂","榥","滉","皝","皩","鎤","㿠"],zhěng:["愸","抍","拯","整","晸"],cǎo:["愺","艸","草","騲"],"xì xié":["慀"],"cǎo sāo":["慅"],"xù chù":["慉"],"qiè qiàn":["慊"],"cáo cóng":["慒"],"ào áo":["慠"],"lián liǎn":["慩","梿","槤","櫣"],"jìn qín jǐn":["慬"],"dì chì":["慸"],"zhí zhé":["慹"],"lóu lǚ":["慺","鷜"],còng:["憁","謥"],"zhī zhì":["憄","知","織","织"],chēng:["憆","摚","撐","撑","晿","柽","棦","橕","檉","泟","浾","琤","瞠","碀","緽","罉","蛏","蟶","赪","赬","鏿","鐣","阷","靗","頳","饓"],biē:["憋","虌","鱉","鳖","鼈","龞"],"chéng dèng zhèng":["憕"],"xǐ xī":["憘"],"duì dùn tūn":["憞"],"xiāo jiāo":["憢"],"xián xiàn":["憪"],"liáo liǎo":["憭","燎","爎","爒"],shéng:["憴","縄","繉","繩","绳","譝"],"náo nǎo náng":["憹"],"jǐng jìng":["憼"],"jǐ jiǎo":["憿"],"xuān huān":["懁"],"cǎo sāo sào":["懆"],mèn:["懑","懣","暪","焖","燜"],"mèng méng měng":["懜"],"ài yì nǐ":["懝"],"méng měng":["懞","瞢","矒"],"qí jī jì":["懠"],mǒ:["懡"],"lán xiàn":["懢"],"yōu yǒu":["懮"],"liú liǔ":["懰","藰"],ràng:["懹","譲","讓","让"],huān:["懽","欢","歓","歡","獾","讙","貛","酄","驩","鴅","鵍"],nǎn:["戁","揇","湳","煵","腩","蝻","赧"],"mí mó":["戂"],"gàng zhuàng":["戅","戆"],"zhuàng gàng":["戇"],"xū qu":["戌"],"xì hū":["戏","戯","戲"],"jiá gā":["戛"],zéi:["戝","蠈","賊","贼","鰂","鱡","鲗"],děng:["戥","等"],"hū xì":["戱"],chuō:["戳","踔","逴"],"biǎn piān":["扁"],"shǎng jiōng":["扄"],"shàn shān":["扇"],cái:["才","材","纔","裁","財","财"],"zhā zā zhá":["扎"],"lè lì cái":["扐"],"bā pá":["扒"],"dǎ dá":["打"],rēng:["扔"],"fǎn fú":["払"],"diǎo dí yuē lì":["扚"],"káng gāng":["扛"],"yū wū":["扜"],"yū wū kū":["扝"],"tuō chǐ yǐ":["扡"],"gǔ jié xì gē":["扢"],dèn:["扥","扽"],"sǎo sào":["扫","掃"],rǎo:["扰","擾","隢"],"xī chā qì":["扱"],"bān pān":["扳"],"bā ào":["扷"],"xī zhé":["扸"],"zhì sǔn kǎn":["扻"],zhǎo:["找","沼","瑵"],"kuáng wǎng zài":["抂"],"hú gǔ":["抇","鹄","鹘"],"bǎ bà":["把"],"dǎn shěn":["抌"],"nè nì ruì nà":["抐"],zhuā:["抓","檛","簻","膼","髽"],póu:["抔","裒"],"zhé shé zhē":["折"],"póu pōu fū":["抙","捊"],pāo:["抛","拋","脬","萢"],"ǎo ào niù":["抝"],"lūn lún":["抡","掄"],"qiǎng qiāng chēng":["抢"],"zhǐ zhǎi":["抧"],"bù pū":["抪","柨"],"yǎo tāo":["抭"],"hē hè qiā":["抲"],"nǐ ní":["抳"],"pī pēi":["抷"],"mǒ mò mā":["抹"],chōu:["抽","犨","犫","瘳","篘"],"jiā yá":["拁"],"fú bì":["拂","畐","鶝"],zhǎ:["拃","眨","砟","鮺","鲝"],"dān dàn dǎn":["担"],"chāi cā":["拆"],niān:["拈","蔫"],"lā lá lǎ là":["拉"],"bàn pàn":["拌"],pāi:["拍"],līn:["拎"],guǎi:["拐","枴","柺"],"tuò tà zhí":["拓"],"ào ǎo niù":["拗"],"jū gōu":["拘"],"pīn pàn fān":["拚"],"bài bái":["拜"],bài:["拝","敗","稗","粺","薭","贁","败","韛"],qiá:["拤"],"nǐng níng nìng":["拧"],"zé zhái":["择","擇"],hén:["拫","痕","鞎"],"kuò guā":["括"],"jié jiá":["拮"],nǐn:["拰"],shuān:["拴","栓","閂","闩"],"cún zùn":["拵"],"zā zǎn":["拶","桚"],kǎo:["拷","攷","栲","烤","考"],"yí chǐ hài":["拸"],"cè sè chuò":["拺"],"zhuài zhuāi yè":["拽"],"shí shè":["拾"],bāi:["挀","掰"],"kuò guāng":["挄"],nòng:["挊","挵","齈"],"jiào jiāo":["挍","敎","教"],"kuà kū":["挎"],"ná rú":["挐"],"tiāo tiǎo":["挑"],"dié shè":["挕"],liě:["挘","毟"],"yà yǎ":["挜","掗"],"wō zhuā":["挝"],"xié jiā":["挟","挾"],"dǎng dàng":["挡","擋"],"zhèng zhēng":["挣","正","症"],"āi ái":["挨"],"tuō shuì":["挩","捝"],"tǐ tì":["挮"],"suō shā":["挱"],"sā shā suō":["挲"],"kēng qiān":["挳","摼"],"bàng péng":["挷"],"ruó ruá":["挼"],"jiǎo kù":["捁"],"wǔ wú":["捂"],tǒng:["捅","桶","筒","筩","統","綂","统","㛚"],"huò chì":["捇"],"tú shū chá":["捈"],"lǚ luō":["捋"],"shāo shào":["捎","稍"],niē:["捏","揑"],"shù sǒng sōu":["捒"],"yé yú":["捓"],"jué zhuó":["捔"],"bù pú zhì":["捗"],zùn:["捘","銌"],lāo:["捞","撈","粩"],sǔn:["损","損","榫","笋","筍","箰","鎨","隼"],"wàn wǎn wān yù":["捥"],pěng:["捧","淎","皏"],shě:["捨"],"fǔ fù bǔ":["捬"],dáo:["捯"],"luò luǒ wǒ":["捰"],"juǎn quán":["捲"],"chēn tiǎn":["捵"],"niǎn niē":["捻"],"ruó wěi ré":["捼"],zuó:["捽","昨","秨","稓","筰","莋","鈼"],"wò xiá":["捾"],"qìng qiàn":["掅"],"póu pǒu":["掊"],qiā:["掐","葜"],"pái pǎi":["排"],"qiān wàn":["掔"],"yè yē":["掖"],"niè nǐ yì":["掜"],"huò xù":["掝"],"yàn shàn yǎn":["掞"],"zhěng dìng":["掟"],kòng:["控","鞚"],tuī:["推","蓷","藬"],"zōu zhōu chōu":["掫"],tiàn:["掭","舚"],kèn:["掯","裉","褃"],pá:["掱","杷","潖","爬","琶","筢"],"guó guāi":["掴"],"dǎn shàn":["掸","撣"],"chān xiān càn shǎn":["掺"],sāo:["掻","搔","溞","繅","缫","螦","騒","騷","鰠","鱢","鳋"],pèng:["掽","椪","槰","碰","踫"],"zhēng kēng":["揁"],"jiū yóu":["揂"],"jiān jiǎn":["揃","籛"],"pì chè":["揊"],"sāi zǒng cāi":["揌"],"tí dī dǐ":["提"],"zǒng sōng":["揔"],"huáng yóng":["揘"],"zǎn zuàn":["揝"],"xū jū":["揟"],"ké qiā":["揢"],"chuāi chuǎi chuài tuán zhuī":["揣"],"dì tì":["揥"],"lá là":["揦"],là:["揧","楋","溂","瓎","瘌","翋","臘","蝋","蝲","蠟","辢","辣","鑞","镴","鬎","鯻","𬶟"],"jiē qì":["揭"],"chòng dǒng":["揰"],"dié shé yè":["揲"],"jiàn qián jiǎn":["揵"],yé:["揶","爷","爺","瑘","鋣","鎁","铘"],chān:["搀","摻","攙","裧","襜","覘","觇","辿","鋓"],"gē gé":["搁","擱"],"lǒu lōu":["搂","摟"],"chōu zǒu":["搊"],chuāi:["搋"],sūn:["搎","槂","狲","猻","荪","蓀","蕵","薞","飧","飱"],"róng náng nǎng":["搑"],"péng bàng":["搒"],cuō:["搓","瑳","磋","蹉","遳","醝"],"kē è":["搕"],"nù nuò nòu":["搙"],"lā xié xiàn":["搚"],qiǔ:["搝","糗"],"xiǎn xiān":["搟"],"jié zhé":["搩"],"pán bān pó":["搫"],bān:["搬","攽","斑","斒","班","瘢","癍","肦","螁","螌","褩","辬","頒","颁","𨭉"],"zhì nái":["搱"],"wā wǎ wà":["搲"],huá:["搳","撶","滑","猾","蕐","螖","譁","鏵","铧","驊","骅","鷨"],"qiāng qiǎng chēng":["搶"],"tián shēn":["搷"],"ná nuò":["搻"],èn:["摁"],"shè niè":["摄","攝"],bìn:["摈","擯","殡","殯","膑","臏","髌","髕","髩","鬂","鬓","鬢"],"shā sà shǎi":["摋"],"chǎn sùn":["摌"],"jiū liú liáo jiǎo náo":["摎"],"féng pěng":["摓"],shuāi:["摔"],"dì tú zhí":["摕"],"qì jì chá":["摖"],"sōu sǒng":["摗"],"liǎn liàn":["摙"],"gài xì":["摡"],"hù chū":["摢"],tàng:["摥","烫","燙","鐋"],"nái zhì":["摨"],"mó mā":["摩"],"jiāng qiàng":["摪"],"áo qiáo":["摮"],"niè chè":["摰"],"mán màn":["摱"],"chàn cán":["摲"],"sè mí sù":["摵"],"biāo biào":["摽"],"juē jué":["撅"],piē:["撆","暼","氕","瞥"],"piě piē":["撇"],"zǎn zān zēn qián":["撍"],"sā sǎ":["撒"],hòng:["撔","訌","讧","闀","鬨"],"héng guàng":["撗"],niǎn:["撚","撵","攆","涊","焾","碾","簐","蹍","蹨","躎","輦","辇"],"chéng zhěng":["撜"],"huī wéi":["撝"],cāo:["撡","操","糙"],"xiāo sōu":["撨"],"liáo liāo":["撩"],"cuō zuǒ":["撮"],"wěi tuǒ":["撱"],cuān:["撺","攛","汆","蹿","躥","鑹","镩"],"qiào yāo jī":["撽"],"zhuā wō":["撾"],"lèi léi":["擂"],nǎng:["擃","攮","曩","灢"],"qíng jǐng":["擏"],kuǎi:["擓","蒯","㧟"],"pǐ bò":["擗"],"bò bāi":["擘"],"jù jǐ":["據"],mēng:["擝"],"sǒu sòu":["擞"],xǐng:["擤","箵","醒"],cā:["擦"],"níng nǐng nìng":["擰"],"zhì jié":["擳"],"là liè":["擸","爉"],"sòu sǒu":["擻"],"lì luò yuè":["擽"],"tī zhāi zhì":["擿"],pān:["攀","潘","眅","萠"],lèi:["攂","泪","涙","淚","禷","类","纇","蘱","酹","銇","錑","頛","頪","類","颣"],"cā sǎ":["攃"],"jùn pèi":["攈"],"lì luò":["攊","躒"],"là lài":["攋","櫴"],"lú luó":["攎"],"zǎn cuán":["攒"],"xiān jiān":["攕"],"mí mǐ mó":["攠"],"zǎn cuán zàn zuān":["攢"],zuàn:["攥"],"lì shài":["攦"],"lì luǒ":["攭"],"guǐ guì":["攱"],"jī qī yǐ":["攲"],fàng:["放"],"wù móu":["敄"],"chù shōu":["敊"],"gé guó è":["敋"],"duó duì":["敓","敚"],"duō què":["敠","敪"],"sàn sǎn":["散"],"dūn duì":["敦","镦"],"qī yǐ jī":["敧"],"xiào xué":["敩"],"shù shǔ shuò":["数","數"],"ái zhú":["敱","敳"],"xiòng xuàn":["敻"],"zhuó zhú":["斀"],"yì dù":["斁"],"lí tái":["斄"],"fěi fēi":["斐"],"yǔ zhōng":["斔"],"dòu dǒu":["斗"],"wò guǎn":["斡"],"tǒu tiǎo":["斢"],dòu:["斣","梪","浢","痘","窦","竇","脰","荳","豆","逗","郖","酘","閗","闘","餖","饾","鬥","鬦","鬪","鬬","鬭"],"yín zhì":["斦"],"chǎn jiè":["斺"],"wū yū yú":["於"],"yóu liú":["斿"],"páng bàng":["旁"],"máo mào":["旄"],"pī bì":["旇"],"xuán xuàn":["旋"],"wú mó":["无"],zǎo:["早","枣","栆","棗","澡","璪","薻","藻","蚤"],gā:["旮"],"gàn hàn":["旰"],"tái yīng":["旲"],"xū xù":["旴"],"tūn zhùn":["旽"],"wù wǔ":["旿"],"pò pèi":["昢"],zòng:["昮","猔","疭","瘲","粽","糉","糭","縦"],ǎi:["昹","毐","矮","蔼","藹","譪","躷","霭","靄"],"huàng huǎng":["晃"],xuǎn:["晅","癣","癬","选","選"],"xù kuā":["晇"],hǒng:["晎"],shài:["晒","曬"],"yūn yùn":["晕","煴"],"shèng chéng":["晟","椉","盛"],"jǐng yǐng":["景"],shǎn:["晱","熌","睒","覢","閃","闪","陕","陝"],"qǐ dù":["晵"],"ǎn àn yǎn":["晻"],"wǎng wàng":["暀"],zàn:["暂","暫","瓉","瓒","瓚","禶","襸","讃","讚","賛","贊","赞","蹔","鄼","錾","鏨","饡"],"yùn yūn":["暈"],"mín mǐn":["暋"],"dǔ shǔ":["暏"],shǔ:["暑","曙","潻","癙","糬","署","薥","薯","藷","蜀","蠴","襡","襩","鱪","鱰","黍","鼠","鼡"],"jiǎn lán":["暕"],nuǎn:["暖","煗","餪"],"bào pù":["暴"],"xī xǐ":["暿"],"pù bào":["曝","瀑"],"qū qǔ":["紶"],"qǔ qū":["曲"],"gèng gēng":["更"],"hū hù":["曶","雽"],"zēng céng":["曽","橧"],"céng zēng":["曾","竲"],"cǎn qián jiàn":["朁"],"qiè hé":["朅"],"bì pí":["朇","禆","笓","裨"],"yǒu yòu":["有"],"bān fén":["朌","鳻"],"fú fù":["服","洑"],"fěi kū":["朏","胐"],"qú xù chǔn":["朐"],"juān zuī":["朘"],"huāng máng wáng":["朚"],"qī jī":["期"],"tóng chuáng":["朣","橦"],zhá:["札","牐","箚","蚻","譗","鍘","铡","閘","闸"],"zhú shù shú":["朮"],"shù shú zhú":["术"],"zhū shú":["朱"],"pǔ pò pō piáo":["朴"],"dāo tiáo mù":["朷"],"guǐ qiú":["朹"],xiǔ:["朽","滫","潃","糔"],"chéng chēng":["朾"],zá:["杂","沯","砸","襍","雑","雜","雥","韴"],"yú wū":["杅"],"gān gǎn":["杆"],"chā chà":["杈"],"shān shā":["杉"],cūn:["村","皴","竴","膥","踆","邨"],"rèn ér":["杒","梕"],"sháo biāo":["杓"],"dì duò":["杕","枤"],"gū gài":["杚"],"yí zhì lí duò":["杝"],"gàng gāng":["杠"],"tiáo tiāo":["条","條"],"mà mǎ":["杩"],"sì zhǐ xǐ":["杫"],"yuán wán":["杬","蚖"],"bèi fèi":["杮"],"shū duì":["杸"],"niǔ chǒu":["杻"],"wò yuè":["枂","臒"],máo:["枆","毛","氂","渵","牦","矛","罞","茅","茆","蝥","蟊","軞","酕","鉾","錨","锚","髦","鶜"],"pī mì":["枈"],àng:["枊","盎","醠"],"fāng bìng":["枋"],"hù dǐ":["枑"],xín:["枔","襑","鐔","鬵"],"yāo yǎo":["枖"],"ě è":["枙"],"zhī qí":["枝"],"cōng zōng":["枞","樅"],"xiān zhēn":["枮"],"tái sì":["枱"],"gǒu jǔ gōu":["枸"],"bāo fú":["枹"],"yì xiè":["枻","栧"],"tuó duò":["柁","馱","駄","驮"],"yí duò lí":["柂"],"nǐ chì":["柅"],"pán bàn":["柈","跘"],"yǎng yàng yāng yīng":["柍"],"fù fū fǔ":["柎"],"bǎi bó bò":["柏"],mǒu:["某"],"sháo shào":["柖"],zhè:["柘","樜","浙","淛","蔗","蟅","這","鷓","鹧","䗪"],"yòu yóu":["柚","櫾"],"guì jǔ":["柜"],"zhà zuò":["柞"],"dié zhì":["柣","眰"],"zhā zǔ zū":["柤"],"chá zhā":["查","査"],"āo ào":["柪","軪"],"bā fú pèi bó biē":["柭"],"duò zuó wù":["柮"],"bì bié":["柲"],"zhù chù":["柷"],"bēi pēi":["柸"],"shì fèi":["柹"],"shān zhà shi cè":["栅"],"lì yuè":["栎","櫟"],"qì qiè":["栔","砌"],"qī xī":["栖","蹊"],"guā kuò":["栝"],"bīng bēn":["栟"],"xiào jiào":["校"],"jiàn zùn":["栫","袸"],"yǒu yù":["栯"],"hé hú":["核"],gēn:["根","跟"],"zhī yì":["栺"],"gé gē":["格"],"héng háng":["桁"],"guàng guāng":["桄"],"yí tí":["桋","荑"],sāng:["桑","桒","槡"],"jú jié":["桔"],"yú móu":["桙"],"ráo náo":["桡","橈"],"guì huì":["桧","檜"],"chén zhèn":["桭"],"tīng yíng":["桯"],"bó po":["桲"],"bèn fàn":["桳"],"fēng fèng":["桻","葑"],"sù yìn":["梀"],"tǐng tìng":["梃"],"xuān juān xié":["梋"],"tú chá":["梌"],"āo yòu":["梎"],kuǎn:["梡","欵","款","歀"],"shāo sào":["梢"],"qín chén cén":["梣"],"lí sì qǐ":["梩"],"chān yán":["梴"],"bīn bīng":["梹","槟","檳"],"táo chóu dào":["梼"],"cōng sōng":["棇"],"gùn hùn":["棍"],"dé zhé":["棏"],"pái bèi pèi":["棑"],"bàng pǒu bèi bēi":["棓"],"dì dài tì":["棣"],sēn:["森","椮","槮","襂"],"rěn shěn":["棯"],"léng lēng líng":["棱"],"fú sù":["棴"],"zōu sǒu":["棷"],zōu:["棸","箃","緅","諏","诹","邹","郰","鄒","鄹","陬","騶","驺","鯫","鲰","黀","齱","齺"],"zhào zhuō":["棹"],"chēn shēn":["棽"],"jiē qiè":["椄"],"yǐ yī":["椅"],"chóu zhòu diāo":["椆"],"qiāng kōng":["椌"],"zhuī chuí":["椎"],"bēi pí":["椑"],mēn:["椚"],"quān juàn quán":["椦"],"duǒ chuán":["椯"],"wěi huī":["椲"],"jiǎ jiā":["椵"],"hán jiān":["椷"],"shèn zhēn":["椹"],"yàn yà":["椻"],"zhā chá":["楂"],"guō kuǎ":["楇"],"jí zhì":["楖"],"kǔ hù":["楛"],"yóu yǒu":["楢"],"sǒng cōng":["楤"],"yuán xuàn":["楥"],"yǎng yàng yīng":["楧"],pián:["楩","胼","腁","賆","蹁","駢","騈","骈","骿","㛹"],"dié yè":["楪"],"dùn shǔn":["楯"],"còu zòu":["楱"],"dì dǐ shì":["楴"],"kǎi jiē":["楷"],"róu ròu":["楺"],"lè yuè":["楽"],"wēn yùn":["榅","鞰"],lǘ:["榈","櫚","氀","膢","藘","閭","闾","驢","驴"],shén:["榊","神","鉮","鰰","𬬹"],"bī pi":["榌"],"zhǎn niǎn zhèn":["榐"],"fú fù bó":["榑"],"jiàn jìn":["榗"],"bǎng bàng":["榜"],"shā xiè":["榝","樧"],nòu:["槈","耨","鎒","鐞"],"qiǎn lián xiàn":["槏"],gàng:["槓","焵","焹","筻","鿍"],gāo:["槔","槹","橰","櫜","睾","篙","糕","羔","臯","韟","餻","高","髙","鷎","鷱","鼛"],"diān zhěn zhēn":["槙"],"kǎn jiàn":["槛"],"xí dié":["槢"],"jī guī":["槣"],"róng yōng":["槦"],"tuán shuàn quán":["槫"],"qì sè":["槭"],"cuī zhǐ":["槯"],"yǒu chǎo":["槱"],"màn wàn":["槾"],"lí chī":["樆"],"léi lěi":["樏","櫑","礌"],"cháo jiǎo chāo":["樔"],"chēng táng":["樘"],"jiū liáo":["樛"],"mó mú":["模"],"niǎo mù":["樢"],"héng hèng":["横","橫"],xuě:["樰","膤","艝","轌","雪","鱈","鳕"],"fá fèi":["橃"],rùn:["橍","润","潤","膶","閏","閠","闰"],"zhǎn jiǎn":["橏"],shùn:["橓","瞚","瞬","舜","蕣","順","顺","鬊"],"tuí dūn":["橔"],"táng chēng":["橖"],"sù qiū":["橚"],"tán diàn":["橝"],"fén fèn fèi":["橨"],"rǎn yān":["橪"],"cū chu":["橻"],"shū qiāo":["橾"],"píng bò":["檘"],"zhái shì tú":["檡"],"biǎo biāo":["檦"],"qiān lián":["檶"],"nǐ mí":["檷"],"jiàn kǎn":["檻"],"nòu ruǎn rú":["檽"],"jī jì":["櫅","禨"],"huǎng guǒ gǔ":["櫎"],"lǜ chū":["櫖"],"miè mèi":["櫗"],ōu:["櫙","欧","歐","殴","毆","瓯","甌","膒","藲","謳","讴","鏂","鴎","鷗","鸥"],"zhù zhuó":["櫡"],"jué jì":["櫭"],"huái guī":["櫰"],"chán zhàn":["欃"],"wéi zuì":["欈"],cáng:["欌","鑶"],"yù yì":["欥"],"chù qù xì":["欪"],"kài ài":["欬"],"yì yīn":["欭"],"xì kài":["欯"],"shuò sòu":["欶"],"ǎi ēi éi ěi èi ê̄ ế ê̌ ề":["欸"],"qī yī":["欹"],"chuā xū":["欻"],"chǐ chuài":["欼"],"kǎn qiàn":["欿"],"kǎn kè":["歁"],"chuǎn chuán":["歂"],"yīn yān":["歅"],"jìn qūn":["歏"],pēn:["歕"],"xū chuā":["歘"],"xī shè":["歙"],"liǎn hān":["歛"],"zhì chí":["歭"],"sè shà":["歰"],sǐ:["死"],"wěn mò":["歾"],piǎo:["殍","皫","瞟","醥","顠"],"qíng jìng":["殑"],"fǒu bó":["殕"],"zhí shi":["殖"],"yè yān yàn":["殗"],"hūn mèi":["殙"],chòu:["殠","臰","遚"],"kuì huì":["殨","溃","潰"],cuàn:["殩","熶","爨","窜","竄","篡","簒"],"yīn yān yǐn":["殷"],"qìng kēng shēng":["殸"],"yáo xiáo xiào":["殽"],"gū gǔ":["毂","蛄"],"guàn wān":["毌"],"dú dài":["毒"],"xún xùn":["毥"],mú:["毪","氁"],"dòu nuò":["毭"],"sāi suī":["毸"],lu:["氇"],sào:["氉","瘙","矂","髞"],"shì zhī":["氏"],"dī dǐ":["氐"],"máng méng":["氓"],"yáng rì":["氜"],shuǐ:["水","氵","氺","閖"],"zhěng chéng zhèng":["氶"],tǔn:["氽"],"fán fàn":["氾"],"guǐ jiǔ":["氿"],"bīn pà pā":["汃"],"zhuó què":["汋"],"dà tài":["汏"],pìn:["汖","牝","聘"],"hàn hán":["汗","馯"],tu:["汢"],"tāng shāng":["汤","湯"],"zhī jì":["汥"],"gàn hán cén":["汵"],"wèn mén":["汶"],"fāng pāng":["汸"],"hǔ huǎng":["汻"],"niú yóu":["汼"],hàng:["沆"],"shěn chén":["沈"],"dùn zhuàn":["沌"],"nǜ niǔ":["沑"],"méi mò":["沒","没"],"tà dá":["沓"],"mì wù":["沕"],"hóng pāng":["沗"],"shā shà":["沙"],"zhuǐ zǐ":["沝"],"ōu òu":["沤","漚"],"jǔ jù":["沮"],"tuō duó":["沰"],"mǐ lì":["沵"],"yí chí":["沶"],"xiè yì":["泄"],"bó pō":["泊"],"mì bì":["泌","秘"],"chù shè":["泏"],"yōu yòu āo":["泑"],"pēng píng":["泙","硑"],"pào pāo":["泡"],"ní nì":["泥","秜"],"yuè sà":["泧"],"jué xuè":["泬","疦"],"lóng shuāng":["泷","瀧"],"luò pō":["泺","濼"],"zé shì":["泽","澤"],"sǎ xǐ":["洒"],"sè qì zì":["洓"],"xǐ xiǎn":["洗"],"kǎo kào":["洘"],"àn yàn è":["洝"],"lěi lèi":["洡"],"qiè jié":["洯"],"qiǎn jiān":["浅"],"jì jǐ":["济","済","濟","纪"],"hǔ xǔ":["浒","滸"],"jùn xùn":["浚","濬"],"yǐng chéng yíng":["浧"],"liàn lì":["浰"],"féng hóng":["浲","溄"],"jiǒng jiōng":["浻"],"suī něi":["浽"],"yǒng chōng":["涌"],"tūn yūn":["涒"],"wō guō":["涡","渦"],hēng:["涥","脝"],"zhǎng zhàng":["涨","漲"],"shòu tāo":["涭"],shuàn:["涮","腨"],"kōng náng":["涳"],"wò wǎn yuān":["涴"],"tuō tuò":["涶"],wō:["涹","猧","窝","窩","莴","萵","蜗","蝸","踒"],"qiè jí":["淁"],"guǒ guàn":["淉"],"lín lìn":["淋","獜","疄"],"tǎng chǎng":["淌"],"nào chuò zhuō":["淖"],"péng píng":["淜"],féi:["淝","肥","腓","蜰"],"pì pèi":["淠"],"niǎn shěn":["淰"],"biāo hǔ":["淲"],"chún zhūn":["淳"],"hùn hún":["混"],qiǎn:["淺","繾","缱","肷","膁","蜸","譴","谴","遣","鑓"],"wèn mín":["渂"],"rè ruò luò":["渃"],"dú dòu":["渎","瀆","读"],"jiàn jiān":["渐","溅","漸","濺"],"miǎn shéng":["渑","澠"],"nuǎn nuán":["渜"],"qiú wù":["渞"],"tíng tīng":["渟"],"dì tí dī":["渧"],"gǎng jiǎng":["港"],"hōng qìng":["渹"],tuān:["湍","煓"],"huì mǐn xū":["湏"],"xǔ xù":["湑"],pén:["湓","瓫","盆","葐"],"mǐn hūn":["湣"],"tuàn nuǎn":["湪"],"qiū jiǎo":["湫","湬"],"yān yīn":["湮"],"bàn pán":["湴"],"zhuāng hún":["湷"],"yàn guì":["溎"],"lián liǎn nián xián xiàn":["溓"],"dá tǎ":["溚","鿎"],"liū liù":["溜","澑","蹓"],lùn:["溣"],mǎ:["溤","犸","獁","玛","瑪","码","碼","遤","鎷","馬","马","鰢","鷌"],"zhēn qín":["溱"],"nì niào":["溺"],"chù xù":["滀","畜"],"wěng wēng":["滃"],"hào xuè":["滈"],"qì xì xiē":["滊"],"xíng yíng":["滎"],"zé hào":["滜"],"piāo piào piǎo":["漂"],"cóng sǒng":["漎"],"féng péng":["漨"],"luò tà":["漯"],"pēng bēn":["漰"],"chóng shuāng":["漴"],"huǒ kuò huò":["漷"],"liáo liú":["漻"],"cuǐ cuī":["漼"],"cóng zǒng":["潀"],"cóng zōng":["潈"],"pì piē":["潎"],"dàng xiàng":["潒"],"huáng guāng":["潢"],"liáo lào lǎo":["潦"],"cōng zòng":["潨"],"zhí zhì":["潪"],"tān shàn":["潬"],"tú zhā":["潳"],"sàn sǎ":["潵"],hēi:["潶","黑","黒","𬭶"],"chéng dèng":["澄","瀓"],"cūn cún":["澊"],"péng pēng":["澎"],"hòng gǒng":["澒","銾"],"wàn màn":["澫"],"kuài huì":["澮"],"guō wō":["濄"],"pēn fén":["濆"],"jí shà":["濈"],"huì huò":["濊"],"dǐng tìng":["濎"],"mǐ nǐ":["濔"],"bì pì":["濞"],"cuì zuǐ":["濢"],"hù huò":["濩"],"ǎi kài kè":["濭"],"wěi duì":["濻","瀢"],"zàn cuán":["濽","灒"],"yǎng yàng":["瀁"],"wǎng wāng":["瀇"],"mò miè":["瀎","眜"],suǐ:["瀡","膸","髓"],"huái wāi":["瀤"],"zùn jiàn":["瀳"],"yīng yǐng yìng":["瀴"],"ráng ràng":["瀼"],shuàng:["灀"],"zhuó jiào zé":["灂"],sǎ:["灑","訯","靸"],"luán luàn":["灓"],"dǎng tǎng":["灙"],"xún quán quàn":["灥"],"huǒ biāo":["灬"],"zhà yù":["灹"],"fén bèn":["炃"],"jiǒng guì":["炅"],"pàng fēng":["炐"],quē:["炔","缺","缼","蒛"],biān:["炞","煸","甂","砭","笾","箯","籩","編","编","蝙","邉","邊","鍽","鞭","鯾","鯿","鳊"],"zhāo zhào":["炤"],"zhuō chù":["炪"],"pào páo bāo":["炮"],"páo fǒu":["炰"],"shǎn qián shān":["炶"],"zhà zhá":["炸"],"jiǎo yào":["烄"],quǎn:["烇","犬","犭","畎","綣","绻","虇"],"yàng yáng":["烊"],"lào luò":["烙"],"huí huǐ":["烠"],rè:["热","熱"],"fú páo":["烰"],"xiè chè":["烲","焎"],"yàn shān":["烻"],"hūn xūn":["焄"],kào:["焅","犒","銬","铐","靠","鮳","鯌","鲓","㸆"],"juān yè":["焆"],"jùn qū":["焌"],"tāo dào":["焘"],"chǎo jù":["焣"],"wò ài":["焥"],"zǒng cōng":["焧"],"xī yì":["焬"],"xìn xīn":["焮"],"chāo zhuō":["焯"],"xiǒng yīng":["焸","焽"],kuǐ:["煃","跬","蹞","頍","𫠆"],"huī yùn xūn":["煇"],"jiǎo qiāo":["煍"],"qián shǎn shān":["煔"],"xī yí":["煕"],"shà shā":["煞"],"yè zhá":["煠"],"yáng yàng":["煬"],"ēn yūn":["煾"],"yūn yǔn":["熅"],"hè xiāo":["熇"],xióng:["熊","熋","雄"],"xūn xùn":["熏","爋"],gòng:["熕","貢","贡"],liū:["熘"],"cōng zǒng":["熜"],"lù āo":["熝"],"shú shóu":["熟"],"fēng péng":["熢"],"cuǐ suī":["熣"],tēng:["熥","膯","鼟"],"yùn yù":["熨"],"áo āo":["熬"],"hàn rǎn":["熯"],"ōu ǒu":["熰"],"huáng huǎng":["熿"],"chǎn dǎn chàn":["燀"],"jiāo zhuó qiáo jué":["燋"],"yàn yān":["燕"],"tài liè":["燤"],āo:["爊"],"yàn xún":["爓"],"jué jiào":["爝","覐","覚","覺","觉"],"lǎn làn":["爦"],"zhuǎ zhǎo":["爪"],"zhǎo zhuǎ":["爫"],"fù fǔ":["父"],diē:["爹","褺","跌"],zāng:["牂","羘","臧","賍","賘","贓","贜","赃","髒"],"piàn piān":["片"],"biān miàn":["牑"],bǎng:["牓","綁","绑"],"yǒu yōng":["牗"],"chēng chèng":["牚","竀"],niú:["牛","牜"],"jiū lè":["牞"],"mù móu":["牟"],māng:["牤"],"gē qiú":["牫"],"yòu chōu":["牰"],"tè zhí":["犆"],bēn:["犇","錛","锛"],"jiān qián":["犍","玪"],má:["犘","痲","蔴","蟇","麻"],"máo lí":["犛"],"bá quǎn":["犮"],"zhuó bào":["犳"],"àn hān":["犴"],"kàng gǎng":["犺"],"pèi fèi":["犻"],"fān huān":["犿"],kuáng:["狂","狅","誑","诳","軖","軠","鵟","𫛭"],"yí quán chí":["狋"],"xīng shēng":["狌"],"tuó yí":["狏"],kǔ:["狜","苦"],"huán huān":["狟"],"hé mò":["狢"],"tà shì":["狧"],"máng dòu":["狵"],"xī shǐ":["狶"],suān:["狻","痠","酸"],"bài pí":["猈"],"jiān yàn":["猏","豣"],"yī yǐ":["猗"],"yá wèi":["猚"],cāi:["猜"],"māo máo":["猫","貓"],"chuàn chuān":["猭"],"tuān tuàn":["猯","貒"],"yà jiá qiè":["猰"],"hè xiē gé hài":["猲"],"biān piàn":["猵","獱"],"bó pò":["猼"],"háo gāo":["獋"],"fén fèn":["獖"],"yào xiāo":["獟"],"shuò xī":["獡"],"gé liè xiē":["獦"],"nòu rú":["獳"],"náo nǎo yōu":["獶"],ráng:["獽","瓤","禳","穣","穰","蘘","躟","鬤"],"náo yōu":["獿"],"lǜ shuài":["率"],"wáng wàng":["王"],"yáng chàng":["玚"],"mín wén":["玟"],"bīn fēn":["玢"],"mén yǔn":["玧"],"qiāng cāng":["玱","瑲","篬"],"án gān":["玵"],"xuán xián":["玹"],"cī cǐ":["玼","跐"],"yí tāi":["珆"],"zǔ jù":["珇"],fà:["珐","琺","蕟","髪","髮"],"yín kèn":["珢"],"huī hún":["珲"],"xuán qióng":["琁"],"fú fū":["琈"],"bǐng pín":["琕"],"cuì sè":["琗"],"yù wéi":["琟"],"tiǎn tiàn":["琠"],"zhuó zuó":["琢"],"běng pěi":["琣"],guǎn:["琯","璭","痯","筦","管","舘","輨","錧","館","馆","鳤"],"hún huī":["琿"],"xié jiē":["瑎"],"chàng dàng yáng":["瑒"],"tiàn zhèn":["瑱"],"bīn pián":["瑸","璸"],"tú shū":["瑹"],cuǐ:["璀","皠","趡"],"zǎo suǒ":["璅"],"jué qióng":["璚"],"lú fū":["璷"],"jì zī":["璾"],suí:["瓍","綏","绥","遀","随","隨","髄"],"mí xǐ":["瓕"],"qióng wěi wèi":["瓗"],"huán yè yà":["瓛"],"bó páo":["瓟"],"zhí hú":["瓡"],piáo:["瓢","闝"],"wǎ wà":["瓦"],"xiáng hóng":["瓨"],wèng:["瓮","甕","罋","蕹","齆"],"shèn shén":["甚"],ruí:["甤","緌","蕤"],yòng:["用","砽","苚","蒏","醟","㶲"],shuǎi:["甩"],béng:["甭","甮"],"yóu zhá":["甴"],"diàn tián shèng":["甸"],"tǐng dīng":["町","甼"],"zāi zī":["甾"],"bì qí":["畁"],"dá fú":["畗"],"cè jì":["畟"],"zāi zī tián":["畠"],"zhì chóu shì":["畤"],"fān pān":["畨","番"],"shē yú":["畬"],"dāng dàng dǎng":["當"],"jiāng qiáng":["疆"],"pǐ yǎ shū":["疋"],"jié qiè":["疌"],"yí nǐ":["疑"],nè:["疒","眲","訥","讷"],"gē yì":["疙"],"nüè yào":["疟","瘧"],"lì lài":["疠","癘"],"yǎ xiā":["疨"],xuē:["疶","蒆","薛","辥","辪","靴","鞾"],"dǎn da":["疸"],"fá biǎn":["疺"],"fèi féi":["疿","痱"],"shān diàn":["痁"],"téng chóng":["痋"],"tōng tóng":["痌"],"wěi yòu yù":["痏"],"tān shǐ":["痑"],"pū pù":["痡","鋪"],"bēng péng":["痭"],"má lìn":["痳"],"tiǎn diàn":["痶"],"ān yè è":["痷"],"kē ē":["痾"],"zhì chì":["瘈"],"jiǎ xiá xiā":["瘕"],"lěi huì":["瘣"],"chài cuó":["瘥"],"diān chēn":["瘨"],"da dá":["瘩"],"biě biē":["瘪"],qué:["瘸"],"dàn dān":["癉"],"guì wēi":["癐"],"nòng nóng":["癑"],"biē biě":["癟"],"bō bǒ":["癷"],bái:["白"],"jí bī":["皀"],"de dì dí dī":["的"],"pā bà":["皅"],"gāo háo":["皋"],"gāo yáo":["皐"],"lì luò bō":["皪"],"zhā cǔ":["皻"],"zhāo zhǎn dǎn":["皽"],"jiān jiàn":["监","監","鋻","间","鞬"],"gài gě hé":["盖"],"máng wàng":["盳"],yuǎn:["盶","逺","遠"],"tián xián":["盷"],"xiāng xiàng":["相"],dǔn:["盹","趸","躉"],"xì pǎn":["盻"],"shěng xǐng":["省"],"yún hùn":["眃"],"miǎn miàn":["眄"],"kàn kān":["看"],"yìng yāng yǎng":["眏"],"yǎo āo ǎo":["眑"],"jū xū kōu":["眗"],"yí chì":["眙"],"dié tì":["眣"],"bǐng fǎng":["眪"],"pàng pán":["眫"],"mī mí":["眯","瞇"],"xuàn shùn xún":["眴"],tiào:["眺","粜","糶","覜","趒"],"zhe zhuó zháo zhāo":["着"],"qiáo shào xiāo":["睄"],"cuó zhuài":["睉"],gùn:["睔","謴"],"suì zuì":["睟"],"pì bì":["睥","稫","辟"],"yì zé gāo":["睪"],"xǐng xìng":["睲"],"guì wèi kuì":["瞆"],"kòu jì":["瞉"],"qióng huán":["瞏"],"mán mén":["瞒","瞞"],"diāo dōu":["瞗"],"lou lóu lǘ":["瞜"],"shùn rún":["瞤"],"liào liǎo":["瞭","钌"],"jiàn xián":["瞯"],"wǔ mí":["瞴"],"guì kuì":["瞶"],"nǐng chēng":["矃"],"huò yuè":["矆"],"mēng méng":["矇"],"kuàng guō":["矌"],"guàn quán":["矔"],"mǎn mán":["矕"],"jīn guān qín":["矜"],"jīn qín guān":["矝"],"yù xù jué":["矞"],"jiǎo jiáo":["矫","矯"],duǎn:["短"],"shí dàn":["石"],"gāng qiāng kòng":["矼"],"huā xū":["砉"],"pīn bīn fēn":["砏"],"yán yàn":["研","硏"],"luǒ kē":["砢"],"fú fèi":["砩","笰"],"zhǔ zhù":["砫"],"lá lì lā":["砬"],"kuāng guāng":["硄"],"gè luò":["硌"],"shuò shí":["硕","碩"],"wèi wéi ái":["硙"],"què kè kù":["硞"],"mǎng bàng":["硥"],"luò lòng":["硦"],"yǒng tóng":["硧"],nüè:["硸","虐"],"kēng kěng":["硻"],"yān yǎn":["硽"],"zhuì chuí duǒ":["硾"],"kōng kòng":["硿"],"zòng cóng":["碂"],"jiān zhàn":["碊"],"lù liù":["碌","陆"],"què xī":["碏"],"lún lǔn lùn":["碖"],"náo gāng":["碙"],"jié yà":["碣"],"wèi wěi":["碨"],"tí dī":["碮"],"chá chā":["碴"],"qiāo què":["碻"],"sù xiè":["碿"],"liú liù":["磂","遛","鎦","馏"],"sī tí":["磃"],"bàng páng":["磅"],"huá kě gū":["磆"],"wěi kuǐ":["磈"],"xiá qià yà":["磍"],"lián qiān":["磏"],"wèi ái gài":["磑"],"lá lā":["磖"],"áo qiāo":["磝"],"pēng pèng":["磞","閛"],"yīn yǐn":["磤"],"lěi léi":["磥"],"mó mò":["磨"],"qì zhú":["磩"],"láo luò":["磱"],"pán bō":["磻"],"jí shé":["磼"],"hé qiāo qiào":["礉"],"kè huò":["礊"],"què hú":["礐"],"è qì":["礘"],cǎ:["礤","礸"],"xián xín":["礥"],"léi lěi lèi":["礧"],"yán yǎn":["礹"],"qí zhǐ":["祇","蚔"],"bēng fāng":["祊"],"bì mì":["祕"],suàn:["祘","笇","筭","算","蒜"],"piào piāo":["票"],"jì zhài":["祭"],"shuì lèi":["祱"],"jìn jīn":["禁"],"chán shàn":["禅"],"yáng shāng":["禓"],"zhī zhǐ tí":["禔"],"shàn chán":["禪"],"yú yù ǒu":["禺"],"zǐ zì":["秄"],"chá ná":["秅"],"zhǒng zhòng chóng":["种"],"hào mào":["秏"],"kù kū":["秙"],zū:["租","葅"],chèng:["秤","穪"],"huó kuò":["秮","秳"],"chēng chèn chèng":["称","稱"],"shì zhì":["秲","銴"],"fù pū":["秿"],"xùn zè":["稄"],"tú shǔ":["稌"],"zhùn zhǔn":["稕"],"jī qí":["稘","綨","觭"],"léng líng":["稜"],"zuì zú sū":["稡"],"xì qiè":["稧","郄"],"zhǒng zhòng":["種"],"zōng zǒng":["稯"],"xián jiān liàn":["稴"],"zī jiū":["稵"],"jī qǐ":["稽"],ròng:["穃"],"shān cǎn cēn":["穇"],"mén méi":["穈"],"jǐ jì":["穖"],"xiāo rào":["穘"],"zhuō bó":["穛"],"tóng zhǒng zhòng":["穜"],zuō:["穝"],"biāo pāo":["穮","藨"],"zhuō jué":["穱"],"cuán zàn":["穳"],"kōng kòng kǒng":["空"],"yū yǔ":["穻"],zhǎi:["窄","鉙"],báo:["窇","雹"],"kū zhú":["窋"],"jiào liáo liù":["窌"],"wā guī":["窐"],"tiǎo yáo":["窕"],"xūn yìn":["窨"],"yà yē":["窫"],"tián diān yǎn":["窴"],"chāo kē":["窼"],"kuǎn cuàn":["窽","窾"],"chù qì":["竐"],"qǔ kǒu":["竘"],"jìng zhěn":["竧"],"kǎn kàn":["竷"],"zhú dǔ":["竺"],"lè jīn":["竻"],"zhuì ruì":["笍"],"háng hàng":["笐"],"cén jìn hán":["笒"],"dā xiá nà":["笚"],"zé zuó":["笮"],"lóng lǒng":["笼","篭","籠","躘","龓"],"zhù zhú":["筑","築"],"dá dā":["答","荅"],shāi:["筛","篩","簁","籭"],"yún jūn":["筠"],"láng làng":["筤","郎","阆"],"zhì zhǐ":["筫"],o:["筽"],"póu bù fú pú":["箁"],"pái bēi":["箄"],gè:["箇","虼","鉻","铬"],"tái chí":["箈"],"guǎi dài":["箉"],"zhào dào":["箌"],"jīng qìng":["箐"],"lín lǐn":["箖"],"jùn qūn":["箘"],"shī yí":["箷","釶"],"yuē yào chuò":["箹"],"xiāo shuò qiào":["箾"],"gōng gǎn lǒng":["篢"],"páng péng":["篣"],"zhuó huò":["篧"],"jiǎn jiān":["篯"],"dí zhú":["篴"],"zān cēn cǎn":["篸"],"zhuàn suǎn zuàn":["篹"],"piǎo biāo":["篻"],"guó guì":["簂"],"cè jí":["簎"],"mì miè":["簚"],"shāi sī":["簛"],"sǔn zhuàn":["簨"],"gàn gǎn":["簳"],"bò bǒ":["簸"],"bó bù":["簿"],shi:["籂"],"zhēn jiān":["籈"],"zhuàn zuǎn":["籑"],"fān pān biān":["籓"],"sǒu shǔ":["籔"],zuǎn:["籫","繤","纂","纉","纘","缵"],nǚ:["籹","釹","钕"],"shā chǎo":["粆"],"kāng jīng":["粇"],fěn:["粉","黺"],cū:["粗","觕","麁","麄","麤"],"nián zhān":["粘"],"cè sè":["粣"],"zhōu yù":["粥"],"shēn sǎn":["糁"],"biān biǎn":["糄","萹"],miàn:["糆","面","靣","麪","麫","麵","麺"],"hú hū hù":["糊"],"gǔ gòu":["糓"],"mí méi":["糜"],"sǎn shēn":["糝","糣"],zāo:["糟","蹧","遭","醩"],"mì sī":["糸"],"jiū jiǔ":["糺"],"xì jì":["系","繫"],"zhēng zhěng":["糽"],"chà chǎ":["紁","衩"],"yuē yāo":["約","约"],"hóng gōng":["紅","红"],"hé gē":["紇","纥"],"wén wèn":["紋","纹"],fóu:["紑"],"jì jié jiè":["紒"],"pī pí bǐ":["紕","纰"],"jīn jìn":["紟"],"zhā zā":["紥","紮"],hā:["紦"],"fū fù":["紨"],"chōu chóu":["紬"],"lèi léi lěi":["累"],"bō bì":["紴"],"tiǎn zhěn":["紾"],"jiōng jiǒng":["絅"],"jié jiē":["結","结","节"],"guà kuā":["絓"],"bǎi mò":["絔"],"gēng huán":["絙"],"jié xié":["絜"],"quán shuān":["絟"],"gǎi ǎi":["絠"],"luò lào":["絡","络"],"bīng bēng pēng":["絣"],"gěi jǐ":["給","给"],"tóng tōng dòng":["絧"],"tiào diào dào":["絩"],"lěi lèi léi":["絫"],"gāi hài":["絯"],"chī zhǐ":["絺"],"wèn miǎn mán wàn":["絻"],"huán huàn wàn":["綄"],"qīn xiān":["綅"],"tì tí":["綈"],"yán xiàn":["綖"],"zōng zèng zòng":["綜"],"chēn lín":["綝"],"zhǔn zhùn":["綧"],"qiàn qīng zhēng":["綪"],"qìng qǐ":["綮"],"lún guān":["綸","纶"],"chuò chāo":["綽","绰"],"tián tǎn chān":["緂"],"lǜ lù":["緑","绿"],"ruǎn ruàn":["緛"],"jí qī":["緝"],"zhòng chóng":["緟","重"],"miáo máo":["緢"],"xiè yè":["緤"],huǎn:["緩","缓","㬊"],"gēng gèng":["緪","縆"],"tōu xū shū":["緰"],"zōng zòng":["緵","繌"],"yùn gǔn":["緷"],"guā wō":["緺"],"yùn yūn wēn":["緼","縕"],"bāng bàng":["縍"],"gǔ hú":["縎","鶻"],"cī cuò suǒ":["縒"],"cuī shuāi":["縗"],"róng rǒng ròng":["縙"],"zài zēng":["縡"],cài:["縩","菜","蔡"],"féng fèng":["縫"],"suō sù":["縮","缩"],"yǎn yǐn":["縯","酓"],"zòng zǒng":["縱","纵"],"zhuàn juàn":["縳"],"mò mù":["縸","莫"],"piǎo piāo":["縹","缥"],"fán pó":["繁"],"bēng bèng":["繃"],"móu miù miào liǎo":["繆"],"yáo yóu zhòu":["繇"],"zēng zèng":["繒","缯"],"jú jué":["繘"],"chuō chuò":["繛"],"zūn zǔn":["繜"],rào:["繞","绕","遶"],"chǎn chán":["繟"],"huì huí":["繢","缋","藱"],"qiāo sāo zǎo":["繰"],"jiǎo zhuó":["繳","缴"],"dàn tán chán":["繵"],nǒng:["繷"],"pú fú":["纀"],"yào lì":["纅"],"rǎng xiāng":["纕"],"lí sǎ xǐ lǐ":["纚"],"xiān qiàn":["纤"],"jīng jìng":["经"],"tí tì":["绨"],"bēng běng bèng":["绷"],"zōng zèng":["综"],"jī qī":["缉"],"wēn yùn yūn":["缊"],"fèng féng":["缝"],"shuāi cuī suī":["缞"],"miù móu liáo miào mù":["缪"],"qiāo sāo":["缲"],fǒu:["缶","缹","缻","雬","鴀"],"bà ba pí":["罢","罷"],"guà guǎi":["罫"],"yáng xiáng":["羊","羏"],"měi gāo":["羙"],"yì xī":["羛"],"qiǎng qiān":["羟"],"qiāng kòng":["羫"],"qián xián yán":["羬"],nóu:["羺"],"hóng gòng":["羾"],"pī bì pō":["翍"],"qú yù":["翑"],ké:["翗"],"qiào qiáo":["翘"],"zhái dí":["翟"],"dào zhōu":["翢"],"hóu qú":["翵"],shuǎ:["耍"],"ruǎn nuò":["耎"],"ér nài":["耏"],"zhuān duān":["耑"],"pá bà":["耙"],"chí sì":["耛"],"qù chú":["耝"],"lún lǔn":["耣"],"jí jiè":["耤"],"tāng tǎng":["耥"],pǎng:["耪","覫"],"zhá zé":["耫"],"yē yé":["耶"],"yún yíng":["耺"],"wà tuǐ zhuó":["聉"],"ér nǜ":["聏"],"tiē zhé":["聑"],"dǐ zhì":["聜"],qié:["聺"],"nǐ jiàn":["聻"],"lèi lē":["肋"],cào:["肏","襙","鄵","鼜"],"bó dí":["肑"],"xiào xiāo":["肖"],"dù dǔ":["肚"],chāi:["肞","釵","钗"],"hán qín hàn":["肣"],"pàng pán pàn":["肨","胖"],"zhūn chún":["肫"],āng:["肮","骯"],"yù yō":["育"],"pí bǐ bì":["肶"],"fèi bì":["胇"],"bèi bēi":["背"],"fèi zǐ":["胏"],"píng pēng":["胓","苹"],"fū fú zhǒu":["胕"],"shèng shēng":["胜"],kuà:["胯","跨","骻"],"gǎi hǎi":["胲"],"gē gé gā":["胳"],"néng nài":["能"],"guī kuì":["胿"],"mài mò":["脉"],"zāng zàng":["脏"],"jiǎo jué":["脚","角"],cuǒ:["脞"],"de te":["脦"],"zuī juān":["脧"],něi:["脮","腇","餒","馁","鮾","鯘"],"pú fǔ":["脯"],niào:["脲"],shuí:["脽"],guò:["腂","過","鐹"],"là xī":["腊"],"yān ā":["腌"],"gāo gào":["膏"],"lù biāo":["膔"],chuái:["膗"],"zhuān chuán chún zhuǎn":["膞"],chuài:["膪","踹"],"fán pán":["膰"],"wǔ hū":["膴"],"shān dàn":["膻"],tún:["臀","臋","蛌","豘","豚","軘","霕","飩","饨","魨","鲀","黗"],"bì bei":["臂"],"là gé":["臈"],"sào sāo":["臊"],nào:["臑","閙","闹","鬧"],"ní luán":["臡"],"qiān xián":["臤"],"guàng jiǒng":["臦"],"guǎng jiǒng":["臩"],"chòu xiù":["臭"],"mián biān":["臱"],"dié zhí":["臷"],"zhī jìn":["臸"],"shè shě":["舍"],pù:["舖","舗"],"bān bō pán":["般"],kuā:["舿"],"gèn gěn":["艮"],"sè shǎi":["色"],"fú bó":["艴"],"jiāo qiú":["艽"],"chāi chā":["芆"],"sháo què":["芍"],"hù xià":["芐"],"zì zǐ":["芓"],"huì hū":["芔"],"tún chūn":["芚"],"jiè gài":["芥"],"xù zhù":["芧"],"yuán yán":["芫"],"xīn xìn":["芯"],"lún huā":["芲"],"wù hū":["芴"],"gōu gǒu":["芶"],"mào máo":["芼"],"fèi fú":["芾"],"chán yín":["苂"],qiē:["苆"],"sū sù":["苏"],"tiáo sháo":["苕"],"lì jī":["苙"],"kē hē":["苛"],"jù qǔ":["苣"],"ruò rě":["若"],"zhù níng":["苧"],"pā bó":["苩"],xiú:["苬"],"zhǎ zuó":["苲"],"jū chá":["苴"],nié:["苶"],"shēng ruí":["苼"],"qié jiā":["茄"],"zǐ cí":["茈"],"qiàn xī":["茜"],chǎi:["茝"],"fá pèi":["茷"],ráo:["荛","蕘","襓","饒","饶"],"yíng xíng":["荥"],"qián xún":["荨","蕁"],"yìn yīn":["荫"],"hé hè":["荷"],"shā suō":["莎"],"péng fēng":["莑"],"shēn xīn":["莘"],"wǎn guān guǎn":["莞"],"yóu sù":["莤"],"shāo xiāo":["莦","蛸"],"làng liáng":["莨"],"piǎo fú":["莩"],"wèn wǎn miǎn":["莬"],"shì shí":["莳","蒔"],"tù tú":["莵"],"xiān liǎn":["莶","薟"],"wǎn yù":["菀"],"zōu chù":["菆"],"lù lǜ":["菉"],"jūn jùn":["菌"],"niè rěn":["菍"],"zī zì zāi":["菑"],"tú tù":["菟"],"jiē shà":["菨"],"qiáo zhǎo":["菬"],"tái zhī chí":["菭"],"fēi fěi":["菲","蜚"],"qín qīn jīn":["菳"],"zū jù":["菹","蒩"],"lǐn má":["菻"],"tián tiàn":["菾"],tiē:["萜","貼","贴"],"luò là lào luō":["落"],"zhù zhuó zhe":["著"],"shèn rèn":["葚"],"gě gé":["葛"],"jùn suǒ":["葰"],"kuì kuài":["蒉"],"rú ná":["蒘"],"méng mēng měng":["蒙"],"yuán huán":["蒝"],"xú shú":["蒣"],"xí xì":["蒵"],"mì míng":["蓂"],"sōu sǒu":["蓃"],"gài gě hé hài":["蓋"],"yǎo zhuó":["蓔"],"diào tiáo dí":["蓧"],"xū qiū fū":["蓲"],"zí jú":["蓻"],"liǎo lù":["蓼"],xu:["蓿"],"hàn hǎn":["蔊"],"màn wàn mán":["蔓"],"pó bò":["蔢"],"fān fán bō":["蕃"],"hóng hòng":["蕻"],"yù ào":["薁","隩"],"xí xiào":["薂"],"báo bó bò":["薄"],"cí zī":["薋"],"wàn luàn":["薍"],"kǎo hāo":["薧"],"yuǎn wěi":["薳"],"zhòu chóu":["薵"],"wō mái":["薶"],"xiāo hào":["藃"],"yù xù xū":["藇"],"jiè jí":["藉"],"diào zhuó":["藋"],"cáng zàng":["藏"],lǎ:["藞"],"chú zhū":["藸"],"pín píng":["蘋"],"gān hán":["虷"],"hóng jiàng":["虹"],"huī huǐ":["虺"],"xiā há":["虾"],"mǎ mà mā":["蚂"],"fāng bàng":["蚄"],"bàng bèng":["蚌"],"jué quē":["蚗"],"qín qián":["蚙"],"gōng zhōng":["蚣"],"fǔ fù":["蚥"],"dài dé":["蚮"],"gǒu qú xù":["蚼"],"bǒ pí":["蚾"],"shé yí":["蛇"],tiě:["蛈","鉄","銕","鐡","鐵","铁","驖"],"gé luò":["蛒"],"máng bàng":["蛖"],"yì xǔ":["蛡"],"há gé":["蛤"],"qiè ní":["蛪"],"é yǐ":["蛾"],"zhē zhé":["蜇"],"là zhà":["蜡"],suò:["蜶","逤"],"yóu qiú":["蝤"],"xiā hā":["蝦"],"xī qī":["螇"],"bī pí":["螕"],"nài něng":["螚"],"hé xiá":["螛"],"guì huǐ":["螝"],"mǎ mā mà":["螞"],"shì zhē":["螫"],"zhì dié":["螲"],"jiàn chán":["螹"],"ma má mò":["蟆"],"mǎng měng":["蟒"],"biē bié":["蟞"],"bēn fèi":["蟦"],"láo liáo":["蟧"],"yín xún":["蟫"],"lí lǐ":["蠡"],"xuè xiě":["血"],"xíng háng hàng héng":["行"],"shuāi cuī":["衰"],"tuó tuō":["袉"],"lǐng líng":["袊"],"bào páo pào":["袌"],"jù jiē":["袓"],"hè kè":["袔"],"yí yì":["袘","貤"],"nà jué":["袦"],"bèi pī":["被"],"chǐ nuǒ":["袲"],"chǐ qǐ duǒ nuǒ":["袳"],"jiá qiā jié":["袷"],"bó mò":["袹"],"guī guà":["袿"],"liè liě":["裂"],"chéng chěng":["裎"],"jiē gé":["裓"],"dāo chóu":["裯"],"shang cháng":["裳"],"yuān gǔn":["裷"],"yǎn ān":["裺"],"tì xī":["裼"],"fù fú":["褔"],"chǔ zhǔ":["褚"],"tuì tùn":["褪"],lǎi:["襰"],"yào yāo":["要"],"qín tán":["覃"],"jiàn xiàn":["見","见"],piǎn:["覑","諞","谝","貵","𡎚"],"piē miè":["覕"],"yíng yǐng":["覮"],"qù qū":["覰","覷","觑"],"jiàn biǎn":["覵"],"luó luǎn":["覶"],"zī zuǐ":["觜"],"huà xiè":["觟"],"jiě jiè xiè":["解","觧"],"xué hù":["觷"],"lì lù":["觻"],tǎo:["討","讨"],zhùn:["訰"],"zī zǐ":["訾"],"yí dài":["詒","诒"],xiòng:["詗","诇"],"diào tiǎo":["誂"],"yí chǐ chì":["誃"],"lǎng làng":["誏"],"ēi éi ěi èi xī":["誒","诶"],shuà:["誜"],"yǔ yù":["語","语","雨"],"shuō shuì yuè":["說","说"],"shuí shéi":["誰","谁"],"qū juè":["誳"],"chī lài":["誺"],"nì ná":["誽"],"diào tiáo":["調"],"pǐ bēi":["諀"],"jì jī":["諅"],"zé zuò zhǎ cuò":["諎"],"chù jí":["諔"],"háo xià":["諕"],"lùn lún":["論","论"],"shì dì":["諟"],"huà guā":["諣"],"xǐ shāi āi":["諰"],"nán nàn":["諵","難"],miù:["謬","谬"],zèn:["譖","谮"],"shí zhì":["識","识"],"juàn xuān":["讂"],"yí tuī":["讉"],zhán:["讝"],"xǔ hǔ":["许"],"xiáng yáng":["详"],"tiáo diào zhōu":["调"],"chén shèn":["谌"],"mí mèi":["谜"],"màn mán":["谩"],"gǔ yù":["谷"],"huō huò huá":["豁"],"zhì zhài":["豸"],"huān huán":["貆"],"kěn kūn":["貇"],"mò hé":["貈"],"mò hé háo":["貉"],"jù lóu":["貗"],"zé zhài":["責","责"],"dài tè":["貸"],"bì bēn":["賁"],"jiǎ gǔ jià":["賈"],"xiōng mín":["賯"],càng:["賶"],"zhuàn zuàn":["賺","赚"],"wàn zhuàn":["贃"],"gàn gòng zhuàng":["贛"],"yuán yùn":["贠"],"bēn bì":["贲"],"jiǎ gǔ":["贾"],zǒu:["走","赱","鯐"],"dié tú":["趃"],"jū qiè":["趄"],"qū cù":["趋","趨"],"jí jié":["趌"],"guā huó":["趏"],"què qì jí":["趞"],"tàng tāng":["趟"],"chuō zhuó":["趠"],"qù cù":["趣"],"yuè tì":["趯"],"bō bào":["趵"],"kuà wù":["趶"],"guì jué":["趹"],"fāng fàng páng":["趽"],"páo bà":["跁"],"qí qǐ":["跂"],"jiàn chén":["跈"],"pǎo páo":["跑"],"diǎn diē tiē":["跕"],"jū jù qiè":["跙"],bǒ:["跛"],"luò lì":["跞"],"dài duò duō chí":["跢"],zhuǎi:["跩"],"bèng pián":["跰"],"tiào táo":["跳"],"shū chōu":["跾"],"liàng liáng":["踉"],"tà tā":["踏"],chǎ:["蹅","鑔","镲"],"dí zhí":["蹢"],"dēng dèng":["蹬","鐙","镫"],cèng:["蹭"],"dūn cún":["蹲"],"juě jué":["蹶"],liāo:["蹽"],"xiè sǎ":["躠"],tǐ:["躰","軆","骵"],"yà zhá gá":["轧","軋"],"xìn xiàn":["軐"],"fàn guǐ":["軓"],"zhuàn zhuǎn":["転"],"zhóu zhòu":["軸","轴"],bú:["轐","醭","鳪"],"zhuǎn zhuàn zhuǎi":["转"],"zǎi zài":["载"],"niǎn zhǎn":["辗"],"biān bian":["边"],"dào biān":["辺"],"yǐ yí":["迆","迤","迱"],"guò guo guō":["过"],"wàng kuāng":["迋"],"hái huán":["还"],"zhè zhèi":["这"],"yuǎn yuàn":["远"],"zhì lì":["迣"],"zhù wǎng":["迬"],"zhuī duī":["追"],"shì kuò":["适"],tòu:["透"],"tōng tòng":["通"],guàng:["逛"],"dǎi dài":["逮"],"suì suí":["遂"],"tí dì":["遆"],"yí wèi":["遗"],"shì dí zhé":["適"],cà:["遪"],"huán hái":["還"],"lí chí":["邌"],"kàng háng":["邟"],"nà nèi nā":["那"],"xié yá yé yú xú":["邪"],"gāi hái":["郂"],"huán xún":["郇"],"chī xī":["郗"],hǎo:["郝"],"lì zhí":["郦"],"xiáo ǎo":["郩"],"dōu dū":["都"],liǎo:["曢","鄝","镽"],"zàn cuán cuó":["酂","酇"],"dīng dǐng":["酊"],"cù zuò":["酢"],"fā pō":["酦"],"shāi shī":["酾"],niàng:["酿","醸"],"qiú chōu":["醔"],"pō fā":["醗","醱"],"chǎn chěn":["醦"],"yàn liǎn xiān":["醶"],"niàng niáng":["釀"],"lǐ li":["里"],"lí xǐ xī":["釐"],"liǎo liào":["釕"],"dīng dìng":["釘","钉"],"qiǎo jiǎo":["釥"],"yú huá":["釪"],"huá wū":["釫"],"rì rèn jiàn":["釰","釼"],"dì dài":["釱"],"pī zhāo":["釽"],"yá yé":["釾"],"bǎ pá":["鈀","钯"],"tā tuó":["鉈","铊"],běi:["鉳"],"bǐng píng":["鉼"],"hā kē":["鉿","铪"],chòng:["銃","铳"],"xiǎng jiōng":["銄"],"yù sì":["銉"],"xù huì":["銊"],"rén rěn":["銋"],"shàn shuò":["銏"],"chì lì":["銐"],"xiǎn xǐ":["銑","铣"],"hóu xiàng":["銗"],"diào tiáo yáo":["銚"],"xiān kuò tiǎn guā":["銛","銽","铦"],"zhé niè":["銸"],"zhōng yōng":["銿"],"tōu tù dòu":["鋀"],"méi méng":["鋂"],"wàn jiǎn":["鋄","鎫"],"tǐng dìng":["鋌","铤"],"juān jiān cuān":["鋑"],"sī tuó":["鋖"],"juān xuān juàn":["鋗"],"wú huá wū":["鋘"],"zhuó chuò":["鋜"],"xíng xìng jīng":["鋞"],"jū jú":["鋦","锔"],"zuì niè":["鋷"],"yuān yuǎn wǎn wān":["鋺"],"gāng gàng":["鋼","钢"],zhuī:["錐","锥","騅","骓","鵻"],ā:["錒","锕"],"cuō chā":["鎈"],"suǒ sè":["鎍"],"yáo zú":["鎐"],"yè tà gé":["鎑"],"qiāng chēng":["鎗"],"gé lì":["鎘","镉","鬲"],"bī pī bì":["鎞"],"gǎo hào":["鎬"],"zú chuò":["鏃"],"xiū xiù":["鏅"],"shòu sōu":["鏉"],"dí dī":["鏑","镝"],"qiāo sǎn càn":["鏒"],"lù áo":["鏕"],"tāng táng":["鏜"],"jiàn zàn":["鏩"],"huì suì ruì":["鏸"],"qiǎng qiāng":["鏹","镪"],"sǎn xiàn sà":["鏾"],"jiǎn jiàn":["鐧","锏"],"dāng chēng":["鐺","铛"],"zuān zuàn":["鑽"],"sà xì":["钑"],"yào yuè":["钥"],"tǒu dǒu":["钭"],"zuàn zuān":["钻"],"qiān yán":["铅"],"pí pī":["铍"],"yáo diào tiáo":["铫"],"tāng tàng":["铴"],"pù pū":["铺"],"tán xiān":["锬"],"liù liú":["镏"],"hào gǎo":["镐"],"táng tāng":["镗"],"tán chán xín":["镡"],"huò shǎn":["閄"],"hàn bì":["閈","闬"],"kāng kàng":["閌","闶"],"xián jiàn jiān jiǎn":["閒"],"xiā xiǎ":["閕"],"xiǎ kě":["閜"],"biàn guān":["閞"],"hé gé":["閤","颌"],"hòng xiàng":["閧"],"sē xī":["閪"],"tíng tǐng":["閮"],"è yān":["閼","阏"],"hòng juǎn xiàng":["闂"],"bǎn pàn":["闆"],"dū shé":["闍","阇"],"què quē":["闕"],"tāng táng chāng":["闛"],"kàn hǎn":["闞","阚"],"xì sè tà":["闟"],"mēn mèn":["闷"],"quē què":["阙"],"yán diàn":["阽"],"ā ē":["阿"],"bēi pō pí":["陂"],"yàn yǎn":["隁"],"yú yáo shù":["隃"],"lóng lōng":["隆"],"duì zhuì":["隊"],"suí duò":["隋"],"gāi qí ái":["隑"],"huī duò":["隓","隳"],"wěi kuí":["隗"],"lì dài":["隸"],"zhuī cuī wéi":["隹"],"hè hú":["隺","鶮"],"jùn juàn":["隽","雋"],"nán nàn nuó":["难"],"què qiāo qiǎo":["雀"],"guàn huán":["雚"],"guī xī":["雟"],"sè xí":["雭"],án:["雸"],"wù méng":["雺"],tèng:["霯"],"lù lòu":["露"],mái:["霾"],"jìng liàng":["靚"],"gé jí":["革"],bǎ:["靶"],"yāng yàng":["鞅"],"gé tà sǎ":["鞈"],"biān yìng":["鞕"],"qiào shāo":["鞘"],"juān xuān":["鞙"],"shàng zhǎng":["鞝"],"pí bǐng bì bēi":["鞞"],la:["鞡"],"xiè dié":["鞢"],ēng:["鞥"],"móu mù":["鞪"],"bì bǐng":["鞸"],"mèi wà":["韎"],rǒu:["韖"],"shè xiè":["韘"],"yùn wēn":["韫"],"dùn dú":["頓","顿"],duǐ:["頧"],luō:["頱"],"bīn pín":["頻"],yóng:["顒","颙","鰫"],mān:["顢","颟"],"jǐng gěng":["颈"],"jié xié jiá":["颉"],"kē ké":["颏"],"pín bīn":["频"],"chàn zhàn":["颤"],"fēng fěng":["風","风"],"biāo diū":["颩"],"bá fú":["颰"],"sāo sōu":["颾"],"liù liáo":["飂"],"shí sì yì":["食"],"yǎng juàn":["飬"],"zhù tǒu":["飳"],"yí sì":["飴"],"zuò zé zhā":["飵"],tiè:["飻","餮"],"xiǎng náng":["饟"],"táng xíng":["饧"],"gē le":["饹"],"chā zha":["馇"],"náng nǎng":["馕"],"yūn wò":["馧"],"zhī shì":["馶"],"xìn jìn":["馸"],"kuài jué":["駃"],zǎng:["駔","驵"],"tái dài":["駘"],"xún xuān":["駨"],"liáng láng":["駺"],piàn:["騗","騙","骗","魸"],"dài tái":["骀"],"sāo sǎo":["骚"],"gǔ gū":["骨"],"bèi mó":["骳"],"xiāo qiāo":["骹"],"bǎng pǎng":["髈"],"bó jué":["髉"],"bì pǒ":["髲"],"máo méng":["髳"],"kuò yuè":["髺"],"bā bà":["魞","鲃"],"jì cǐ":["鮆"],"bó bà":["鮊"],"zhǎ zhà":["鮓","鲊"],"chóu dài":["鮘"],"luò gé":["鮥"],"guī xié wā kuí":["鮭"],"xiān xiǎn":["鮮","鲜"],"pū bū":["鯆"],"yì sī":["鯣"],"bà bó":["鲌"],"guī xié":["鲑"],"sāi xǐ":["鳃"],"niǎo diǎo":["鳥"],"diāo zhāo":["鳭"],"gān hàn yàn":["鳱"],"fū guī":["鳺"],"jiān qiān zhān":["鳽"],"hé jiè":["鶡"],"piān biǎn":["鶣"],"chuàn zhì":["鶨"],"cāng qiāng":["鶬"],"sǔn xùn":["鶽"],"biāo páo":["麃"],"zhù cū":["麆"],"jūn qún":["麇","麕"],chi:["麶"],"mó me":["麼"],"mó me ma":["麽"],"mí mǒ":["麿"],"dàn shèn":["黮"],"zhěn yān":["黰"],"dǎn zhǎn":["黵"],"miǎn mǐn měng":["黾"],hōu:["齁"],nàng:["齉"],"qí jì zī zhāi":["齐"],"yín kěn yǎn":["龂"],"yín kěn":["龈"],"gōng wò":["龏"],"guī jūn qiū":["龜","龟"],"kuí wā":["䖯"],lōu:["䁖"],"ōu qū":["𫭟"],"lóu lǘ":["𦝼"],"gǎ gā gá":["嘎"],"wā guà":["坬"],"zhǐ dǐ":["茋"],"gǒng hóng":["硔"],"yáo xiào":["滧"]},Rd=new wP;Object.keys(EI).forEach(e=>{const t=EI[e];for(let n of t)Rd.set(n,e)});const LI={这个:"zhè ge",成为:"chéng wéi",认为:"rèn wéi",作为:"zuò wéi",部分:"bù fen",要求:"yāo qiú",应该:"yīng gāi",增长:"zēng zhǎng",提供:"tí gōng",觉得:"jué de",任务:"rèn wu",那个:"nà ge",称为:"chēng wéi",为主:"wéi zhǔ",了解:"liǎo jiě",处理:"chǔ lǐ",皇上:"huáng shang",只要:"zhǐ yào",大量:"dà liàng",力量:"lì liàng",几乎:"jī hū",干部:"gàn bù",目的:"mù dì",行为:"xíng wéi",只见:"zhǐ jiàn",认识:"rèn shi",市长:"shì zhǎng",师父:"shī fu",调查:"diào chá",重新:"chóng xīn",分为:"fēn wéi",知识:"zhī shi",导弹:"dǎo dàn",质量:"zhì liàng",行款:"háng kuǎn",行列:"háng liè",行话:"háng huà",行业:"háng yè",隔行:"gé háng",在行:"zài háng",行家:"háng jia",内行:"nèi háng",外行:"wài háng",同行:"tóng háng",本行:"běn háng",行伍:"háng wǔ",洋行:"yáng háng",银行:"yín háng",商行:"shāng háng",支行:"zhī háng",总行:"zǒng háng",行情:"háng qíng",懂行:"dǒng háng",行规:"háng guī",行当:"háng dang",行货:"háng huò",太行:"tài háng",入行:"rù háng",中行:"zhōng háng",农行:"nóng háng",工行:"gōng háng",建行:"jiàn háng",各行:"gè háng",行号:"háng hào",行高:"háng gāo",行首:"háng shǒu",行尾:"háng wěi",行末:"háng mò",行长:"háng zhǎng",行距:"háng jù",换行:"huàn háng",行会:"háng huì",行辈:"háng bèi",行道:"háng dào",道行:"dào heng",参与:"cān yù",充分:"chōng fèn",尽管:"jǐn guǎn",生长:"shēng zhǎng",数量:"shù liàng",应当:"yīng dāng",院长:"yuàn zhǎng",强调:"qiáng diào",只能:"zhǐ néng",音乐:"yīn yuè",以为:"yǐ wéi",处于:"chǔ yú",部长:"bù zhǎng",蒙古:"měng gǔ",只有:"zhǐ yǒu",适当:"shì dàng",只好:"zhǐ hǎo",成长:"chéng zhǎng",高兴:"gāo xìng",不了:"bù liǎo",产量:"chǎn liàng",胖子:"pàng zi",显得:"xiǎn de",只是:"zhǐ shì",似的:"shì de",率领:"shuài lǐng",改为:"gǎi wéi",不禁:"bù jīn",成分:"chéng fèn",答应:"dā ying",少年:"shào nián",兴趣:"xìng qù",太监:"tài jian",休息:"xiū xi",校长:"xiào zhǎng",更新:"gēng xīn",合同:"hé tong",喝道:"hè dào",重庆:"chóng qìng",重建:"chóng jiàn",使得:"shǐ de",审查:"shěn chá",累计:"lěi jì",给予:"jǐ yǔ",极为:"jí wéi",冠军:"guàn jūn",仿佛:"fǎng fú",头发:"tóu fa",投降:"tóu xiáng",家长:"jiā zhǎng",仔细:"zǐ xì",要是:"yào shi",将领:"jiàng lǐng",含量:"hán liàng",更为:"gèng wéi",积累:"jī lěi",地处:"dì chǔ",县长:"xiàn zhǎng",少女:"shào nǚ",路上:"lù shang",只怕:"zhǐ pà",能量:"néng liàng",储量:"chǔ liàng",供应:"gōng yìng",挑战:"tiǎo zhàn",西藏:"xī zàng",记得:"jì de",总量:"zǒng liàng",当真:"dàng zhēn",将士:"jiàng shì",差别:"chā bié",较为:"jiào wéi",长老:"zhǎng lǎo",大夫:"dài fu",差异:"chā yì",懂得:"dǒng de",尽量:"jǐn liàng",模样:"mú yàng",的确:"dí què",为首:"wéi shǒu",便宜:"pián yi",更名:"gēng míng",石头:"shí tou",州长:"zhōu zhǎng",为止:"wéi zhǐ",漂亮:"piào liang",炮弹:"pào dàn",藏族:"zàng zú",角色:"jué sè",当作:"dàng zuò",尽快:"jǐn kuài",人为:"rén wéi",重复:"chóng fù",胡同:"hú tòng",差距:"chā jù",弟兄:"dì xiong",大将:"dà jiàng",睡觉:"shuì jiào",一觉:"yí jiào",团长:"tuán zhǎng",队长:"duì zhǎng",区长:"qū zhǎng",难得:"nán dé",丫头:"yā tou",会长:"huì zhǎng",弟弟:"dì di",王爷:"wáng ye",重量:"zhòng liàng",誉为:"yù wéi",家伙:"jiā huo",华山:"huà shān",椅子:"yǐ zi",流量:"liú liàng",长大:"zhǎng dà",勉强:"miǎn qiǎng",会计:"kuài jì",过分:"guò fèn",济南:"jǐ nán",调动:"diào dòng",燕京:"yān jīng",少将:"shào jiàng",中毒:"zhòng dú",晓得:"xiǎo de",变更:"biàn gēng",打更:"dǎ gēng",认得:"rèn de",苹果:"píng guǒ",念头:"niàn tou",挣扎:"zhēng zhá",三藏:"sān zàng",剥削:"bō xuē",丞相:"chéng xiàng",少量:"shǎo liàng",寻思:"xún si",夺得:"duó dé",干线:"gàn xiàn",呼吁:"hū yù",处罚:"chǔ fá",长官:"zhǎng guān",柏林:"bó lín",亲戚:"qīn qi",身分:"shēn fèn",胳膊:"gē bo",着手:"zhuó shǒu",炸弹:"zhà dàn",咳嗽:"ké sou",叶子:"yè zi",外长:"wài zhǎng",供给:"gōng jǐ",师长:"shī zhǎng",变量:"biàn liàng",应有:"yīng yǒu",下载:"xià zài",乐器:"yuè qì",间接:"jiàn jiē",底下:"dǐ xià",打扮:"dǎ bàn",子弹:"zǐ dàn",弹药:"dàn yào",热量:"rè liàng",削弱:"xuē ruò",骨干:"gǔ gàn",容量:"róng liàng",模糊:"mó hu",转动:"zhuàn dòng",称呼:"chēng hu",科长:"kē zhǎng",处置:"chǔ zhì",着重:"zhuó zhòng",着急:"zháo jí",强迫:"qiǎng pò",庭长:"tíng zhǎng",首相:"shǒu xiàng",喇嘛:"lǎ ma",镇长:"zhèn zhǎng",只管:"zhǐ guǎn",重重:"chóng chóng",免得:"miǎn de",着实:"zhuó shí",度假:"dù jià",真相:"zhēn xiàng",相貌:"xiàng mào",处分:"chǔ fèn",委屈:"wěi qu",为期:"wéi qī",伯伯:"bó bo",伯子:"bǎi zi",圈子:"quān zi",见识:"jiàn shi",笼罩:"lǒng zhào",与会:"yù huì",都督:"dū du",都市:"dū shì",成都:"chéng dū",首都:"shǒu dū",帝都:"dì dū",王都:"wáng dū",东都:"dōng dū",都护:"dū hù",都城:"dū chéng",建都:"jiàn dū",迁都:"qiān dū",故都:"gù dū",定都:"dìng dū",中都:"zhōng dū",六安:"lù ān",宰相:"zǎi xiàng",较量:"jiào liàng",对称:"duì chèn",总长:"zǒng zhǎng",相公:"xiàng gong",空白:"kòng bái",打量:"dǎ liang",水分:"shuǐ fèn",舌头:"shé tou",没收:"mò shōu",行李:"xíng li",判处:"pàn chǔ",散文:"sǎn wén",处境:"chǔ jìng",孙子:"sūn zi",拳头:"quán tou",打发:"dǎ fā",组长:"zǔ zhǎng",骨头:"gǔ tou",宁可:"nìng kě",更换:"gēng huàn",薄弱:"bó ruò",还原:"huán yuán",重修:"chóng xiū",重来:"chóng lái",只顾:"zhǐ gù",爱好:"ài hào",馒头:"mán tou",军长:"jūn zhǎng",首长:"shǒu zhǎng",厂长:"chǎng zhǎng",司长:"sī zhǎng",长子:"zhǎng zǐ",强劲:"qiáng jìng",恰当:"qià dàng",头儿:"tóu er",站长:"zhàn zhǎng",折腾:"zhē teng",相处:"xiāng chǔ",统率:"tǒng shuài",中将:"zhōng jiàng",命中:"mìng zhòng",名将:"míng jiàng",木头:"mù tou",动弹:"dòng tan",地壳:"dì qiào",干活:"gàn huó",少爷:"shào ye",水量:"shuǐ liàng",补给:"bǔ jǐ",尾巴:"wěi ba",来得:"lái de",好奇:"hào qí",钥匙:"yào shi",当做:"dàng zuò",沉着:"chén zhuó",哑巴:"yǎ ba",车子:"chē zi",上将:"shàng jiàng",恶心:"ě xīn",担子:"dàn zi",应届:"yīng jiè",主角:"zhǔ jué",运转:"yùn zhuǎn",兄长:"xiōng zhǎng",格式:"gé shì",正月:"zhēng yuè",营长:"yíng zhǎng",当成:"dàng chéng",女婿:"nǚ xu",咽喉:"yān hóu",重阳:"chóng yáng",化为:"huà wéi",吐蕃:"tǔ bō",钻进:"zuān jìn",乐队:"yuè duì",亮相:"liàng xiàng",被子:"bèi zi",舍得:"shě de",杉木:"shā mù",击中:"jī zhòng",排长:"pái zhǎng",假期:"jià qī",分量:"fèn liàng",数次:"shù cì",提防:"dī fáng",吆喝:"yāo he",查处:"chá chǔ",量子:"liàng zǐ",里头:"lǐ tou",调研:"diào yán",伺候:"cì hou",重申:"chóng shēn",枕头:"zhěn tou",拚命:"pīn mìng",社长:"shè zhǎng",归还:"guī huán",批量:"pī liàng",畜牧:"xù mù",点着:"diǎn zháo",甚为:"shèn wéi",小将:"xiǎo jiàng",着眼:"zhuó yǎn",处死:"chǔ sǐ",厌恶:"yàn wù",鼓乐:"gǔ yuè",树干:"shù gàn",秘鲁:"bì lǔ",大方:"dà fāng",外头:"wài tou",班长:"bān zhǎng",星宿:"xīng xiù",宁愿:"nìng yuàn",钦差:"qīn chāi",为数:"wéi shù",勾当:"gòu dàng",削减:"xuē jiǎn",间谍:"jiàn dié",埋怨:"mán yuàn",结实:"jiē shi",计量:"jì liáng",淹没:"yān mò",村长:"cūn zhǎng",连长:"lián zhǎng",自给:"zì jǐ",武将:"wǔ jiàng",温差:"wēn chā",直奔:"zhí bèn",供求:"gōng qiú",剂量:"jì liàng",道长:"dào zhǎng",泄露:"xiè lòu",王八:"wáng ba",切割:"qiē gē",间隔:"jiàn gé",一晃:"yì huǎng",长假:"cháng jià",令狐:"líng hú",为害:"wéi hài",句子:"jù zi",偿还:"cháng huán",疙瘩:"gē da",燕山:"yān shān",堵塞:"dǔ sè",夺冠:"duó guàn",扎实:"zhā shi",电荷:"diàn hè",看守:"kān shǒu",复辟:"fù bì",郁闷:"yù mèn",尽早:"jǐn zǎo",切断:"qiē duàn",指头:"zhǐ tou",为生:"wéi shēng",畜生:"chù sheng",切除:"qiē chú",着力:"zhuó lì",着想:"zhuó xiǎng",级差:"jí chā",投奔:"tóu bèn",棍子:"gùn zi",含糊:"hán hu",少妇:"shào fù",兴致:"xìng zhì",纳闷:"nà mèn",干流:"gàn liú",卷起:"juǎn qǐ",扇子:"shàn zi",更改:"gēng gǎi",笼络:"lǒng luò",喇叭:"lǎ ba",载荷:"zài hè",妥当:"tuǒ dàng",为难:"wéi nán",着陆:"zhuó lù",燕子:"yàn zi",干吗:"gàn má",白发:"bái fà",总得:"zǒng děi",夹击:"jiā jī",曝光:"bào guāng",曲调:"qǔ diào",相机:"xiàng jī",叫化:"jiào huà",角逐:"jué zhú",啊哟:"ā yō",载重:"zài zhòng",长辈:"zhǎng bèi",出差:"chū chāi",垛口:"duǒ kǒu",撇开:"piē kāi",厅长:"tīng zhǎng",组分:"zǔ fèn",误差:"wù chā",家当:"jiā dàng",传记:"zhuàn jì",个子:"gè zi",铺设:"pū shè",干事:"gàn shì",杆菌:"gǎn jūn",定量:"dìng liàng",运载:"yùn zài",会儿:"huì er",酋长:"qiú zhǎng",重返:"chóng fǎn",差额:"chā é",露面:"lòu miàn",钻研:"zuān yán",大城:"dài chéng",上当:"shàng dàng",销量:"xiāo liàng",作坊:"zuō fang",照相:"zhào xiàng",哎呀:"āi yā",调集:"diào jí",看中:"kàn zhòng",议长:"yì zhǎng",风筝:"fēng zheng",辟邪:"bì xié",空隙:"kòng xì",更迭:"gēng dié",偏差:"piān chā",声调:"shēng diào",适量:"shì liàng",屯子:"tún zi",无量:"wú liàng",空地:"kòng dì",调度:"diào dù",散射:"sǎn shè",创伤:"chuāng shāng",海参:"hǎi shēn",满载:"mǎn zài",重叠:"chóng dié",落差:"luò chā",单调:"dān diào",老将:"lǎo jiàng",人参:"rén shēn",间断:"jiàn duàn",重现:"chóng xiàn",夹杂:"jiā zá",调用:"diào yòng",萝卜:"luó bo",附着:"fù zhuó",应声:"yìng shēng",主将:"zhǔ jiàng",罪过:"zuì guo",咀嚼:"jǔ jué",为政:"wéi zhèng",过量:"guò liàng",乐曲:"yuè qǔ",负荷:"fù hè",枪弹:"qiāng dàn",悄然:"qiǎo rán",处方:"chǔ fāng",悄声:"qiǎo shēng",曲子:"qǔ zi",情调:"qíng diào",挑衅:"tiǎo xìn",代为:"dài wéi",了结:"liǎo jié",打中:"dǎ zhòng",酒吧:"jiǔ bā",懒得:"lǎn de",增量:"zēng liàng",衣着:"yī zhuó",部将:"bù jiàng",要塞:"yào sài",茶几:"chá jī",杠杆:"gàng gǎn",出没:"chū mò",鲜有:"xiǎn yǒu",间隙:"jiàn xì",重担:"zhòng dàn",重演:"chóng yǎn",重试:"chóng shì",应酬:"yìng chou",只当:"zhǐ dāng",毋宁:"wú nìng",包扎:"bāo zā",前头:"qián tou",卷烟:"juǎn yān",非得:"fēi děi",弹道:"dàn dào",杆子:"gān zi",门将:"mén jiàng",后头:"hòu tou",喝彩:"hè cǎi",暖和:"nuǎn huo",累积:"lěi jī",调遣:"diào qiǎn",倔强:"jué jiàng",宝藏:"bǎo zàng",丧事:"sāng shì",约莫:"yuē mo",纤夫:"qiàn fū",更替:"gēng tì",装载:"zhuāng zài",背包:"bēi bāo",帖子:"tiě zi",松散:"sōng sǎn",呼喝:"hū hè",可恶:"kě wù",自转:"zì zhuàn",供电:"gōng diàn",反省:"fǎn xǐng",坦率:"tǎn shuài",苏打:"sū dá",本分:"běn fèn",落得:"luò de",鄙薄:"bǐ bó",相间:"xiāng jiàn",单薄:"dān bó",混蛋:"hún dàn",贞观:"zhēn guān",附和:"fù hè",能耐:"néng nài",吓唬:"xià hu",未了:"wèi liǎo",引着:"yǐn zháo",抽调:"chōu diào",沙子:"shā zi",席卷:"xí juǎn",标的:"biāo dì",别扭:"biè niu",思量:"sī liang",喝采:"hè cǎi",论语:"lún yǔ",盖子:"gài zi",分外:"fèn wài",弄堂:"lòng táng",乐舞:"yuè wǔ",雨量:"yǔ liàng",毛发:"máo fà",差遣:"chāi qiǎn",背负:"bēi fù",转速:"zhuàn sù",声乐:"shēng yuè",夹攻:"jiā gōng",供水:"gōng shuǐ",主干:"zhǔ gàn",惩处:"chéng chǔ",长相:"zhǎng xiàng",公差:"gōng chāi",榴弹:"liú dàn",省得:"shěng de",条子:"tiáo zi",重围:"chóng wéi",阻塞:"zǔ sè",劲风:"jìng fēng",纠葛:"jiū gé",颠簸:"diān bǒ",点中:"diǎn zhòng",重创:"zhòng chuāng",姥姥:"lǎo lao",迷糊:"mí hu",公家:"gōng jia",几率:"jī lǜ",苦闷:"kǔ mèn",度量:"dù liàng",差错:"chā cuò",暑假:"shǔ jià",参差:"cēn cī",搭载:"dā zài",助长:"zhù zhǎng",相称:"xiāng chèn",红晕:"hóng yùn",舍命:"shě mìng",喜好:"xǐ hào",列传:"liè zhuàn",劲敌:"jìng dí",蛤蟆:"há ma",请假:"qǐng jià",钉子:"dīng zi",沉没:"chén mò",高丽:"gāo lí",休假:"xiū jià",无为:"wú wéi",巴结:"bā jie",了得:"liǎo dé",变相:"biàn xiàng",核弹:"hé dàn",亲家:"qìng jia",承载:"chéng zài",喝问:"hè wèn",还击:"huán jī",交还:"jiāo huán",将令:"jiàng lìng",单于:"chán yú",空缺:"kòng quē",绿林:"lù lín",胆量:"dǎn liàng",执着:"zhí zhuó",低调:"dī diào",闭塞:"bì sè",轻薄:"qīng bó",得当:"dé dàng",占卜:"zhān bǔ",扫帚:"sào zhou",龟兹:"qiū cí",年长:"nián zhǎng",外传:"wài zhuàn",头子:"tóu zi",裁缝:"cái feng",礼乐:"lǐ yuè",血泊:"xuè pō",散乱:"sǎn luàn",动量:"dòng liàng",倒腾:"dǎo teng",取舍:"qǔ shě",咱家:"zán jiā",长发:"cháng fà",爪哇:"zhǎo wā",弹壳:"dàn ké",省悟:"xǐng wù",嚷嚷:"rāng rang",连累:"lián lèi",应得:"yīng dé",族长:"zú zhǎng",柜子:"guì zi",擂鼓:"léi gǔ",眩晕:"xuàn yùn",调配:"tiáo pèi",躯干:"qū gàn",差役:"chāi yì",坎坷:"kǎn kě",少儿:"shào ér",乐团:"yuè tuán",养分:"yǎng fèn",退还:"tuì huán",格调:"gé diào",语调:"yǔ diào",音调:"yīn diào",乐府:"yuè fǔ",古朴:"gǔ pǔ",打点:"dǎ diǎn",差使:"chāi shǐ",匀称:"yún chèn",瘦削:"shòu xuē",膏药:"gāo yao",吞没:"tūn mò",调任:"diào rèn",散居:"sǎn jū",上头:"shàng tóu",风靡:"fēng mǐ",放假:"fàng jià",估量:"gū liang",失当:"shī dàng",中弹:"zhòng dàn",妄为:"wàng wéi",长者:"zhǎng zhě",起哄:"qǐ hòng",末了:"mò liǎo",相声:"xiàng sheng",校正:"jiào zhèng",劝降:"quàn xiáng",矢量:"shǐ liàng",沉闷:"chén mèn",给与:"jǐ yǔ",解法:"jiě fǎ",塞外:"sài wài",将校:"jiàng xiào",嗜好:"shì hào",没落:"mò luò",朴刀:"pō dāo",片子:"piān zi",切削:"qiē xiāo",弹丸:"dàn wán",稀薄:"xī bó",亏得:"kuī dé",间歇:"jiàn xiē",翘首:"qiáo shǒu",色调:"sè diào",处决:"chǔ jué",表率:"biǎo shuài",尺子:"chǐ zi",招降:"zhāo xiáng",称职:"chèn zhí",斗篷:"dǒu peng",铺子:"pù zi",底子:"dǐ zi",负载:"fù zài",干警:"gàn jǐng",倒数:"dào shǔ",将官:"jiàng guān",锄头:"chú tou",归降:"guī xiáng",疟疾:"nüè ji",唠叨:"láo dao",限量:"xiàn liàng",屏息:"bǐng xī",重逢:"chóng féng",器乐:"qì yuè",氢弹:"qīng dàn",脖颈:"bó gěng",妃子:"fēi zi",处事:"chǔ shì",参量:"cān liàng",轻率:"qīng shuài",缥缈:"piāo miǎo",中奖:"zhòng jiǎng",才干:"cái gàn",施舍:"shī shě",卷子:"juàn zi",游说:"yóu shuì",巷子:"xiàng zi",膀胱:"páng guāng",切勿:"qiè wù",看管:"kān guǎn",风头:"fēng tou",精干:"jīng gàn",高差:"gāo chā",恐吓:"kǒng hè",扁担:"biǎn dàn",给养:"jǐ yǎng",格子:"gé zi",供需:"gōng xū",反差:"fǎn chā",飞弹:"fēi dàn",微薄:"wēi bó",发型:"fà xíng",即兴:"jí xìng",攒动:"cuán dòng",间或:"jiàn huò",浅薄:"qiǎn bó",乐章:"yuè zhāng",顺差:"shùn chā",调子:"diào zi",相位:"xiàng wèi",转子:"zhuàn zǐ",劲旅:"jìng lǚ",咔嚓:"kā chā",了事:"liǎo shì",转悠:"zhuàn you",当铺:"dàng pù",爪子:"zhuǎ zi",单子:"dān zi",好战:"hào zhàn",燕麦:"yàn mài",只许:"zhǐ xǔ",干练:"gàn liàn",女将:"nǚ jiàng",酒量:"jiǔ liàng",划船:"huá chuán",伎俩:"jì liǎng",挑拨:"tiǎo bō",少校:"shào xiào",着落:"zhuó luò",憎恶:"zēng wù",刻薄:"kè bó",要挟:"yāo xié",用处:"yòng chu",还手:"huán shǒu",模具:"mú jù",执著:"zhí zhuó",喝令:"hè lìng",保长:"bǎo zhǎng",吸着:"xī zhe",症结:"zhēng jié",公转:"gōng zhuàn",校勘:"jiào kān",重提:"chóng tí",扫兴:"sǎo xìng",铺盖:"pū gài",长史:"zhǎng shǐ",差价:"chā jià",压根:"yà gēn",怔住:"zhèng zhù",应允:"yīng yǔn",切入:"qiē rù",战将:"zhàn jiàng",年少:"nián shào",舍身:"shě shēn",执拗:"zhí niù",处世:"chǔ shì",中风:"zhòng fēng",等量:"děng liàng",放量:"fàng liàng",腔调:"qiāng diào",老少:"lǎo shào",没入:"mò rù",瓜葛:"guā gé",将帅:"jiàng shuài",车载:"chē zài",窝囊:"wō nang",长进:"zhǎng jìn",可汗:"kè hán",并州:"bīng zhōu",供销:"gōng xiāo",切片:"qiē piàn",差事:"chāi shì",知会:"zhī hui",鹰爪:"yīng zhǎo",处女:"chǔ nǚ",切磋:"qiē cuō",日头:"rì tou",押解:"yā jiè",滋长:"zī zhǎng",道观:"dào guàn",脚色:"jué sè",当量:"dāng liàng",婆家:"pó jia",缘分:"yuán fèn",空闲:"kòng xián",好色:"hào sè",怒喝:"nù hè",笼统:"lǒng tǒng",边塞:"biān sài",何曾:"hé céng",重合:"chóng hé",零散:"líng sǎn",轰隆:"hōng lōng",化子:"huà zi",内蒙:"nèi měng",数落:"shǔ luò",逆差:"nì chā",牟利:"móu lì",栅栏:"zhà lan",中标:"zhòng biāo",调档:"diào dàng",佝偻:"gōu lóu",场子:"chǎng zi",甲壳:"jiǎ qiào",重温:"chóng wēn",炮制:"páo zhì",返还:"fǎn huán",自传:"zì zhuàn",高调:"gāo diào",殷红:"yān hóng",固着:"gù zhuó",强求:"qiǎng qiú",本相:"běn xiàng",骄横:"jiāo hèng",草率:"cǎo shuài",气闷:"qì mèn",着色:"zhuó sè",宁肯:"nìng kěn",兴头:"xìng tou",拘泥:"jū nì",夹角:"jiā jiǎo",发髻:"fà jì",猛将:"měng jiàng",约摸:"yuē mo",拖累:"tuō lěi",呢绒:"ní róng",钻探:"zuān tàn",夹层:"jiā céng",落魄:"luò pò",巷道:"hàng dào",运量:"yùn liàng",解闷:"jiě mèn",空儿:"kòng er",估摸:"gū mo",好客:"hào kè",钻孔:"zuān kǒng",糊弄:"hù nòng",荥阳:"xíng yáng",烦闷:"fán mèn",仓卒:"cāng cù",分叉:"fēn chà",厂子:"chǎng zi",小调:"xiǎo diào",少阳:"shào yáng",受降:"shòu xiáng",染坊:"rǎn fáng",胳臂:"gē bei",将门:"jiàng mén",模板:"mú bǎn",配给:"pèi jǐ",为伍:"wéi wǔ",跟头:"gēn tou",划算:"huá suàn",累赘:"léi zhui",哄笑:"hōng xiào",晕眩:"yūn xuàn",干掉:"gàn diào",缝制:"féng zhì",难处:"nán chù",着意:"zhuó yì",蛮横:"mán hèng",奇数:"jī shù",短发:"duǎn fà",生还:"shēng huán",还清:"huán qīng",看护:"kān hù",直率:"zhí shuài",奏乐:"zòu yuè",载客:"zài kè",专横:"zhuān hèng",湮没:"yān mò",空格:"kòng gé",铺垫:"pū diàn",良将:"liáng jiàng",哗啦:"huā lā",散漫:"sǎn màn",脱发:"tuō fà",送还:"sòng huán",埋没:"mái mò",累及:"lěi jí",薄雾:"bó wù",调离:"diào lí",舌苔:"shé tāi",机长:"jī zhǎng",栓塞:"shuān sè",配角:"pèi jué",切口:"qiē kǒu",创口:"chuāng kǒu",哈欠:"hā qian",实弹:"shí dàn",铺平:"pū píng",哈达:"hǎ dá",懒散:"lǎn sǎn",实干:"shí gàn",填空:"tián kòng",刁钻:"diāo zuān",乐师:"yuè shī",量变:"liàng biàn",诱降:"yòu xiáng",搪塞:"táng sè",征调:"zhēng diào",夹道:"jiā dào",干咳:"gān ké",止咳:"zhǐ ké",乐工:"yuè gōng",划过:"huá guò",着火:"zháo huǒ",更正:"gēng zhèng",给付:"jǐ fù",空子:"kòng zi",哪吒:"né zhā",正着:"zhèng zháo",刷子:"shuā zi",丧葬:"sāng zàng",夹带:"jiā dài",安分:"ān fèn",中意:"zhòng yì",长孙:"zhǎng sūn",校订:"jiào dìng",卷曲:"juǎn qū",载运:"zài yùn",投弹:"tóu dàn",柞蚕:"zuò cán",份量:"fèn liàng",调换:"diào huàn",了然:"liǎo rán",咧嘴:"liě zuǐ",典当:"diǎn dàng",寒假:"hán jià",长兄:"zhǎng xiōng",给水:"jǐ shuǐ",须发:"xū fà",枝干:"zhī gàn",属相:"shǔ xiàng",哄抢:"hōng qiǎng",刻划:"kè huà",塞子:"sāi zi",单干:"dān gàn",还乡:"huán xiāng",兆头:"zhào tou",寺观:"sì guàn",督率:"dū shuài",啊哈:"ā ha",割舍:"gē shě",抹布:"mā bù",好恶:"hào wù",下处:"xià chǔ",消长:"xiāo zhǎng",离间:"lí jiàn",准头:"zhǔn tou",校对:"jiào duì",什物:"shí wù",番禺:"pān yú",佛爷:"fó ye",吗啡:"mǎ fēi",盐分:"yán fèn",虎将:"hǔ jiàng",薄荷:"bò he",独处:"dú chǔ",空位:"kòng wèi",铺路:"pū lù",乌拉:"wū lā",调回:"diào huí",来头:"lái tou",闲散:"xián sǎn",胶卷:"jiāo juǎn",冒失:"mào shi",干劲:"gàn jìn",弦乐:"xián yuè",相国:"xiàng guó",丹参:"dān shēn",助兴:"zhù xìng",铺开:"pū kāi",次长:"cì zhǎng",发卡:"fà qiǎ",拮据:"jié jū",刹车:"shā chē",生发:"shēng fà",重播:"chóng bō",缝合:"féng hé",音量:"yīn liàng",少尉:"shào wèi",冲压:"chòng yā",苍劲:"cāng jìng",厚薄:"hòu báo",威吓:"wēi hè",外相:"wài xiàng",呼号:"hū háo",着迷:"zháo mí",挑担:"tiāo dàn",纹路:"wén lù",还俗:"huán sú",强横:"qiáng hèng",着数:"zhāo shù",降顺:"xiáng shùn",挑明:"tiǎo míng",眯缝:"mī feng",分内:"fèn nèi",更衣:"gēng yī",软和:"ruǎn huo",尽兴:"jìn xìng",号子:"hào zi",爪牙:"zhǎo yá",败将:"bài jiàng",猜中:"cāi zhòng",结扎:"jié zā",没空:"méi kòng",夹缝:"jiā fèng",拾掇:"shí duo",掺和:"chān huo",簸箕:"bò ji",电量:"diàn liàng",荷载:"hè zǎi",调式:"diào shì",处身:"chǔ shēn",打手:"dǎ shǒu",弹弓:"dàn gōng",横蛮:"hèng mán",能干:"néng gàn",校点:"jiào diǎn",加载:"jiā zài",干校:"gàn xiào",哄传:"hōng chuán",校注:"jiào zhù",淤塞:"yū sè",马扎:"mǎ zhá",月氏:"yuè zhī",高干:"gāo gàn",经传:"jīng zhuàn",曾孙:"zēng sūn",好斗:"hào dòu",关卡:"guān qiǎ",逃奔:"táo bèn",磨蹭:"mó ceng",牟取:"móu qǔ",颤栗:"zhàn lì",蚂蚱:"mà zha",撮合:"cuō he",趔趄:"liè qie",摔打:"shuāi dǎ",台子:"tái zi",分得:"fēn de",粘着:"nián zhuó",采邑:"cài yì",散装:"sǎn zhuāng",婀娜:"ē nuó",兴味:"xìng wèi",行头:"xíng tou",气量:"qì liàng",调运:"diào yùn",处治:"chǔ zhì",乐音:"yuè yīn",充塞:"chōng sè",恫吓:"dòng hè",论调:"lùn diào",相中:"xiāng zhòng",民乐:"mín yuè",炮仗:"pào zhang",丧服:"sāng fú",骁将:"xiāo jiàng",量刑:"liàng xíng",缝补:"féng bǔ",财会:"cái kuài",大干:"dà gàn",历数:"lì shǔ",校场:"jiào chǎng",塞北:"sài běi",识相:"shí xiàng",辱没:"rǔ mò",鲜亮:"xiān liàng",语塞:"yǔ sè",露脸:"lòu liǎn",凉快:"liáng kuai",腰杆:"yāo gǎn",溜达:"liū da",嘎嘎:"gā gā",公干:"gōng gàn",桔梗:"jié gěng",挑逗:"tiǎo dòu",看门:"kān mén",乐歌:"yuè gē",拓片:"tà piàn",挑动:"tiǎo dòng",准将:"zhǔn jiàng",遒劲:"qiú jìng",磨坊:"mò fáng",逶迤:"wēi yí",搅和:"jiǎo huo",摩挲:"mó suō",作弄:"zuò nòng",苗头:"miáo tou",打颤:"dǎ zhàn",大藏:"dà zàng",畜牲:"chù shēng",勾搭:"gōu da",树荫:"shù yīn",树杈:"shù chà",铁杆:"tiě gǎn",将相:"jiàng xiàng",份子:"fèn zi",视差:"shì chā",绿荫:"lǜ yīn",枪杆:"qiāng gǎn",缝纫:"féng rèn",愁闷:"chóu mèn",点将:"diǎn jiàng",华佗:"huà tuó",劲射:"jìng shè",箱笼:"xiāng lǒng",终了:"zhōng liǎo",鬓发:"bìn fà",结巴:"jiē ba",苦干:"kǔ gàn",看家:"kān jiā",正旦:"zhēng dàn",中肯:"zhòng kěn",厦门:"xià mén",东莞:"dōng guǎn",食量:"shí liàng",宫调:"gōng diào",间作:"jiàn zuò",弹片:"dàn piàn",差池:"chā chí",漂白:"piǎo bái",杠子:"gàng zi",调处:"tiáo chǔ",好动:"hào dòng",转炉:"zhuàn lú",屏气:"bǐng qì",夹板:"jiā bǎn",哀乐:"āi yuè",干道:"gàn dào",苦处:"kǔ chù",劈柴:"pǐ chái",长势:"zhǎng shì",天华:"tiān huá",共处:"gòng chǔ",校验:"jiào yàn",出塞:"chū sài",磨盘:"mò pán",萎靡:"wěi mǐ",奔丧:"bēn sāng",唱和:"chàng hè",大调:"dà diào",非分:"fēi fèn",钻营:"zuān yíng",夹子:"jiā zi",超载:"chāo zài",更始:"gēng shǐ",铃铛:"líng dang",披散:"pī sàn",发还:"fā huán",转轮:"zhuàn lún",横财:"hèng cái",泡桐:"pāo tóng",抛撒:"pāo sǎ",天呀:"tiān yā",糊糊:"hū hu",躯壳:"qū qiào",通量:"tōng liàng",奉还:"fèng huán",午觉:"wǔ jiào",闷棍:"mèn gùn",浪头:"làng tou",砚台:"yàn tái",油坊:"yóu fáng",学长:"xué zhǎng",过载:"guò zài",笔调:"bǐ diào",衣被:"yī bèi",畜产:"xù chǎn",调阅:"diào yuè",蛮干:"mán gàn",曾祖:"zēng zǔ",提干:"tí gàn",变调:"biàn diào",覆没:"fù mò",模子:"mú zi",乐律:"yuè lǜ",称心:"chèn xīn",木杆:"mù gān",重印:"chóng yìn",自省:"zì xǐng",提调:"tí diào",看相:"kàn xiàng",芋头:"yù tou",下切:"xià qiē",塞上:"sài shàng",铺张:"pū zhāng",藤蔓:"téng wàn",薄幸:"bó xìng",解数:"xiè shù",褪去:"tuì qù",霰弹:"xiàn dàn",柚木:"yóu mù",痕量:"hén liàng",雅乐:"yǎ yuè",号哭:"háo kū",诈降:"zhà xiáng",猪圈:"zhū juàn",咋舌:"zé shé",铣床:"xǐ chuáng",防弹:"fáng dàn",健将:"jiàn jiàng",丽水:"lí shuǐ",削发:"xuē fà",空当:"kòng dāng",多相:"duō xiàng",鲜见:"xiǎn jiàn",划桨:"huá jiǎng",载波:"zài bō",跳蚤:"tiào zao",俏皮:"qiào pí",吧嗒:"bā dā",结发:"jié fà",了断:"liǎo duàn",同调:"tóng diào",石磨:"shí mò",时差:"shí chā",鼻塞:"bí sè",挑子:"tiāo zi",推磨:"tuī mò",武侯:"wǔ hóu",抹煞:"mǒ shā",调转:"diào zhuǎn",籍没:"jí mò",还债:"huán zhài",调演:"diào yǎn",分划:"fēn huá",奇偶:"jī ǒu",断喝:"duàn hè",闷雷:"mèn léi",狼藉:"láng jí",饭量:"fàn liàng",还礼:"huán lǐ",转调:"zhuǎn diào",星相:"xīng xiàng",手相:"shǒu xiàng",配乐:"pèi yuè",盖头:"gài tou",连杆:"lián gǎn",簿记:"bù jì",刀把:"dāo bà",量词:"liàng cí",名角:"míng jué",步调:"bù diào",校本:"jiào běn",账簿:"zhàng bù",隽永:"juàn yǒng",稍为:"shāo wéi",易传:"yì zhuàn",乐谱:"yuè pǔ",牵累:"qiān lěi",答理:"dā li",喝斥:"hè chì",吟哦:"yín é",干渠:"gàn qú",海量:"hǎi liàng",精当:"jīng dàng",着床:"zhuó chuáng",月相:"yuè xiàng",庶几:"shù jī",宫观:"gōng guàn",论处:"lùn chǔ",征辟:"zhēng bì",厚朴:"hòu pò",介壳:"jiè qiào",吭哧:"kēng chī",咯血:"kǎ xiě",铺陈:"pū chén",重生:"chóng shēng",乐理:"yuè lǐ",哀号:"āi háo",藏历:"zàng lì",刚劲:"gāng jìng",削平:"xuē píng",浓荫:"nóng yīn",城垛:"chéng duǒ",当差:"dāng chāi",正传:"zhèng zhuàn",并处:"bìng chǔ",创面:"chuāng miàn",旦角:"dàn jué",薄礼:"bó lǐ",晃荡:"huàng dang",臊子:"sào zi",家什:"jiā shí",闷头:"mēn tóu",美发:"měi fà",度数:"dù shu",着凉:"zháo liáng",闯将:"chuǎng jiàng",几案:"jī àn",姘头:"pīn tou",差数:"chā shù",散碎:"sǎn suì",壅塞:"yōng sè",寒颤:"hán zhàn",牵强:"qiān qiǎng",无间:"wú jiàn",轮转:"lún zhuàn",号叫:"háo jiào",铺排:"pū pái",降伏:"xiáng fú",轧钢:"zhá gāng",东阿:"dōng ē",病假:"bìng jià",累加:"lěi jiā",梗塞:"gěng sè",弹夹:"dàn jiā",钻心:"zuān xīn",晃眼:"huǎng yǎn",魔爪:"mó zhǎo",标量:"biāo liàng",憋闷:"biē mèn",猜度:"cāi duó",处士:"chǔ shì",官差:"guān chāi",讨还:"tǎo huán",长门:"cháng mén",馏分:"liú fēn",里弄:"lǐ lòng",色相:"sè xiàng",雅兴:"yǎ xìng",角力:"jué lì",弹坑:"dàn kēng",枝杈:"zhī chà",夹具:"jiā jù",处刑:"chǔ xíng",悍将:"hàn jiàng",好学:"hào xué",好好:"hǎo hǎo",银发:"yín fà",扫把:"sào bǎ",法相:"fǎ xiàng",贵干:"guì gàn",供气:"gōng qì",空余:"kòng yú",捆扎:"kǔn zā",瘠薄:"jí bó",浆糊:"jiàng hu",嘎吱:"gā zhī",调令:"diào lìng",法帖:"fǎ tiè",淋病:"lìn bìng",调派:"diào pài",转盘:"zhuàn pán",供稿:"gōng gǎo",差官:"chāi guān",忧闷:"yōu mèn",教长:"jiào zhǎng",重唱:"chóng chàng",酒兴:"jiǔ xìng",乐坛:"yuè tán",花呢:"huā ní",叱喝:"chì hè",膀臂:"bǎng bì",得空:"dé kòng",转圈:"zhuàn quān",横暴:"hèng bào",哄抬:"hōng tái",引吭:"yǐn háng",载货:"zài huò",中计:"zhòng jì",官长:"guān zhǎng",相面:"xiàng miàn",看头:"kàn tou",盼头:"pàn tou",意兴:"yì xìng",军乐:"jūn yuè",累次:"lěi cì",骨嘟:"gǔ dū",燕赵:"yān zhào",报丧:"bào sāng",弥撒:"mí sa",挨斗:"ái dòu",扁舟:"piān zhōu",丑角:"chǒu jué",吊丧:"diào sāng",强将:"qiáng jiàng",重奏:"chóng zòu",发辫:"fà biàn",着魔:"zháo mó",着法:"zhāo fǎ",盛放:"shèng fàng",填塞:"tián sè",凶横:"xiōng hèng",稽首:"qǐ shǒu",碑帖:"bēi tiè",冲量:"chōng liàng",发菜:"fà cài",假发:"jiǎ fà",翻卷:"fān juǎn",小量:"xiǎo liàng",胶着:"jiāo zhuó",里子:"lǐ zi",调调:"diào diao",散兵:"sǎn bīng",高挑:"gāo tiǎo",播撒:"bō sǎ",夹心:"jiā xīn",扇动:"shān dòng",叨扰:"tāo rǎo",霓裳:"ní cháng",捻子:"niǎn zi",弥缝:"mí féng",撒布:"sǎ bù",场院:"cháng yuàn",省亲:"xǐng qīn",提拉:"tí lā",惯量:"guàn liàng",强逼:"qiáng bī",强征:"qiáng zhēng",晕车:"yùn chē",数道:"shù dào",带累:"dài lèi",拓本:"tà běn",嫌恶:"xián wù",宿将:"sù jiàng",龟裂:"jūn liè",缠夹:"chán jiā",发式:"fà shì",隔扇:"gé shàn",天分:"tiān fèn",癖好:"pǐ hào",四通:"sì tōng",白术:"bái zhú",划伤:"huá shāng",角斗:"jué dòu",听差:"tīng chāi",岁差:"suì chā",丧礼:"sāng lǐ",脉脉:"mò mò",削瘦:"xuē shòu",撒播:"sǎ bō",莎草:"suō cǎo",犍为:"qián wéi",调头:"diào tóu",龙卷:"lóng juǎn",外调:"wài diào",字帖:"zì tiè",卷发:"juǎn fà",揣度:"chuǎi duó",洋相:"yáng xiàng",散光:"sǎn guāng",骨碌:"gū lu",薄命:"bó mìng",笼头:"lóng tóu",咽炎:"yān yán",碌碡:"liù zhou",片儿:"piàn er",纤手:"qiàn shǒu",散体:"sǎn tǐ",内省:"nèi xǐng",强留:"qiáng liú",解送:"jiè sòng",反间:"fǎn jiàn",少壮:"shào zhuàng",留空:"liú kōng",告假:"gào jià",咳血:"ké xuè",薄暮:"bó mù",铺轨:"pū guǐ",磨削:"mó xuē",治丧:"zhì sāng",叉子:"chā zi",哄动:"hōng dòng",蛾子:"é zi",出落:"chū luò",股长:"gǔ zhǎng",贵处:"guì chù",还魂:"huán hún",例假:"lì jià",刹住:"shā zhù",身量:"shēn liàng",同好:"tóng hào",模量:"mó liàng",更生:"gēng shēng",服丧:"fú sāng",率直:"shuài zhí",字模:"zì mú",散架:"sǎn jià",答腔:"dā qiāng",交恶:"jiāo wù",薄情:"bó qíng",眼泡:"yǎn pāo",袅娜:"niǎo nuó",草垛:"cǎo duò",冲劲:"chòng jìn",呢喃:"ní nán",切中:"qiè zhòng",挑灯:"tiǎo dēng",还愿:"huán yuàn",激将:"jī jiàng",更鼓:"gēng gǔ",没药:"mò yào",败兴:"bài xìng",切面:"qiē miàn",散户:"sǎn hù",累进:"lěi jìn",背带:"bēi dài",秤杆:"chèng gǎn",碾坊:"niǎn fáng",簿子:"bù zi",扳手:"bān shǒu",铅山:"yán shān",儒将:"rú jiàng",重光:"chóng guāng",剪发:"jiǎn fà",长上:"zhǎng shàng",小传:"xiǎo zhuàn",压轴:"yā zhòu",弱冠:"ruò guàn",花卷:"huā juǎn",横祸:"hèng huò",夹克:"jiā kè",光晕:"guāng yùn",披靡:"pī mǐ",对调:"duì diào",夹持:"jiā chí",空额:"kòng é",平调:"píng diào",铺床:"pū chuáng",丧钟:"sāng zhōng",作乐:"zuò lè",少府:"shào fǔ",数数:"shuò shuò",奔头:"bèn tou",进给:"jìn jǐ",率性:"shuài xìng",乐子:"lè zi",绑扎:"bǎng zā",挑唆:"tiǎo suō",漂洗:"piǎo xǐ",夹墙:"jiā qiáng",咳喘:"ké chuǎn",乜斜:"miē xie",错处:"cuò chù",闷酒:"mèn jiǔ",时调:"shí diào",重孙:"chóng sūn",经幢:"jīng chuáng",圩场:"xū chǎng",调门:"diào mén",花头:"huā tóu",划拉:"huá la",套色:"tào shǎi",粗率:"cū shuài",相率:"xiāng shuài",款识:"kuǎn zhì",吁请:"yù qǐng",荫蔽:"yīn bì",文蛤:"wén gé",嘀嗒:"dī dā",调取:"diào qǔ",交差:"jiāo chāi",落子:"luò zǐ",相册:"xiàng cè",絮叨:"xù dao",落发:"luò fà",异相:"yì xiàng",浸没:"jìn mò",角抵:"jué dǐ",卸载:"xiè zài",春卷:"chūn juǎn",扎挣:"zhá zheng",畜养:"xù yǎng",吡咯:"bǐ luò",垛子:"duò zi",恶少:"è shào",发际:"fà jì",红苕:"hóng sháo",糨糊:"jiàng hu",哭丧:"kū sāng",稍息:"shào xī",晕船:"yùn chuán",校样:"jiào yàng",外差:"wài chā",脚爪:"jiǎo zhǎo",铺展:"pū zhǎn",芫荽:"yán sui",夹紧:"jiā jǐn",尿泡:"suī pào",丧乱:"sāng luàn",凶相:"xiōng xiàng",华发:"huá fà",打场:"dǎ cháng",云量:"yún liàng",正切:"zhèng qiē",划拳:"huá quán",划艇:"huá tǐng",评传:"píng zhuàn",拉纤:"lā qiàn",句读:"jù dòu",散剂:"sǎn jì",骨殖:"gǔ shi",塞音:"sè yīn",铺叙:"pū xù",阏氏:"yān zhī",冷颤:"lěng zhàn",煞住:"shā zhù",少男:"shào nán",管乐:"guǎn yuè",号啕:"háo táo",纳降:"nà xiáng",拥塞:"yōng sè",万乘:"wàn shèng",杆儿:"gǎn ér",葛藤:"gé téng",簿籍:"bù jí",皮夹:"pí jiā",校准:"jiào zhǔn",允当:"yǔn dàng",器量:"qì liàng",选调:"xuǎn diào",扮相:"bàn xiàng",干才:"gàn cái",基干:"jī gàn",割切:"gē qiē",国乐:"guó yuè",卡壳:"qiǎ ké",辟谷:"bì gǔ",磨房:"mò fáng",咿呀:"yī yā",芥末:"jiè mo",薄技:"bó jì",产假:"chǎn jià",诗兴:"shī xìng",重出:"chóng chū",转椅:"zhuàn yǐ",酌量:"zhuó liang",簿册:"bù cè",藏青:"zàng qīng",的士:"dī shì",调人:"diào rén",解元:"jiè yuán",茎干:"jīng gàn",巨量:"jù liàng",榔头:"láng tou",率真:"shuài zhēn",喷香:"pèn xiāng",锁钥:"suǒ yuè",虾蟆:"há má",相图:"xiàng tú",兴会:"xìng huì",灶头:"zào tóu",重婚:"chóng hūn",钻洞:"zuān dòng",忖度:"cǔn duó",党参:"dǎng shēn",调温:"diào wēn",杆塔:"gān tǎ",葛布:"gé bù",拱券:"gǒng xuàn",夹生:"jiā shēng",露馅:"lòu xiàn",恰切:"qià qiè",散见:"sǎn jiàn",哨卡:"shào qiǎ",烫发:"tàng fà",体量:"tǐ liàng",挺括:"tǐng kuò",系带:"jì dài",相士:"xiàng shì",羊圈:"yáng juàn",转矩:"zhuàn jǔ",吧台:"bā tái",苍术:"cāng zhú",菲薄:"fěi bó",蛤蚧:"gé jiè",蛤蜊:"gé lí",瓜蔓:"guā wàn",怪相:"guài xiàng",临帖:"lín tiè",女红:"nǚ gōng",刨床:"bào chuáng",翘楚:"qiáo chǔ",数九:"shǔ jiǔ",谈兴:"tán xìng",雄劲:"xióng jìng",扎染:"zā rǎn",遮荫:"zhē yīn",周正:"zhōu zhèng",赚头:"zhuàn tou",扒手:"pá shǒu",搀和:"chān huo",诚朴:"chéng pǔ",肚量:"dù liàng",干结:"gān jié",工尺:"gōng chě",家累:"jiā lěi",曲水:"qū shuǐ",沙参:"shā shēn",挑花:"tiǎo huā",阿门:"ā mén",背篓:"bēi lǒu",瘪三:"biē sān",裁处:"cái chǔ",创痛:"chuāng tòng",福相:"fú xiàng",更动:"gēng dòng",豪兴:"háo xìng",还阳:"huán yáng",还嘴:"huán zuǐ",借调:"jiè diào",卷云:"juǎn yún",流弹:"liú dàn",想头:"xiǎng tou",削价:"xuē jià",校阅:"jiào yuè",雅量:"yǎ liàng",别传:"bié zhuàn",薄酒:"bó jiǔ",春假:"chūn jià",发妻:"fà qī",哗哗:"huā huā",宽绰:"kuān chuo",了悟:"liǎo wù",切花:"qiē huā",审度:"shěn duó",应许:"yīng xǔ",转台:"zhuàn tái",仔猪:"zǐ zhū",裁量:"cái liáng",藏戏:"zàng xì",乘兴:"chéng xìng",绸缪:"chóu móu",摧折:"cuī zhé",调经:"tiáo jīng",调职:"diào zhí",缝缀:"féng zhuì",骨朵:"gū duǒ",核儿:"hú er",恒量:"héng liàng",还价:"huán jià",浑朴:"hún pǔ",苦差:"kǔ chāi",面糊:"miàn hù",煞车:"shā chē",省视:"xǐng shì",什锦:"shí jǐn",信差:"xìn chāi",余切:"yú qiē",攒眉:"cuán méi",炸糕:"zhá gāo",钻杆:"zuàn gǎn",扒灰:"pá huī",拌和:"bàn huò",长调:"cháng diào",大溜:"dà liù",抖搂:"dǒu lōu",飞转:"fēi zhuàn",干仗:"gàn zhàng",好胜:"hào shèng",画片:"huà piàn",搅混:"jiǎo hún",螺杆:"luó gǎn",木模:"mù mú",怒号:"nù háo",频数:"pín shù",无宁:"wú níng",遗少:"yí shào",邮差:"yóu chāi",占卦:"zhān guà",占星:"zhān xīng",重审:"chóng shěn",自量:"zì liàng",调防:"diào fáng",发廊:"fà láng",反调:"fǎn diào",缝子:"fèng zi",更夫:"gēng fū",骨子:"gǔ zi",光杆:"guāng gǎn",夹棍:"jiā gùn",居丧:"jū sāng",巨贾:"jù gǔ",看押:"kān yā",空转:"kōng zhuàn",量力:"liàng lì",炮烙:"páo luò",赔还:"péi huán",扑扇:"pū shān",散记:"sǎn jì",散件:"sǎn jiàn",删削:"shān xuē",射干:"shè gàn",条几:"tiáo jī",偷空:"tōu kòng",削壁:"xuē bì",校核:"jiào hé",阴干:"yīn gān",择菜:"zhái cài",重九:"chóng jiǔ",主调:"zhǔ diào",自禁:"zì jīn",吧唧:"bā jī",便溺:"biàn niào",词调:"cí diào",叨咕:"dáo gu",落枕:"lào zhěn",铺砌:"pū qì",刷白:"shuà bái",委靡:"wěi mǐ",系泊:"xì bó",相马:"xiàng mǎ",熨帖:"yù tiē",转筋:"zhuàn jīn",棒喝:"bàng hè",傧相:"bīn xiàng",镐头:"gǎo tóu",间苗:"jiàn miáo",乐池:"yuè chí",卖相:"mài xiàng",屏弃:"bǐng qì",铅弹:"qiān dàn",切变:"qiē biàn",请调:"qǐng diào",群氓:"qún méng",散板:"sǎn bǎn",省察:"xǐng chá",事假:"shì jià",纤绳:"qiàn shéng",重影:"chóng yǐng",耕种:"gēng zhòng",种地:"zhòng dì",种菜:"zhòng cài",栽种:"zāi zhòng",接种:"jiē zhòng",垦种:"kěn zhòng",种殖:"zhòng zhí",种瓜:"zhòng guā",种豆:"zhòng dòu",种树:"zhòng shù",睡着:"shuì zháo",笼子:"lóng zi",重启:"chóng qǐ",重整:"chóng zhěng",重弹:"chóng tán",重足:"chóng zú",重山:"chóng shān",重游:"chóng yóu",重峦:"chóng luán",爷爷:"yé ye",奶奶:"nǎi nai",姥爷:"lǎo ye",爸爸:"bà ba",妈妈:"mā ma",婶婶:"shěn shen",舅舅:"jiù jiu",姑姑:"gū gu",叔叔:"shū shu",姨夫:"yí fu",舅母:"jiù mu",姑父:"gū fu",姐夫:"jiě fu",婆婆:"pó po",公公:"gōng gong",舅子:"jiù zi",姐姐:"jiě jie",哥哥:"gē ge",妹妹:"mèi mei",妹夫:"mèi fu",姨子:"yí zi",宝宝:"bǎo bao",娃娃:"wá wa",孩子:"hái zi",日子:"rì zi",样子:"yàng zi",狮子:"shī zi",身子:"shēn zi",架子:"jià zi",嫂子:"sǎo zi",鼻子:"bí zi",亭子:"tíng zi",折子:"zhé zi",面子:"miàn zi",脖子:"bó zi",辈子:"bèi zi",帽子:"mào zi",拍子:"pāi zi",柱子:"zhù zi",辫子:"biàn zi",鸽子:"gē zi",房子:"fáng zi",丸子:"wán zi",摊子:"tān zi",牌子:"pái zi",胡子:"hú zi",鬼子:"guǐ zi",矮子:"ǎi zi",鸭子:"yā zi",小子:"xiǎo zi",影子:"yǐng zi",屋子:"wū zi",对子:"duì zi",点子:"diǎn zi",本子:"běn zi",种子:"zhǒng zi",儿子:"ér zi",兔子:"tù zi",骗子:"piàn zi",院子:"yuàn zi",猴子:"hóu zi",嗓子:"sǎng zi",侄子:"zhí zi",柿子:"shì zi",钳子:"qián zi",虱子:"shī zi",瓶子:"píng zi",豹子:"bào zi",筷子:"kuài zi",篮子:"lán zi",绳子:"shéng zi",嘴巴:"zuǐ ba",耳朵:"ěr duo",茄子:"qié zi",蚌埠:"bèng bù",崆峒:"kōng tóng",琵琶:"pí pa",蘑菇:"mó gu",葫芦:"hú lu",狐狸:"hú li",桔子:"jú zi",盒子:"hé zi",桌子:"zhuō zi",竹子:"zhú zi",师傅:"shī fu",衣服:"yī fu",袜子:"wà zi",杯子:"bēi zi",刺猬:"cì wei",麦子:"mài zi",队伍:"duì wu",知了:"zhī liǎo",鱼儿:"yú er",馄饨:"hún tun",灯笼:"dēng long",庄稼:"zhuāng jia",聪明:"cōng ming",镜子:"jìng zi",银子:"yín zi",盘子:"pán zi",了却:"liǎo què",力气:"lì qi",席子:"xí zi",林子:"lín zi",朝霞:"zhāo xiá",朝夕:"zhāo xī",朝气:"zhāo qì",翅膀:"chì bǎng",省长:"shěng zhǎng",臧否:"zāng pǐ",否泰:"pǐ tài",变得:"biàn de",丈夫:"zhàng fu",豆腐:"dòu fu",笔杆:"bǐ gǎn",枞阳:"zōng yáng",行人:"xíng rén",打着:"dǎ zhe",第一:"dì yī",万一:"wàn yī",之一:"zhī yī",得之:"dé zhī",统一:"tǒng yī",唯一:"wéi yī",专一:"zhuān yī",单一:"dān yī",如一:"rú yī",其一:"qí yī",合一:"hé yī",逐一:"zhú yī",周一:"zhōu yī",初一:"chū yī",研一:"yán yī",归一:"guī yī",假一:"jiǎ yī",闻一:"wén yī",了了:"liǎo liǎo",公了:"gōng liǎo",私了:"sī liǎo",一月:"yī yuè",一号:"yī hào",一级:"yī jí",一等:"yī děng",一哥:"yī gē",月一:"yuè yī",一一:"yī yī",二一:"èr yī",三一:"sān yī",四一:"sì yī",五一:"wǔ yī",六一:"liù yī",七一:"qī yī",八一:"bā yī",九一:"jiǔ yī","一〇":"yī líng",一零:"yī líng",一二:"yī èr",一三:"yī sān",一四:"yī sì",一五:"yī wǔ",一六:"yī liù",一七:"yī qī",一八:"yī bā",一九:"yī jiǔ",一又:"yī yòu",一饼:"yī bǐng",一楼:"yī lóu",为例:"wéi lì",为准:"wéi zhǔn",沧海:"cāng hǎi",难为:"nán wéi",责难:"zé nàn",患难:"huàn nàn",磨难:"mó nàn",大难:"dà nàn",刁难:"diāo nàn",殉难:"xùn nàn",落难:"luò nàn",罹难:"lí nàn",灾难:"zāi nàn",难民:"nàn mín",苦难:"kǔ nàn",危难:"wēi nàn",发难:"fā nàn",逃难:"táo nàn",避难:"bì nàn",遇难:"yù nàn",阻难:"zǔ nàn",厄难:"è nàn",徇难:"xùn nàn",空难:"kōng nàn",喜欢:"xǐ huan",朝朝:"zhāo zhāo",不行:"bù xíng",轧轧:"yà yà",弯曲:"wān qū",扭曲:"niǔ qū",曲直:"qū zhí",委曲:"wěi qū",酒曲:"jiǔ qū",曲径:"qū jìng",曲解:"qū jiě",歪曲:"wāi qū",曲线:"qū xiàn",曲阜:"qū fù",九曲:"jiǔ qū",曲折:"qū zhé",曲肱:"qū gōng",曲意:"qū yì",仡佬:"gē lǎo"},ale=Object.keys(LI).map(e=>({zh:e,pinyin:LI[e],probability:2e-8,length:2,priority:Wl.Normal,dict:Symbol("dict2")})),NI={为什么:"wèi shén me",实际上:"shí jì shang",检察长:"jiǎn chá zhǎng",干什么:"gàn shén me",这会儿:"zhè huì er",尽可能:"jǐn kě néng",董事长:"dǒng shì zhǎng",了不起:"liǎo bù qǐ",参谋长:"cān móu zhǎng",朝鲜族:"cháo xiǎn zú",海内外:"hǎi nèi wài",禁不住:"jīn bú zhù",柏拉图:"bó lā tú",不在乎:"bú zài hu",洛杉矶:"luò shān jī",有点儿:"yǒu diǎn er",迫击炮:"pǎi jī pào",不得了:"bù dé liǎo",马尾松:"mǎ wěi sōng",运输量:"yùn shū liàng",发脾气:"fā pí qi",士大夫:"shì dà fū",鸭绿江:"yā lù jiāng",压根儿:"yà gēn er",对得起:"duì de qǐ",那会儿:"nà huì er",自个儿:"zì gě er",物理量:"wù lǐ liàng",怎么着:"zěn me zhāo",明晃晃:"míng huǎng huǎng",节假日:"jié jià rì",心里话:"xīn lǐ huà",发行量:"fā xíng liàng",兴冲冲:"xìng chōng chōng",分子量:"fēn zǐ liàng",国子监:"guó zǐ jiàn",老大难:"lǎo dà nán",党内外:"dǎng nèi wài",这么着:"zhè me zhāo",少奶奶:"shào nǎi nai",暗地里:"àn dì lǐ",更年期:"gēng nián qī",工作量:"gōng zuò liàng",背地里:"bèi dì lǐ",山里红:"shān li hóng",好好儿:"hǎo hāo er",交响乐:"jiāo xiǎng yuè",好意思:"hǎo yì si",吐谷浑:"tǔ yù hún",没意思:"méi yì si",理发师:"lǐ fà shī",塔什干:"tǎ shí gān",充其量:"chōng qí liàng",靠得住:"kào de zhù",车行道:"chē xíng dào",人行道:"rén xíng dào",中郎将:"zhōng láng jiàng",照明弹:"zhào míng dàn",烟幕弹:"yān mù dàn",没奈何:"mò nài hé",乱哄哄:"luàn hōng hōng",惠更斯:"huì gēng sī",载重量:"zài zhòng liàng",瞧得起:"qiáo de qǐ",纪传体:"jì zhuàn tǐ",阿房宫:"ē páng gōng",卷心菜:"juǎn xīn cài",戏班子:"xì bān zi",过得去:"guò de qù",花岗石:"huā gāng shí",外甥女:"wài sheng nǚ",团团转:"tuán tuán zhuàn",大堡礁:"dà bǎo jiāo",燃烧弹:"rán shāo dàn",劳什子:"láo shí zi",摇滚乐:"yáo gǔn yuè",夹竹桃:"jiā zhú táo",闹哄哄:"nào hōng hōng",三连冠:"sān lián guàn",重头戏:"zhòng tóu xì",二人转:"èr rén zhuàn",节骨眼:"jiē gǔ yǎn",知识面:"zhī shi miàn",护士长:"hù shi zhǎng",信号弹:"xìn hào dàn",干电池:"gān diàn chí",枪杆子:"qiāng gǎn zi",哭丧棒:"kū sāng bàng",鼻咽癌:"bí yān ái",瓦岗军:"wǎ gāng jūn",买得起:"mǎi de qǐ",癞蛤蟆:"lài há ma",脊梁骨:"jǐ liang gǔ",子母弹:"zǐ mǔ dàn",开小差:"kāi xiǎo chāi",女强人:"nǚ qiáng rén",英雄传:"yīng xióng zhuàn",爵士乐:"jué shì yuè",说笑话:"shuō xiào hua",碰头会:"pèng tóu huì",玻璃钢:"bō li gāng",曳光弹:"yè guāng dàn",少林拳:"shào lín quán",咏叹调:"yǒng tàn diào",少先队:"shào xiān duì",灵长目:"líng zhǎng mù",对着干:"duì zhe gàn",蒙蒙亮:"méng méng liàng",软骨头:"ruǎn gǔ tou",铺盖卷:"pū gài juǎn",和稀泥:"huò xī ní",背黑锅:"bēi hēi guō",红彤彤:"hóng tōng tōng",武侯祠:"wǔ hóu cí",打哆嗦:"dǎ duō suo",户口簿:"hù kǒu bù",马尾藻:"mǎ wěi zǎo",夜猫子:"yè māo zi",打手势:"dǎ shǒu shì",龙王爷:"lóng wáng yé",气头上:"qì tóu shang",糊涂虫:"hú tu chóng",笔杆子:"bǐ gǎn zi",占便宜:"zhàn pián yi",打主意:"dǎ zhǔ yì",多弹头:"duō dàn tóu",露一手:"lòu yì shǒu",堰塞湖:"yàn sè hú",保得住:"bǎo de zhù",趵突泉:"bào tū quán",奥得河:"ào de hé",司务长:"sī wù zhǎng",禁不起:"jīn bù qǐ",什刹海:"shí chà hǎi",莲花落:"lián huā lào",见世面:"jiàn shì miàn",豁出去:"huō chū qù",电位差:"diàn wèi chā",挨个儿:"āi gè er",那阵儿:"nà zhèn er",肺活量:"fèi huó liàng",大师傅:"dà shī fu",掷弹筒:"zhì dàn tǒng",打呼噜:"dǎ hū lu",广渠门:"ān qú mén",未见得:"wèi jiàn dé",大婶儿:"dà shěn er",谈得来:"tán de lái",脚丫子:"jiǎo yā zi",空包弹:"kōng bāo dàn",窝里斗:"wō li dòu",弹着点:"dàn zhuó diǎn",个头儿:"gè tóu er",看得起:"kàn de qǐ",糊涂账:"hú tu zhàng",大猩猩:"dà xīng xing",禁得起:"jīn de qǐ",法相宗:"fǎ xiàng zōng",可怜相:"kě lián xiàng",吃得下:"chī de xià",汉堡包:"hàn bǎo bāo",闹嚷嚷:"nào rāng rāng",数来宝:"shǔ lái bǎo",合得来:"hé de lái",干性油:"gān xìng yóu",闷葫芦:"mèn hú lu",呱呱叫:"guā guā jiào",西洋参:"xī yáng shēn",林荫道:"lín yīn dào",拉家常:"lā jiā cháng",卷铺盖:"juǎn pū gài",过得硬:"guò de yìng",飞将军:"fēi jiāng jūn",挑大梁:"tiǎo dà liáng",哈巴狗:"hǎ ba gǒu",过家家:"guò jiā jiā",催泪弹:"cuī lèi dàn",雨夹雪:"yǔ jiā xuě",敲竹杠:"qiāo zhú gàng",列车长:"liè chē zhǎng",华达呢:"huá dá ní",犯得着:"fàn de zháo",土疙瘩:"tǔ gē da",煞风景:"shā fēng jǐng",轻量级:"qīng liàng jí",羞答答:"xiū dā dā",石子儿:"shí zǐ er",达姆弹:"dá mǔ dàn",科教片:"kē jiào piān",侃大山:"kǎn dà shān",丁点儿:"dīng diǎn er",吃得消:"chī de xiāo",捋虎须:"luō hǔ xū",高丽参:"gāo lí shēn",众生相:"zhòng shēng xiàng",咽峡炎:"yān xiá yán",禁得住:"jīn de zhù",吃得开:"chī de kāi",柞丝绸:"zuò sī chóu",应声虫:"yìng shēng chóng",数得着:"shǔ de zháo",傻劲儿:"shǎ jìn er",铅玻璃:"qiān bō li",可的松:"kě dì sōng",划得来:"huá de lái",晕乎乎:"yūn hū hū",屎壳郎:"shǐ ke làng",尥蹶子:"liào juě zi",藏红花:"zàng hóng huā",闷罐车:"mèn guàn chē",卡脖子:"qiǎ bó zi",红澄澄:"hóng deng deng",赶得及:"gǎn de jí",当间儿:"dāng jiàn er",露马脚:"lòu mǎ jiǎo",鸡内金:"jī nèi jīn",犯得上:"fàn de shàng",钉齿耙:"dīng chǐ bà",饱和点:"bǎo hé diǎn",龙爪槐:"lóng zhǎo huái",喝倒彩:"hè dào cǎi",定冠词:"dìng guàn cí",担担面:"dàn dan miàn",吃得住:"chī de zhù",爪尖儿:"zhuǎ jiān er",支着儿:"zhī zhāo er",折跟头:"zhē gēn tou",阴着儿:"yīn zhāo er",烟卷儿:"yān juǎn er",宣传弹:"xuān chuán dàn",信皮儿:"xìn pí er",弦切角:"xián qiē jiǎo",缩砂密:"sù shā mì",说得来:"shuō de lái",水漂儿:"shuǐ piāo er",耍笔杆:"shuǎ bǐ gǎn",数得上:"shǔ de shàng",数不着:"shǔ bù zháo",数不清:"shǔ bù qīng",什件儿:"shí jiàn er",生死簿:"shēng sǐ bù",扇风机:"shān fēng jī",撒呓挣:"sā yì zheng",日记簿:"rì jì bù",热得快:"rè de kuài",亲家公:"qìng jia gōng",奇函数:"jī hán shù",拍纸簿:"pāi zhǐ bù",努劲儿:"nǔ jìn er",泥娃娃:"ní wá wa",内切圆:"nèi qiē yuán",哪会儿:"nǎ huì er",闷头儿:"mēn tóu er",没谱儿:"méi pǔ er",铆劲儿:"mǎo jìn er",溜肩膀:"liū jiān bǎng",了望台:"liào wàng tái",老来少:"lǎo lái shào",坤角儿:"kūn jué er",考勤簿:"kǎo qín bù",卷笔刀:"juǎn bǐ dāo",进给量:"jìn jǐ liàng",划不来:"huá bù lái",汗褂儿:"hàn guà er",鼓囊囊:"gǔ nāng nāng",够劲儿:"gòu jìn er",公切线:"gōng qiē xiàn",搁得住:"gé de zhù",赶浪头:"gǎn làng tóu",赶得上:"gǎn de shàng",干酵母:"gān jiào mǔ",嘎渣儿:"gā zhā er",嘎嘣脆:"gā bēng cuì",对得住:"duì de zhù",逗闷子:"dòu mèn zi",顶呱呱:"dǐng guā guā",滴溜儿:"dī liù er",大轴子:"dà zhòu zi",打板子:"dǎ bǎn zi",寸劲儿:"cùn jìn er",醋劲儿:"cù jìn er",揣手儿:"chuāi shǒu er",冲劲儿:"chòng jìn er",吃得来:"chī de lái",不更事:"bù gēng shì",奔头儿:"bèn tou er",百夫长:"bǎi fū zhǎng",娃娃亲:"wá wa qīn",死劲儿:"sǐ jìn er",骨朵儿:"gū duǒ er",功劳簿:"gōng láo bù",都江堰:"dū jiāng yàn",一担水:"yí dàn shuǐ",否极泰:"pǐ jí tài",泰来否:"tài lái pǐ",咳特灵:"ké tè líng",开户行:"kāi hù háng",郦食其:"lì yì jī",花事了:"huā shì liǎo",一更更:"yì gēng gēng",一重山:"yì chóng shān",风一更:"fēng yì gēng",雪一更:"xuě yì gēng",归一码:"guī yì mǎ",星期一:"xīng qī yī",礼拜一:"lǐ bài yī",一季度:"yī jì dù",一月一:"yī yuè yī",一字马:"yī zì mǎ",一是一:"yī shì yī",一次方:"yī cì fāng",一阳指:"yī yáng zhǐ",一字决:"yī zì jué",一年级:"yī nián jí",一不做:"yī bú zuò",屈戌儿:"qū qu ér",难为水:"nán wéi shuǐ",难为情:"nán wéi qíng",行一行:"xíng yì háng",别别的:"biè bié de",干哪行:"gàn nǎ háng",干一行:"gàn yì háng",曲别针:"qū bié zhēn"},ule=Object.keys(NI).map(e=>({zh:e,pinyin:NI[e],probability:2e-8,length:3,priority:Wl.Normal,dict:Symbol("dict3")})),DI={成吉思汗:"chéng jí sī hán",四通八达:"sì tōng bā dá",一模一样:"yì mú yí yàng",青藏高原:"qīng zàng gāo yuán",阿弥陀佛:"ē mí tuó fó",解放思想:"jiè fàng sī xiǎng",所作所为:"suǒ zuò suǒ wéi",迷迷糊糊:"mí mí hu hū",荷枪实弹:"hè qiāng shí dàn",兴高采烈:"xìng gāo cǎi liè",无能为力:"wú néng wéi lì",布鲁塞尔:"bù lǔ sài ěr",为所欲为:"wéi suǒ yù wéi",克什米尔:"kè shí mǐ ěr",没完没了:"méi wán méi liǎo",不为人知:"bù wéi rén zhī",结结巴巴:"jiē jiē bā bā",前仆后继:"qián pū hòu jì",铺天盖地:"pū tiān gài dì",直截了当:"zhí jié liǎo dàng",供不应求:"gōng bú yìng qiú",御史大夫:"yù shǐ dà fū",不为瓦全:"bù wéi wǎ quán",不可收拾:"bù kě shōu shi",胡作非为:"hú zuò fēi wéi",分毫不差:"fēn háo bú chà",模模糊糊:"mó mó hu hū",不足为奇:"bù zú wéi qí",悄无声息:"qiǎo wú shēng xī",了如指掌:"liǎo rú zhǐ zhǎng",深恶痛绝:"shēn wù tòng jué",高高兴兴:"gāo gāo xìng xìng",唉声叹气:"āi shēng tàn qì",汉藏语系:"hàn zàng yǔ xì",处心积虑:"chǔ xīn jī lǜ",泣不成声:"qì bù chéng shēng",半夜三更:"bàn yè sān gēng",失魂落魄:"shī hún luò pò",二十八宿:"èr shí bā xiù",转来转去:"zhuàn lái zhuàn qù",数以万计:"shǔ yǐ wàn jì",相依为命:"xiāng yī wéi mìng",恋恋不舍:"liàn liàn bù shě",屈指可数:"qū zhǐ kě shǔ",神出鬼没:"shén chū guǐ mò",结结实实:"jiē jiē shí shí",有的放矢:"yǒu dì fàng shǐ",叽哩咕噜:"jī lǐ gū lū",调兵遣将:"diào bīng qiǎn jiàng",载歌载舞:"zài gē zài wǔ",转危为安:"zhuǎn wēi wéi ān",踏踏实实:"tā tā shi shí",桑给巴尔:"sāng jǐ bā ěr",装模作样:"zhuāng mú zuò yàng",见义勇为:"jiàn yì yǒng wéi",相差无几:"xiāng chā wú jǐ",叹为观止:"tàn wéi guān zhǐ",闷闷不乐:"mèn mèn bú lè",喜怒哀乐:"xǐ nù āi lè",鲜为人知:"xiǎn wéi rén zhī",张牙舞爪:"zhāng yá wǔ zhǎo",为非作歹:"wéi fēi zuò dǎi",含糊其辞:"hán hú qí cí",疲于奔命:"pí yú bēn mìng",勉为其难:"miǎn wéi qí nán",依依不舍:"yī yī bù shě",顶头上司:"dǐng tóu shàng si",不着边际:"bù zhuó biān jì",大模大样:"dà mú dà yàng",寻欢作乐:"xún huān zuò lè",一走了之:"yì zǒu liǎo zhī",字里行间:"zì lǐ háng jiān",含含糊糊:"hán hán hu hū",恰如其分:"qià rú qí fèn",破涕为笑:"pò tì wéi xiào",深更半夜:"shēn gēng bàn yè",千差万别:"qiān chā wàn bié",数不胜数:"shǔ bú shèng shǔ",据为己有:"jù wéi jǐ yǒu",天旋地转:"tiān xuán dì zhuàn",养尊处优:"yǎng zūn chǔ yōu",玻璃纤维:"bō li xiān wéi",吵吵闹闹:"chāo chao nào nào",晕头转向:"yūn tóu zhuàn xiàng",土生土长:"tǔ shēng tǔ zhǎng",宁死不屈:"nìng sǐ bù qū",不省人事:"bù xǐng rén shì",尽力而为:"jìn lì ér wéi",精明强干:"jīng míng qiáng gàn",唠唠叨叨:"láo lao dāo dāo",叽叽喳喳:"jī ji zhā zhā",功不可没:"gōng bù kě mò",锲而不舍:"qiè ér bù shě",排忧解难:"pái yōu jiě nàn",稀里糊涂:"xī li hú tú",各有所长:"gè yǒu suǒ cháng",的的确确:"dí dí què què",哄堂大笑:"hōng táng dà xiào",听而不闻:"tīng ér bù wén",刀耕火种:"dāo gēng huǒ zhòng",内分泌腺:"nèi fèn mì xiàn",化险为夷:"huà xiǎn wéi yí",百发百中:"bǎi fā bǎi zhòng",重见天日:"chóng jiàn tiān rì",反败为胜:"fǎn bài wéi shèng",一了百了:"yì liǎo bǎi liǎo",大大咧咧:"dà da liē liē",心急火燎:"xīn jí huǒ liǎo",粗心大意:"cū xīn dà yi",鸡皮疙瘩:"jī pí gē da",夷为平地:"yí wéi píng dì",日积月累:"rì jī yuè lěi",设身处地:"shè shēn chǔ dì",投其所好:"tóu qí suǒ hào",间不容发:"jiān bù róng fà",人满为患:"rén mǎn wéi huàn",穷追不舍:"qióng zhuī bù shě",为时已晚:"wéi shí yǐ wǎn",如数家珍:"rú shǔ jiā zhēn",心里有数:"xīn lǐ yǒu shù",以牙还牙:"yǐ yá huán yá",神不守舍:"shén bù shǒu shě",孟什维克:"mèng shí wéi kè",各自为战:"gè zì wéi zhàn",怨声载道:"yuàn shēng zài dào",救苦救难:"jiù kǔ jiù nàn",好好先生:"hǎo hǎo xiān sheng",怪模怪样:"guài mú guài yàng",抛头露面:"pāo tóu lù miàn",游手好闲:"yóu shǒu hào xián",无所不为:"wú suǒ bù wéi",调虎离山:"diào hǔ lí shān",步步为营:"bù bù wéi yíng",好大喜功:"hào dà xǐ gōng",众矢之的:"zhòng shǐ zhī dì",长生不死:"cháng shēng bù sǐ",蔚为壮观:"wèi wéi zhuàng guān",不可胜数:"bù kě shèng shǔ",鬼使神差:"guǐ shǐ shén chāi",洁身自好:"jié shēn zì hào",敢作敢为:"gǎn zuò gǎn wéi",茅塞顿开:"máo sè dùn kāi",走马换将:"zǒu mǎ huàn jiàng",为时过早:"wéi shí guò zǎo",为人师表:"wéi rén shī biǎo",阴差阳错:"yīn chā yáng cuò",油腔滑调:"yóu qiāng huá diào",重蹈覆辙:"chóng dǎo fù zhé",骂骂咧咧:"mà ma liē liē",絮絮叨叨:"xù xù dāo dāo",如履薄冰:"rú lǚ bó bīng",损兵折将:"sǔn bīng zhé jiàng",拐弯抹角:"guǎi wān mò jiǎo",像模像样:"xiàng mú xiàng yàng",供过于求:"gōng guò yú qiú",开花结果:"kāi huā jiē guǒ",仔仔细细:"zǐ zǐ xì xì",川藏公路:"chuān zàng gōng lù",河北梆子:"hé běi bāng zi",长年累月:"cháng nián lěi yuè",正儿八经:"zhèng er bā jīng",不识抬举:"bù shí tái ju",重振旗鼓:"chóng zhèn qí gǔ",气息奄奄:"qì xī yān yān",紧追不舍:"jǐn zhuī bù shě",服服帖帖:"fú fu tiē tiē",强词夺理:"qiǎng cí duó lǐ",噼里啪啦:"pī li pā lā",人才济济:"rén cái jǐ jǐ",发人深省:"fā rén shēn xǐng",不足为凭:"bù zú wéi píng",为富不仁:"wéi fù bù rén",连篇累牍:"lián piān lěi dú",呼天抢地:"hū tiān qiāng dì",落落大方:"luò luò dà fāng",自吹自擂:"zì chuī zì léi",乐善好施:"lè shàn hào shī",以攻为守:"yǐ gōng wéi shǒu",磨磨蹭蹭:"mó mó cèng cèng",削铁如泥:"xuē tiě rú ní",助纣为虐:"zhù zhòu wéi nüè",以退为进:"yǐ tuì wéi jìn",嘁嘁喳喳:"qī qī chā chā",枪林弹雨:"qiāng lín dàn yǔ",令人发指:"lìng rén fà zhǐ",转败为胜:"zhuǎn bài wéi shèng",转弯抹角:"zhuǎn wān mò jiǎo",在劫难逃:"zài jié nán táo",正当防卫:"zhèng dàng fáng wèi",不足为怪:"bù zú wéi guài",难兄难弟:"nàn xiōng nàn dì",咿咿呀呀:"yī yī yā yā",弹尽粮绝:"dàn jìn liáng jué",阿谀奉承:"ē yú fèng chéng",稀里哗啦:"xī li huā lā",返老还童:"fǎn lǎo huán tóng",好高骛远:"hào gāo wù yuǎn",鹿死谁手:"lù sǐ shéi shǒu",差强人意:"chā qiáng rén yì",大吹大擂:"dà chuī dà léi",成家立业:"chéng jiā lì yè",自怨自艾:"zì yuàn zì yì",负债累累:"fù zhài lěi lěi",古为今用:"gǔ wéi jīn yòng",入土为安:"rù tǔ wéi ān",下不为例:"xià bù wéi lì",一哄而上:"yì hōng ér shàng",没头苍蝇:"méi tóu cāng ying",天差地远:"tiān chā dì yuǎn",风卷残云:"fēng juǎn cán yún",多灾多难:"duō zāi duō nàn",乳臭未干:"rǔ xiù wèi gān",行家里手:"háng jiā lǐ shǒu",狼狈为奸:"láng bèi wéi jiān",处变不惊:"chǔ biàn bù jīng",一唱一和:"yí chàng yí hè",一念之差:"yí niàn zhī chā",金蝉脱壳:"jīn chán tuō qiào",滴滴答答:"dī dī dā dā",硕果累累:"shuò guǒ léi léi",好整以暇:"hào zhěng yǐ xiá",红得发紫:"hóng de fā zǐ",传为美谈:"chuán wéi měi tán",富商大贾:"fù shāng dà gǔ",四海为家:"sì hǎi wéi jiā",了若指掌:"liǎo ruò zhǐ zhǎng",大有可为:"dà yǒu kě wéi",出头露面:"chū tóu lù miàn",鼓鼓囊囊:"gǔ gu nāng nāng",窗明几净:"chuāng míng jī jìng",泰然处之:"tài rán chǔ zhī",怒发冲冠:"nù fà chōng guān",有机玻璃:"yǒu jī bō li",骨头架子:"gǔ tou jià zi",义薄云天:"yì bó yún tiān",一丁点儿:"yī dīng diǎn er",时来运转:"shí lái yùn zhuǎn",陈词滥调:"chén cí làn diào",化整为零:"huà zhěng wéi líng",火烧火燎:"huǒ shāo huǒ liǎo",干脆利索:"gàn cuì lì suǒ",吊儿郎当:"diào er láng dāng",广种薄收:"guǎng zhòng bó shōu",种瓜得瓜:"zhòng guā dé guā",种豆得豆:"zhòng dòu dé dòu",难舍难分:"nán shě nán fēn",歃血为盟:"shà xuè wéi méng",奋发有为:"fèn fā yǒu wéi",阴错阳差:"yīn cuò yáng chā",东躲西藏:"dōng duǒ xī cáng",烟熏火燎:"yān xūn huǒ liǎo",钻牛角尖:"zuān niú jiǎo jiān",乔装打扮:"qiáo zhuāng dǎ bàn",改弦更张:"gǎi xián gēng zhāng",河南梆子:"hé nán bāng zi",好吃懒做:"hào chī lǎn zuò",何乐不为:"hé lè bù wéi",大出风头:"dà chū fēng tóu",攻城掠地:"gōng chéng lüè dì",漂漂亮亮:"piào piào liang liang",折衷主义:"zhé zhōng zhǔ yì",大马哈鱼:"dà mǎ hǎ yú",绿树成荫:"lǜ shù chéng yīn",率先垂范:"shuài xiān chuí fàn",家长里短:"jiā cháng lǐ duǎn",宽大为怀:"kuān dà wéi huái",左膀右臂:"zuǒ bǎng yòu bì",一笑了之:"yí xiào liǎo zhī",天下为公:"tiān xià wéi gōng",还我河山:"huán wǒ hé shān",何足为奇:"hé zú wéi qí",好自为之:"hǎo zì wéi zhī",风姿绰约:"fēng zī chuò yuē",大雨滂沱:"dà yǔ pāng tuó",传为佳话:"chuán wéi jiā huà",吃里扒外:"chī lǐ pá wài",重操旧业:"chóng cāo jiù yè",小家子气:"xiǎo jiā zi qì",少不更事:"shào bù gēng shì",难分难舍:"nán fēn nán shě",添砖加瓦:"tiān zhuān jiā wǎ",是非分明:"shì fēi fēn míng",舍我其谁:"shě wǒ qí shuí",偏听偏信:"piān tīng piān xìn",量入为出:"liàng rù wéi chū",降龙伏虎:"xiáng lóng fú hǔ",钢化玻璃:"gāng huà bō li",正中下怀:"zhèng zhòng xià huái",以身许国:"yǐ shēn xǔ guó",一语中的:"yì yǔ zhòng dì",丧魂落魄:"sàng hún luò pò",三座大山:"sān zuò dà shān",济济一堂:"jǐ jǐ yì táng",好事之徒:"hào shì zhī tú",干净利索:"gàn jìng lì suǒ",出将入相:"chū jiàng rù xiàng",袅袅娜娜:"niǎo niǎo nuó nuó",狐狸尾巴:"hú li wěi ba",好逸恶劳:"hào yì wù láo",大而无当:"dà ér wú dàng",打马虎眼:"dǎ mǎ hu yǎn",板上钉钉:"bǎn shàng dìng dīng",吆五喝六:"yāo wǔ hè liù",虾兵蟹将:"xiā bīng xiè jiàng",水调歌头:"shuǐ diào gē tóu",数典忘祖:"shǔ diǎn wàng zǔ",人事不省:"rén shì bù xǐng",曲高和寡:"qǔ gāo hè guǎ",屡教不改:"lǚ jiào bù gǎi",互为因果:"hù wéi yīn guǒ",互为表里:"hù wéi biǎo lǐ",厚此薄彼:"hòu cǐ bó bǐ",过关斩将:"guò guān zhǎn jiàng",疙疙瘩瘩:"gē ge dā dā",大腹便便:"dà fù pián pián",走为上策:"zǒu wéi shàng cè",冤家对头:"yuān jia duì tóu",有隙可乘:"yǒu xì kě chèng",一鳞半爪:"yì lín bàn zhǎo",片言只语:"piàn yán zhǐ yǔ",开花结实:"kāi huā jié shí",经年累月:"jīng nián lěi yuè",含糊其词:"hán hú qí cí",寡廉鲜耻:"guǎ lián xiǎn chǐ",成年累月:"chéng nián lěi yuè",不徇私情:"bú xùn sī qíng",不当人子:"bù dāng rén zǐ",膀大腰圆:"bǎng dà yāo yuán",指腹为婚:"zhǐ fù wéi hūn",这么点儿:"zhè me diǎn er",意兴索然:"yì xīng suǒ rán",绣花枕头:"xiù huā zhěn tou",无的放矢:"wú dì fàng shǐ",望闻问切:"wàng wén wèn qiè",舍己为人:"shě jǐ wèi rén",穷年累月:"qióng nián lěi yuè",排难解纷:"pái nàn jiě fēn",处之泰然:"chǔ zhī tài rán",指鹿为马:"zhǐ lù wéi mǎ",危如累卵:"wēi rú lěi luǎn",天兵天将:"tiān bīng tiān jiàng",舍近求远:"shě jìn qiú yuǎn",南腔北调:"nán qiāng běi diào",苦中作乐:"kǔ zhōng zuò lè",厚积薄发:"hòu jī bó fā",臭味相投:"xiù wèi xiāng tóu",长幼有序:"zhǎng yòu yǒu xù",逼良为娼:"bī liáng wéi chāng",悲悲切切:"bēi bēi qiè qiē",败军之将:"bài jūn zhī jiàng",欺行霸市:"qī háng bà shì",削足适履:"xuē zú shì lǚ",先睹为快:"xiān dǔ wéi kuài",啼饥号寒:"tí jī háo hán",疏不间亲:"shū bú jiàn qīn",神差鬼使:"shén chāi guǐ shǐ",敲敲打打:"qiāo qiāo dǎ dǎ",平铺直叙:"píng pū zhí xù",没头没尾:"méi tóu mò wěi",寥寥可数:"liáo liáo kě shǔ",哼哈二将:"hēng hā èr jiàng",鹤发童颜:"hè fà tóng yán",各奔前程:"gè bèn qián chéng",弹无虚发:"dàn wú xū fā",大人先生:"dà rén xiān sheng",与民更始:"yǔ mín gēng shǐ",树碑立传:"shù bēi lì zhuàn",是非得失:"shì fēi dé shī",实逼处此:"shí bī chǔ cǐ",塞翁失马:"sài wēng shī mǎ",日薄西山:"rì bó xī shān",切身体会:"qiè shēn tǐ huì",片言只字:"piàn yán zhǐ zì",跑马卖解:"pǎo mǎ mài xiè",宁折不弯:"nìng zhé bù wān",零零散散:"líng líng sǎn sǎn",量体裁衣:"liàng tǐ cái yī",连中三元:"lián zhòng sān yuán",礼崩乐坏:"lǐ bēng yuè huài",不为已甚:"bù wéi yǐ shèn",转悲为喜:"zhuǎn bēi wéi xǐ",以眼还眼:"yǐ yǎn huán yǎn",蔚为大观:"wèi wéi dà guān",未为不可:"wèi wéi bù kě",童颜鹤发:"tóng yán hè fà",朋比为奸:"péng bǐ wéi jiān",莫此为甚:"mò cǐ wéi shèn",夹枪带棒:"jiā qiāng dài bàng",富商巨贾:"fù shāng jù jiǎ",淡然处之:"dàn rán chǔ zhī",箪食壶浆:"dān shí hú jiāng",创巨痛深:"chuāng jù tòng shēn",草长莺飞:"cǎo zhǎng yīng fēi",坐视不救:"zuò shī bú jiù",以己度人:"yǐ jǐ duó rén",随行就市:"suí háng jiù shì",文以载道:"wén yǐ zài dào",文不对题:"wén bú duì tí",铁板钉钉:"tiě bǎn dìng dīng",身体发肤:"shēn tǐ fà fū",缺吃少穿:"quē chī shǎo chuān",目无尊长:"mù wú zūn zhǎng",吉人天相:"jí rén tiān xiàng",毁家纾难:"huǐ jiā shū nàn",钢筋铁骨:"gāng jīn tiě gǔ",丢卒保车:"diū zú bǎo jū",丢三落四:"diū sān là sì",闭目塞听:"bì mù sè tīng",削尖脑袋:"xuē jiān nǎo dài",为非作恶:"wéi fēi zuò è",人才难得:"rén cái nán dé",情非得已:"qíng fēi dé yǐ",切中要害:"qiè zhòng yào hài",火急火燎:"huǒ jí huǒ liǎo",画地为牢:"huà dì wéi láo",好酒贪杯:"hào jiǔ tān bēi",长歌当哭:"cháng gē dàng kū",载沉载浮:"zài chén zài fú",遇难呈祥:"yù nàn chéng xiáng",榆木疙瘩:"yú mù gē da",以邻为壑:"yǐ lín wéi hè",洋为中用:"yáng wéi zhōng yòng",言为心声:"yán wéi xīn shēng",言必有中:"yán bì yǒu zhòng",图穷匕见:"tú qióng bǐ xiàn",滂沱大雨:"páng tuó dà yǔ",目不暇给:"mù bù xiá jǐ",量才录用:"liàng cái lù yòng",教学相长:"jiào xué xiāng zhǎng",悔不当初:"huǐ bù dāng chū",呼幺喝六:"hū yāo hè liù",不足为训:"bù zú wéi xùn",不拘形迹:"bù jū xíng jī",傍若无人:"páng ruò wú rén",罪责难逃:"zuì zé nán táo",自我吹嘘:"zì wǒ chuī xū",转祸为福:"zhuǎn huò wéi fú",勇冠三军:"yǒng guàn sān jūn",易地而处:"yì dì ér chǔ",卸磨杀驴:"xiè mò shā lǘ",玩儿不转:"wán ér bú zhuàn",天道好还:"tiān dào hǎo huán",身单力薄:"shēn dān lì bó",撒豆成兵:"sǎ dòu chéng bīng",片纸只字:"piàn zhǐ zhī zì",宁缺毋滥:"nìng quē wú làn",没没无闻:"mò mò wú wén",量力而为:"liàng lì ér wéi",历历可数:"lì lì kě shǔ",口碑载道:"kǒu bēi zài dào",君子好逑:"jūn zǐ hǎo qiú",好为人师:"hào wéi rén shī",豪商巨贾:"háo shāng jù jiǎ",各有所好:"gè yǒu suǒ hào",度德量力:"duó dé liàng lì",指天为誓:"zhǐ tiān wéi shì",逸兴遄飞:"yì xìng chuán fēi",心宽体胖:"xīn kuān tǐ pán",为德不卒:"wéi dé bù zú",天下为家:"tiān xià wéi jiā",视为畏途:"shì wéi wèi tú",三灾八难:"sān zāi bā nàn",沐猴而冠:"mù hóu ér guàn",哩哩啦啦:"lī li lā lā",见缝就钻:"jiàn fèng jiù zuān",夹层玻璃:"jiā céng bō li",急公好义:"jí gōng hào yì",积年累月:"jī nián lěi yuè",划地为牢:"huá dì wéi láo",更名改姓:"gēng míng gǎi xìng",奉为圭臬:"fèng wéi guī niè",多难兴邦:"duō nàn xīng bāng",不破不立:"bú pò bú lì",坐地自划:"zuò dì zì huá",坐不重席:"zuò bù chóng xí",坐不窥堂:"zuò bù kuī táng",作嫁衣裳:"zuò jià yī shang",左枝右梧:"zuǒ zhī yòu wú",左宜右有:"zuǒ yí yòu yǒu",钻头觅缝:"zuān tóu mì fèng",钻天打洞:"zuān tiān dǎ dòng",钻皮出羽:"zuān pí chū yǔ",钻火得冰:"zuān huǒ dé bīng",钻洞觅缝:"zuàn dòng mì féng",钻冰求火:"zuān bīng qiú huǒ",子为父隐:"zǐ wéi fù yǐn",擢发难数:"zhuó fà nán shǔ",着人先鞭:"zhuó rén xiān biān",斫雕为朴:"zhuó diāo wéi pǔ",锥处囊中:"zhuī chǔ náng zhōng",椎心饮泣:"chuí xīn yǐn qì",椎心泣血:"chuí xīn qì xuè",椎牛飨士:"chuí niú xiǎng shì",椎牛歃血:"chuí niú shà xuè",椎牛发冢:"chuí niú fà zhǒng",椎埋屠狗:"chuí mái tú gǒu",椎埋狗窃:"chuí mái gǒu qiè",壮发冲冠:"zhuàng fā chōng guàn",庄严宝相:"zhuāng yán bǎo xiàng",转愁为喜:"zhuǎn chóu wéi xǐ",转嗔为喜:"zhuǎn chēn wéi xǐ",拽巷啰街:"zhuài xiàng luó jiē",拽耙扶犁:"zhuāi pá fú lí",拽布拖麻:"zhuài bù tuō má",箸长碗短:"zhù cháng wǎn duǎn",铸剑为犁:"zhù jiàn wéi lí",杼柚其空:"zhù yòu qí kōng",杼柚空虚:"zhù yòu kōng xū",助天为虐:"zhù tiān wéi nüè",属垣有耳:"zhǔ yuán yǒu ěr",属毛离里:"zhǔ máo lí lǐ",属辞比事:"zhǔ cí bǐ shì",逐物不还:"zhú wù bù huán",铢量寸度:"zhū liáng cùn duó",铢两悉称:"zhū liǎng xī chèn",侏儒观戏:"zhū rú guān xì",朱轓皁盖:"zhū fān zào gài",昼度夜思:"zhòu duó yè sī",诪张为幻:"zhōu zhāng wéi huàn",重明继焰:"chóng míng jì yàn",众啄同音:"zhòng zhuó tóng yīn",众毛攒裘:"zhòng máo cuán qiú",众好众恶:"zhòng hào zhòng wù",擿埴索涂:"zhāi zhí suǒ tú",稚齿婑媠:"zhì chǐ wǒ tuó",至当不易:"zhì dàng bú yì",指皂为白:"zhǐ zào wéi bái",指雁为羹:"zhǐ yàn wéi gēng",指树为姓:"zhǐ shù wéi xìng",指山说磨:"zhǐ shān shuō mò",止戈为武:"zhǐ gē wéi wǔ",枝干相持:"zhī gàn xiāng chí",枝大于本:"zh dà yú běn",支吾其词:"zhī wú qí cí",正身率下:"zhèng shēn shuài xià",正冠李下:"zhèng guàn lǐ xià",整冠纳履:"zhěng guān nà lǚ",整躬率物:"zhěng gōng shuài wù",整顿干坤:"zhěng dùn gàn kūn",针头削铁:"zhēn tóu xuē tiě",贞松劲柏:"zhēn sōng jìng bǎi",赭衣塞路:"zhě yī sè lù",折箭为誓:"shé jiàn wéi shì",折而族之:"zhé ér zú zhī",昭德塞违:"zhāo dé sè wéi",章句小儒:"zhāng jù xiǎo rú",湛恩汪濊:"zhàn ēn wāng huì",占风望气:"zhān fēng wàng qì",斩将搴旗:"zhǎn jiàng qiān qí",曾母投杼:"zēng mǔ tóu zhù",曾参杀人:"zēng shēn shā rén",造谣中伤:"zào yáo zhòng shāng",早占勿药:"zǎo zhān wù yào",凿龟数策:"záo guī shǔ cè",攒三聚五:"cuán sān jù wǔ",攒眉蹙额:"cuán mei cù é",攒零合整:"cuán líng hé zhěng",攒锋聚镝:"cuán fēng jù dí",载笑载言:"zài xiào zài yán",载酒问字:"zài jiǔ wèn zì",殒身不恤:"yǔn shēn bú xù",云舒霞卷:"yún shū xiá juǎn",月中折桂:"yuè zhōng shé guì",月落参横:"yuè luò shēn héng",鬻驽窃价:"yù nú qiè jià",鬻鸡为凤:"yù jī wéi fèng",遇难成祥:"yù nàn chéng xiáng",郁郁累累:"yù yù lěi lěi",玉卮无当:"yù zhī wú dàng",语笑喧阗:"yǔ xiào xuān tián",与世沉浮:"yǔ shì chén fú",与时消息:"yǔ shí xiāo xi",逾墙钻隙:"yú qiáng zuān xì",渔夺侵牟:"yú duó qīn móu",杅穿皮蠹:"yú chuān pí dù",余勇可贾:"yú yǒng kě gǔ",予智予雄:"yú zhì yú xióng",予取予求:"yú qǔ yú qiú",于家为国:"yú jiā wéi guó",有借无还:"yǒu jiè wú huán",有加无已:"yǒu jiā wú yǐ",有国难投:"yǒu guó nán tóu",游必有方:"yóu bì yǒu fāng",油干灯尽:"yóu gàn dēng jìn",尤云殢雨:"yóu yún tì yǔ",庸中皦皦:"yōng zhōng jiǎo jiǎo",郢书燕说:"yǐng shū yān shuō",营蝇斐锦:"yíng yíng fēi jǐn",鹰心雁爪:"yīng xīn yàn zhǎo",莺吟燕儛:"yīng yín yàn wǔ",应天顺时:"yīng tiān shùn shí",印累绶若:"yìn léi shòu ruò",隐占身体:"yǐn zhàn shēn tǐ",饮犊上流:"yìn dú shàng liú",引绳切墨:"yǐn shéng qiē mò",龈齿弹舌:"yín chǐ dàn shé",因缘为市:"yīn yuán wéi shì",因树为屋:"yīn shù wéi wū",溢美溢恶:"yì měi yì wù",抑塞磊落:"yì sè lěi luò",倚闾望切:"yǐ lǘ wàng qiē",以意为之:"yǐ yì wéi zhī",以言为讳:"yǐ yán wéi huì",以疏间亲:"yǐ shū jiàn qīn",以水济水:"yǐ shuǐ jǐ shuǐ",以书为御:"yǐ shū wéi yù",以守为攻:"yǐ shǒu wéi gōng",以升量石:"yǐ shēng liáng dàn",以慎为键:"yǐ shèn wéi jiàn",以筌为鱼:"yǐ quán wéi yú",以利累形:"yǐ lì lěi xíng",以毁为罚:"yǐ huǐ wéi fá",以黑为白:"yǐ hēi wéi bái",以规为瑱:"yǐ guī wéi tiàn",以古为鉴:"yǐ gǔ wéi jiàn",以宫笑角:"yǐ gōng xiào jué",以法为教:"yǐ fǎ wéi jiào",以大恶细:"yǐ dà wù xì",遗世忘累:"yí shì wàng lěi",遗寝载怀:"yí qǐn zài huái",移的就箭:"yí dì jiù jiàn",依头缕当:"yī tóu lǚ dàng",衣租食税:"yì zū shí shuì",衣轻乘肥:"yì qīng chéng féi",衣裳之会:"yī shang zhī huì",衣单食薄:"yī dān shí bó",一还一报:"yì huán yí bào",叶公好龙:"yè gōng hào lóng",野调无腔:"yě diào wú qiāng",瑶池女使:"yáo chí nǚ shǐ",幺麽小丑:"yāo mó xiǎo chǒu",养精畜锐:"yǎng jīng xù ruì",卬首信眉:"áng shǒu shēn méi",洋洋纚纚:"yáng yáng sǎ sǎ",羊羔美酒:"yáng gāo měi jiǔ",扬风扢雅:"yáng fēng jié yǎ",燕昭市骏:"yān zhāo shì jùn",燕昭好马:"yān zhāo hǎo mǎ",燕石妄珍:"yān shí wàng zhēn",燕骏千金:"yān jùn qiān jīn",燕金募秀:"yān jīn mù xiù",燕驾越毂:"yān jià yuè gǔ",燕歌赵舞:"yān gē zhào wǔ",燕岱之石:"yān dài zhī shí",燕处危巢:"yàn chǔ wēi cháo",掞藻飞声:"shàn zǎo fēi shēng",偃革为轩:"yǎn gé wéi xuān",妍蚩好恶:"yán chī hǎo è",压良为贱:"yā liáng wéi jiàn",搀行夺市:"chān háng duó shì",泣数行下:"qì shù háng xià",当行出色:"dāng háng chū sè",秀出班行:"xiù chū bān háng",儿女成行:"ér nǚ chéng háng",大行大市:"dà háng dà shì",寻行数墨:"xún háng shǔ mò",埙篪相和:"xūn chí xiāng hè",血债累累:"xuè zhài lěi lěi",炫玉贾石:"xuàn yù gǔ shí",炫石为玉:"xuàn shí wéi yù",悬石程书:"xuán dàn chéng shū",悬狟素飡:"xuán huán sù cān",悬龟系鱼:"xuán guī xì yú",揎拳捋袖:"xuān quán luō xiù",轩鹤冠猴:"xuān hè guàn hóu",畜妻养子:"xù qī yǎng zǐ",羞人答答:"xiū rén dā dā",修鳞养爪:"xiū lín yǎng zhǎo",熊据虎跱:"xióng jù hǔ zhì",兄死弟及:"xiōng sǐ dì jí",腥闻在上:"xīng wén zài shàng",兴文匽武:"xīng wén yǎn wǔ",兴观群怨:"xìng guān qún yuàn",兴高彩烈:"xìng gāo cǎi liè",心手相应:"xīn shǒu xiāng yìng",心口相应:"xīn kǒu xiāng yīng",挟势弄权:"xié shì nòng quán",胁肩累足:"xié jiān lěi zú",校短量长:"jiào duǎn liáng cháng",小眼薄皮:"xiǎo yǎn bó pí",硝云弹雨:"xiāo yún dàn yǔ",鸮鸣鼠暴:"xiāo míng shǔ bào",削株掘根:"xuē zhū jué gēn",削铁无声:"xuē tiě wú shēng",削职为民:"xuē zhí wéi mín",削木为吏:"xuē mù wéi lì",想望风褱:"xiǎng wàng fēng huái",香培玉琢:"xiang pei yu zhuó",相鼠有皮:"xiàng shǔ yǒu pí",相时而动:"xiàng shí ér dòng",相切相磋:"xiāng qiē xiāng cuō",相女配夫:"xiàng nǚ pèi fū",相门有相:"xiàng mén yǒu xiàng",挦章撦句:"xián zhāng chě jù",先我着鞭:"xiān wǒ zhuó biān",习焉不察:"xí yān bù chá",歙漆阿胶:"shè qī ē jiāo",晰毛辨发:"xī máo biàn fà",悉索薄赋:"xī suǒ bó fù",雾鳞云爪:"wù lín yún zhǎo",物稀为贵:"wù xī wéi guì",碔砆混玉:"wǔ fū hùn yù",武断专横:"wǔ duàn zhuān héng",五石六鹢:"wǔ shí liù yì",五色相宣:"wǔ sè xiāng xuān",五侯七贵:"wǔ hóu qī guì",五侯蜡烛:"wǔ hòu là zhú",五羖大夫:"wǔ gǔ dà fū",吾自有处:"wú zì yǒu chǔ",无下箸处:"wú xià zhù chǔ",无伤无臭:"wú shāng wú xiù",无能为役:"wú néng wéi yì",无寇暴死:"wú kòu bào sǐ",无孔不钻:"wú kǒng bú zuàn",无间可乘:"wú jiān kě chéng",无间冬夏:"wú jiān dōng xià",无恶不为:"wú è bù wéi",无动为大:"wú dòng wéi dà",诬良为盗:"wū liáng wéi dào",握拳透爪:"wò quán tòu zhǎo",文武差事:"wén wǔ chāi shì",委委佗佗:"wēi wēi tuó tuó",惟日为岁:"wéi rì wéi suì",帷薄不修:"wéi bó bù xiū",为善最乐:"wéi shàn zuì lè",为山止篑:"wéi shān zhǐ kuì",为仁不富:"wéi rén bú fù",为裘为箕:"wéi qiú wéi jī",为民父母:"wéi mín fù mǔ",为虺弗摧:"wéi huǐ fú cuī",为好成歉:"wéi hǎo chéng qiàn",为鬼为蜮:"wéi guǐ wéi yù",望风响应:"wàng fēng xiǎng yīng",望尘僄声:"wàng chén piào shēng",往渚还汀:"wǎng zhǔ huán tīng",王贡弹冠:"wáng gòng dàn guàn",亡国大夫:"wáng guó dà fū",万贯家私:"wàn guàn jiā sī",晚食当肉:"wǎn shí dàng ròu",晚节不保:"wǎn jié bù bǎo",玩岁愒时:"wán suì kài shí",蛙蟆胜负:"wā má shèng fù",吞言咽理:"tūn yán yàn lǐ",颓垣断堑:"tuí yuán duàn qiàn",推干就湿:"tuī gàn jiù shī",剸繁决剧:"tuán fán jué jù",团头聚面:"tuán tóu jù miàn",兔丝燕麦:"tù sī yàn mài",兔头麞脑:"tù tóu zhāng nǎo",兔葵燕麦:"tù kuí yàn mài",吐哺握发:"tǔ bǔ wò fà",投传而去:"tóu zhuàn ér qù",头没杯案:"tóu mò bēi àn",头昏脑闷:"tóu hūn nǎo mèn",头会箕敛:"tóu kuài jī liǎn",头出头没:"tóu chū tóu mò",痛自创艾:"tòng zì chuāng yì",同恶相助:"tóng wù xiāng zhù",同恶相恤:"tóng wù xiāng xù",痌瘝在抱:"tōng guān zài bào",通文调武:"tōng wén diào wǔ",停留长智:"tíng liú zhǎng zhì",铁树开华:"tiě shù kāi huā",条贯部分:"tiáo guàn bù fēn",挑牙料唇:"tiǎo yá liào chún",挑么挑六:"tiāo yāo tiāo liù",挑唇料嘴:"tiǎo chún liào zuǐ",恬不为意:"tián bù wéi yì",恬不为怪:"tián bù wéi guài",天下为笼:"tiān xià wéi lóng",天台路迷:"tiān tái lù mí",天年不遂:"tiān nián bú suì",探囊胠箧:"tàn náng qū qiè",谭言微中:"tán yán wēi zhòng",谈言微中:"tán yán wēi zhòng",狧穅及米:"shì kāng jí mǐ",随物应机:"suí wù yīng jī",搜岩采干:"sōu yán cǎi gàn",宋斤鲁削:"sòng jīn lǔ xuē",松筠之节:"sōng yún zhī jié",四亭八当:"sì tíng bā dàng",四马攒蹄:"sì mǎ cuán tí",四不拗六:"sì bú niù liù",思所逐之:"sī suǒ zhú zhī",丝恩发怨:"sī ēn fà yuàn",硕望宿德:"shuò wàng xiǔ dé",铄古切今:"shuò gǔ qiē jīn",顺风而呼:"shùn fēng ér hū",顺风吹火:"shùn fēng chuī huǒ",水中著盐:"shuǐ zhōng zhuó yán",双柑斗酒:"shuāng gān dǒu jiǔ",数米而炊:"shǔ mǐ ér chuī",数米量柴:"shǔ mǐ liáng chái",数理逻辑:"shù lǐ luó ji",数黑论黄:"shǔ hēi lùn huáng",数白论黄:"shǔ bái lùn huáng",束缊还妇:"shù yūn huán fù",束蒲为脯:"shù pú wéi pú",束椽为柱:"shù chuán wéi zhù",书缺有间:"shū quē yǒu jiàn",手足重茧:"shǒu zú chóng jiǎn",手足异处:"shǒu zú yì chǔ",手脚干净:"shǒu jiǎo gàn jìng",手不应心:"shǒu bù yīng xīn",螫手解腕:"shì shǒu jiě wàn",释知遗形:"shì zhī yí xíng",适时应务:"shì shí yīng wù",适情率意:"shì qíng shuài yì",适当其冲:"shì dāng qí chōng",视为知己:"shì wéi zhī jǐ",使羊将狼:"shǐ yáng jiàng láng",食为民天:"shí wéi mín tiān",拾掇无遗:"shí duō wú yí",实与有力:"shí yù yǒu lì",石英玻璃:"shí yīng bō li",石室金匮:"shí shì jīn guì",什袭珍藏:"shí xí zhēn cáng",什伍东西:"shí wǔ dōng xī",什围伍攻:"shí wéi wǔ gōng",十魔九难:"shí mó jiǔ nàn",诗书发冢:"shī shū fà zhǒng",虱处裈中:"shī chǔ kūn zhōng",师直为壮:"shī zhí wéi zhuàng",尸居龙见:"shī jū lóng xiàn",圣经贤传:"shèng jīng xián zhuàn",圣君贤相:"shèng jūn xián xiàng",生拖死拽:"shēng tuō sǐ zhuài",审己度人:"shěn jǐ duó rén",神武挂冠:"shén wǔ guà guàn",神龙失埶:"shén lóng shī shì",深文曲折:"shēn wén qǔ shé",深厉浅揭:"shēn lì qiǎn qì",深谷为陵:"shēn gǔ wéi líng",深恶痛疾:"shēn wù tòng jí",深仇宿怨:"shēn chóu xiǔ yuàn",舍己为公:"shě jǐ wèi gōng",舍短取长:"shě duǎn qǔ cháng",舍策追羊:"shě cè zhuī yáng",蛇蝎为心:"shé xiē wéi xīn",少成若性:"shào chéng ruò xìng",上当学乖:"shàng dàng xué guāi",赏不当功:"shǎng bù dāng gōng",善自为谋:"shàn zì wéi móu",善为说辞:"shàn wéi shuō cí",善善恶恶:"shàn shàn wù è",善财难舍:"shàn cái nán shě",苫眼铺眉:"shān yǎn pū méi",讪牙闲嗑:"shàn yá xián kē",山阴乘兴:"shān yīn chéng xīng",山殽野湋:"shān yáo yě wéi",山溜穿石:"shān liù chuān shí",山节藻棁:"shān jié zǎo zhuō",杀鸡为黍:"shā jī wéi shǔ",色厉胆薄:"sè lì dǎn bó",桑荫未移:"sāng yīn wèi yí",桑荫不徙:"sāng yīn bù xǐ",桑土绸缪:"sāng tǔ chóu miù",桑户棬枢:"sāng hù juàn shū",三战三北:"sān zhàn sān běi",三瓦两舍:"sān wǎ liǎng shě",三人为众:"sān rén wèi zhòng",三差两错:"sān chā liǎng cuò",塞井焚舍:"sāi jǐng fén shě",洒心更始:"sǎ xīn gèng shǐ",洒扫应对:"sǎ sǎo yìng duì",软红香土:"ruǎn hóng xiāng tǔ",入吾彀中:"rù wú gòu zhōng",入铁主簿:"rù tiě zhǔ bù",入理切情:"rù lǐ qiē qíng",汝成人耶:"rǔ chéng rén yé",如水投石:"rú shuǐ tóu shí",如切如磋:"rú qiē rú cuō",如登春台:"rú dēng chūn tái",肉薄骨并:"ròu bó gǔ bìng",柔情绰态:"róu qíng chuò tài",戎马劻勷:"róng mǎ kuāng ráng",日中为市:"rì zhōng wéi shì",日月参辰:"rì yuè shēn chén",日省月修:"rì xǐng yuè xiū",日削月割:"rì xuē yuè gē",日省月试:"rì xǐng yuè shì",任达不拘:"rèn dá bù jū",人言藉藉:"rén yán jí jí",人模狗样:"rén mú gǒu yàng",人莫予毒:"rén mò yú dú",热熬翻饼:"rè áo fān bǐng",圈牢养物:"juàn láo yǎng wù",取予有节:"qǔ yǔ yǒu jié",诎要桡腘:"qū yāo ráo guó",穷形尽相:"qióng xíng jìn xiàng",情凄意切:"qíng qī yì qiè",情见势屈:"qíng xiàn shì qū",情见乎辞:"qíng xiàn hū cí",清都绛阙:"qīng dōu jiàng què",倾肠倒肚:"qīng cháng dào dǔ",青紫被体:"qīng zǐ pī tǐ",青林黑塞:"qīng lín hēi sài",螓首蛾眉:"qín shǒu é méi",琴瑟之好:"qín sè zhī hào",且住为佳:"qiě zhù wéi jiā",切树倒根:"qiē shù dǎo gēn",切理餍心:"qiē lǐ yàn xīn",切近的当:"qiē jìn de dāng",翘足引领:"qiáo zú yǐn lǐng",巧发奇中:"qiǎo fā qí zhòng",强嘴拗舌:"jiàng zuǐ niù shé",强直自遂:"qiáng zhí zì suí",强死强活:"qiǎng sǐ qiǎng huó",强食自爱:"qiǎng shí zì ài",强食靡角:"qiǎng shí mí jiǎo",强弓劲弩:"qiáng gōng jìng nǔ",强聒不舍:"qiǎng guō bù shě",强凫变鹤:"qiáng fú biàn hè",强而后可:"qiǎng ér hòu kě",强得易贫:"qiǎng dé yì pín",遣兴陶情:"qiǎn xìng táo qíng",牵羊担酒:"qiān yáng dān jiǔ",千了百当:"qiān liǎo bǎi dàng",泣下如雨:"qì xià rú yǔ",起偃为竖:"qǐ yǎn wéi shù",岂弟君子:"kǎi tì jūn zǐ",綦溪利跂:"qí xī lì qí",棋输先著:"qí shū xiān zhuó",齐王舍牛:"qí wáng shě niú",欺天诳地:"qī tiān kuáng dì",普天率土:"pǔ tiān shuài tǔ",铺胸纳地:"pū xiōng nà dì",铺锦列绣:"pū jǐn liè xiù",破家为国:"pò jiā wèi guó",破觚为圜:"pò gū wéi yuán",萍飘蓬转:"píng piāo péng zhuàn",帡天极地:"píng tiān jí dì",屏声息气:"bǐng shēng xī qì",凭几据杖:"píng jī jù zhàng",贫嘴薄舌:"pín zuǐ bó shé",片语只辞:"piàn yǔ zhī cí",披发文身:"pī fà wén shēn",烹龙炮凤:"pēng lóng páo fèng",炰鳖脍鲤:"fǒu biē kuài lǐ",庞眉皓发:"páng méi hào fà",攀花折柳:"pān huā zhé liǔ",攀蟾折桂:"pān chán shé guì",女大难留:"nǚ dà nán liú",弄玉吹箫:"nòng yù chuī xiāo",弄管调弦:"nòng guǎn tiáo xián",弄粉调朱:"nòng fěn diào zhū",浓抹淡妆:"nóng mò dàn zhuāng",捻土为香:"niǎn tǔ wéi xiāng",年谊世好:"nián yì shì hǎo",年华垂暮:"nián huá chuí mù",儗不于伦:"nǐ bù yú lún",泥而不滓:"ní ér bù zǐ",能者为师:"néng zhě wéi shī",能不称官:"néng bú chèn guān",挠直为曲:"náo zhí wéi qū",难进易退:"nán jìn yì tuì",难得糊涂:"nán dé hú tú",南蛮鴂舌:"nán mán jué shé",南贩北贾:"nán fàn běi gǔ",牧猪奴戏:"mù zhū nú xì",目眢心忳:"mù yuān xīn tún",目挑心招:"mù tiǎo xīn zhāo",目量意营:"mù liàng yì yíng",木头木脑:"mù tóu mù nǎo",木干鸟栖:"mù gàn niǎo qī",侔色揣称:"móu sè chuǎi chèn",莫予毒也:"mò yú dú yě",抹粉施脂:"mò fěn shī zhī",磨砻镌切:"mó lóng juān qiē",磨棱刓角:"mó léng wán jiǎo",摸门不着:"mō mén bù zháo",摸不着边:"mō bù zhuó biān",命中注定:"mìng zhōng zhù dìng",鸣鹤之应:"míng hè zhī yìng",明效大验:"míng xiào dà yàn",名我固当:"míng wǒ gù dāng",邈处欿视:"miǎo chǔ kǎn shì",黾穴鸲巢:"měng xué qú cháo",绵里薄材:"mián lǐ bó cái",靡有孑遗:"mǐ yǒu jié yí",靡衣偷食:"mǐ yī tōu shí",迷恋骸骨:"mí liàn hái gǔ",扪参历井:"mén shēn lì jǐng",门单户薄:"mén dān hù bó",昧旦晨兴:"mèi dàn chén xīng",冒名接脚:"mào míng jiē jiǎo",毛遂堕井:"máo suí duò jǐng",毛发倒竖:"máo fā dǎo shù",卖文为生:"mài wén wéi shēng",卖李钻核:"mài lǐ zuān hé",买椟还珠:"mǎi dú huán zhū",埋三怨四:"mán sān yuàn sì",马入华山:"mǎ rù huá shān",落魄江湖:"luò pò jiāng hú",落落难合:"luò luò nán hé",落草为寇:"luò cǎo wéi kòu",罗织构陷:"luó zhī gòu xiàn",鸾凤和鸣:"luán fèng hè míng",率由旧章:"shuài yóu jiù zhāng",率土同庆:"shuài tǔ tóng qìng",率兽食人:"shuài shòu shí rén",率土归心:"shuài tǔ guī xīn",率马以骥:"shuài mǎ yǐ jì",率尔成章:"shuài ěr chéng zhāng",鲁斤燕削:"lǔ jīn yàn xuē",漏尽更阑:"lòu jìn gēng lán",笼鸟槛猿:"lóng niǎo jiàn yuán",笼鸟池鱼:"lóng niǎo chí yú",龙游曲沼:"lóng yóu qū zhǎo",龙血玄黄:"lóng xuè xuán huáng",龙雕凤咀:"lóng diāo fèng jǔ",六尺之讬:"liù chǐ zhī tuō",令原之戚:"líng yuán zhī qī",令人捧腹:"lìng rén pěng fù",陵劲淬砺:"líng jìng cuì lì",临敌易将:"lín dí yì jiàng",裂裳衣疮:"liè shang yī chuāng",裂冠毁冕:"liè guàn huǐ miǎn",了无惧色:"liǎo wú jù sè",了身达命:"liǎo shēn dá mìng",了然无闻:"liǎo rán wú wén",了不可见:"liǎo bù kě jiàn",了不长进:"liǎo bù zhǎng jìn",燎发摧枯:"liǎo fà cuī kū",审时度势:"shěn shí duó shì",量小力微:"liàng xiǎo lì wēi",相时度力:"xiāng shí duó lì",量枘制凿:"liàng ruì zhì záo",量如江海:"liàng rú jiāng hǎi",量金买赋:"liàng jīn mǎi fù",量己审分:"liàng jǐ shěn fēn",敛骨吹魂:"liǎn gǔ chuī hún",詈夷为跖:"lì yí wéi zhí",利令志惛:"lì lìng zhì hūn",李广不侯:"lǐ guǎng bú hòu",礼为情貌:"lǐ wéi qíng mào",礼让为国:"lǐ ràng wéi guó",犁生骍角:"lí shēng xīng jiǎo",离本徼末:"lí běn jiǎo mò",楞眉横眼:"léng méi hèng yǎn",擂天倒地:"léi tiān dǎo dì",累足成步:"lěi zú chéng bù",累瓦结绳:"lěi wǎ jié shéng",累土至山:"lěi tǔ zhì shān",累土聚沙:"lěi tǔ jù shā",累卵之危:"lěi luǎn zhī wēi",累累如珠:"lěi lěi rú zhū",累块积苏:"lěi kuài jī sū",乐山乐水:"lè shān lè shuǐ",潦原浸天:"lǎo yuán jìn tiān",老师宿儒:"lǎo shī xiǔ rú",牢什古子:"láo shí gǔ zi",琅嬛福地:"láng huán fú dì",揆情度理:"kuí qíng duó lǐ",旷日累时:"kuàng rì lěi shí",匡救弥缝:"kuāng jiù mí fèng",枯树生华:"kū shù shēng huā",口轻舌薄:"kǒu qīng shé bó",口角生风:"kǒu jiǎo shēng fēng",口角春风:"kǒu jiǎo chūn fēng",口角风情:"kǒu jiǎo fēng qíng",口干舌焦:"kǒu gān shé jiāo",口腹之累:"kǒu fù zhī lěi",空腹便便:"kōng fù pián pián",嗑牙料嘴:"kē yá liào zuǐ",刻木为鹄:"kè mù wéi hú",咳珠唾玉:"ké zhū tuò yù",咳唾成珠:"ké tuò chéng zhū",抗颜为师:"kàng yán wéi shī",开华结果:"kāi huā jié guǒ",峻阪盐车:"jùn bǎn yán chē",嚼铁咀金:"jiáo tiě jǔ jīn",嚼墨喷纸:"jué mò pēn zhǐ",倔头强脑:"juè tóu jiàng nǎo",倔头倔脑:"juè tóu juè nǎo",倦鸟知还:"juàn niǎo zhī huán",卷席而葬:"juǎn xí ér zàng",卷甲倍道:"juǎn jiǎ bèi dào",聚米为山:"jù mǐ wéi shān",举手相庆:"jǔ shǒu xiāng qìng",举世混浊:"jǔ shì hún zhuó",鞠为茂草:"jū wéi mào cǎo",拘神遣将:"jū shén qiǎn jiàng",居下讪上:"jū xià shàn shàng",久要不忘:"jiǔ yāo bú wàng",九转功成:"jiǔ zhuǎn gōng chéng",九蒸三熯:"jiǔ zhēng sān hàn",敬业乐群:"jìng yè lè qún",井底虾蟆:"jǐng dǐ xiā má",旌旗卷舒:"jīng qí juǎn shū",荆棘载途:"jīng jí zài tú",禁舍开塞:"jìn shě kāi sāi",祲威盛容:"jìn wēi shèng róng",进退消长:"jìn tuì xiāo cháng",进退应矩:"jìn tuì yīng jǔ",进退触籓:"jìn tuì chù fān",进退跋疐:"jìn tuì bá zhì",尽多尽少:"jǐn duō jǐn shǎo",锦囊还矢:"jǐn náng huán shǐ",矜己自饰:"jīn jǐ zì shì",矜功负气:"jīn gōng fù qì",津关险塞:"jīn guān xiǎn sài",金吾不禁:"jīn wú bú jìn",金翅擘海:"jīn chì bāi hǎi",解衣衣人:"jiě yī yī rén",解人难得:"jiě rén nán dé",解铃系铃:"jiě líng xì líng",解发佯狂:"jiě fà yáng kuáng",诘屈磝碻:"jié qū áo qiāo",教猱升木:"jiāo náo shēng mù",较瘦量肥:"jiào shòu liàng féi",角立杰出:"jiǎo lì jié chū",焦沙烂石:"jiāo shā làn shí",骄儿騃女:"jiāo ér sì nǚ",浇风薄俗:"jiāo fēng bó sú",降妖捉怪:"xiáng yāo zhuō guài",将取固予:"jiāng qǔ gù yǔ",将门有将:"jiàng mén yǒu jiàng",将夺固与:"jiāng duó gù yǔ",槛花笼鹤:"jiàn huā lóng hè",鉴影度形:"jiàn yǐng duó xíng",渐不可长:"jiàn bù kě zhǎng",见素抱朴:"xiàn sù bào pǔ",见弃于人:"jiàn qì yú rén",简丝数米:"jiǎn sī shǔ mǐ",俭不中礼:"jiǎn bú zhòng lǐ",间见层出:"jiàn xiàn céng chū",尖嘴薄舌:"jiān zuǐ bó shé",甲冠天下:"jiǎ guàn tiān xià",葭莩之亲:"jiā fú zhī qīn",家累千金:"jiā lèi qiān jīn",家给人足:"jiā jǐ rén zú",家道从容:"jiā dào cóng róng",夹袋人物:"jiā dài rén wù",霁风朗月:"jì fēng lǎng yuè",寄兴寓情:"jì xìng yù qíng",计深虑远:"jì shēn lǜ yuǎn",计功量罪:"jì gōng liàng zuì",掎裳连襼:"jǐ shang lián yì",虮虱相吊:"jǐ shī xiāng diào",疾不可为:"jí bù kě wéi",极深研几:"jí shēn yán jī",及宾有鱼:"jí bīn yǒu yú",激薄停浇:"jī bó tíng jiāo",积素累旧:"jī sù lěi jiù",积时累日:"jī shí lěi rì",积露为波:"jī lù wéi bō",积德累功:"jī dé lěi gōng",积谗糜骨:"jī chán méi gǔ",击排冒没:"jī pái mào mò",祸为福先:"huò wéi fú xiān",祸福相依:"huò fú xiāng yī",获隽公车:"huò jùn gōng chē",混应滥应:"hùn yīng làn yīng",毁舟为杕:"huǐ zhōu wéi duò",毁钟为铎:"huǐ zhōng wéi duó",毁冠裂裳:"huǐ guān liè cháng",晦盲否塞:"huì máng pǐ sè",回船转舵:"huí chuán zhuàn duò",潢池盗弄:"huáng chí dào nòng",黄冠草履:"huáng guàn cǎo lǚ",黄发儿齿:"huáng fà ér chǐ",黄发垂髫:"huáng fà chuí tiáo",还珠返璧:"huán zhū fǎn bì",还年驻色:"huán nián zhù sè",还年却老:"huán nián què lǎo",坏裳为裤:"huài shang wéi kù",画荻和丸:"huà dí huò wán",化枭为鸠:"huà xiāo wéi jiū",化腐为奇:"huà fǔ wéi qí",化鸱为凤:"huà chī wéi fèng",花不棱登:"huā bu lēng dēng",户限为穿:"hù xiàn wéi chuān",呼卢喝雉:"hū lú hè zhì",呼来喝去:"hū lái hè qù",呼不给吸:"hū bù jǐ xī",厚味腊毒:"hòu wèi xī dú",厚德载物:"hòu dé zài wù",鸿渐于干:"hóng jiàn yú gàn",洪炉燎发:"hóng lú liáo fà",红绳系足:"hóng shéng jì zú",红不棱登:"hóng bu lēng dēng",横抢硬夺:"hèng qiǎng yìng duó",横恩滥赏:"hèng ēn làn shǎng",恨海难填:"hèn hǎi nán tián",鹤发鸡皮:"hè fà jī pí",涸思干虑:"hé sī gān lǜ",河涸海干:"hé hé hǎi gān",和颜说色:"hé yán yuè sè",合从连衡:"hé zòng lián héng",浩浩汤汤:"hào hào shāng shāng",好勇斗狠:"hào yǒng dòu hěn",好问则裕:"hào wèn zé yù",好为事端:"hào wéi shì duān",好问决疑:"hào wèn jué yí",好生之德:"hào shēng zhī dé",好奇尚异:"hǎo qí shàng yì",好恶不同:"hǎo è bù tóng",好丹非素:"hào dān fēi sù",豪干暴取:"háo gàn bào qǔ",毫发不爽:"háo fà bù shuǎng",寒酸落魄:"hán suān luò pò",含英咀华:"hán yīng jǔ huá",含糊不明:"hán hú bù míng",过为已甚:"guò wéi yǐ shèn",桂折兰摧:"guì shé lán cuī",规旋矩折:"guī xuán jǔ shé",广文先生:"guǎng wén xiān sheng",广陵散绝:"guǎng líng sǎn jué",冠山戴粒:"guàn shān dài lì",冠屦倒施:"guàn jù dǎo shī",挂席为门:"guà xí wéi mén",寡见鲜闻:"guǎ jiàn xiǎn wén",瓜葛相连:"guā gé xiāng lián",鼓吻奋爪:"gǔ wěn fèn zhǎo",古调单弹:"gǔ diào dān tán",古调不弹:"gǔ diào bù tán",姑射神人:"gū yè shén rén",苟合取容:"gǒu hé qǔ róng",狗续侯冠:"gǒu xù hòu guàn",钩爪锯牙:"gōu zhǎo jù yá",共枝别干:"gòng zhī bié gàn",共为唇齿:"gòng wéi chún chǐ",拱手而降:"gǒng shǒu ér xiáng",拱肩缩背:"gǒng jiān suō bèi",功薄蝉翼:"gōng bó chán yì",弓调马服:"gōng diào mǎ fú",更姓改物:"gēng xìng gǎi wù",更仆难数:"gēng pú nán shǔ",更令明号:"gēng lìng míng hào",更待干罢:"gèng dài gàn bà",更唱迭和:"gēng chàng dié hé",更长梦短:"gēng cháng mèng duǎn",各色名样:"gè sè míng yàng",格格不纳:"gé gé bú nà",格格不吐:"gé gé bù tǔ",告朔饩羊:"gù shuò xì yáng",膏车秣马:"gào chē mò mǎ",高义薄云:"gāo yì bó yún",岗头泽底:"gāng tóu zé dǐ",敢为敢做:"gǎn wéi gǎn zuò",甘分随时:"gān fèn suí shí",甘处下流:"gān chǔ xià liú",干啼湿哭:"gàn tí shī kū",干名犯义:"gàn míng fàn yì",干将莫邪:"gān jiāng mò yé",干城之将:"gān chéng zhī jiàng",腹载五车:"fù zài wǔ chē",父债子还:"fù zhài zǐ huán",父为子隐:"fù wéi zǐ yǐn",辅世长民:"fǔ shì zhǎng mín",福为祸始:"fú wéi huò shǐ",符号逻辑:"fú hào luó jí",浮收勒折:"fú shōu lè shé",肤受之愬:"fū shòu zhī sù",否终则泰:"pǐ zhōng zé tài",佛头著粪:"fó tóu zhuó fèn",奉为楷模:"fèng wéi kǎi mó",凤靡鸾吪:"fèng mǐ luán é",封豨修蛇:"fēng xī xiū shé",风影敷衍:"fēng yǐng fū yǎn",丰屋蔀家:"fēng wū bù jiā",粪土不如:"fèn tǔ bù rú",分风劈流:"fēn fēng pǐ liú",沸沸汤汤:"fèi fèi shāng shāng",菲食薄衣:"fěi shí bó yī",飞将数奇:"fēi jiàng shù qí",放辟邪侈:"fàng pì xié chǐ",方领圆冠:"fāng lǐng yuán guàn",犯而不校:"fàn ér bú jiào",返本还源:"fǎn běn huán yuán",反劳为逸:"fǎn láo wéi yì",法轮常转:"fǎ lún cháng zhuàn",罚不当罪:"fá bù dāng zuì",发引千钧:"fà yǐn qiān jūn",发奸擿伏:"fā jiān tī fú",发短心长:"fà duǎn xīn cháng",二竖为虐:"èr shù wéi nüè",儿女心肠:"ér nǚ xīn cháng",儿女亲家:"ér nǚ qìng jiā",遏恶扬善:"è wù yáng shàn",饿殍枕藉:"è piǎo zhěn jí",饿殍载道:"è piǎo zài dào",恶醉强酒:"wù zuì qiǎng jiǔ",恶意中伤:"è yì zhòng shāng",恶湿居下:"wù shī jū xià",恶居下流:"wù jū xià liú",恶不去善:"wù bú qù shàn",扼吭夺食:"è háng duó shí",扼襟控咽:"è jīn kòng yān",峨峨汤汤:"é é shāng shāng",屙金溺银:"ē jīn niào yín",朵颐大嚼:"duǒ yí dà jiáo",夺人所好:"duó rén suǒ hào",多言数穷:"duō yán shuò qióng",多文为富:"duō wén wéi fù",多端寡要:"duō duān guǎ yào",多财善贾:"duō cái shàn gǔ",遁世无闷:"dùn shì wú mèn",遁迹黄冠:"dùn jì huáng guàn",堆案盈几:"duī àn yíng jī",断还归宗:"duàn huán guī zōng",短见薄识:"duǎn jiàn bó shí",蠹居棊处:"dù jū qí chǔ",度己以绳:"duó jǐ yǐ shéng",杜默为诗:"dù mò wéi shī",杜鹃啼血:"dù juān tí xuè",笃近举远:"dǔ jìn jǔ yuǎn",独有千秋:"dú yǒu qiān qiū",读书得间:"dú shū dé jiàn",斗转参横:"dǒu zhuǎn shēn héng",兜肚连肠:"dōu dǔ lián cháng",洞见症结:"dòng jiàn zhèng jié",恫疑虚喝:"dòng yí xū hè",动中窾要:"dòng zhōng kuǎn yào",东鸣西应:"dōng míng xī yīng",东鳞西爪:"dōng lín xī zhǎo",东量西折:"dōng liàng xī shé",东家西舍:"dōng jiā xī shè",东扯西拽:"dōng chě xī zhuāi",鼎铛有耳:"dǐng chēng yǒu ěr",鼎铛玉石:"dǐng chēng yù shí",钉头磷磷:"dīng tóu lín lín",跌宕不羁:"diē dàng bù jī",跌弹斑鸠:"diē dàn bān jiū",雕心雁爪:"diāo xīn yàn zhǎo",颠倒衣裳:"diān dǎo yī cháng",德薄能鲜:"dé bó néng xiǎn",得马折足:"dé mǎ shé zú",蹈其覆辙:"dǎo qí fù zhé",捣虚撇抗:"dǎo xū piē kàng",倒载干戈:"dào zài gān gē",倒裳索领:"dào cháng suǒ lǐng",倒果为因:"dào guǒ wéi yīn",叨在知己:"tāo zài zhī jǐ",叨陪末座:"tāo péi mò zuò",党豺为虐:"dǎng chái wéi nüè",当轴处中:"dāng zhóu chǔ zhōng",当着不着:"dāng zhuó bù zhuó",当务始终:"dāng wù shǐ zhōng",淡汝浓抹:"dàn rǔ nóng mǒ",弹丸脱手:"tán wán tuō shǒu",弹铗无鱼:"dàn jiá wú yú",箪食瓢饮:"dān sì piáo yǐn",大璞不完:"dà pú bù wán",大明法度:"dà míng fǎ dù",大车以载:"dà chē yǐ zài",打闷葫芦:"dǎ mèn hú lu",沓来踵至:"tà lái zhǒng zhì",厝火燎原:"cuò huǒ liǎo yuán",撮科打哄:"cuō kē dǎ hòng",寸积铢累:"cùn jī zhū lěi",啛啛喳喳:"cuì cuì chā chā",摧折豪强:"cuī zhé háo qiáng",摧刚为柔:"cuī gāng wéi róu",从俗就简:"cóng sú jiù jiǎn",此发彼应:"cǐ fā bǐ yīng",此唱彼和:"cǐ chàng bǐ hè",慈悲为本:"cí bēi wéi běn",纯属骗局:"chún shǔ piàn jú",春笋怒发:"chūn sǔn nù fā",垂头搨翼:"chuí tóu tà yì",传为笑谈:"chuán wéi xiào tán",传风扇火:"chuán fēng shān huǒ",穿红着绿:"chuān hóng zhuó lǜ",触处机来:"chù chǔ jī lái",处尊居显:"chǔ zūn jū xiǎn",处堂燕雀:"chǔ táng yàn què",处实效功:"chǔ shí xiào gōng",处高临深:"chǔ gāo lín shēn",出入无间:"chū rù wú jiān",出门应辙:"chū mén yīng zhé",出处语默:"chū chǔ yǔ mò",出处殊途:"chū chǔ shū tú",出处进退:"chū chǔ jìn tuì",愁山闷海:"chóu shān mèn hǎi",冲冠眦裂:"chōng guàn zì liè",齿牙为祸:"chǐ yá wéi huò",尺二冤家:"chǐ èr yuān jia",尺短寸长:"chǐ duǎn cùn cháng",尺寸之功:"chǐ cùn zhī gōng",城北徐公:"chéng běi xú gōng",成败兴废:"chéng bài xīng fèi",趁水和泥:"chèn shuǐ huò ní",称雨道晴:"chēng yǔ dào qíng",称体载衣:"chēng tǐ zài yī",称体裁衣:"chèn tǐ cái yī",称家有无:"chèn jiā yǒu wú",称德度功:"chēng dé duó gōng",沉吟章句:"chén yín zhāng jù",沉吟不决:"chén yín bù jué",沉疴宿疾:"chén kē sù jí",扯纤拉烟:"chě qiàn lā yān",扯顺风旗:"chě shùn fēng qí",车载船装:"chē zǎi chuán zhuāng",朝升暮合:"zhāo shēng mù gě",朝攀暮折:"zhāo pān mù shé",超今冠古:"chāo jīn guàn gǔ",倡而不和:"chàng ér bú hè",畅所欲为:"chàng suǒ yù wéi",苌弘碧血:"cháng hóng bì xiě",长幼尊卑:"zhǎng yòu zūn bēi",长绳系日:"cháng shéng jì rì",长年三老:"zhǎng nián sān lǎo",长春不老:"cháng chūn bù lǎo",长傲饰非:"zhǎng ào shì fēi",昌亭旅食:"chāng tíng lǚ shí",禅絮沾泥:"chán xù zhān ní",差三错四:"chā sān cuò sì",层台累榭:"céng tái lěi xiè",层见迭出:"céng xiàn dié chū",藏踪蹑迹:"cáng zōng niè jì",苍蝇见血:"cāng yíng jiàn xiě",餐松啖柏:"cān sōng dàn bó",骖风驷霞:"cān fēng sì xiá",参伍错综:"cēn wǔ cuò zōng",参辰卯酉:"shēn chén mǎo yǒu",材优干济:"cái yōu gān jǐ",材薄质衰:"cái bó zhì shuāi",才大难用:"cái dà nán yòng",才薄智浅:"cái bó zhì qiǎn",不足为意:"bù zú wéi yì",不足为据:"bù zú wéi jù",不足为法:"bù zú wéi fǎ",不足齿数:"bù zú chǐ shǔ",不着疼热:"bù zhuó téng rè",不知薡蕫:"bù zhī dǐng dǒng",不越雷池:"bú yuè léi chí",不相为谋:"bù xiāng wéi móu",不贪为宝:"bù tān wéi bǎo",不了而了:"bù liǎo ér liǎo",不可揆度:"bù kě kuí duó",不遑启处:"bù huáng qǐ chǔ",不当不正:"bù dāng bú zhèng",不差什么:"bú chà shén me",不差累黍:"bù chā lěi shǔ",擘两分星:"bò liǎng fēn xīng",簸土扬沙:"bǒ tǔ yáng shā",薄物细故:"bó wù xì gù",薄寒中人:"bó hán zhòng rén",博文约礼:"bó wén yuē lǐ",播糠眯目:"bō kāng mí mù",剥皮抽筋:"bō pí chōu jīn",剥肤椎髓:"bō fū chuí suǐ",波属云委:"bō zhǔ yún wěi",波骇云属:"bō hài yún zhǔ",兵微将寡:"bīng wēi jiàng guǎ",兵强将勇:"bīng qiáng jiàng yǒng",兵多将广:"bīng duō jiàng guǎng",兵不由将:"bīng bù yóu jiàng",冰解的破:"bīng jiě dì pò",彬彬济济:"bīn bīn jǐ jǐ",摽梅之年:"biào méi zhī nián",表里为奸:"biǎo lǐ wéi jiān",飙发电举:"biāo fā diàn jǔ",变贪厉薄:"biàn tān lì bó",敝盖不弃:"bì gài bú qì",秕言谬说:"bǐ yán miù shuō",比物属事:"bǐ wù zhǔ shì",被山带河:"pī shān dài hé",被甲枕戈:"pī jiǎ zhěn gē",被甲据鞍:"pī jiǎ jù ān",被褐怀玉:"pī hè huái yù",被发缨冠:"pī fà yīng guàn",背曲腰躬:"bèi qǔ yāo gōng",北窗高卧:"běi chuāng gāo wò",北辰星拱:"běi chén xīng gǒng",北鄙之音:"běi bǐ zhī yīn",卑宫菲食:"bēi gōng fěi shí",暴衣露冠:"pù yī lù guàn",暴腮龙门:"pù sāi lóng mén",暴露文学:"bào lù wén xué",暴虎冯河:"bào hǔ píng hé",抱蔓摘瓜:"bào wàn zhāi guā",抱法处势:"bào fǎ chǔ shì",褒贬与夺:"bāo biǎn yǔ duó",帮闲钻懒:"bāng xián zuān lǎn",拜将封侯:"bài jiàng fēng hóu",百兽率舞:"bǎi shòu shuài wǔ",百孔千创:"bǎi kǒng qiān chuāng",白衣卿相:"bái yī qīng xiàng",白首为郎:"bái shǒu wéi láng",白首相知:"bái shǒu xiāng zhī",把玩无厌:"bǎ wán wú yàn",拔锅卷席:"bá guō juǎn xí",拔本塞源:"bá běn sè yuán",傲不可长:"ào bù kě zhǎng",熬更守夜:"áo gēng shǒu yè",安时处顺:"ān shí chǔ shùn",安身为乐:"ān shēn wéi lè",安老怀少:"ān lǎo huái shào",安步当车:"ān bù dàng chē",爱人好士:"ài rén hào shì",矮人观场:"ǎi rén guān chǎng",捱风缉缝:"ái fēng jī fèng",挨山塞海:"āi shān sè hǎi",阿家阿翁:"ā jiā ā wēng",阿党相为:"ē dǎng xiāng wéi",追亡逐北:"zhuī wáng zhú běi",竹篮打水:"zhú lán dá shuǐ",知疼着热:"zhī téng zháo rè",语不惊人:"yǔ bù jīng rén",于今为烈:"yú jīn wéi liè",一日三省:"yí rì sān xǐng",穴居野处:"xué jū yě chǔ",五脊六兽:"wǔ jǐ liù shòu",无声无臭:"wú shēng wú xiù",谓予不信:"wèi yú bú xìn",舍身为国:"shě shēn wéi guó",杀妻求将:"shā qī qiú jiàng",强作解人:"qiǎng zuò jiě rén",气冲斗牛:"qì chōng dǒu niú",临深履薄:"lín shēn lǚ bó",钧天广乐:"jūn tiān guǎng yuè",艰难竭蹶:"jiān nán jié jué",夹七夹八:"jiā qī jiā bā",混混噩噩:"hún hún è è",厚古薄今:"hòu gǔ bó jīn",鬼怕恶人:"guǐ pà è rén",伽马射线:"gā mǎ shè xiàn",佛头着粪:"fó tóu zhuó fèn",奉为至宝:"fèng wéi zhì bǎo",登坛拜将:"dēng tán bài jiàng",晨昏定省:"chén hūn dìng xǐng",察察为明:"chá chá wéi míng",博闻强识:"bó wén qiáng zhì",避难就易:"bì nán jiù yì",了无生机:"liǎo wú shēng jī",有一说一:"yǒu yī shuō yī",独一无二:"dú yī wú èr",说一不二:"shuō yī bù èr",举一反三:"jǔ yī fǎn sān",数一数二:"shǔ yī shǔ èr",杀一儆百:"shā yī jǐng bǎi",丁一卯二:"dīng yī mǎo èr",丁一确二:"dīng yī què èr",不一而止:"bù yī ér zhǐ",无一幸免:"wú yī xìng miǎn",表里不一:"biǎo lǐ bù yī",良莠不一:"liáng yǒu bù yī",心口不一:"xīn kǒu bù yī",言行不一:"yán xíng bù yī",政令不一:"zhèng lìng bù yī",参差不一:"cēn cī bù yī",纷纷不一:"fēn fēn bù yī",毁誉不一:"huǐ yù bù yī",不一而三:"bù yī ér sān",百不一遇:"bǎi bù yī yù",言行抱一:"yán xíng bào yī",瑜百瑕一:"yú bǎi xiá yī",背城借一:"bèi chéng jiè yī",凭城借一:"píng chéng jiè yī",劝百讽一:"quàn bǎi fěng yī",群居和一:"qún jū hé yī",百不获一:"bǎi bù huò yī",百不失一:"bǎi bù shī yī",百无失一:"bǎi wú shī yī",万不失一:"wàn bù shī yī",万无失一:"wàn wú shī yī",合而为一:"hé ér wéi yī",合两为一:"hé liǎng wéi yī",合二为一:"hé èr wéi yī",天下为一:"tiān xià wéi yī",相与为一:"xiāng yǔ wéi yī",较若画一:"jiào ruò huà yī",较如画一:"jiào rú huà yī",斠若画一:"jiào ruò huà yī",言行若一:"yán xíng ruò yī",始终若一:"shǐ zhōng ruò yī",终始若一:"zhōng shǐ ruò yī",惟精惟一:"wéi jīng wéi yī",众多非一:"zhòng duō fēi yī",不能赞一:"bù néng zàn yī",问一答十:"wèn yī dá shí",一不扭众:"yī bù niǔ zhòng",一以贯之:"yī yǐ guàn zhī",一以当百:"yī yǐ dāng bǎi",百不当一:"bǎi bù dāng yī",十不当一:"shí bù dāng yī",以一警百:"yǐ yī jǐng bǎi",以一奉百:"yǐ yī fèng bǎi",以一持万:"yǐ yī chí wàn",以一知万:"yǐ yī zhī wàn",百里挑一:"bǎi lǐ tiāo yī",整齐划一:"zhěng qí huà yī",一来二去:"yī lái èr qù",一路公交:"yī lù gōng jiāo",一路汽车:"yī lù qì chē",一路巴士:"yī lù bā shì",朝朝朝落:"zhāo cháo zhāo luò",曲意逢迎:"qū yì féng yíng",一行不行:"yì háng bù xíng",行行不行:"háng háng bù xíng"},cle=Object.keys(DI).map(e=>({zh:e,pinyin:DI[e],probability:2e-8,length:4,priority:Wl.Normal,dict:Symbol("dict4")})),FI={巴尔干半岛:"bā ěr gàn bàn dǎo",巴尔喀什湖:"bā ěr kā shí hú",不幸而言中:"bú xìng ér yán zhòng",布尔什维克:"bù ěr shí wéi kè",何乐而不为:"hé lè ér bù wéi",苛政猛于虎:"kē zhèng měng yú hǔ",蒙得维的亚:"méng dé wéi dì yà",民以食为天:"mín yǐ shí wéi tiān",事后诸葛亮:"shì hòu zhū gě liàng",物以稀为贵:"wù yǐ xī wéi guì",先下手为强:"xiān xià shǒu wéi qiáng",行行出状元:"háng háng chū zhuàng yuan",亚得里亚海:"yà dé lǐ yà hǎi",眼不见为净:"yǎn bú jiàn wéi jìng",竹筒倒豆子:"zhú tǒng dào dòu zi"},dle=Object.keys(FI).map(e=>({zh:e,pinyin:FI[e],probability:2e-8,length:5,priority:Wl.Normal,dict:Symbol("dict5")}));function BI(e,t){return e&&(e.decimalt.probability)?e:t}function RI(e){e.probability<1e-300&&(e.probability*=1e300,e.decimal+=1)}function fle(e){return e.priority===Wl.Custom?-(e.length*e.length*100):e.priority===Wl.Surname?-(e.length*e.length*10):0}function hle(e,t){const n=[];let i=e.length-1,o=e[i];for(let s=t-1;s>=0;s--){const r=s+1>=t?{probability:1,decimal:0,patterns:[]}:n[s+1];for(;o&&o.index+o.length-1===s;){const a=o.index,u={probability:o.probability*r.probability,decimal:r.decimal+fle(o),patterns:r.patterns,concatPattern:o};RI(u),n[a]=BI(n[a],u),o=e[--i]}const l={probability:1e-13*r.probability,decimal:0,patterns:r.patterns};RI(l),n[s]=BI(n[s],l),n[s].concatPattern&&(n[s].patterns=n[s].patterns.concat(n[s].concatPattern),n[s].concatPattern=void 0,delete n[s+1])}return n[0].patterns.reverse()}function $I(e,t){return e&&e.count<=t.count?e:t}function ple(e){return e.priority===Wl.Custom?-(e.length*e.length*1e5):e.priority===Wl.Surname?-(e.length*e.length*100):1}function mle(e,t){const n=[];let i=e.length-1,o=e[i];for(let s=t-1;s>=0;s--){const r=s+1>=t?{count:0,patterns:[]}:n[s+1];for(;o&&o.index+o.length-1===s;){const a=o.index,u={count:ple(o)+r.count,patterns:r.patterns,concatPattern:o};n[a]=$I(n[a],u),o=e[--i]}const l={count:1+r.count,patterns:r.patterns};n[s]=$I(n[s],l),n[s].concatPattern&&(n[s].patterns=n[s].patterns.concat(n[s].concatPattern),n[s].concatPattern=void 0,delete n[s+1])}return n[0].patterns.reverse()}function gle(e,t){return!(t.index+t.length<=e.index||t.priority>e.priority||t.priority===e.priority&&t.length>e.length)}function vle(e){const t=[];for(let n=e.length-1;n>=0;){const{index:i}=e[n];let o=n-1;for(;o>=0&&gle(e[n],e[o]);)o--;(o<0||e[o].index+e[o].length<=i)&&t.push(e[n]),n=o}return t.reverse()}var OI;(function(e){e[e.ReverseMaxMatch=1]="ReverseMaxMatch",e[e.MaxProbability=2]="MaxProbability",e[e.MinTokenization=3]="MinTokenization"})(OI||(OI={}));class PI{constructor(t,n="",i=""){this.children=new Map,this.fail=null,this.patterns=[],this.parent=t,this.prefix=n,this.key=i}}class yle{constructor(){this.dictMap=new Map,this.queues=[],this.root=new PI(null)}build(t){this.buildTrie(t),this.buildFailPointer()}buildTrie(t){for(let n of t){const i=Ww(n.zh);let o=this.root;for(let s=0;s{t=t.concat(i)}),this.queues=[];t.length>n;){let i=t[n++],o=i.parent&&i.parent.fail,s=i.key;for(;o&&!o.children.has(s);)o=o.fail;o?i.fail=o.children.get(s):i.fail=this.root}}addPatternToDictMap(t){this.dictMap.has(t.dict)||this.dictMap.set(t.dict,new Set),this.dictMap.get(t.dict).add(t)}addNodeToQueues(t){this.queues[Fa(t.prefix)]||(this.queues[Fa(t.prefix)]=[]),this.queues[Fa(t.prefix)].push(t)}insertPattern(t,n){for(let i=t.length-1;i>=0;i--){const o=t[i];if(n.priority===o.priority&&n.probability>=o.probability)t[i+1]=o;else if(n.priority>o.priority)t[i+1]=o;else{t[i+1]=n;return}}t[0]=n}removeDict(t){this.dictMap.has(t)&&(this.dictMap.get(t).forEach(i=>{i.node.patterns=i.node.patterns.filter(o=>o!==i)}),this.dictMap.delete(t))}match(t,n){let i=this.root,o=[];const s=Ww(t);for(let r=0;rn==="off"?c.priority!==Wl.Surname:n==="head"?c.length-1-r===0:!0);a&&o.push(Object.assign(Object.assign({},a),{index:r-a.length+1}));let u=i.fail;for(;u!==null;){const c=u.patterns.find(d=>n==="off"?d.priority!==Wl.Surname:n==="head"?d.length-1-r===0:!0);c&&o.push(Object.assign(Object.assign({},c),{index:r-c.length+1})),u=u.fail}}}return o}search(t,n,i=2){const o=this.match(t,n);return i===1?vle(o):i===3?mle(o,Fa(t)):hle(o,Fa(t))}}const kle=[...dle,...cle,...ule,...ale,...ole,...lle],AP=new yle;AP.build(kle);const ble=new wP,wle=()=>ble,Cle=[];function Ale(){return Cle}const sg=e=>{const t=Rd.get(e);return t?t.split(" ")[0]:e},xle=e=>{const t=[],n=Ale();for(let i=0;i{const s=o?xle(e):e,r=AP.search(s,n,i);let l=0;const a=Ww(e);for(let u=0;ue.replace(/(ā|á|ǎ|à)/g,"a").replace(/(ō|ó|ǒ|ò)/g,"o").replace(/(ē|é|ě|è)/g,"e").replace(/(ī|í|ǐ|ì)/g,"i").replace(/(ū|ú|ǔ|ù)/g,"u").replace(/(ǖ|ǘ|ǚ|ǜ)/g,"ü").replace(/(n̄|ń|ň|ǹ)/g,"n").replace(/(m̄|ḿ|m̌|m̀)/g,"m").replace(/(ê̄|ế|ê̌|ề)/g,"ê"),xP=(e,t="off")=>{const n=wle();let i=Rd.get(e)?Rd.get(e).split(" "):[];if(n.get(e))i=n.get(e).split(" ");else if(t!=="off"){const o=qw[e];o&&(i=[o].concat(i.filter(s=>s!==o)))}return i},_le=(e,t="off")=>{let n=xP(e,t);return n.length>0?n.map(i=>({origin:e,result:i,isZh:!0,originPinyin:i})):[{origin:e,result:e,isZh:!1,originPinyin:e}]},$9=(e,t)=>{const n=e.split(" "),i=[],o=[];for(let s of n)for(let r of Jre)if(s.startsWith(r)){let l=s.slice(r.length);Xre.indexOf(r)!==-1&&ele.indexOf(l)!==-1&&(l=tle[l]),i.push(r),o.push(l);break}return t==="standard"&&i.forEach((s,r)=>{(s==="y"||s==="w")&&(i[r]="")}),{final:o.join(" "),initial:i.join(" ")}},Ty=e=>{const{final:t}=$9(e);let n="",i="",o="";return nle.indexOf(xk(t))!==-1?(n=t[0],i=t[1],o=t.slice(2)):(i=t[0]||"",o=t.slice(1)||""),{head:n,body:i,tail:o}},Sk=e=>{const t=/(ā|ō|ē|ī|ū|ǖ|n̄|m̄|ê̄)/,n=/(á|ó|é|í|ú|ǘ|ń|ḿ|ế)/,i=/(ǎ|ǒ|ě|ǐ|ǔ|ǚ|ň|m̌|ê̌)/,o=/(à|ò|è|ì|ù|ǜ|ǹ|m̀|ề)/,s=/(a|o|e|i|u|ü|ê)/,r=/(n|m)$/,l=[];return e.split(" ").forEach(u=>{t.test(u)?l.push("1"):n.test(u)?l.push("2"):i.test(u)?l.push("3"):o.test(u)?l.push("4"):s.test(u)||r.test(u)?l.push("0"):l.push("")}),l.join(" ")},Mle=(e,t)=>{const n=xk(e).split(" "),i=Sk(t).split(" "),o=[];return n.forEach((s,r)=>{o.push(`${s}${i[r]}`)}),o.join(" ")},SP=(e,t)=>{const n=[];return e.split(" ").forEach(o=>{n.push(t?o[0]:o)}),n.join(" ")};function Ile(e,t,n){if(rle.indexOf(e)===-1)return sg(e);if(t===n&&t&&sg(t)!==t)return xk(sg(e));if(n&&!sle[e].includes(n)){const i=sg(n);if(i!==n){const o=Sk(i),s=CP[e];for(let r in s)if(s[r].indexOf(Number(o))!==-1)return r}}}function Tle(e,t){if(e==="了"&&(!t||!Rd.get(t)))return"liǎo"}function Ele(e,t){if(e==="々")return!t||!Rd.get(t)?"tóng":Rd.get(t).split(" ")[0]}function zI(e,t,n){return Ele(e,t)||Tle(e,t)||Ile(e,t,n)||sg(e)}const Lle=e=>typeof e!="string"?(console.error("The first param of pinyin is error: "+e+' is not assignable to type "string".'),!1):!0;function L3(e,t){return t instanceof RegExp?t.test(e):!0}const Nle=(e,t)=>{let n=t.nonZh;if(n==="removed")return e.filter(i=>i.isZh||!L3(i.origin,t.nonZhScope));if(n==="consecutive"){for(let i=e.length-2;i>=0;i--){const o=e[i],s=e[i+1];!o.isZh&&!s.isZh&&L3(o.origin,t.nonZhScope)&&L3(s.origin,t.nonZhScope)&&(o.origin+=s.origin,o.result+=s.result,s.delete=!0)}return e.filter(i=>!i.delete)}else return e},jI=(e,t)=>Fa(e)===1&&t.multiple?_le(e,t.surname):!1,Dle=(e,t)=>{switch(t.pattern){case"pinyin":break;case"num":e.forEach(n=>{n.result=n.isZh?Sk(n.result):""});break;case"initial":e.forEach(n=>{n.result=n.isZh?$9(n.result,t.initialPattern).initial:""});break;case"final":e.forEach(n=>{n.result=n.isZh?$9(n.result,t.initialPattern).final:""});break;case"first":e.forEach(n=>{n.result=SP(n.result,n.isZh)});break;case"finalHead":e.forEach(n=>{n.result=n.isZh?Ty(n.result).head:""});break;case"finalBody":e.forEach(n=>{n.result=n.isZh?Ty(n.result).body:""});break;case"finalTail":e.forEach(n=>{n.result=n.isZh?Ty(n.result).tail:""});break}},Fle=(e,t)=>{switch(t.toneType){case"symbol":break;case"none":e.forEach(n=>{n.isZh&&(n.result=xk(n.result))});break;case"num":{e.forEach(n=>{n.isZh&&(n.result=Mle(n.result,n.originPinyin))});break}}},Ble=(e,t)=>{t.v&&e.forEach(n=>{n.isZh&&(n.result=n.result.replace(/ü/g,typeof t.v=="string"?t.v:"v"))})},Rle=(e,t,n)=>{if(t.multiple&&Fa(n)===1){let i="";e=e.filter(o=>{const s=o.result!==i;return i=o.result,s})}return t.type==="array"?e.map(i=>i.result):t.type==="all"?e.map(i=>{const o=i.isZh?i.result:"",{initial:s,final:r}=$9(o,t.initialPattern),{head:l,body:a,tail:u}=Ty(o);let c=[];return o!==""&&(c=[o].concat(xP(i.origin,t.surname).filter(d=>d!==o))),{origin:i.origin,pinyin:o,initial:s,final:r,first:SP(i.result,i.isZh),finalHead:l,finalBody:a,finalTail:u,num:Number(Sk(i.originPinyin)),isZh:i.isZh,polyphonic:c,inZhRange:!!Rd.get(i.origin),result:i.result}}):e.map(i=>i.result).join(t.separator)},$le=(e,t)=>(t===!1&&e.forEach(n=>{n.origin==="一"?n.result=n.originPinyin="yī":n.origin==="不"&&(n.result=n.originPinyin="bù")}),e),Ole={pattern:"pinyin",toneType:"symbol",type:"string",multiple:!1,mode:"normal",removeNonZh:!1,nonZh:"spaced",v:!1,separator:" ",toneSandhi:!0,segmentit:2};function O9(e,t){if(t=Object.assign(Object.assign({},Ole),t||{}),!Lle(e))return e;if(e==="")return t.type==="array"||t.type==="all"?[]:"";t.surname===void 0&&(t.mode==="surname"?t.surname="all":t.surname="off"),t.type==="all"&&(t.pattern="pinyin"),t.pattern==="num"&&(t.toneType="none"),t.removeNonZh&&(t.nonZh="removed");let i=Array(Fa(e)),{list:o}=Sle(e,i,t.surname,t.segmentit,t.traditional);return o=$le(o,t.toneSandhi),o=Nle(o,t),jI(e,t)&&(o=jI(e,t)),Dle(o,t),Fle(o,t),Ble(o,t),Rle(o,t,e)}var Uw;(function(e){e[e.AllSegment=1]="AllSegment",e[e.AllArray=2]="AllArray",e[e.AllString=3]="AllString",e[e.PinyinSegment=4]="PinyinSegment",e[e.PinyinArray=5]="PinyinArray",e[e.PinyinString=6]="PinyinString",e[e.ZhSegment=7]="ZhSegment",e[e.ZhArray=8]="ZhArray",e[e.ZhString=9]="ZhString"})(Uw||(Uw={}));Uw.AllSegment;const _P=[{name:"/new",desc:"commands.new.desc",noArgs:!0},{name:"/clear",desc:"commands.clear.desc",noArgs:!0},{name:"/login",desc:"commands.login.desc",noArgs:!0},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc"},{name:"/goal",desc:"commands.goal.desc"},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc",noArgs:!0},{name:"/fork",desc:"commands.fork.desc",noArgs:!0},{name:"/export",desc:"commands.export.desc",noArgs:!0},{name:"/status",desc:"commands.status.desc",noArgs:!0}];function HI(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const gc="skill:";function Ple(e,t){const n=e.find(r=>r.name===t);if(n!==void 0)return n;const i=`/${gc}${t.slice(1)}`,o=e.find(r=>r.name===i);if(o!==void 0)return o;if(!t.startsWith(`/${gc}`))return;const s=t.slice(1+gc.length);if(!(s.length===0||s.includes(" ")))return e.find(r=>r.isSkill===!0&&B6(r.name)===s)}function B6(e){const t=e.startsWith("/")?e.slice(1):e;return t.startsWith(gc)?t.slice(gc.length):t}function zle(e,t,n){for(const i of[`/${gc}${t}`,`/${t}`]){if(e===i)return;if(e.startsWith(`${i} `))return e.slice(i.length+1).trim()||void 0}return(n??"").trim()||void 0}function MP(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${gc}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[..._P,...t]}const WI=new Map;function IP(e){let t=WI.get(e);if(!t){const n=O9(e,{toneType:"none",type:"array"}),i=O9(e,{pattern:"first",toneType:"none",type:"array"});t=jle(e,n,i),WI.set(e,t)}return t}const qI={full:[],first:[],offsets:[],literal:[]};function jle(e,t,n){if(t.length!==n.length)return qI;const i=[],o=[];let s=0;for(let r=0;r0&&e.slice(s,s+l.length).toLowerCase()===l.toLowerCase()?(o.push(!0),s+=l.length):(o.push(!1),s+=Array.from(e.slice(s))[0]?.length??0)}return i.push(s),s!==e.length?qI:{full:t,first:n,offsets:i,literal:o}}function Vw(e,t,n,i){const o=e[t];let s=0,r=-1,l=-1,a=0,u=0;for(let f=0;f=0)return Vw(i,"first",o,o+t.length);const s=i.full.join("").indexOf(t);if(!(s<0))return Vw(i,"full",s,s+t.length)}function Vle(e,t,n){const i=e.trim().replace(/^\//,"").toLowerCase();if(i==="")return{};const o=qle(t,i),s=Ule(n,i);return{name:o?[o]:void 0,desc:s?[s]:void 0}}const Kle={keys:[{name:"name",weight:3},{name:"desc",weight:1},{name:"pinyinFull",weight:1},{name:"pinyinFirst",weight:1}],includeScore:!0,includeMatches:!0,ignoreLocation:!0,threshold:.4};function Zle(e,t){const n=e.toLowerCase(),i=t.toLowerCase();return n===i?0:n.startsWith(i)?1:2}function VI(e){const t=[...e].sort((i,o)=>i[0]-o[0]),n=[];for(const i of t){const o=n[n.length-1];o&&i[0]<=o[1]?o[1]=Math.max(o[1],i[1]):n.push([...i])}return n}function Gle(e,t){const n=[],i=[];for(const o of t??[])for(const[s,r]of o.indices)if(o.key==="name")n.push([s+1,r+2]);else if(o.key==="desc")i.push([s,r+1]);else if(o.key==="pinyinFirst"||o.key==="pinyinFull"){const l=Vw(IP(e.desc),o.key==="pinyinFirst"?"first":"full",s,r+1);l&&i.push(l)}return{name:n.length>0?VI(n):void 0,desc:i.length>0?VI(i):void 0}}function Qle(e,t=_P,n=i=>i.desc){const i=e.trim().replace(/^\//,"");if(i==="")return t.map(s=>({item:s,ranges:{}}));const o=t.map((s,r)=>{const l=n(s),a=Hle(l);return{index:r,item:s,name:s.name.replace(/^\//,""),desc:l,pinyinFull:a.full,pinyinFirst:a.first}});return new Zre(o,Kle).search(i).map(({item:s,score:r,matches:l})=>({doc:s,score:r??1,rank:Zle(s.name,i),ranges:Gle(s,l)})).sort((s,r)=>s.rank!==r.rank?s.rank-r.rank:s.score!==r.score?s.score-r.score:s.doc.index-r.doc.index).map(({doc:s,ranges:r})=>({item:s.item,ranges:r}))}const Cn={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",planArmed:"kimi-web.plan-armed",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",fontScale:"kimi-web.font-scale",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceSort:"kimi-web.workspace-sort",workspaceRecencyFloor:"kimi-web.workspace-recency-floor",pinnedSessions:"kimi-web.pinned-sessions",pinnedCollapsed:"kimi-web.pinned-collapsed",workspaceNameOverrides:"kimi-web.workspace-name-overrides",notifyEnabled:"kimi-web.notify-enabled",notifySound:"kimi-web.notify-sound",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInDefaultTarget:"kimi-web.open-in.default-target",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",sidebarViewMode:"kimi-web.sidebar-view-mode",mobileSwitcherViewMode:"kimi-web.mobile-switcher-view-mode",sidebarPinnedHeight:"kimi-web.sidebar-pinned-height",shortcutOverrides:"kimi-web.shortcut-overrides",dockIconChoice:"kimi-web.dock-icon-choice",updateSkippedVersion:"kimi-web.update-skipped-version",canarySkippedVersion:"kimi-web.canary-skipped-version",planMode:"kimi-web.plan-mode",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme",thinking:"kimi-web.thinking",accent:"kimi-web.accent",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete"},ad="__new__";function KI(e){return`kimi-web.draft.${e&&e.length>0?e:ad}`}function ZI(e){return`kimi-web.attachment-draft.${e&&e.length>0?e:ad}`}function GI(e){return`kimi-web.draft-atts.${e&&e.length>0?e:ad}`}function ms(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function fs(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Sr(e){try{globalThis.localStorage.removeItem(e)}catch{}}function Ic(e){const t=ms(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Tc(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function R6(){const e=ms(Cn.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[i,o]of Object.entries(t))o===!0&&(n[i]=!0);return n}catch{return{}}}function $6(e){const n={...R6()};for(const[i,o]of Object.entries(e))o?n[i]=!0:delete n[i];fs(Cn.unread,JSON.stringify(n))}function Yle(){const e=Ic(Cn.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function N3(e){Tc(Cn.collapsedWorkspaces,Array.from(e))}function Jle(){return Ic(Cn.pinnedCollapsed)===!0}function Kw(e){Tc(Cn.pinnedCollapsed,e)}function Xle(){return ms(Cn.sidebarViewMode)==="flat"?"flat":"grouped"}function eae(e){fs(Cn.sidebarViewMode,e)}function tae(){return ms(Cn.mobileSwitcherViewMode)==="grouped"?"grouped":"flat"}function nae(e){fs(Cn.mobileSwitcherViewMode,e)}function iae(){const e=Ic(Cn.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function EP(e){Tc(Cn.workspaceOrder,Array.from(e))}function oae(){return ms(Cn.workspaceSort)==="recent"?"recent":"manual"}function sae(e){fs(Cn.workspaceSort,e)}function rae(){const e=Ic(Cn.workspaceRecencyFloor);if(!e||typeof e!="object")return{};const t={};for(const[n,i]of Object.entries(e))typeof i=="number"&&Number.isFinite(i)&&(t[n]=i);return t}function LP(e){Tc(Cn.workspaceRecencyFloor,e)}function NP(){const e=Ic(Cn.pinnedSessions);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function D3(e){Tc(Cn.pinnedSessions,Array.from(e))}function x2(){const e=Ic(Cn.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,i]of Object.entries(e))typeof i=="string"&&(t[n]=i);return t}function QI(e){Tc(Cn.workspaceNameOverrides,e)}function lae(e,t,n,i,o){const s=n-o-(t.right+i),r=t.left-i-o,l=e>s&&r>s,a=Math.min(e,l?r:s);return{left:l?t.left-i-a:t.right+i,maxWidth:a,flipped:l}}let aae=0;function uae(e,t){const n=++aae;return e.pendingSwarmBySession[t]=n,n}function Zw(e,t,n){return n===void 0||e.pendingSwarmBySession[t]!==n?!1:(delete e.pendingSwarmBySession[t],!0)}function Gw(e,t,n){e.pendingSwarmBySession[t]===void 0&&(e.swarmModeBySession[t]=n)}function YI(e,t){const n=new Set(e.map(u=>u.id)),i=t.filter(u=>u.kind==="subagent"&&!n.has(u.id));if(i.length===0)return e;const o=new Map(e.map(u=>[u.id,u])),s=new Map(e.filter(u=>u.kind==="subagent"&&u.agentId!==void 0).map(u=>[u.agentId,u])),r=new Set,l=i.map(u=>{const c=u.backgroundTaskId!==void 0?o.get(u.backgroundTaskId):void 0,d=s.get(u.agentId??u.id),f=(d?.status==="running"&&c?.status!=="running"?d:c)??d;if(f===void 0)return u;r.add(f.id);const h=u.status==="running"&&f.status!=="running";return{...u,status:u.status==="running"?f.status:u.status,subagentPhase:h?f.status==="completed"?"completed":"failed":u.subagentPhase,completedAt:f.completedAt??u.completedAt,completedAtEstimated:f.completedAt!==void 0?void 0:u.completedAtEstimated,outputPreview:f.outputPreview??u.outputPreview,outputBytes:f.outputBytes??u.outputBytes,model:u.model??f.model,thinkingEffort:u.thinkingEffort??f.thinkingEffort,backgroundTaskId:f.id}});return[...e.filter(u=>!r.has(u.id)),...l]}function cae(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const e=navigator.userAgentData;return e?.platform==="macOS"||e?.platform==="iOS"}function dae(e,t=cae()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyF"||e.key.toLowerCase()==="f")&&!e.defaultPrevented}const fae=new Map([["ς","σ"],["ß","ss"],["ſ","s"],["ff","ff"],["fi","fi"],["fl","fl"],["ffi","ffi"],["ffl","ffl"],["ſt","st"],["st","st"],["ʼn","ʼn"],["µ","μ"],["K","k"],["Å","å"],["Ω","ω"]]);function hae(e){return e==="pre"||e==="pre-wrap"||e==="break-spaces"?"preserve":e==="pre-line"?"pre-line":"collapse"}function pae(e,t){if(t==="preserve")return{text:e,map:Array.from({length:e.length},(r,l)=>l)};const n=t==="collapse"?/[\t\n\f\r ]/:/[\t ]/;let i="";const o=[];let s=!1;for(let r=0;rJI(c.text)),i="\0";let o="";const s=[];for(let c=0;c0&&e[c].gapBefore&&(o+=i),s[c]=o.length,o+=n[c].folded;const r=vae(JI(t).folded);if(r===null)return;const l=new RegExp(r,"g");function a(c){let d=0,f=s.length-1,h=0;for(;d<=f;){const m=d+f>>1;s[m]<=c?(h=m,d=m+1):f=m-1}return h}let u;for(;;){const c=l.exec(o);if(c===null)return;const d=c.index,f=d+c[0].length-1,h=a(d),m=a(f),g=n[h].map[d-s[h]],v=n[m].map[f-s[m]],y={startSeg:h,startOffset:g.start,endSeg:m,endOffset:v.start+v.length};u!==void 0&&u.startSeg===y.startSeg&&u.startOffset===y.startOffset&&u.endSeg===y.endSeg&&u.endOffset===y.endOffset||(u=y,yield y)}}const gae=/[.*+?^${}()|[\]\\]/g;function vae(e){const t=[];let n=0;for(;n=Cae)return{ranges:a,truncated:!0};a.push(f)}}return{ranges:a,truncated:!1}}const DP="kimi-transcript-search",Qw="kimi-transcript-search-current";function FP(){return globalThis.CSS?.highlights??null}function F3(e,t){const n=FP(),i=globalThis.Highlight;if(!n||!i)return;if(e.length===0){Yw();return}const o=new i;for(const r of e)o.add(r);n.set(DP,o);const s=e[t];if(s!==void 0){const r=new i;r.add(s),n.set(Qw,r)}else n.delete(Qw)}function Yw(){const e=FP();e?.delete(DP),e?.delete(Qw)}let BP=null;function xae(e){e!==null&&(BP=e)}let eT=0,S2=null;async function Jw(e){const t=++eT,n=(async()=>{const o=await e();t===eT&&xae(o)})(),i=(async()=>{await n,S2!==null&&S2.seq>t&&await S2.promise})();return S2={seq:t,promise:i},i}let RP=null;function Sae(e){RP=e}const _ae=5e3;function Mae(e){return Promise.race([e(),new Promise(t=>{setTimeout(()=>t(null),_ae)})])}function _2(){return`${BP==="global"?"https://www.kimi.ai":"https://www.kimi.com"}/code?from=${Wh?"kimi_code_desktop":"kimi_code_web"}`}function mv(){const e=RP;if(e===null){window.open(_2(),"_blank","noopener");return}const t=()=>Mae(e);if(Wh){Jw(t).then(()=>{window.open(_2(),"_blank","noopener")});return}const n=window.open("","_blank");if(n===null){window.open(_2(),"_blank","noopener");return}try{n.opener=null}catch{}Jw(t).then(()=>{try{n.location.href=_2()}catch{}})}function Iae(e,t,n){if(e.length===0)return null;const i=new Set(e),o=t.filter(r=>i.has(r)),s=e.filter(r=>!t.includes(r));return s.length===0&&o.length===t.length?null:t.length===0&&n!==void 0?s.toSorted((r,l)=>(n.get(l)??Number.NEGATIVE_INFINITY)-(n.get(r)??Number.NEGATIVE_INFINITY)):[...s,...o]}function Tae(e,t){const n=new Map(t.map((i,o)=>[i,o]));return e.toSorted((i,o)=>(n.get(i.id)??-1)-(n.get(o.id)??-1))}function Eae(e,t,n,i="before"){const o=e.indexOf(t),s=e.indexOf(n);if(o===-1||s===-1||o===s)return e;const r=[...e];r.splice(o,1);const l=o(t.get(i.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}function Nae(e,t){let n=!1;const i={...e};for(const[o,s]of t)s>(i[o]??Number.NEGATIVE_INFINITY)&&(i[o]=s,n=!0);return{next:i,changed:n}}function Dae(e,t){const n=new Map;for(const i of e){if(i.parentSessionId||i.archived)continue;const o=new Date(i.updatedAt).getTime();if(Number.isNaN(o))continue;const s=t(i);o>(n.get(s)??Number.NEGATIVE_INFINITY)&&n.set(s,o)}return n}function Fae(e,t){const n=new Map;for(const i of e){const o=t[i.id]??Number.NEGATIVE_INFINITY,s=i.lastOpenedAt?Date.parse(i.lastOpenedAt):Number.NaN,r=Number.isNaN(s)?Number.NEGATIVE_INFINITY:s;n.set(i.id,Math.max(o,r))}return n}function Bae(e,t){const n=Object.keys(e);if(!n.some(o=>!t.has(o)))return{next:e,changed:!1};const i={};for(const o of n)t.has(o)&&(i[o]=e[o]);return{next:i,changed:!0}}const Rae=5;function $ae(e,t,n,i=Rae){if(e.length<=i)return e;const o=e.slice(0,i);if(t&&!o.some(s=>s.id===t)){const s=e.find(r=>r.id===t);s&&(o[i-1]=s)}return o}const Oae={class:"error-boundary-title"},Pae=lt({__name:"ErrorBoundary",props:{closable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t}){const n=t,{t:i}=qt(),o=V(!1);s$(()=>{o.value=!0});function s(){o.value=!1}return(r,l)=>o.value?(k(),L("div",{key:1,class:Re(["error-boundary",{fullscreen:e.fullscreen}]),role:"alert"},[e.closable?(k(),de(p(ln),{key:0,class:"error-boundary-close",size:"sm",label:p(i)("common.close"),tooltip:p(i)("common.close"),onClick:l[0]||(l[0]=a=>n("close"))},{default:ce(()=>[U(p(Ce),{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])):ee("",!0),U(p(Ce),{class:"error-boundary-icon",name:"alert-triangle",size:"lg"}),A("p",Oae,F(p(i)("common.errorBoundaryTitle")),1),U(p(sn),{size:"sm",onClick:s},{default:ce(()=>[$e(F(p(i)("common.errorBoundaryRetry")),1)]),_:1})],2)):Un(r.$slots,"default",{key:0},void 0,!0)}}),$P=xt(Pae,[["__scopeId","data-v-3c47f494"]]);var zae=Object.create,O6=Object.defineProperty,jae=Object.getOwnPropertyDescriptor,OP=Object.getOwnPropertyNames,Hae=Object.getPrototypeOf,Wae=Object.prototype.hasOwnProperty,PP=(e,t)=>function(){return t||(0,e[OP(e)[0]])((t={exports:{}}).exports,t),t.exports},qae=e=>{let t={};for(var n in e)O6(t,n,{get:e[n],enumerable:!0});return t},Uae=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=OP(t),s=0,r=o.length,l;st[a]).bind(null,l),enumerable:!(i=jae(t,l))||i.enumerable});return e},zP=(e,t,n)=>(n=e!=null?zae(Hae(e)):{},Uae(O6(n,"default",{value:e,enumerable:!0}),e));function Vae(e,t,n,i){const o=Number(e[t].meta.id+1).toString();let s="";return typeof i.docId=="string"&&(s=`-${i.docId}-`),s+o}function Kae(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function Zae(e,t,n,i,o){const s=o.rules.footnote_anchor_name(e,t,n,i,o),r=o.rules.footnote_caption(e,t,n,i,o);let l=s;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`${r}`}function Gae(e,t,n){return(n.xhtmlOut?`
      -`:`
      -`)+`
      -
        -`}function Qae(){return`
      -
      -`}function Yae(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`
    1. `}function Jae(){return`
    2. -`}function Xae(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),` ↩︎`}function eue(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Zae,e.renderer.rules.footnote_block_open=Gae,e.renderer.rules.footnote_block_close=Qae,e.renderer.rules.footnote_open=Yae,e.renderer.rules.footnote_close=Jae,e.renderer.rules.footnote_anchor=Xae,e.renderer.rules.footnote_caption=Kae,e.renderer.rules.footnote_anchor_name=Vae;function i(l,a,u,c){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h=f||l.src.charCodeAt(++h)!==58)return!1;if(c)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const m=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${m}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:m},g.level=l.level++,l.tokens.push(g);const v=l.bMarks[a],y=l.tShift[a],b=l.sCount[a],w=l.parentType,C=h,T=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let N=T;for(;h=u||l.src.charCodeAt(c)!==94||l.src.charCodeAt(c+1)!==91)return!1;const d=c+2,f=t(l,c+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,m=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,m);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:m}}return l.pos=f+1,l.posMax=u,!0}function s(l,a){const u=l.posMax,c=l.pos;if(c+3>u||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(c)!==91||l.src.charCodeAt(c+1)!==94)return!1;let d;for(d=c+2;d=u)return!1;d++;const f=l.src.slice(c+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const m=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:m,label:f}}return l.pos=d,l.posMax=u,!0}function r(l){let a,u,c,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(m){return m.type==="footnote_reference_open"?(d=!0,u=[],c=m.meta.label,!1):m.type==="footnote_reference_close"?(d=!1,f[":"+c]=u,!1):(d&&u.push(m),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let m=0,g=h.length;m0?h[m].count:1;for(let w=0;w?@[\]^_`{|}~-])/g;function oue(e,t){const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==94||t||i+2>=n)return!1;e.pos=i+1;let o=!1;for(;e.pos{t.exports=function(g,v){v=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},v),g.core.ruler.after("inline","github-task-lists",function(y){for(var b=y.tokens,w=0,C=2;C=0;b--)if(g[b].level===y)return b;return-1}function o(g,v){return d(g[v])&&f(g[v-1])&&h(g[v-2])&&m(g[v])}function s(g,v,y,b){var w=y.idPrefix+v;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(w,b)),g.children.push(a(b)),g.children.unshift(r(g,w,y,b)),y.divWrap&&(g.children.unshift(u(y,b)),g.children.push(c(b)))}function r(g,v,y,b){var w=new b("checkbox_input","input",0);return w.attrs=[["type","checkbox"],["id",v]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&w.attrs.push(["checked","true"]),y.disabled===!0&&w.attrs.push(["disabled","true"]),w}function l(g,v){var y=new v("label_open","label",1);return y.attrs=[["for",g]],y}function a(g){return new g("label_close","label",-1)}function u(g,v){var y=new v("checkbox_open","div",0);return y.attrs=[["class",g.divClass]],y}function c(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function m(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})});const lue=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function aue(e){return e>=55296&&e<=57343||e>1114111?65533:lue.get(e)??e}function uue(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let o=0,s=0;o=Eo.ZERO&&e<=Eo.NINE}function due(e){return e>=Eo.UPPER_A&&e<=Eo.UPPER_F||e>=Eo.LOWER_A&&e<=Eo.LOWER_F}function fue(e){return e>=Eo.UPPER_A&&e<=Eo.UPPER_Z||e>=Eo.LOWER_A&&e<=Eo.LOWER_Z||Xw(e)}function hue(e){return e===Eo.EQUALS||fue(e)}var $s;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})($s||($s={}));var ud;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ud||(ud={}));var pue=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=$s.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=ud.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=$s.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case $s.EntityStart:return e.charCodeAt(t)===Eo.NUM?(this.state=$s.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=$s.NamedEntity,this.stateNamedEntity(e,t));case $s.NumericStart:return this.stateNumericStart(e,t);case $s.NumericDecimal:return this.stateNumericDecimal(e,t);case $s.NumericHex:return this.stateNumericHex(e,t);case $s.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|tT)===Eo.LOWER_X?(this.state=$s.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=$s.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const l=i&Br.JUMP_TABLE;if(e.charCodeAt(t)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return-1;const l=this.runConsumed-1,a=n[this.treeIndex+1+(l>>1)],u=l%2===0?a&255:a>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(r>>1),i=n[this.treeIndex],o=(i&Br.VALUE_LENGTH)>>14}if(t>=e.length)break;const s=e.charCodeAt(t);if(s===Eo.SEMI&&o!==0&&(i&Br.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=gue(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===ud.Attribute&&(o===0||hue(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&Br.VALUE_LENGTH)>>14,o!==0){if(s===Eo.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==ud.Strict&&(i&Br.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:e,decodeTree:t}=this,n=(t[e]&Br.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~(Br.VALUE_LENGTH|Br.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case $s.NamedEntity:return this.result!==0&&(this.decodeMode!==ud.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case $s.NumericDecimal:return this.emitNumericEntity(0,2);case $s.NumericHex:return this.emitNumericEntity(0,3);case $s.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case $s.EntityStart:return 0}}};function mue(e){let t="";const n=new pue(e,i=>t+=String.fromCodePoint(i));return function(o,s){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(s);const u=n.write(o,l+1);if(u<0){r=l+n.end();break}r=l+u,l=u===0?r+1:r}const a=t+o.slice(r);return t="",a}}function gue(e,t,n,i){const o=(t&Br.BRANCH_LENGTH)>>7,s=t&Br.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const u=i-s;return u<0||u>=o?-1:e[n+u]-1}const r=o+1>>1;let l=0,a=o-1;for(;l<=a;){const u=l+a>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(ci)a=u-1;else return e[n+r+u]}return-1}const vue=mue(cue);function P6(e,t=ud.Legacy){return vue(e,t)}var yue=zP(rue());const nT={};function kue(e){let t=nT[e];if(t)return t;t=nT[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),s+=6;continue}}if((l&248)===240&&s+91114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}o+="�"}return o})}_k.defaultChars=";/?:@&=+$,#";_k.componentChars="";var eC=_k;const iT={};function bue(e){let t=iT[e];if(t)return t;t=iT[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=bue(t);let o="";for(let s=0,r=e.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&a<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}Mk.defaultChars=";/?:@&=+$,-_.!~*'()#";Mk.componentChars="-_.!~*'()";var jP=Mk;function z6(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function P9(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const wue=/^([a-z0-9.+-]+:)/i,Cue=/:[0-9]*$/,Aue=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,xue=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` -`," "]),Sue=["'"].concat(xue),oT=["%","/","?",";","#"].concat(Sue),sT=["/","?","#"],_ue=255,rT=/^[+a-z0-9A-Z_-]{0,63}$/,Mue=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,lT={javascript:!0,"javascript:":!0},aT={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Iue(e,t){if(e&&e instanceof P9)return e;const n=new P9;return n.parse(e,t),n}P9.prototype.parse=function(e,t){let n,i,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=Aue.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=wue.exec(s);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,s=s.substr(r.length)),(t||r||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(r&&lT[r])&&(s=s.substr(2),this.slashes=!0)),!lT[r]&&(o||r&&!aT[r])){let u=-1;for(let m=0;m127?b+="x":b+=y[w];if(!b.match(rT)){const w=m.slice(0,g),C=m.slice(g+1),T=y.match(Mue);T&&(w.push(T[1]),C.unshift(T[2])),C.length&&(s=C.join(".")+s),this.hostname=w.join(".");break}}}}this.hostname.length>_ue&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const a=s.indexOf("?");return a!==-1&&(this.search=s.substr(a),s=s.slice(0,a)),s&&(this.pathname=s),aT[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};P9.prototype.parseHost=function(e){let t=Cue.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var j6=Iue,HP=qae({decode:()=>eC,encode:()=>jP,format:()=>z6,parse:()=>j6}),Tue=Object.defineProperty,WP=e=>{let t={};for(var n in e)Tue(t,n,{get:e[n],enumerable:!0});return t},Is=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Eue=WP({arrayReplaceAt:()=>$ue,assign:()=>Bue,countLines:()=>Oo,escapeHtml:()=>Vue,escapeRE:()=>Zue,fromCodePoint:()=>M0,has:()=>Fue,isMdAsciiPunct:()=>H9,isPunctChar:()=>j9,isPunctCode:()=>tC,isSpace:()=>Rue,isString:()=>Nue,isValidEntityCode:()=>Tk,isWhiteSpace:()=>_0,lib:()=>Gue,mdurl:()=>HP,normalizeReference:()=>Ik,ucmicro:()=>z9,unescapeAll:()=>I0,unescapeMd:()=>jue});const z9={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function Lue(e){return Object.prototype.toString.call(e)}function Nue(e){return Lue(e)==="[object String]"}const Due=Object.prototype.hasOwnProperty;function Fue(e,t){return Due.call(e,t)}function Bue(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(i=>{e[i]=n[i]})}}),e}function Rue(e){return e===9||e===32}function _0(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function j9(e){return z9.P.test(e)||z9.S.test(e)}const uT=new Map;function tC(e){if(H9(e))return!0;if(e>=0&&e<128)return!1;const t=uT.get(e);if(t!==void 0)return t;const n=j9(String.fromCharCode(e));return uT.set(e,n),n}function H9(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Ik(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function $ue(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Tk(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function M0(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const qP=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Oue=new RegExp(`${qP.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Pue=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function zue(e,t){if(t.charCodeAt(0)===35&&Pue.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Tk(i)?M0(i):e}const n=P6(e);return n!==e?n:e}function jue(e){return e.includes("\\")?e.replace(qP,"$1"):e}function I0(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Oue,(t,n,i)=>n||zue(t,i))}const Hue=/[&<>"]/,Wue=/[&<>"]/g,que={"&":"&","<":"<",">":">",'"':"""};function Uue(e){return que[e]}function Vue(e){return Hue.test(e)?e.replace(Wue,Uue):e}const Kue=/[.?*+^$[\]\\(){}|-]/g;function Zue(e){return e.replace(Kue,"\\$&")}const Gue={mdurl:HP,ucmicro:z9};function Oo(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` -`,n+1))!==-1;)t++;return t}const Que=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Yue=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Jue=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,H6=["references","footnotes","abbreviations","abbr","abbrs"],W6=Symbol.for("markdown-it-ts.global-state"),q6=Object.prototype.hasOwnProperty;function cT(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function $a(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ad(e){if(Array.isArray(e))return e.map(t=>Ad(t));if($a(e)){const t={};for(const n of Object.keys(e))t[n]=Ad(e[n]);return t}return e}function W9(e){return Array.isArray(e)?e.map((t,n)=>String(n)):$a(e)?Object.keys(e):[]}function nC(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ns.has(r)?!nC(o[r],UP(i.value,r)):!0)}}function xc(e){const t=U6(e);if(t){for(const n of H6){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){ece(e,n,i);continue}i.existed?e[n]=Xue(e[n],i.value):delete e[n]}delete e[W6]}}function B3(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const iC=Symbol.for("markdown-it-ts.diagnostics");function vv(e,t){if(e)try{const n=e[iC];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[iC]=i,i}catch{return}}function ec(e){return vv(e,!1)}function nce(e){if(e)try{const t=e[iC];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function Rr(e){nce(e)}function $m(e,t){const n=vv(e,!0);n&&(n.stockFast=t)}function is(e,t){const n=vv(e,!0);n&&(n.strategy=t)}function R3(e,t){const n=vv(e,!0);n&&(n.chunk=t)}function VP(e,t){const n=vv(e,!0);n&&(n.unbounded=t)}const ice=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,oce=/[\0-\x1F\x7F-\x9F]/,sce=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,rce=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var lce=class{src_Any=ice.source;src_Cc=oce.source;src_Z=rce.source;src_P=sce.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${i}|${o}).)`;let r=`${i}${s}{0,1000}${o}`;for(let l=2;l<=n;l++)r=`${i}(?:${s}|${r}){0,1000}${o}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},$3={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},ace={"http:":$3,"https:":$3,"ftp:":$3,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const o=i.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},uce="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",cce="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function dce(){const e=cce.split("|");return uce.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const o of t.slice(n+1))e.push(i+o)}),e}var fce={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:dce(),urlAuth:!1,maxLength:1e4},dT=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,i){const o=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=o,this.text=o,this.url=o}},KP=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...fce,...n},this.__schemas__={...ace},this.re=t||new lce,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,o)=>o.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,o,s,r,l,a,u=!1,c=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const h=Math.max(f-1,0);if(o&&s&&!d&&(!l||l.index=f)break;o.lastIndex=f)break;i.lastIndexm.lastIndex))&&(m=r);let g;if(!u)for(;;){if(!a){n.lastIndexm.index)break;const b=a;a=void 0;const w=this.testSchemaAt(e,b.schema,b.lastIndex);if(w){g={schema:b.schema,index:b.index,lastIndex:b.lastIndex+w};break}}let v=g;if((!v||l&&(l.indexv.lastIndex))&&(v=l),(!v||r&&(r.indexv.lastIndex))&&(v=r),!v)break;v===l?l=void 0:v===r&&(r=void 0);const y=new dT(e,v.schema,v.index,v.lastIndex);y.schema?this.__schemas__[y.schema].normalize(y,this):this.normalize(y),t.push(y),f=v.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new dT(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},hce=PP({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,v=Math.floor,y=String.fromCharCode;function b(z){throw new RangeError(m[z])}function w(z,O){const B=[];let P=z.length;for(;P--;)B[P]=O(z[P]);return B}function C(z,O){const B=z.split("@");let P="";B.length>1&&(P=B[0]+"@",z=B[1]),z=z.replace(h,".");const H=w(z.split("."),O).join(".");return P+H}function T(z){const O=[];let B=0;const P=z.length;for(;B=55296&&H<=56319&&BString.fromCodePoint(...z),I=function(z){return z>=48&&z<58?26+(z-48):z>=65&&z<91?z-65:z>=97&&z<123?z-97:36},S=function(z,O){return z+22+75*(z<26)-((O!=0)<<5)},_=function(z,O,B){let P=0;for(z=B?v(z/700):z>>1,z+=v(z/O);z>g*26>>1;P+=36)z=v(z/g);return v(P+(g+1)*z/(z+38))},x=function(z){const O=[],B=z.length;let P=0,H=128,j=72,Z=z.lastIndexOf("-");Z<0&&(Z=0);for(let ie=0;ie=128&&b("not-basic"),O.push(z.charCodeAt(ie));for(let ie=Z>0?Z+1:0;ie=B&&b("invalid-input");const ge=I(z.charCodeAt(ie++));ge>=36&&b("invalid-input"),ge>v((2147483647-P)/te)&&b("overflow"),P+=ge*te;const ue=X<=j?1:X>=j+26?26:X-j;if(gev(2147483647/se)&&b("overflow"),te*=se}const Q=O.length+1;j=_(P-W,Q,W==0),v(P/Q)>2147483647-H&&b("overflow"),H+=v(P/Q),P%=Q,O.splice(P++,0,H)}return String.fromCodePoint(...O)},E=function(z){const O=[];z=T(z);const B=z.length;let P=128,H=0,j=72;for(const W of z)W<128&&O.push(y(W));const Z=O.length;let ie=Z;for(Z&&O.push("-");ie=P&&tev((2147483647-H)/Q)&&b("overflow"),H+=(W-P)*Q,P=W;for(const te of z)if(te2147483647&&b("overflow"),te===P){let X=H;for(let ge=36;;ge+=36){const ue=ge<=j?1:ge>=j+26?26:ge-j;if(X32))return s;if(i===41){if(r===0)break;r--}o++}return t===o||r!==0||(s.str=I0(e.slice(t,o)),s.pos=o,s.ok=!0),s}var GP=Z6;const Ey=-2;function pce(e,t,n,i){let o=1,s=t+1;for(;s=0&&t+1>=c)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=pce(l,t,a,n);if(f!==Ey)return f;for(e.pos=t+1;e.pos=n)return r;let l=e.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return r;t++,s++,l===40&&(l=41),r.marker=l}for(;s=0?e.attrs[n][1]:null}function vce(e,t,n){const i=Ek(e,t);i<0?Y6(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var yce=WP({attrGet:()=>gce,attrIndex:()=>Ek,attrJoin:()=>vce,attrPush:()=>Y6,attrSet:()=>mce,parseLinkDestination:()=>Z6,parseLinkLabel:()=>G6,parseLinkTitle:()=>Q6});function kce(e){return e.includes("\r")||e.includes("\0")}function YP(e){return typeof e=="string"?e:e.toString()}function bce(e){if(e.inlineMode){const t=new Is("inline","",0);t.content=YP(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const wce=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Cce=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Ace(e,t){let n=e.pos;const i=e.src;if(i.charCodeAt(n)!==60)return!1;const o=n,s=e.posMax;for(;;){if(++n>=s)return!1;const l=i.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=i.slice(o+1,n);if(Cce.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}if(wce.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}return!1}var JP=Ace;function xce(e,t){const n=e.src;let i=e.pos;if(n.charCodeAt(i)!==96)return!1;const o=i;i++;const s=e.posMax;for(;i2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var XP=xce;function fT(e){const t={},n=e.length;if(!n)return;let i=0,o=-2;const s=[];for(let r=0;ra;u-=s[u]+1){const d=e[u];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=u>0&&!e[u-1].open?s[u-1]+1:0;s[r]=r-u+h,s[u]=h,l.open=!1,d.end=r,d.close=!1,c=-1,o=-2;break}}}c!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function Sce(e){const t=e.tokens_meta,n=e.tokens_meta.length;fT(e.delimiters);for(let i=0;i=0;o--){const s=t[o],r=s.marker;if(r!==95&&r!==42||s.end===-1)continue;const l=t[s.end],a=s.token,u=l.token,c=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===r&&t[o-1].token===a-1&&t[s.end+1].token===u+1,d=r===42?ez:tz,f=i[a];c?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=i[u];c?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),c&&(i[t[o-1].token].content="",i[t[s.end+1].token].content="",o--)}}function Ice(e){const t=e.tokens_meta,n=e.tokens_meta.length;hT(e,e.delimiters);for(let i=0;i=48&&e<=57}function Tce(e){const t=e|32;return J6(e)||t>=97&&t<=102}function iz(e){const t=e|32;return t>=97&&t<=122}function Ece(e){return iz(e)||J6(e)}function Lce(e,t,n){let i=t+2;if(i>=n)return null;let o=!1,s=7,r=i;for((e.charCodeAt(i)|32)===120&&(o=!0,s=6,i++,r=i);i=n||e.charCodeAt(i)!==59?null:e.slice(t,i+1)}function Nce(e,t,n){let i=t+1;if(i>=n||!iz(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const o=e.slice(t,i+1);return nz(o)!==o?o:null}function Dce(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=Lce(e.src,n,i);if(o){if(!t){const s=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=Tk(s)?M0(s):M0(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=Nce(e.src,n,i);if(o){const s=nz(o);if(!t){const r=e.push("text_special","",0);r.content=s,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var oz=Dce;const sz=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),sC=new Array(128),rz=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);sC[e]=`\\${t}`,rz[e]=sz[e]?t:sC[e]}function pT(e,t,n){e.pending&&e.pushPending();const i=new Is("text_special","",0);i.level=e.level,i.content=t,i.markup=n,i.info="escape",e.pendingLevel=e.level,e.tokens.push(i),e.tokens_meta.push(null)}function Fce(e,t){let n=e.pos;const i=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=i))return!1;let s=o.charCodeAt(n);if(s===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&s<=56319&&n+1=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(s>=55296&&s<=56319&&n+1=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return pT(e,s<256&&sz[s]?r:l,l),e.pos=n+1,!0}var lz=Fce;function Bce(e){let t,n,i=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t0&&i++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,uz="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",$ce=new RegExp(`^(?:${az}|${uz}||<\\?[\\s\\S]*?\\?>|]*>|)`),Oce=new RegExp(`^(?:${az}|${uz})`);function cz(e){return e===32||e===9||e===10||e===12||e===13}function Pce(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||cz(t)}function zce(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function Hce(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos,o=e.src;if(o.charCodeAt(i)!==60||i+2>=n)return!1;const s=o.charCodeAt(i+1);if(s!==33&&s!==63&&s!==47&&!jce(s))return!1;const r=o.slice(i).match($ce);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,Pce(l)&&e.linkLevel++,zce(l)&&e.linkLevel--}return e.pos+=l.length,!0}var dz=Hce;function Wce(e,t){let n,i,o,s,r,l,a,u,c="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,m=q9(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=f)return!1;if(l=GP(e.src,s,e.posMax),l.ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?s=l.pos:c="",u=s;s=f||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?o=e.src.slice(u,s++):s=m+1):s=m+1,o||(o=e.src.slice(h,m)),r=e.env.references[Ik(o)],!r)return e.pos=d,!1;c=r.href,a=r.title}if(!t){i=e.src.slice(h,m);const g=[];e.md.inline.parse(i,e.md,e.env,g);const v=e.push("image","img",0);v.attrs=[["src",c],["alt",""]],v.children=g,v.content=i,a&&v.attrs.push(["title",a])}return e.pos=s,e.posMax=f,!0}var fz=Wce;function O3(e,t,n){for(;t"u")return!1;let d;if(l=r+1,l=0?(d=n.slice(h,m),d||(d=n.slice(s,r)),l=m+1):d=n.slice(s,r)}else d=n.slice(s,r);const f=e.env.references[Ik(d)];if(!f)return e.pos=i,!1;a=f.href,u=f.title}if(!t){e.pos=s,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=u?[["href",a],["title",u]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=o,!0}var hz=qce;function pz(e){const t=e|32;return t>=97&&t<=122}function Uce(e){return e>=48&&e<=57}function Vce(e){return pz(e)||Uce(e)||e===43||e===45||e===46}function Kce(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&Vce(e.charCodeAt(t));)t--;return t++,t>=e.length||!pz(e.charCodeAt(t))?null:e.slice(t)}function Zce(e,t,n){let i=t;for(;i0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=Kce(e.pending);if(!o)return!1;const s=Zce(e.src,n-o.length,i),r=e.md.linkify.matchAtStart(s);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-o.length,!0}function Gce(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,o=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let s=i-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=o||gT(n.charCodeAt(i)))return!1;let s=i+1;for(;si-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function ede(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function yz(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,i={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:X6(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function o1(e,t,n,i,o,s){const r=yz(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=ede(t,n));a.calls++,a.inclusiveMs+=i,i>a.maxMs&&(a.maxMs=i),a.samples.push(i),s?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=X6()}function tde(e){const t=yz(e);if(!t)return null;const n=Object.keys(t.records);for(let i=0;io.name===e);i>=0&&this.rules.splice(i,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(i<0)return;const o=this.rules[i];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(i<0)throw new Error(`Parser rule not found: ${e}`);this.rules[i].fn=t,n?.alt!==void 0&&(this.rules[i].alt=n.alt),this.invalidateCache()}before(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const o of i.alt)e.add(o);const t=new Map,n=new Map;for(const i of e){const o=[],s=[];for(const r of this.rules)r.enabled&&(i!==""&&!r.alt?.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t.set(i,o),n.set(i,s)}this.cache=t,this.namedCache=n}},kz=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.tokens_meta=new Array(i.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Is("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Is(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const i=new Is(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i}scanDelims(e,t){const{src:n,posMax:i}=this,o=n.charCodeAt(e);let s=e;for(;s0?n.charCodeAt(e-1):32,a=s@[\]\\^_`{}~]/;function yT(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return gz(e,t);case 33:return fz(e,t);case 38:return oz(e,t);case 42:case 95:return oC.tokenize(e,t);case 58:return e.md.options.linkify&&mz(e,t);case 60:return JP(e,t)||dz(e,t);case 91:return hz(e,t);case 92:return lz(e,t);case 96:return XP(e,t);case 126:return rC.tokenize(e,t);default:return vz(e,t)}}function bz(e){return!nde.test(e)}var ide=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new vT,this.ruler2=new vT,this.ruler.push("text",vz),this.ruler.push("linkify",mz),this.ruler.push("newline",gz),this.ruler.push("escape",lz),this.ruler.push("backticks",XP),this.ruler.push("strikethrough",rC.tokenize),this.ruler.push("emphasis",oC.tokenize),this.ruler.push("link",hz),this.ruler.push("image",fz),this.ruler.push("autolink",JP),this.ruler.push("html_inline",dz),this.ruler.push("entity",oz),this.ruler2.push("balance_pairs",_ce),this.ruler2.push("strikethrough",rC.postProcess),this.ruler2.push("emphasis",oC.postProcess),this.ruler2.push("fragments_join",Rce),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),i=n.length,o=e.cache,s=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(s!==void 0){e.pos=s;return}let l=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,l=yT(e,!0),e.level--,l&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,i=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const s=this.isDefaultRuleset();for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos")}if(l){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,i){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&bz(e)){const a=new Is("text","",0);a.content=e,i.push(a);return}const o=new kz(e,t,n,i);this.tokenize(o);const s=this.getRules2(),r=s.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a0&&bz(s.content)){const r=new Is("text","",0);r.content=s.content,s.children.push(r);continue}e.md.inline.parse(s.content,e.md,e.env,s.children)}}}const sde=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,rde=/[0-9a-z]/i;function lde(e){return/^\s]/i.test(e)}function ade(e){return/^<\/a\s*>/i.test(e)}function ude(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(lde(l.content)&&s>0&&s--,ade(l.content)&&s++),s>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let u=(e.md.linkify.match(a)||[]).map(h=>ude(e.md.linkify,h));if(u.length===0)continue;const c=[];let d=l.level,f=0;u.length>0&&u[0].index===0&&r>0&&o[r-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hf){const T=new Is("text","",0);T.content=a.slice(f,y),T.level=d,c.push(T)}const b=new Is("link_open","a",1);b.attrs=[["href",g]],b.level=d++,b.markup="linkify",b.info="auto",c.push(b);const w=new Is("text","",0);w.content=v,w.level=d,c.push(w);const C=new Is("link_close","a",-1);C.level=--d,C.markup="linkify",C.info="auto",c.push(C),f=m.lastIndex}if(f!==0){if(f=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(mde,vde)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function kde(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&wz.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function bde(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");pde.test(i)&&yde(n.children||[]),wz.test(i)&&kde(n.children||[])}}var wde=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(i=>i.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(i=>i.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const Cde=/['"]/,kT=/['"]/g,bT="’";function M2(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Ade(e,t){let n;const i=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let s=0;s=0&&!(i[n].level<=l);n--);if(i.length=n+1,r.type!=="text")continue;let a=r.content,u=0,c=a.length;e:for(;u=0)g=a.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let v=32;if(u=48&&g<=57&&(h=f=!1),f&&h&&(f=y,h=b),!f&&!h){m&&(r.content=M2(r.content,d.index,bT));continue}if(h)for(n=i.length-1;n>=0;n--){let T=i[n];if(i[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!Cde.test(i)||!n.children||Ade(n.children,e)}}function Sde(e){const t=e.tokens||[],n=t.length;for(let i=0;i=4||o.charCodeAt(c)!==62)return!1;if(i)return!0;const h=[],m=[],g=[],v=[],y=e.md.block.ruler.getRulesForState(e,"blockquote"),b=e.parentType;e.parentType="blockquote";let w=!1,C;for(C=t;C=d)break;if(o.charCodeAt(c++)===62&&!_){let E=a[C]+1,M,R;o.charCodeAt(c)===32?(c++,E++,R=!1,M=!0):o.charCodeAt(c)===9?(M=!0,(u[C]+E)%4===3?(c++,E++,R=!1):R=!0):M=!1;let q=E;for(h.push(s[C]),s[C]=c;c=d,m.push(u[C]),u[C]=a[C]+1+(M?1:0),g.push(a[C]),a[C]=q-E,v.push(l[C]),l[C]=c-s[C];continue}if(w)break;let x=!1;for(let E=0,M=y.length;E";const I=[t,0];N.map=I,e.md.block.tokenize(e,t,C);const S=e.push("blockquote_close","blockquote",-1);S.markup=">",e.lineMax=f,e.parentType=b,I[1]=e.line;for(let _=0;_=4){i++,o=i;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=`${e.getLines(t,o,4+e.blkIndent,!1)} -`,s.map=[t,e.line],!0}function Lde(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const u=e.src.slice(l,o),c=e.src.slice(o,s);if(r===96&&c.includes(String.fromCharCode(r)))return!1;if(i)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],o=4)&&(o=e.skipChars(o,r),!(o-l=4)return!1;let c=o.charCodeAt(a);if(c!==35||a>=u)return!1;let d=1;for(c=o.charCodeAt(++a);c===35&&a6||aa&&AT(o.charCodeAt(f-1))&&(u=f),e.line=t+1;const h=e.push("heading_open",wT[d],1);h.markup=CT[d],h.map=[t,e.line];const m=e.push("inline","",0);m.content=o.slice(a,u).trim(),m.map=[t,e.line],m.children=[];const g=e.push("heading_close",wT[d],-1);return g.markup=CT[d],!0}function Dde(e){switch(e){case 9:case 32:return!0}return!1}function Fde(e,t,n,i){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;s|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${Oce.source}\\s*$`),/^$/,!1]];function Bde(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,s),l=0;for(;l=48&&e<=57}var _z=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i;const o=this.src;let s=0,r=0,l=0,a=!1,u=0;for(let c=0,d=o.length;c0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,i=this.eMarks;for(let o=this.lineMax;et;){const i=n.charCodeAt(--e);if(i!==9&&i!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let i=n.length;en;)if(t!==i.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";if(e+1===t){const c=e,d=this.bMarks[c];let f=d;const h=i?this.eMarks[c]+1:this.eMarks[c];let m=0;const g=this.src,v=this.bsCount,y=this.tShift;for(;fn?new Array(m-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const o=new Array(t-e),s=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,u=this.tShift;for(let c=0,d=e;dn?o[c]=new Array(f-n+1).join(" ")+s.slice(m,g):o[c]=s.slice(m,g)}return o.join("")}};_z.prototype.Token=Is;function $de(e,t,n){for(let i=t;i=o)return!1;const s=n.charCodeAt(i);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:$de(n,i,o)}const ST=["","h1","h2"];function Ode(e,t,n){const i=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,s=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,u=e.blkIndent,c=Mz(e);if(a[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,m=t+1;for(;m=T)break;if(a[m]-u>3)continue;if(a[m]>=u&&(h=o.charCodeAt(C),h===45||h===61)){let I=C+1,S=I;for(;I=T){f=h===61?1:2;break}if(S-C>1)continue}if(a[m]<0||c&&!Iz(e,m,o,C,T))continue;let N=!1;for(let I=0,S=i.length;IC;){const N=o.charCodeAt(T-1);if(N!==9&&N!==32)break;T--}g=o.slice(C,T)}else g=e.getLines(t,m,u,!1).trim();e.line=m+1;const v=h===61?"=":"-",y=e.push("heading_open",ST[f],1);y.markup=v,y.map=[t,e.line];const b=e.push("inline","",0);b.content=g,b.map=[t,e.line-1],b.children=[];const w=e.push("heading_close",ST[f],-1);return w.markup=v,e.parentType=d,!0}function Tz(e){switch(e){case 9:case 32:return!0}return!1}function _T(e,t){const n=e.eMarks,i=e.bMarks,o=e.tShift,s=e.src,r=n[t];let l=i[t]+o[t];const a=s.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l=l)return-1;let u=s.charCodeAt(a++);if(u<48||u>57)return-1;for(;;){if(a>=l)return-1;if(u=s.charCodeAt(a++),u>=48&&u<=57){if(a-r>=10)return-1;continue}if(u===41||u===46)break;return-1}return a0&&++o=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(u=!0);let c,d,f;const h=e.src,m=e.bMarks,g=e.tShift,v=e.eMarks,y=e.sCount,b=e.bsCount,w=m[l]+g[l];if(w>=v[l])return!1;const C=h.charCodeAt(w);if(C>=48&&C<=57){if(f=MT(e,l),f<0||(c=!0,r=w,d=Pde(e,l,f),u&&d!==1))return!1}else if(C===42||C===45||C===43){if(f=_T(e,l),f<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(f)>=v[l])return!1;if(i)return!0;const T=h.charCodeAt(f-1),N=String.fromCharCode(T);if(c){const M=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(M.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const I=[l,0];e.tokens[e.tokens.length-1].map=I,e.tokens[e.tokens.length-1].markup=N;let S=!1;const _=e.tokens.length-1,x=e.md.block.ruler.getRulesForState(e,"list"),E=e.parentType;for(e.parentType="list";l=o?z=1:z=R-M,z>4&&(z=1);const O=M+z,B=e.push("list_item_open","li",1);B.markup=N;const P=[l,0];B.map=P,c&&(B.info=f-r-1===1?zde[h.charCodeAt(r)-48]:h.slice(r,f-1));const H=e.tight,j=e.tShift[l],Z=e.sCount[l],ie=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=O,e.tight=!0,e.tShift[l]=q-m[l],e.sCount[l]=R,q>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||S)&&(a=!1),S=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ie,e.tShift[l]=j,e.sCount[l]=Z,e.tight=H,e.push("list_item_close","li",-1).markup=N,l=e.line,P[1]=l,l>=n||e.sCount[l]=4)break;let W=!1;for(let Q=0,te=x.length;Q3||u[f]<0)continue;if(o==="list"&&u[f]>=c){const w=r[f]+l[f],C=a[f];if(w=C||IT(s.charCodeAt(w+1)))break}else if(T>=48&&T<=57&&w+1=C){N=-1;break}const I=s.charCodeAt(N++);if(I>=48&&I<=57){if(N-w>=10){N=-1;break}continue}if((I===41||I===46)&&(N>=C||IT(s.charCodeAt(N))))break;N=-1;break}if(N>=0)break}}}const v=r[f]+l[f],y=a[f];if(d&&!Iz(e,f,s,v,y))continue;let b=!1;for(let w=0,C=i.length;w=4||e.src.charCodeAt(o)!==91)return!1;function a(w){const C=e.lineMax;if(w>=C||e.isEmpty(w))return null;let T=!1;if(e.sCount[w]-e.blkIndent>3&&(T=!0),e.sCount[w]<0&&(T=!0),!T){const S=e.parentType;e.parentType="reference";let _=!1;for(let x=0,E=l.length;x"u"&&(e.env.references={}),typeof e.env.references[b]>"u"&&(e.env.references[b]={title:y,href:f}),e.line=r),!0):!1}function P3(e){switch(e){case 9:case 32:return!0}return!1}const Ude=65536;function z3(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function Vde(e,t){if(e.lineFlags)return(e.lineFlags[t]&Bg.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];nn)return!1;let o=t+1;if(e.sCount[o]=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const r=e.src.charCodeAt(s++);if(r!==124&&r!==45&&r!==58||s>=e.eMarks[o])return!1;const l=e.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!P3(l)||r===45&&P3(l)||!Vde(e,t))return!1;for(;s=4)return!1;u=TT(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g;const v=e.push("thead_open","thead",1);v.map=[t,t+1];const y=e.push("tr_open","tr",1);y.map=[t,t+1];for(let C=0;C=4||(u=TT(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),w+=d-u.length,w>Ude))break;if(o===t+2){const N=e.push("tbody_open","tbody",1);N.map=b=[t+2,0]}const T=e.push("tr_open","tr",1);T.map=[o,o+1];for(let N=0;Nr.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}after(e,t,n,i){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:i,fn:o})=>(s,r,l,a)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=o(s,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return o1(s?.env,"block",i,d-u,c,!!a),c}):this.getRules(t)}at(e,t,n){const i=this._rules.findIndex(o=>o.name===e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[i].fn=t,n?.alt&&(this._rules[i].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this._rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const i of this._rules)if(i.enabled)for(const o of i.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const i of e){const o=[],s=[];for(const r of this._rules)r.enabled&&(i!==""&&!r.alt.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t[i]=o,n[i]=s}this.cache=t,this.namedCache=n}};const T2=[["table",Kde,["paragraph","reference"]],["code",Ede],["fence",Lde,["paragraph","reference","blockquote","list"]],["blockquote",Tde,["paragraph","reference","blockquote","list"]],["hr",Fde,["paragraph","reference","blockquote","list"]],["list",Hde,["paragraph","reference","blockquote"]],["reference",qde],["html_block",Bde,["paragraph","reference","blockquote"]],["heading",Nde,["paragraph","reference","blockquote"]],["lheading",Ode],["paragraph",Wde]];var Gde=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Zde;for(let e=0;e=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}return}const f=this.ruler.getNamedRules("");for(;c=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}}parse(e,t,n,i){if(!e||e.length===0)return;const o=new _z(e,t,n,i);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},Ez=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};Ez.prototype.Token=Is;const ET=[["normalize",hde],["block",bce],["inline",ode],["linkify",cde],["replacements",bde],["smartquotes",xde],["text_join",Sde]],Qde={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Yde={parseLinkLabel:G6,parseLinkDestination:Z6,parseLinkTitle:Q6};function Jde(){return{...Qde}}function Xde(){return{...Yde}}var efe=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Gde,this.inline=new ide,this.ruler=new wde;for(let e=0;e@[\]\\^_`{}~]/;function U9(e){return!tfe.test(e)}function rg(e,t){const n=e.indexOf(` -`,t);return n===-1?e.length:n}function Ly(e,t,n){for(let i=t;i3)return U9(e);for(let t=0;t=i||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;ll&&t.charCodeAt(a-1)===32;)a--;let u=a;for(;u>l&&t.charCodeAt(u-1)===35;)u--;if(u>l&&t.charCodeAt(u-1)===32)for(a=u-1;a>l&&t.charCodeAt(a-1)===32;)a--;const c=t.slice(l,a);if(!U9(c))return!1;const d=ife[s],f=ofe[s],h=da("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(e7(c,o,1));const m=da("heading_close",d,-1,0);return m.markup=f,e.push(m),!0}function rfe(e,t,n){const i=da("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(e7(t,n,1)),e.push(da("paragraph_close","p",-1,0))}function lfe(e,t,n){const i=e.charCodeAt(n-1);return i===32||i===9?e.slice(t,n).trim():e.slice(t,n)}function q3(e,t){for(;t=1e5?NT:W3,o="",s=!1,r=!1,l=0,a=0;for(;l"]/,DT=/[&<>"]/g,pfe=/&/g,mfe=/[<>"]/g,gfe={"&":"&","<":"<",">":">",'"':"""};function U3(e){return gfe[e]||e}function Ui(e){if(e.length===0)return"";if(e.length<32)return hfe.test(e)?e.replace(DT,U3):e;const t=e.includes("&"),n=e.includes("<"),i=e.includes(">"),o=e.includes('"');return!t&&!n&&!i&&!o?e:t&&!n&&!i&&!o?e.replace(pfe,"&"):t?e.replace(DT,U3):e.replace(mfe,U3)}const vfe=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),yfe=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function Lz(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(vfe,(t,n,i)=>{if(n)return n;if(yfe.test(i)){const s=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return Tk(s)?M0(s):"�"}const o=P6(t);return o!==t?o:t})}const kfe=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,bfe=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,wfe=/"/g;function Op(e,t){const n=e.indexOf(` -`,t);return n===-1?e.length:n}function V9(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!V9(e,t,Op(e,t))}function FT(e,t,n){return t+2=n||e.charCodeAt(o)!==32)return null;let s=o+1;for(;ss&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>s&&e.charCodeAt(l-1)===35;)l--;if(l>s&&e.charCodeAt(l-1)===32)for(r=l-1;r>s&&e.charCodeAt(r-1)===32;)r--;const a=t7(e.slice(s,r));return a===null?null:`${a} -`}function BT(e,t,n){return t+1" -`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`
    3. ${e[t]}
    4. -`}function _fe(e,t,n){const i=t+2;if(n===i+1)return Sfe(e,i);const o=t7(e.slice(t+2,n));return o===null?null:`
    5. ${o}
    6. -`}function Mfe(e,t,n){for(;tt;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let i=n;for(let o=t;o`:"
      ",i.lang=s,i.open=d),{html:`${d}${Ui(c)}
      -`,nextPos:u=25e4,s=[],r={lang:null,open:""};let l="",a="",u="",c="";for(;n -`;C -`,l=y,a=b}let w=E2(e,v);for(;w${v}

      -`,u=h,c=m}const g=de.core.parse(t,n,e).tokens);let r=Ny(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=Dfe(r,o.maxChunks)),Dy(t,r))return R3(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),i1(n,s,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return R3(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:s||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!s}),i1(n,s,()=>{for(let u=0;u=3&&(c?c.marker===w&&T>=c.length&&(c=null):c={marker:w,length:T})}}const v=m-f;o+=v,s+=1,l+=1,g?(a=0,u=0):(a+=1,u+=v);const y=g;if((o>=t.maxChunkChars||s>=t.maxChunkLines)&&!c)if(y)d(m);else{const b=Math.max(10,Math.floor(t.maxChunkLines*.5)),w=Math.max(t.maxChunkChars,8e3);(a>=b||u>=w)&&d(m)}f=m}return n&&d(e.length),i}function Dy(e,t,n={rangesCoverWholeSource:!0}){const i=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;oe.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let i=n+1;i=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Nfe(e,t){for(let n=0;n=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Hc(e){return e.length===0?0:Oo(e)+(e.charCodeAt(e.length-1)===10?0:1)}function zfe(e,t,n){for(let i=t;i=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}i=o===e.length?e.length:o+1}return n!==null}function Hfe(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return zfe(e,n+1,e.length-1)?!jfe(e,t):!1}function Wfe(e,t,n,i={}){const o=i.mode??"full",s=i.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(i.maxChunkChars!==void 0||i.maxChunkLines!==void 0||i.autoTune===!1){const r=i.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??$fe:e.options.fullChunkSizeChars??Bfe),l=i.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??Ofe:e.options.fullChunkSizeLines??Rfe);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:s}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:s}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:s}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}}var yv=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=Hc(this.pending);if(this.pending.length=i||n>=o}function $z(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??Dz))return"yes";const i=e.options.autoUnboundedThresholdLines??Fz;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const s=[],r=new yv(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(l){Bz(s,l)}});if(o&&V6(n,o),r.feed(t),r.flushForce(n),o&&(K6(n),i.fallbackOnGlobalState===!1)){const l=ec(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return s}const s1=(e,t,n)=>en?n:e;function Oz(e){return e.experimental?{...e,...e.experimental}:e}const OT=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],PT=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function Pz(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function Zfe(e,t=Math.max(0,e/40|0),n={}){const i=Oz(n),o=i.fullChunkFenceAware??!0,s=i.fullChunkTargetChunks??8,r=i.fullChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:s1(Math.ceil(e/s),8e3,64e3),maxChunkLines:s1(Math.ceil(t/s),150,700),maxChunks:s1(Math.ceil(e/64e3),s,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.fullChunkSizeChars??1e4,maxChunkLines:i.fullChunkSizeLines??200,fenceAware:o,maxChunks:i.fullChunkMaxChunks}}function zT(e,t=Math.max(0,e/40|0),n={}){const i=Oz(n),o=i.streamChunkFenceAware??!0,s=i.streamChunkTargetChunks??8,r=i.streamChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:s1(Math.ceil(e/s),8e3,64e3),maxChunkLines:s1(Math.ceil(t/s),150,700),maxChunks:s1(Math.ceil(e/64e3),s,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.streamChunkSizeChars??1e4,maxChunkLines:i.streamChunkSizeLines??200,maxChunks:i.streamChunkMaxChunks,fenceAware:o}}var Gfe={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},Qfe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Yfe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function Lk(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Fy(e,t){if(Lk(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const jT=e=>Lk(e)?e:Promise.resolve(e);function $g(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Ui(e)}}function $d(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${$g(t[0])}="${Ui(t[1])}"`;for(let i=1;i=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${t} -`;const s=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${i}`;return s<0?r.push(["class",l]):(r[s]=r[s].slice(),r[s][1]+=` ${l}`),`
      ${t}
      -`}return`
      ${t}
      -`}function T0(e){return!e.attrs||e.attrs.length===0?`${Ui(e.content)}`:`${Ui(e.content)}`}function lC(e){const t=Ui(e.content);return e.attrs?`${t} -`:`
      ${t}
      -`}function Jfe(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

      `;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function HT(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function Xfe(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function WT(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function Z9(e,t){if(e.hidden)return"";const n=e.attrs,i=e.nesting,o=e.tag;if(!n||n.length===0)return i===0?t?`<${o} />`:`<${o}>`:i===-1?``:`<${o}>`;let s=(i===-1?"`}const ehe={langPrefix:"language-",xhtmlOut:!1,breaks:!1},L2=Object.prototype.hasOwnProperty,Si={code_inline(e,t){return T0(e[t])},code_block(e,t){return lC(e[t])},fence(e,t,n,i,o){const s=e[t],r=s.info?Lz(s.info).trim():"",{langName:l,langAttrs:a}=zz(r),u=n.highlight,c=Ui(s.content);if(!u)return Og(s,c,r,l,n);const d=u(s.content,l,a);return Lk(d)?d.then(f=>Og(s,f||c,r,l,n)):Og(s,d||c,r,l,n)},image(e,t,n,i,o){const s=e[t],r=o.renderInlineAsText(s.children||[],n,i),l=s.attrIndex("alt");return l>=0&&s.attrs?s.attrs[l][1]=r:s.attrs?s.attrs.push(["alt",r]):s.attrs=[["alt",r]],Z9(s,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
      -`:`
      -`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
      -`:`
      -`:` -`},text(e,t){return Ui(e[t].content)},text_special(e,t){return Ui(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function qT(e,t,n){const i=e.info?Lz(e.info).trim():"",{langName:o,langAttrs:s}=zz(i),r=t.highlight,l=Ui(e.content);if(!r)return Og(e,l,i,o,t);const a=r(e.content,o,s);if(Lk(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Og(e,a||l,i,o,t)}function V3(e,t,n,i){switch(e.type){case"text":return t.text===Si.text?e.content.length===0?"":Ui(e.content):null;case"text_special":return t.text_special===Si.text_special?e.content.length===0?"":Ui(e.content):null;case"softbreak":return t.softbreak===Si.softbreak?i:null;case"hardbreak":return t.hardbreak===Si.hardbreak?n:null;case"html_inline":return t.html_inline===Si.html_inline?e.content:null;case"code_inline":return t.code_inline===Si.code_inline?T0(e):null;default:return null}}function the(e,t,n,i,o){const s=e[0];switch(s.type){case"text":if(o.text===Si.text)return s.content.length===0?"":Ui(s.content);break;case"text_special":if(o.text_special===Si.text_special)return s.content.length===0?"":Ui(s.content);break;case"softbreak":if(o.softbreak===Si.softbreak)return t.breaks?t.xhtmlOut?`
      -`:`
      -`:` -`;break;case"hardbreak":if(o.hardbreak===Si.hardbreak)return t.xhtmlOut?`
      -`:`
      -`;break;case"html_inline":if(o.html_inline===Si.html_inline)return s.content;break;case"code_inline":if(o.code_inline===Si.code_inline)return T0(s);break}const r=o[s.type];if(!r)return Z9(s,t.xhtmlOut===!0);const l=r(e,0,t,n,i);return typeof l=="string"?l:Fy(l,s.type)}var nhe=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Si}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const i=this.mergeOptions(t),o=n??{},s=this.rules,r=i.xhtmlOut===!0;let l,a,u,c,d,f,h="",m="",g=!1,v="";for(let y=0;y0&&e[y-1].hidden?` -`:"";if(w==="list_item_open"&&(!b.attrs||b.attrs.length===0)&&y+3${this.renderInlineTokens(S.children||[],i,o)}`,y+=3;continue}}if(y+2 -`,y+=2;continue}}}if(w==="inline"){const I=b.children||[];if(I.length===1){g||(l=s.text,a=s.text_special,u=s.softbreak,c=s.hardbreak,d=s.html_inline,f=s.code_inline,h=i.xhtmlOut?`
      -`:`
      -`,m=i.breaks?h:` -`,g=!0);const S=I[0];switch(S.type){case"text":if(l===Si.text){v+=Ui(S.content);continue}break;case"text_special":if(a===Si.text_special){v+=Ui(S.content);continue}break;case"softbreak":if(u===Si.softbreak){v+=m;continue}break;case"hardbreak":if(c===Si.hardbreak){v+=h;continue}break;case"html_inline":if(d===Si.html_inline){v+=S.content;continue}break;case"code_inline":if(f===Si.code_inline){v+=T0(S);continue}break}}v+=this.renderInlineTokens(I,i,o);continue}const T=s[w];if(!T){const I=b.attrs;if(!b.hidden){if(!I||I.length===0)switch(w){case"hr":v+=r?`


      -`:`
      -`;continue;case"heading_open":v+=`<${b.tag}>`;continue;case"heading_close":v+=` -`;continue;case"paragraph_open":v+=`${C}

      `;continue;case"paragraph_close":v+=`

      -`;continue;case"list_item_open":{const S=e[y+1];v+=C+(S&&(S.type==="inline"||S.hidden||S.nesting===-1&&S.tag==="li")?"
    7. ":`
    8. -`);continue}case"list_item_close":v+=`
    9. -`;continue;case"bullet_list_open":v+=`${C}
        -`;continue;case"bullet_list_close":v+=`
      -`;continue;case"blockquote_open":v+=C+(e[y+1]&&e[y+1].nesting===-1&&e[y+1].tag==="blockquote"?"
      ":`
      -`);continue;case"blockquote_close":v+=`
      -`;continue;case"ordered_list_open":v+=`${C}
        -`;continue;case"ordered_list_close":v+=`
      -`;continue;case"table_open":v+=`${C} -`;continue;case"table_close":v+=`
      -`;continue;case"thead_open":v+=`${C} -`;continue;case"thead_close":v+=` -`;continue;case"tbody_open":v+=`${C} -`;continue;case"tbody_close":v+=` -`;continue;case"tr_open":v+=`${C} -`;continue;case"tr_close":v+=` -`;continue;case"td_open":v+=`${C}`;continue;case"td_close":v+=` -`;continue;case"th_open":v+=`${C}`;continue;case"th_close":v+=` -`;continue}else if(I.length===1){const S=I[0];if(w==="ordered_list_open"&&S[0]==="start"){v+=`${C}
        -`;continue}if(w==="td_open"&&S[0]==="style"){v+=`${C}`;continue}if(w==="th_open"&&S[0]==="style"){v+=`${C}`;continue}}}v+=this.renderToken(e,y,i);continue}if(w==="code_block"&&T===Si.code_block){v+=lC(b);continue}if(w==="fence"&&T===Si.fence){v+=qT(b,i);continue}if(w==="html_block"&&T===Si.html_block){v+=b.content;continue}const N=T(e,y,i,o,this);typeof N=="string"?v+=N:v+=Fy(N,b.type)}return v}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const i=this.mergeOptions(t),o=n??{},s=this.rules;let r="";for(let l=0;l0&&e[t-1].hidden?` -`:"",c=a?`> -`:">";if(!l||l.length===0)return s===0?n.xhtmlOut?`${u}<${r} /${c}`:`${u}<${r}${c}`:s===-1?`${u}(n||(n={...t}),n);if(L2.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),L2.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(i().langPrefix=o)}if(L2.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(i().xhtmlOut=o)}if(L2.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(i().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...ehe,...this.baseOptions})}renderSingleToken(e,t,n,i){const o=this.rules,s=t.type;if(s==="code_block"&&o.code_block===Si.code_block)return lC(t);if(s==="html_block"&&o.html_block===Si.html_block)return t.content;const r=this.mergeOptions(n),l=i??{};if(s==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[s];if(!a)return t.block?this.renderToken(e,0,r):Z9(t,r.xhtmlOut===!0);if(s==="fence"&&a===Si.fence)return qT(t,r);const u=a(e,0,r,l,this);return typeof u=="string"?u:Fy(u,s)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return the(e,t,n,this,i);const o=t.xhtmlOut===!0,s=o?`
        -`:`
        -`,r=t.breaks?s:` -`,l=i.text,a=i.text_special,u=i.softbreak,c=i.hardbreak,d=i.html_inline,f=i.code_inline,h=i.link_open,m=i.link_close,g=i.em_open,v=i.em_close,y=i.strong_open,b=i.strong_close;let w="";for(let C=0;C`;if(u===Si.softbreak&&C+3`,C+=1;continue}if(T.type==="em_open"&&!g&&!v&&C+2${_}`,C+=2;continue}}}if(T.type==="strong_open"&&!y&&!b&&C+2${_}`,C+=2;continue}}}switch(T.type){case"text":if(l===Si.text){const S=T.content.length===0?"":Ui(T.content);if(d===Si.html_inline&&C+1=4)return!0;continue}if(l===9){if(r+=4-r%4,s++,r>=4)return!0;continue}break}if(s0&&u<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=s+1;for(;a57)break;a++}if(a=ue,!G&&se!==void 0&&(fe=Oo(e),G=fe>=se)),G){const K=this.parseFullDocument(e,R,n,fe,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(R,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!ec(R)?.unbounded}),K.tokens}else if(P){const K=(ye,Ae,_e)=>ye_e?_e:ye;fe===void 0&&(fe=Oo(e));const re=te&&!Q?zT(e.length,fe,n.options):null,be=re?.maxChunkChars??(H?K(Math.ceil(e.length/j),8e3,64e3):Z??1e4),ke=re?.maxChunkLines??(H?K(Math.ceil(fe/j),150,700):ie??200),we=re?.maxChunks??(H?K(Math.ceil(e.length/64e3),j,32):W),oe=e.length>0&&e.charCodeAt(e.length-1)===10,le=B&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&re?.strategy!=="plain";if((O||le)&&(e.length>=be*2||fe>=ke*2)&&oe){const ye=K9(n,e,R,{maxChunkChars:be,maxChunkLines:ke,fenceAware:re?.fenceAware??X,maxChunks:we});return this.cache={src:e,tokens:ye,env:R,lineCount:fe,lastSegment:void 0,globalStateReason:il(e)},this.updateCacheLineCount(this.cache,fe),this.recordChunkedParseResult(R,O?"explicit-initial-large-doc":"default-initial-large-doc"),ye}}const ae=this.parseFullDocument(e,R,n,fe);return fe=ae.lineCount,this.cache={src:e,tokens:ae.tokens,env:R,lineCount:fe,lastSegment:void 0,globalStateReason:il(e)},this.updateCacheLineCount(this.cache,fe),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(R,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!ec(R)?.unbounded}),ae.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",is(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const s=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=il(o.src),o.globalStateReason=r);const l=r?null:s!==null?this.detectGlobalStateForAppend(o,s):il(e),a=r||l;if(a){const R=i??o.env;xc(R);const q=il(e),z=this.parseFullDocument(e,R,n),O=z.tokens,B=z.lineCount;return this.cache={src:e,tokens:O,env:R,lineCount:B,lastSegment:void 0,globalStateReason:q},this.updateCacheLineCount(this.cache,B),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(R,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!ec(R)?.unbounded}),O}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length5e3?q=8:c.length>1e3?q=6:c.length>200&&(q=4),q=Math.min(q,R);let z=null;const O=n.options?.streamContextParseStrategy??"chars",B=n.options?.streamContextParseMinChars??200,P=n.options?.streamContextParseMinLines??2;let H;const j=()=>(H===void 0&&(H=Oo(c)),H),Z=this.canDirectlyParseAppend(o),ie=Z&&this.shouldUseUnboundedAppend(e,o,c);let W=!1;if(!Z)switch(O){case"lines":W=j()>=P;break;case"constructs":if(c.length>=B){W=!0;break}if(she(c)){W=!0;break}W=j()>=P;break;case"chars":default:W=c.length>=B}if(q>0&&W){const X=this.getTailLines(o.src,q)+c;try{const ge=this.core.parse(X,o.env,n).tokens,ue=ge.findIndex(se=>se.map&&typeof se.map[1]=="number"&&se.map[1]>q);if(ue!==-1){const se=ge.slice(ue),fe=R-q;fe!==0&&this.shiftTokenLines(se,fe),z={tokens:se}}}catch{z=null}}else z=null;if(!z){const X=R;if(ie)z={tokens:Rg(n,c,o.env,{mode:"stream"})},X>0&&this.shiftTokenLines(z.tokens,X);else{const ge=this.core.parse(c,o.env,n);X>0&&this.shiftTokenLines(ge.tokens,X),z=ge}}let Q=0;if(o.tokens.length>0&&z.tokens.length>0){const X=o.tokens[o.tokens.length-1],ge=z.tokens[0];try{X.type==="inline"&&ge.type==="inline"&&(ge.children&&ge.children.length>0&&(X.children||(X.children=[]),this.appendTokens(X.children,ge.children)),X.content=(X.content||"")+(ge.content||""),Q=1)}catch{Q=0}}const te=o.tokens.length;if(z.tokens.length>Q){const X=o.tokens,ge=z.tokens,ue=Math.min(X.length,ge.length-Q);let se=0;for(let fe=ue;fe>0;fe--){let G=!0;for(let ae=0;ae0&&(Q+=se),ge.length>Q&&this.appendTokens(o.tokens,ge,Q)}if(o.src=e,o.globalStateReason=null,o.lineCount=R+(H??j()),o.tokens.length>te){const X=this.getLastSegment(o.tokens,e,te,o.tokens.length,e.length-c.length,R);X?o.lastSegment=X:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ie&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",is(o.env,{area:"stream",path:ie?"stream-unbounded-append":"stream-append",reason:ie?"large-delta":"safe-append",unbounded:ie}),o.tokens}const d=i??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",is(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,v=!h&&!c&&m,y=g||v,b=n.options?.streamChunkAdaptive!==!1,w=n.options?.streamChunkTargetChunks??8,C=n.options?.streamChunkSizeChars,T=n.options?.streamChunkSizeLines,N=n.options?.streamChunkMaxChunks,I=!!n.__explicitStreamChunkConfig,S=n.options?.autoTuneChunks!==!1,_=n.options?.streamChunkFenceAware??!0;let x=c&&o.lineCount!==void 0?o.lineCount+Oo(c):void 0;if(y){x===void 0&&(x=Oo(e));const R=(j,Z,ie)=>jie?ie:j,q=S&&!I?zT(e.length,x,n.options):null,z=q?.maxChunkChars??(b?R(Math.ceil(e.length/w),8e3,64e3):C??1e4),O=q?.maxChunkLines??(b?R(Math.ceil(x/w),150,700):T??200),B=q?.maxChunks??(b?R(Math.ceil(e.length/64e3),w,32):N),P=e.length>0&&e.charCodeAt(e.length-1)===10,H=v&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&q?.strategy!=="plain";if((g||H)&&(e.length>=z*2||x>=O*2)&&P){const j=K9(n,e,d,{maxChunkChars:z,maxChunkLines:O,fenceAware:q?.fenceAware??_,maxChunks:B});return this.cache={src:e,tokens:j,env:d,lineCount:x,lastSegment:void 0,globalStateReason:il(e)},this.updateCacheLineCount(this.cache,x),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),j}}const E=this.parseFullDocument(e,d,n,x),M=E.tokens;return x=E.lineCount,this.cache={src:e,tokens:M,env:d,lineCount:x,lastSegment:void 0,globalStateReason:il(e)},this.updateCacheLineCount(this.cache,x),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!ec(d)?.unbounded}),M}recordChunkedParseResult(e,t){const n=ec(e)?.chunk,i=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,i){this.stats.fullParses+=1,this.stats.lastMode="full",is(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!ec(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",is(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,o=!0){const s=il(e);gv(t)&&xc(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?$z(n,e.length,i):"no";if(r==="yes"){const a=Rg(n,e,t);return is(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:i??(o?Oo(e):0)}}let l=i;if(r==="need-lines"&&(l=Oo(e),Rz(n,e.length,l))){const a=Rg(n,e,t);return is(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Oo(e):0),{tokens:i1(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:Oo(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` -`))return null;const i=n??t.slice(e.length);if(!i)return null;const o=i.length;if(i.charCodeAt(o-1)!==10)return null;let s=0,r=-1;for(let a=0;a=2));a++);if(s<2)return null;const l=(r===-1?i:i.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),u=a.lastIndexOf(` -`);if(a.slice(u+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,i){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const s=t.src.slice(0,o.srcOffset);if(!e.startsWith(s))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const u=this.tryContainerTailAppendMerge(e,t,n,i,o,a);if(u)return u}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const u=this.core.parse(l,n,i),c=this.getLastSegment(u.tokens,l);return o.lineStart>0&&this.shiftTokenLines(u.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,u.tokens),t.lineCount=o.lineStart+Oo(l),c?t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:o.lineStart+c.lineStart,lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let i=e.length-1;i>=0;i--)if(e.charCodeAt(i)===10&&(n--,n===0))return e.slice(i+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,i=e.slice(n),o=i.length;let s=null,r=0;for(;r<=o;){let l=i.indexOf(` -`,r);l===-1&&(l=o);let a=r;for(;a=3&&(s?s.marker===u&&d>=s.length&&(s=null):s={marker:u,length:d})}}if(l===o)break;r=l+1}return s!==null}peek(){return this.cache?.tokens??ohe}getStats(){return{...this.stats}}appendTokens(e,t,n=0,i=t.length){for(let o=n;oK3?n.slice(n.length-K3):n,i&&(e.globalStateReason=i),i}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,i=e.length,o,s){if(i<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let u=i-1;u>=n;u--){const c=e[u];if(c.map&&(c.map[0]l&&(l=c.map[1])),c.nesting<0){a+=-c.nesting;continue}if(c.nesting>0){if(a-=c.nesting,c.level===0&&a<=0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}continue}if(c.level===0&&a===0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}}return null}getLineStartOffset(e,t,n,i){if(n!==void 0&&i!==void 0&&t>=i)return this.getLineStartOffsetFrom(e,n,t-i);if(t<=0)return 0;let o=t,s=-1;for(;o>0;){if(s=e.indexOf(` -`,s+1),s===-1)return e.length;o--}return s+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let i=n,o=t-1;for(;i>0;){if(o=e.indexOf(` -`,o+1),o===-1)return e.length;i--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,i,o,s){if(!s||this.mayContainReferenceDefinition(s))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,i,o,s,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,i,o,s,r);default:return null}}tryListTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),m=this.getListParagraphMode(c,0,c.length,0);(h==="loose"||m==="loose"||this.endsWithBlankLine(t.src)||(c[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+Oo(s);t.lineCount=g;const v=this.getDocLineCount(e,g);return r.map&&(r.map[1]=v),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:v,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(s))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(m.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(m,g);const v=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,y=t.lineCount??Oo(t.src);t.tokens.splice(v,0,...m),t.src=e,t.env=n,t.globalStateReason=null;const b=y+Oo(s);t.lineCount=b;const w=this.getDocLineCount(e,b);if(r.map&&(r.map[1]=w),h.tbodyOpenIndex>=0){const C=t.tokens[h.tbodyOpenIndex];C?.map&&(C.map[1]=w)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:w,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` -`);if(t<0)return null;const n=e.indexOf(` -`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,i){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===i){o=l;break}}if(o<0)return null;let s=-1,r=-1;for(let l=t+1;l=0){for(let l=o-1;l>s;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===i+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:s,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,i){if(e.length<2)return!1;const o=e[0],s=e[e.length-1];if(o.type!==t||s.type!==n||o.level!==0||s.level!==0||i!==void 0&&o.markup!==i)return!1;let r=0;for(let l=0;l0&&l0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,i){let o=!1,s=!1;const r=i+2;for(let l=t;l=0;){const i=e.charCodeAt(n);if(i===32||i===9){n--;continue}return i===10}return!0}getDocLineCount(e,t=Oo(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let i=0;i=0;s--)n.push(o.children[s]);for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let r=s.children.length-1;r>=0;r--)n.push(s.children[r])}}}}};const VT={default:Qfe,zero:Yfe,commonmark:Gfe};function uhe(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function che(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function KT(e){return e.experimental?{...e,...e.experimental}:e}function ia(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function ZT(e,t,n){for(let i=0;i=4?n.quotes=[S[0],S[1],S[2],S[3]]:n.quotes=["“","”","‘","’"]}let r=ZT(s?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=ZT(s?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=GT(s?.options,o,"fullChunkedFallback"),u=GT(s?.options,o,"streamChunkedFallback"),c=!1,d=null,f=null;const h=new efe;let m=null;const g=()=>(m||(m=new ihe(n)),m);let v=null;const y=()=>(v||(v=new ahe(h)),v);let b=null;const w=()=>(b||(b=new KP({fuzzyLink:!0})),b),C=S=>!c&&!!d&&!che(S,d),T=(S,_)=>i==="default"&&!c&&m===null&&f!==null&&S.parse===f&&C(S)&&!S.stream.enabled&&_<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.xhtmlOut===!1&&S.options.breaks===!1&&S.options.langPrefix==="language-"&&S.options.linkify===!1&&S.options.typographer===!1&&S.options.highlight===null,N=(S,_)=>i==="default"&&!c&&C(S)&&!S.stream.enabled&&!S.options.fullChunkedFallback&&_<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.linkify===!1&&S.options.typographer===!1,I={core:h,block:h.block,inline:h.inline,get linkify(){const S=w();return Object.defineProperty(this,"linkify",{value:S,writable:!0,configurable:!0}),S},get renderer(){const S=g();return Object.defineProperty(this,"renderer",{value:S,writable:!0,configurable:!0}),S},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return C(this)},set(S){const _=KT(S);return this.options={...this.options,..._},(ia(S,"fullChunkSizeChars")||ia(S,"fullChunkSizeLines")||ia(S,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ia(S,"streamChunkSizeChars")||ia(S,"streamChunkSizeLines")||ia(S,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ia(S,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ia(S,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(_),typeof _.stream=="boolean"&&(this.stream.enabled=_.stream,v&&(v.reset(),v.resetStats())),this},configure(S){const _=typeof S=="string"?VT[S]:S;if(!_)throw new Error("Wrong `markdown-it` preset, can't be empty");if(_.options&&this.set(_.options),_.components){const x=_.components;x.core?.rules&&this.core.ruler.enableOnly(x.core.rules),x.block?.rules&&this.block.ruler.enableOnly(x.block.rules),x.inline?.rules&&this.inline.ruler.enableOnly(x.inline.rules),x.inline2?.rules&&this.inline.ruler2.enableOnly(x.inline2.rules)}return this},enable(S,_){const x=Array.isArray(S)?S:[S],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const R of E){if(!R)continue;const q=R.enable(x,!0);for(let z=0;z!M.has(q));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},disable(S,_){const x=Array.isArray(S)?S:[S],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const R of E){if(!R)continue;const q=R.disable(x,!0);for(let z=0;z!M.has(q));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},use(S,..._){const x=typeof S=="function"?S:S&&typeof S.default=="function"?S.default:void 0;if(!x)throw new TypeError("MarkdownIt.use: plugin must be a function");const E=[this,..._],M=S;return c=!0,x.apply(M,E),this},render(S,_){let x;if(T(this,S.length)){_!==void 0&&(Rr(_),x=B3("render"));const R=x?hp():0,q=x?$T(S,x):RT(S);if(x&&(x.attemptMs=hp()-R,q===null&&(x.fallbackReason="unsupported-stock-subset"),$m(_,x)),q!==null)return _!==void 0&&is(_,{area:"render",path:"stock-fast",reason:"stock-subset"}),q}const E=_??{},M=this.parse(S,E);return x&&$m(E,x),g().render(M,this.options,E)},async renderAsync(S,_){let x;if(T(this,S.length)){_!==void 0&&(Rr(_),x=B3("render"));const R=x?hp():0,q=x?$T(S,x):RT(S);if(x&&(x.attemptMs=hp()-R,q===null&&(x.fallbackReason="unsupported-stock-subset"),$m(_,x)),q!==null)return _!==void 0&&is(_,{area:"render",path:"stock-fast",reason:"stock-subset"}),q}const E=_??{},M=this.parse(S,E);return x&&$m(E,x),g().renderAsync(M,this.options,E)},renderIterable(S,_={}){const x=this.parseIterable(S,_);return g().render(x,this.options,_)},async renderAsyncIterable(S,_={}){const x=await this.parseAsyncIterable(S,_);return g().renderAsync(x,this.options,_)},renderInline(S,_={}){const x=this.parseInline(S,_);return g().render(x,this.options,_)},validateLink:Az,normalizeLink:xz,normalizeLinkText:Sz,utils:Eue,helpers:{...yce},parse(S,_){if(typeof S!="string")throw new TypeError("Input data should be a String");if(_!==void 0&&Rr(_),N(this,S.length)){const R=_===void 0?void 0:B3("parse"),q=R?hp():0,z=ffe(S,R);if(R&&(R.attemptMs=hp()-q,z===null&&(R.fallbackReason="unsupported-stock-subset"),$m(_,R)),z!==null)return _!==void 0&&is(_,{area:"parse",path:"stock-fast",reason:"stock-subset"}),z}const x=_??{};let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&C(this)){const R=$z(this,S.length);if(R==="yes"){const q=Rg(this,S,x);return is(_,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),q}R==="need-lines"&&(E=Oo(S))}if(!this.stream.enabled){const R=S.length,q=this.options.autoTuneChunks!==!1,z=r,O=!a&&C(this),B=!!this.options.fullChunkedFallback,P=O&&R>=2e5;let H;(B||P||E!==void 0)&&(H=E??Oo(S));const j=(B||P)&&q&&!z?Zfe(R,H,this.options):null;if(B||P){const Z=H??0;if(B?R>=(this.options.fullChunkThresholdChars??2e4)||Z>=(this.options.fullChunkThresholdLines??400):P){if(j&&j.strategy!=="plain"){const ie=K9(this,S,x,{maxChunkChars:j.maxChunkChars,maxChunkLines:j.maxChunkLines,fenceAware:j.fenceAware,maxChunks:j.maxChunks});return _&&QT(_,B?"explicit-full-chunk":"default-large-string"),ie}if(B){const ie=(G,ae,K)=>GK?K:G,W=this.options.fullChunkAdaptive!==!1,Q=this.options.fullChunkTargetChunks??8,te=ie(Math.ceil(R/Q),8e3,64e3),X=ie(Math.ceil(Z/Q),150,700),ge=W?te:this.options.fullChunkSizeChars??1e4,ue=W?X:this.options.fullChunkSizeLines??200,se=W?ie(Math.ceil(R/64e3),Q,32):this.options.fullChunkMaxChunks,fe=K9(this,S,x,{maxChunkChars:ge,maxChunkLines:ue,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:se});return _&&QT(_,"explicit-full-chunk"),fe}}}if(E!==void 0&&C(this)&&Rz(this,R,H??E)){const Z=Rg(this,S,x);return is(_,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),Z}}const M=il(S);return is(_,{area:"parse",path:"plain",reason:"default-plain"}),i1(x,M,()=>h.parse(S,x,this).tokens)},parseIterable(S,_={}){return Rr(_),qfe(this,S,_)},parseAsyncIterable(S,_={}){return Rr(_),Ufe(this,S,_)},parseIterableToSink(S,_,x={}){return Rr(x),Vfe(this,S,_,x)},parseAsyncIterableToSink(S,_,x={}){return Rr(x),Kfe(this,S,_,x)},parseInline(S,_={}){if(typeof S!="string")throw new TypeError("Input data should be a String");Rr(_),gv(_)&&xc(_);const x=h.createState(S,_,this);return x.inlineMode=!0,h.process(x),x.tokens}};if(I.stream={enabled:!!n.stream,parse(S,_){return I.stream.enabled?y().parse(S,_,I):I.parse(S,_??{})},reset(){y().reset()},peek(){return v?v.peek():[]},stats(){return v?v.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){v&&v.resetStats()}},s?.components){const S=s.components;S.core?.rules&&I.core.ruler.enableOnly(S.core.rules),S.block?.rules&&I.block.ruler.enableOnly(S.block.rules),S.inline?.rules&&I.inline.ruler.enableOnly(S.inline.rules),S.inline2?.rules&&I.inline.ruler2.enableOnly(S.inline2.rules)}return d=uhe(I),f=I.parse,I}var fhe=dhe;const Hz=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],hhe=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],Wz=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],phe=["svg","g","path"],mhe=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],ghe=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],vhe=["action","data","href","src","srcset","poster","xlink:href","formaction"],yhe=["script"],khe=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Od=new Set(Hz),qz=new Set(Wz),E0=new Set([...Hz,...hhe,...Wz,...phe]),Uz=new Set([...E0,...mhe]),bhe=new Set(ghe),whe=new Set(vhe),kv=new Set(yhe),Vz=new Set(khe);function Kz(e){let t="";for(const n of e){const i=n.charCodeAt(0);i<=31||i>=127&&i<=159||/\s/u.test(n)||(t+=n)}return t}const Che={amp:"&",bsol:"\\",colon:":",newline:` -`,sol:"/",tab:" "};function Zz(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,i,o)=>{const s=n??i;if(s){const r=Number.parseInt(s,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return Che[String(o??"").toLowerCase()]??t})}const N2=new Set(["http","https","mailto","tel"]),Ahe=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Mf=new Set(["http","https"]);function Gz(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const xhe=/^https?:\/\//i;function She(e){if(!xhe.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function _he(e,t,n){if(!Pg(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function Pg(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function Mhe(e,t){return t==="href"||t==="xlink:href"?Pg(e,t)?N2:Mf:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Mf:(Pg(e,t),N2)}function hh(e,t={}){if(She(e))return!1;const n=Kz(Zz(e)).toLowerCase(),i=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return i==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const s=Gz(n);return s?s==="file"?!_he(n,i,o):Pg(i,o)?Ahe.has(s):!Mhe(i,o).has(s):!1}function Ihe(e){const t=Zz(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=Gz(Kz(t).toLowerCase());return n==="http"||n==="https"}function The(e,t={}){const n=String(e??"").trim();return n?hh(n,t)?"":n:""}function YT(e){return The(e,{tagName:"img",attrName:"src"})}function Ehe(e,t,n){function i(f){return f.trim().split(" ",2)[0]===t}function o(f,h,m,g,v){return f[h].nesting===1&&f[h].attrJoin("class",t),v.renderToken(f,h,m,g,v)}n=n||{};const s=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,u=n.validate||i,c=n.render||o;function d(f,h,m,g){let v,y=!1,b=f.bMarks[h]+f.tShift[h],w=f.eMarks[h];if(l!==f.src.charCodeAt(b))return!1;for(v=b+1;v<=w&&r[(v-b)%a]===f.src[v];v++);const C=Math.floor((v-b)/a);if(C=m||(b=f.bMarks[I]+f.tShift[I],w=f.eMarks[I],b=4)){for(v=b+1;v<=w&&r[(v-b)%a]===f.src[v];v++);if(!(Math.floor((v-b)/a)=2){const r=Number(s[0]),l=Number(s[1]);Number.isFinite(r)&&Number.isFinite(l)&&(o.map=[r+t,Math.min(l+t,n)])}Array.isArray(o.children)&&Qz(o.children,t,n)}}function Nhe(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(Ehe,t,{render(n,i){return n[i].nesting===1?`
        `:`
        -`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,i,o)=>{const s=t,r=s.bMarks[n]+s.tShift[n],l=s.eMarks[n],a=s.src.slice(r,l),u=a.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const d=a.slice(u[0].length).trim();let f,h;const m=d.indexOf("{"),g=m>=0?d.slice(m).trimStart():void 0;if(m===-1)f=d||void 0;else{if(f=d.slice(0,m).trim()||void 0,g?.startsWith("{")){let N=0,I=-1;for(let S=0;S0&&(h=g.slice(0,I))}h||(f=d||void 0)}if(o)return!0;const v=!!s.env.__markstreamFinal;let y=n+1,b=!1;for(;y<=i;){const N=s.bMarks[y]+s.tShift[y],I=s.eMarks[y];if(s.src.slice(N,I).trim()===":::"){b=!0;break}y++}b||(y=i);const w=s.push("vmr_container_open","div",1);if(w.attrSet("class",`vmr-container vmr-container-${c}`),w.map=[n,b?y:i],w.meta={...w.meta??{},unclosed:!b&&!v},f&&w.attrSet("data-args",f),h)try{const N=JSON.parse(h);for(const[I,S]of Object.entries(N)){const _=S!=null&&typeof S=="object";w.attrSet(`data-${I}`,_?JSON.stringify(S):String(S))}}catch{const N=Lhe(h);if(N)for(const[I,S]of Object.entries(N)){const _=S!=null&&typeof S=="object";w.attrSet(`data-${I}`,_?JSON.stringify(S):String(S))}else w.attrSet("data-attrs",h)}const C=[];for(let N=n+1;NN.trim().length>0)){let N=C.join(` -`);N.endsWith(` -`)||(N+=` -`),N.endsWith(` - -`)||(N+=` -`);const I=s.tokens[s.tokens.length-1];I&&(I.raw=N);const S=[];s.md.block.parse(N,s.md,s.env,S),Qz(S,n+1,n+1+C.length),s.tokens.push(...S)}const T=s.push("vmr_container_close","div",-1);return b||(T.hidden=!0,T.map=[i,i]),s.line=b?y+1:y,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ua(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ho(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function Nk(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=i[2]||i[3]||i[4]||"";t.push([o,s])}return t}const Dhe=/^[a-z][a-z0-9_-]*$/;function JT(e){return Dhe.test(String(e??"").trim().toLowerCase())}function va(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return JT(t)?t.toLowerCase():"";let n=1;for(;n]/.test(s)?"":JT(o)?o:""}function qh(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const i of e){const o=va(i);!o||t.has(o)||(t.add(o),n.push(o))}return n}function Fhe(...e){const t=new Set,n=[];for(const i of e)for(const o of qh(i))t.has(o)||(t.add(o),n.push(o));return n}function Bhe(e){const t=qh(e);return{key:t.join(","),tags:t}}function Yz(e){return va(e)}function Rhe(e,t){const n=String(e??""),i=va(t);if(!i)return!1;const o=Ua(i),s=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return s?s[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function Jz(e,t){const n=va(t);return!!n&&!E0.has(n)&&!Rhe(e,n)}function $he(e,t){const n=String(e??""),i=va(t);if(!i)return n;const o=Ua(i),s=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(s,"").replace(r,"")}const Xz=Od,Ohe=E0,ej=new Set(qz);ej.delete("details");const Phe=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,zhe=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,aC=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,jhe=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function G9(e){return(e.match(aC)?.[1]??"").toLowerCase()}function n7(e){return/^\s*<\s*\//.test(e)}function i7(e,t){return Xz.has(t)||/\/\s*>\s*$/.test(e)}function Hhe(e,t){let n=0;for(let i=0;i0&&n--;continue}i7(o,s)||n++}}return n}function XT(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${Ua(t)}(?=[\s>/])[^>]*>`,"gi");i.lastIndex=Math.max(0,n);let o=0,s;for(;(s=i.exec(e))!==null;){const r=s[0]??"",l=!!s[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:s.index,end:s.index+r.length};o--;continue}a||o++}return null}function qhe(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ua(t)}(?=[\s>/])[^>]*>`,"gi");let i=0,o;for(;(o=n.exec(e))!==null;){const s=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(s);if(r){i>0&&i--;continue}l||i++}return i}function Q9(e){const t=e;return String(t.raw??t.content??t.markup??"")}function Uhe(e){const t=e;return t.meta||(t.meta={}),t.meta}function Z3(e,t,n){const i=Uhe(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function Vhe(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Ua(h)}(?=[\s>/])`,"i")),i=[];let o=!1;const s=h=>h?n.some(m=>m.test(h)):!1,r=h=>{if(!(!h||!i.length))for(const m of i)m.raw+=h,m.inner+=h},l=()=>{!i.length||!o||(r(` -`),o=!1)},a=h=>{r(h)},u=h=>{for(let g=0;g{const m=i[i.length-1]?.tag;if(!m)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Ua(m)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!c(h),f=(h,m,g)=>{const v=g??(h.type==="html_inline"?G9(m):"");if(!(v&&t.has(v))){r(m);return}const y=n7(m),b=!y&&i7(m,v);if(y){if(!i.length||i[i.length-1].tag!==v){r(m);return}u(m);return}if(r(m),b){Z3(h,m,"");return}i.push({tag:v,token:h,raw:m,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const m=String(h.content??"");if(d(m)?o=!1:l(),!i.length&&!s(m)){o=!1;continue}let g=0,v=!0;for(const y of h.children){const b=Q9(y),w=y.type==="html_inline"?G9(b):"",C=w&&t.has(w);let T=b;if(v&&m&&b&&(i.length||C)){const N=m.indexOf(b,g);if(N!==-1)a(m.slice(g,N)),T=m.slice(N,N+b.length),g=N+b.length;else{if(i.length&&!C)continue;v=!1}}f(y,T,w)}v&&m&&g0;continue}if(i.length&&typeof h.content=="string"){const m=Q9(h),g=h.type==="html_block"?c(m):null;if(g){u(`${o?` -`:""}${g}`),o=i.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of i)Z3(h.token,h.raw,h.inner)}function Khe(e){return/^\s*<\s*[!?]/.test(e)}function Zhe(e){const t=new Set(Ohe);if(e&&Array.isArray(e))for(const n of e){const i=String(n??"").trim();if(!i)continue;const o=i.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function eE(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function Ghe(e,t){let n=null;for(const s of e.matchAll(Phe)){const r=s.index??-1;if(r<0)continue;const l=(s[1]??"").toLowerCase();eE(l,t)&&Ho(e.slice(r))===-1&&(!n||r")&&(!n||s")&&(!n||s{const h=f,m=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const w of g){const C=va(String(w??""));C&&m.add(C)}const v=Zhe(Array.from(m)),y=new Set(Jhe);for(const w of m)y.add(w);return{autoCloseInlineTagSet:y,commonHtmlTags:v,customTagSet:m,shouldMergeHtmlBlockTag:w=>m.has(w)||!v.has(w)||ej.has(w)}},o=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},s=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),u=(f,h)=>{const m=r(f);if(!/\S/.test(m))return[];if(l(m))return[{type:"code_block",content:a(m),raw:m}];const g=m.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const v={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},v,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[v]},c=(f,h,m)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":m,d=(f,h)=>{const m=r(h);return!/\S/.test(m)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${m}`,f.children.push({type:"text",content:m,raw:m}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:m,customTagSet:g}=i(f);for(const v of h){const y=v;if(y.type!=="inline"||!Array.isArray(y.children))continue;const b=String(y.content??""),w=y.children.length?y.children:b.includes("<")?[{type:"text",content:b,raw:b}]:null;if(w)try{const C=Yhe(w,m);if(y.children=C.children,C.pendingBuffer){const T=b.lastIndexOf(C.pendingBuffer);if(T!==-1){const N=b.slice(0,T);y.content=N,typeof y.raw=="string"&&(y.raw=N)}}}catch(C){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",C)}}Vhe(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:m,customTagSet:g,shouldMergeHtmlBlockTag:v}=i(f),y=[];for(let b=0;b0){const[T,N]=y[y.length-1];if(b!==N){if(w.type==="paragraph_open"||w.type==="paragraph_close"){h.splice(b,1),b--;continue}const I=String(w.content??w.raw??"");if(I){const S=h[N],_=`${String(S.content||"")} -${I}`,x=Ho(_),E=x===-1?null:XT(_,T,x+1);if(E){const M=_.slice(0,E.end),R=_.slice(E.end);S.content=M,S.loading=!1,h.splice(b,1),y.pop();const q=d(S,R)?[]:u(R,c(h,b,"paragraph"));q.length&&h.splice(b,0,...q),b--;continue}S.content=_,S.loading!==!1&&(S.loading=!0)}h.splice(b,1),b--;continue}}const C=o(w);if(C){if(Khe(C))continue;const T=(C.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),N=/^\s*<\s*\//.test(C);if(!T||!v(T))continue;if(s(w,C),!N)T&&!new RegExp(`^\\s*<\\s*${T}\\b[^>]*\\/\\s*>`,"i").test(C)&&qhe(C,T)>0&&y.push([T,b]);else if(y.length>0&&T&&y[y.length-1][0]===T){const[,I]=y[y.length-1],S=h[I];S.content=`${String(S.content||"")} -${C}`,S.loading=!1,y.pop(),h.splice(b,1),b--}continue}else if(y.length>0){if(w.type==="paragraph_open"||w.type==="paragraph_close"){h.splice(b,1),b--;continue}const T=w.content||"",N=new RegExp(`<\\s*\\/\\s*${y[y.length-1][0]}\\s*>`,"i").test(T);if(T){const[,I]=y[y.length-1],S=h[I];S.content=`${S.content||""} -${T}`,S.loading!==!1&&(S.loading=!N)}N&&y.pop(),h.splice(b,1),b--}else continue}if(g.size>0){const b=new Map,w=new Map,C=I=>{let S=b.get(I);return S||(S=new RegExp(`<\\s*${I}\\b`,"i"),b.set(I,S)),S},T=I=>{let S=w.get(I);return S||(S=new RegExp(`<\\s*\\/\\s*${I}\\s*>`,"i"),w.set(I,S)),S},N=[];for(let I=0;I0){const E=N[N.length-1],M=h[E.index],R=S.type==="html_block"?T(E.tag).exec(_):null;if(R){const O=R.index+R[0].length,B=_.slice(0,O),P=_.slice(O);M.content=`${String(M.content??"")} -${B}`,Array.isArray(M.children)&&M.children.push({type:"html_inline",content:``,raw:``}),N.pop();const H=d(M,P)?[]:u(P,c(h,I,"paragraph"));H.length?h.splice(I,1,...H):(h.splice(I,1),I--);continue}if(S.type!=="inline")continue;const q=Array.isArray(S.children)?S.children:[],z=Hhe(q,E.tag);if(z!==-1){const O=q.slice(0,z+1),B=q.slice(z+1),P=O.map(H=>String(H?.content??H?.raw??"")).join("");if(M.content=`${String(M.content??"")} -${P}`,Array.isArray(M.children)&&M.children.push(...O),B.length){const H=B.map(j=>String(j.content??j.raw??"")).join("");if(H.trim()){const j=H.replace(/^\s+/,"");if(d(M,H))h.splice(I,1),I--;else if(j.startsWith("<"))h.splice(I,1,{type:"html_block",content:j});else{const Z=u(H,c(h,I,"paragraph"));h.splice(I,1,...Z)}}else h.splice(I,1),I--}else h.splice(I,1),I--;N.pop();continue}M.content=`${String(M.content??"")} -${_}`,Array.isArray(M.children)&&M.children.push(...q),h.splice(I,1),I--;continue}if(S.type!=="inline")continue;const x=Array.isArray(S.children)?S.children:[];for(const E of g)if((x.length?Whe(x,E):C(E).test(_)&&!T(E).test(_)?1:0)>0){N.push({tag:E,index:I});break}}}{let b=0;for(let w=0;w0?b--:(h.splice(w,1),w--))}}for(let b=0;b/]+)/)?.[1]??"").toLowerCase();if(S.startsWith("!")||S.startsWith("?")){w.loading=!1;continue}if(g.has(S)){const z=String(w.content??""),O=Ho(z),B=O===-1?null:XT(z,S,O+1);w.loading=B?!1:w.loading!==void 0?w.loading:!0;const P=B?.start??-1,H=B?B.end-B.start:0;if(P!==-1){const j=z.slice(0,P+H);let Z="";O!==-1&&O]+)))?/g;let x;for(;(x=_.exec(w.content||""))!==null;)x[1],x[2]||x[3]||x[4];const E=String(w.content??""),M=new RegExp(`<\\/\\s*${S}\\s*>`,"i").exec(E),R=M?M.index:-1,q=M?M[0].length:0;if(R!==-1){const z=E.slice(0,R+q),O=(E.slice(R+q)||"").replace(/^\s+/,"");w.children=[{type:"html_block",content:z,tag:S,loading:!1}],w.content=z,w.raw=z,O&&h.splice(b+1,0,O.startsWith("<")?{type:"html_block",content:O}:{type:"text",content:O,raw:O})}else w.children=[{type:"html_block",content:w.content,tag:S,loading:!0}];continue}if(!w||w.type!=="inline")continue;if(w.children.length===2&&w.children[0].type==="html_inline"){const S=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),_=w.children[1],x=String(_?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(_?.type==="html_inline"&&x===S)continue;m.has(S)?(w.children[0].loading=!0,w.children[0].tag=S,w.children.push({type:"html_inline",tag:S,loading:!0,content:``})):w.children=[{type:"html_block",loading:!0,tag:S,content:String(w.children[0]?.content??"")+String(w.children[1]?.content??"")}];continue}else if(w.children.length===3&&w.children[0].type==="html_inline"&&w.children[2].type==="html_inline"){const S=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(m.has(S))continue;w.children=[{type:"html_block",loading:!1,tag:S,content:w.children.map(_=>_.content).join("")}];continue}if(!w.content?.startsWith("<")||w.children?.length!==1)continue;const C=String(w.content),T=w,N=T.children[0];if(N?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(C)&&(T.children.length=0);continue}const I=String(N.content??C).match(jhe)?.[1]?.toLowerCase()??"";if(I){if(/\/\s*>\s*$/.test(C)||Xz.has(I)){T.children=[{type:"html_inline",content:C}];continue}T.children.length=0}}})}function epe(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function tpe(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const i=n.tokens??[];for(let o=0;oa.trim().length>0);if(l.length===1&&!epe(l[0]??"")){const a=l[0]??"",u=s.level??0;i.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:a,children:[{type:"text",content:a,level:u+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),o+=2}}})}const tj=/\.([a-z0-9]{1,15})$/i,npe=/[_()[\]{}<>]/u,ipe=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,ope=/[?#@]/u,spe=/[\\/]/u,rpe=/^[\p{L}\p{N}./\\-]+$/u,lpe=/^[A-Za-z0-9-]{1,63}$/u,ape=/^xn--[a-z0-9-]{2,59}$/i,upe=/^(?:[A-Z]{1,6}|\d{1,8})$/u,cpe=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,dpe=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,fpe=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,hpe=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,ppe=2e3,mpe=512,gpe={},vpe=new Set(["ai","md","py","rs","sh","zip"]),nj=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),ype=new Set([...nj,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),kpe=new Set(["com","dev","io","page","site"]),bpe=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),wpe=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),Xf=new Map;function tE(e,t){if(!e||e.length>mpe)return t;for(Xf.set(e,t);Xf.size>ppe;){const n=Xf.keys().next().value;if(!n)break;Xf.delete(n)}return t}function L0(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function G3(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return L0(n)?n:void 0}function nE(e,t){if(!L0(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function iE(e){const t=bv(e);return L0(t)?t:void 0}function Cpe(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function oE(e,t){if(!L0(t))return;const n=String(e??"").trim().split(/\s+/u).map(Cpe).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(o=>Y9(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(o=>Y9(o,{marketTicker:!0}))&&(i.marketTicker=!0),L0(i)?i:void 0}function of(e,t=!1){let n;return{options(i){return t||i==null?nE(e,n):nE(e,G3(iE(i),oE(i,n)))},remember(i){const o=iE(i);n=t?G3(n,o):G3(o,oE(i,n))},reset(){n=void 0}}}function sE(e){return lpe.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function Ape(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return sE(n)||ape.test(n)?t.every(sE):!1}function ij(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function xpe(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function Spe(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function oj(e,t,n){const i=xpe(t);return ij(e)&&Spe(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function _pe(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function bv(e){const t=String(e??""),n=Xf.get(t);return n?(Xf.delete(t),Xf.set(t,n),n):_pe(t)?tE(t,{explicitFilename:dpe.test(t),filename:fpe.test(t),marketTicker:hpe.test(t)}):tE(t,gpe)}function Mpe(e){return Ape(e.split(/[\\/]/)[0]??"")}function Ipe(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function Tpe(e){if(npe.test(e)||!rpe.test(e))return!0;if(spe.test(e))return!Mpe(e);const t=e.replace(tj,"");return ij(t)?!0:t.split(".").filter(Boolean).some(Ipe)}function Epe(e,t,n){if(!(n?ype:nj).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?cpe:upe).test(i)}function Y9(e,t={}){if(!e||ipe.test(e)||ope.test(e))return!1;const n=e.match(tj);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return Epe(e,i,t.marketTicker===!0)?!0:wpe.has(i)?!vpe.has(i)||t.filename?!0:Tpe(e):!!(t.explicitFilename&&kpe.has(i)||t.filename&&bpe.has(i))}const sj=new WeakMap,rj=new WeakSet;function uC(e,t){return sj.set(e,t),e}function Lpe(e){return sj.get(e)}function Npe(e){rj.add(e)}function Dpe(e){return e===void 0||rj.has(e)}const rE=["!"];function lE(e){return e==="linkify"||e==="autolink"?e:"recovery"}function el(e){return{type:"text",content:e,raw:e}}function If(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function Tf(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Wc(e,t,n,i="recovery"){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return uC({type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function Fpe(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(el(t))}}function aE(e,t){let n=-1;for(const i of t){const o=e.indexOf(i);o!==-1&&(n===-1||on?.[0]==="href")?.[1];return typeof t=="string"?t:""}function Rpe(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(i=>i?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function uE(e,t,n){let i="";for(let o=t+1;o{const n=t.tokens??[];for(let i=0;ir.type==="code_inline"),i=new Map;let o=0;for(let r=0;r0&&u?cE(u):-1;if(c!==-1&&u)for(const d of u.slice(c))d==="("?o++:d===")"&&o>0&&o--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?o++:a===")"&&o>0&&o--}const s=bv(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let u=r+1;u0){const m=cE(u);m!==-1&&(d===-1||m=g.content.length){h-=g.content.length;continue}if(h<0)break;const v=g.content[h],y=g.content.slice(0,h);let b=g.content.slice(h);for(let T=m+1;T0&&(e.splice(m+1,w),a=m+1);let C=c;if(v==="!"&&f!==-1)C=c.slice(0,f);else if(b){const T=encodeURI(b);if(T&&c.endsWith(T))C=c.slice(0,c.length-T.length);else{const N=v?encodeURI(v):"",I=N?c.indexOf(N):-1;I!==-1&&(C=c.slice(0,I))}}C!==c&&Rpe(l,C),b&&e.splice(a+1,0,el(b));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let u=r+1;ud[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(c+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(Wc(u,c,f,"linkify"));const h=e[r+3].content?.replace(/^\)\**/,"");h&&a.push(el(h)),e.splice(r-4,8,...a)}else a.push(uC({type:"link",loading:!0,href:c,title:"",text:u,children:[{type:"text",content:c,raw:c}],raw:`[${u}](${c})`},"linkify")),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,u]=e[r-3].content?.split("[**")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,u]=e[r-3].content?.split("[*")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,u]=e[r-3].content?.split("[")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",u=e[r-2].attrs||[],c=u.find(y=>y[0]==="href")?.[1]||"",d=u.find(y=>y[0]==="title")?.[1]||"";let f=3,h=2;const m=(e[r-3]?.content||"").match(/^(\*+)$/),g=[];if(m){h+=1;const y=m[1].length;If(g,y)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let y=r+1;yv[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(g||f)+e[r+5].content,e[r+5].content=""):f=g||f,h+=3}let m=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const g=(e[r+2]?.content??"").indexOf(")");m=g===-1,g===-1&&(f+=e[r+2]?.content?.slice(0,g)||"",e[r+2].content="")}a.push(Wc(d,f,m)),Tf(a,2),e.splice(r-2,h,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const u=(a[2]||"")+a[1];let c=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!c&&e[r+4]?.type==="text"&&(c=e[r+4].content||"");const d=[];If(d,2),d.push(Wc(u,c,!1)),Tf(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let i=0;i{const n=t.tokens??[];for(let i=0;i=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v{const n=t;try{const i=Ype(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function dE(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function fE(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function hE(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function lj(e,t){if(!e.startsWith("|")||e.includes(` -`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(i=>i.trim().length>0)?n:null}function Q3(e){return lj(e)!==null}function aj(e){return/^:?-+:?$/.test(e.trim())}function Vpe(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(aj)}function Kpe(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function Zpe(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(aj)&&Kpe(n)}function Gpe(e){return e==="|"||e==="|:"}function Qpe(e){const t=lj(e);return t!==null&&t.every(n=>!n.includes(":"))}function Ype(e,t=!1,n=""){const i=[...e];if(e.length<3)return i;const o=e.length-2,s=e[o];if(s.type==="inline"){const r=String(s.content??""),l=r.split(` -`)[0]??"",[a="",u="",...c]=r.split(` -`),d=!t&&!r.includes(` -`)&&/\r?\n$/.test(n)&&Q3(r);if(!t&&(r.includes(` -`)&&c.length===0&&Q3(a)&&Zpe(u)||d)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>hE(m)),h=[...dE(),...f,...fE()];i.splice(o-1,3,...h)}else if(r.includes(` -`)&&c.length===0&&Q3(a)&&Vpe(u)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>hE(m)),h=[...dE(),...f,...fE()];i.splice(o-1,3,...h)}else r.includes(` -`)&&c.length===0&&Qpe(a)&&Gpe(u)&&(s.content=r.slice(0,-2),s.children.splice(2,1))}return i}function Jpe(e,t,n,i){const o=e.length;if(n==="$$"&&i==="$$"){let u=t;for(;u=0&&e[c]==="\\";)d++,c--;if(d%2===0)return u}u++}return-1}const s=n[n.length-1],r=i;let l=0,a=t;for(;a=0&&e[c]==="\\";)d++,c--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const u=e[a];if(u==="\\"){a+=2;continue}u===s?l++:u===r[r.length-1]&&l>0&&l--,a++}return-1}var Xpe=Jpe;const e1e=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],J9=e1e.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),t1e=/\\[a-z]+/i,uj="(?:\\\\|\\u0008)",n1e=new RegExp(String.raw`${uj}(?:${J9})\s*\{[^}]+\}`,"i"),i1e=new RegExp(String.raw`(?:${uj})?(?:${J9})\s*\{`,"i"),o1e=/\\(?:text|frac|left|right|times)/,s1e=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,r1e=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,l1e=/[A-Z]+\s*\([^)]+\)/i,a1e=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,u1e=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,c1e=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,d1e={"\b":"\\b","\v":"\\v","\f":"\\f"};function f1e(e){let t="";for(const n of e)t+=d1e[n]??n;return t}function cd(e){if(!e)return!1;const t=f1e(e),n=t.trim();if(c1e.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=t1e.test(t),o=n1e.test(t),s=i1e.test(t),r=o1e.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=s1e.test(t)&&!r1e.test(t),u=l1e.test(t),c=a1e.test(n),d=u1e.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return i||o||s||r||l||a||u||c||d||f||h}const cj="__markstreamMathPluginApplied",cC=80,dj=2e4,pE=dj+4096;function o7(e){return!!e[cj]}function h1e(e){e[cj]=!0}const fj=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],p1e=["cdot","mathbf{","partial","mu_{"],hj=fj.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),pj="[ \r\b\f\v]",m1e=new RegExp(`([^\\\\])(${p1e.map(e=>e).join("|")})+`,"g"),g1e=/span\{([^}]+)\}/,v1e=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,y1e=/(^|[^\\])\\\r?\n/g,k1e=/(^|[^\\])\\$/g,b1e=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,w1e=new RegExp(`(${pj})|(${hj})\\b`,"g"),mE=new Map,gE=new Map;function C1e(e){if(!e)return w1e;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),i=mE.get(n);if(i)return i;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,s=new RegExp(`(${pj})|(${o})\\b`,"g");return mE.set(n,s),s}function A1e(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const i=e?"__default__":n.join(""),o=gE.get(i);if(o)return o;const s=e?[J9,hj].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),J9].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${s})\\s*\\{`,"g");return gE.set(i,r),r}const vE={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function yE(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function x1e(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&b1e.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function kE(e){const t=/(^|[^\\])(__|\*\*)/g;let n,i=null;for(;(n=t.exec(e))!==null;)i={marker:n[2],index:n.index+(n[1]?.length??0)};return i}function qc(e,t){const n=t?.commands??fj,i=t?.escapeExclamation??!0,o=t?.commands==null,s=C1e(o?void 0:n);let r=e.replace(s,(u,c,d,f,h)=>{if(c!==void 0&&vE[c]!==void 0)return`\\${vE[c]}`;if(d&&n.includes(d)){const m=h&&typeof f=="number"?h[f-1]:void 0;return m==="\\"||m&&/\w/.test(m)?u:`\\${d}`}return u});i&&(r=x1e(r));let l=r;const a=A1e(o,o?void 0:n);return l=l.replace(a,(u,c,d)=>`${c}\\${d}{`),l=l.replace(g1e,"span\\{$1\\}").replace(v1e,"\\operatorname{span}\\{$1\\}"),l=l.replace(y1e,`$1\\\\ -`),l=l.replace(k1e,"$1\\\\"),l=l.replace(m1e,"$1\\$2"),l}function bE(e){const t=e.trim();return!(!cd(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function mj(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[s]==="\\"&&s+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)i++,n--;return i%2===1}function dC(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=l)break;const u=X9(o,a);if(u){r=Math.max(a+Math.max(1,t.length),u[1]);continue}wv(e,a)||s++,r=a+Math.max(1,t.length)}return s}function s7(e,t,n){const i=D0(String(e??""));if(!i.endsWith(t))return-1;const o=i.length-t.length;if(o<=0||!D0(i.slice(0,o)).trim()||wv(i,o))return-1;const s=mj(i);if(X9(s,o))return-1;const r=wE(i,t,0,o,s);if(t==="$$"){if(r%2===1)return-1}else if(r>wE(i,n,0,o,s))return-1;return o}function N0(e){return e===" "||e===" "}function D0(e){let t=e.length;for(;t>0&&N0(e[t-1]);)t--;return e.slice(0,t)}function CE(e){let t=0;for(let n=0;n=48&&t<=57}function _1e(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let i=0;i=3}function M1e(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let i=0;for(;t[n]==="-";)i++,n++;return i<3?!1:(t[n]===":"&&n++,n===t.length)}function I1e(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(M1e)}function T1e(e){let t=0;if(!AE(e[t]))return!1;for(;AE(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:N0(e[t+1])}function gj(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&N0(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&N0(t[1])||T1e(t)||_1e(t)||I1e(t))}function xE(e,t){return e?t?`${e} -${t}`:e:t}function fC(e){const t=String(e??"").trim();return t?cd(t):!1}function SE(e){let t=0;for(let n=0;ncC){h=!0;break}const g=o[m],v=Ip(g,c);if(v!==-1){const y=xE(f,g.slice(0,v));if(!fC(y)){h=!0;break}const b=g.slice(v+c.length),w=b.trim()?`suffix:${SE(b)}`:"nosuffix";return["closed",u,i+l,d,i+m,v,SE(y),w].join(":")}if(gj(g)){h=!0;break}if(f=xE(f,g),f.length>dj){h=!0;break}}if(!h&&fC(f))return["pending",u,i+l,d].join(":")}}return null}function J3(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function L1e(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const i=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(i)?!1:i===""||/^[)\s,.!?;:]/.test(i)}function X3(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function N1e(e,t){h1e(e);const n=(r,l,a)=>{const u=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=r.push("paragraph_open","p",1);c.map=[a,a+1];const d=r.push("inline","",0);d.content=u,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},i=(r,l)=>{const a=r,u=!!t?.strictDelimiters,c=!a?.env?.__markstreamFinal,d=(b,w)=>{let C=w;for(;C=3&&(!C||/\s/.test(C))){const T=a.push("text","",0);return T.content=a.src.slice(a.pos,b),a.pos=b,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),m=Math.max(0,a.pos-h.length);let g=m,v=m;const y=m;for(const[b,w]of f){const C=a.src,T=mj(C),N=S1e(C,c);let I=!1;b==="$$"&&g!==y&&(g=y);let S=-1,_=-1,x=0;const E=M=>{if((M==="undefined"||M==null)&&(M=""),M==="\\"){a.pos=a.pos+M.length,g=a.pos;return}if(M==="\\)"||M==="\\("){const z=a.push("text_special","",0);z.content=M==="\\)"?")":"(",z.markup=M,a.pos=a.pos+M.length,g=a.pos;return}if(!M)return;if(b==="$$"&&M.includes("$")){let z=0;for(;z0&&M[O-1]==="$"||O+10){const B=M.slice(0,R),P=a.push("text","",0);P.content=B,a.pos=a.pos+B.length,g=a.pos}const z=M.slice(R).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(z){const[,B,P]=z,H=P.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),j=H?H[1]:P,Z=H&&H[2]?H[2]:null,ie=a.push("image","img",0);ie.attrs=[["src",j],["alt",B]],Z&&ie.attrs.push(["title",Z]),ie.content=B,ie.children=[{type:"text",content:B,tag:""}],a.pos=a.pos+z[0].length,g=a.pos;const W=M.slice(R+z[0].length);W&&E(W);return}const O=a.push("text","",0);O.content=M,a.pos=a.pos+M.length,g=a.pos;return}const q=a.push("text","",0);q.content=M,a.pos=a.pos+M.length,g=a.pos};for(;!(g>=C.length);){const M=C.indexOf(b,g);if(M===-1)break;if(wv(C,M)){g=M+Math.max(1,b.length);continue}const R=X9(T,M);if(R){g=R[1];continue}const q=X9(N,M);if(q){g=q[1];continue}if(M===S&&g===_){if(x++,x>2){g=M+Math.max(1,b.length);continue}}else x=0,S=M,_=g;if(b==="("&&M>0){let W=M-1;for(;W>=0&&C[W]===" ";)W--;if(W>=0&&C[W]==="]"){g=M+b.length;continue}}if(b==="$"&&M>0&&C[M-1]==="$"){g=M+1;continue}if(b==="$"&&M=C.length);){const R=dC(C,M);if(R===-1)break;if(R+10&&C[R-1]==="$"){M=R+1;continue}const q=Y3(C,R+1);if(q===-1)break;const z=C.slice(R+1,q),O=z.includes("`"),B=!z||!z.trim(),P=C[q+1],H=J3(z,P),j=X3(z);if(!O&&!B&&!H&&!j){const Z=C.slice(g,R);Z&&E(Z);const ie=a.push("math_inline","math",0);ie.content=qc(z,t),ie.markup="$",ie.raw=`$${z}$`,ie.loading=!1,g=q+1,M=q+1}else E("$"),M=R+1}M{const c=r,d=!c?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[l]+c.tShift[l];let g=c.src.slice(m,c.eMarks[l]).trim(),v=!1,y="",b="",w=!1,C="",T=!1;for(const[Z,ie]of h)if(g.startsWith(Z))if(Z.includes("[")){const W=Z==="\\["?g.slice(Z.length):"";if(Z==="\\["&&Ip(W,ie)===-1&&!/^\s*!\[/.test(W)&&!W.includes("`")&&cd(W)){v=!0,y=Z,b=ie;break}if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1=0?"\\]":b,x=S>=0?S:Ip(g,b,I);if(!w&&x>y.length){const Z=g.slice(N+y.length,x),ie=c.push("math_block","math",0);ie.content=qc(Z),ie.markup=y==="$$"?"$$":y==="["?"[]":"\\[\\]",ie.map=[l,l+1],ie.raw=`${y}${Z}${_}`,ie.block=!0,ie.loading=!1,c.line=l+1;const W=g.slice(x+_.length);return W.trim()&&n(c,W,l),!0}let E=l,M="",R=!1,q="",z=l;const O=w?g:g===y?"":g.slice(y.length),B=!f&&y==="\\["?"]":"",P=Ip(O,b);if(P!==-1){const Z=P;M=O.slice(0,Z),q=O.slice(Z+b.length),z=w?l+1:l,R=!0,E=z}else for(O&&!w&&(M=O),E=l+1;E{const c=r,d=c.bMarks[l]+c.tShift[l],f=c.src.slice(d,c.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,l,a,u)};e.inline.ruler.before("escape","math",i),e.block.ruler.before("lheading","explicit_math_block",s,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function D1e(e){const t=e.renderer.rules.image||function(n,i,o,s,r){const l=n,a=r;return a.renderToken?a.renderToken(l,i,o):""};e.renderer.rules.image=(n,i,o,s,r)=>{const l=n;return l[i].attrSet?.("loading","lazy"),t(l,i,o,s,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,i)=>{const o=n[i],s=String(o.info??"").trim();return`
        ${e.utils.escapeHtml(String(o.content??""))}
        `})}const F1e=/^\s]/i,B1e=/^<\/a\s*>/i;function R1e(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let i=0;for(let o=n.length-1;o>=0;o--){const s=n[o];if(s?.type==="link_close"){for(o--;o>=0&&n[o]?.level!==s.level&&n[o]?.type!=="link_open";)o--;continue}if(s?.type==="html_inline"){const r=String(s.content??"");F1e.test(r)&&i>0&&i--,B1e.test(r)&&i++}if(!(i>0)&&s?.type==="text"&&t.test(String(s.content??"")))return!0}return!1}function $1e(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(i=>i.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",i=>{if(!i.md?.options?.linkify)return;const o=Array.isArray(i.tokens)?i.tokens:[],s=i.md.linkify;if(!s)return;const r=o.filter(l=>R1e(l,s));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function O1e(e){const t=e.inline.ruler,n=t.getNamedRules?.(),i=n?.find(l=>l.name==="link")?.fn,o=n?.find(l=>l.name==="image")?.fn;if(typeof i!="function"||typeof o!="function")return;const s=e.validateLink,r=e;r.__markstreamOriginalValidateLink=s,t.at("link",(...l)=>{const a=l[0].md,u=a?.validateLink===s?a.options?.validateLink:a?.validateLink;if(!a||typeof u!="function")return i(...l);const c=a.validateLink;a.validateLink=u;try{return i(...l)}finally{a.validateLink=c}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return o(...l);const u=a.validateLink;a.validateLink=s;try{return o(...l)}finally{a.validateLink=u}})}function P1e(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},i=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),s=new fhe({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!o){const r=l=>!hh(l,{tagName:"a",attrName:"href"});Npe(r),s.set({validateLink:r})}return O1e(s),$1e(s),(e.enableMath??!0)&&N1e(s,{...e.mathOptions??{}}),(e.enableContainers??!0)&&Nhe(s),e.enableFixIndentedCodeBlock!==!1&&tpe(s),$pe(s),jpe(s),Ppe(s),Upe(s),D1e(s),Xhe(s,{customHtmlTags:e.customHtmlTags}),s}function ph(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>ph(n))),t}function z1e(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function j1e(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,i=n===""||n==="true";return{type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}}function H1e(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function D2(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;sn.startsWith(t)||t.startsWith(n)):!1}function _E(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function ME(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function V1e(e,t){const n=[],i=[],o=[],s=[],r=e.split(q1e),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),u=h=>{const m=h;if(!kj.some(g=>m.startsWith(g)))if(m.startsWith("-")){const g=m.slice(1);o.push(ME(g,a))}else if(m.startsWith("+")){const g=m.slice(1);s.push(ME(g,a))}else{_E(n,i,o,s);const g=a&&m.startsWith(" ")?m.slice(1):m;n.push(g),i.push(g)}},c=l?Math.max(0,r.length-1):r.length;for(let h=0;h0||s.length>0)&&_E(n,i,o,s);const d=n.join(` -`),f=i.join(` -`);return{original:t&&l&&d?`${d} -`:d,updated:t&&l&&f?`${f} -`:f}}function r7(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},i=typeof n.closed=="boolean"?n.closed:void 0,o=i===!0||i!==!1&&t,s=String(e.info??""),r=s.startsWith("diff"),l=r?(()=>{const u=s,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():s;let a=String(e.content??"");if(!o&&e.markup){const u=e.markup[0],c=e.markup.length,d=W1e(u,c);d.test(a)&&(a=a.replace(d,""))}if(r){const{original:u,updated:c}=V1e(a,o===!0);return{type:"code_block",language:l,code:String(c??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t}}function K1e(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function Z1e(){return{type:"hardbreak",raw:`\\ -`}}function G1e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s\s*$/.test(t)||Od.has(e)}function Q1e(e){if(!e||e.length===0)return IE();const t=t8.get(e);if(t)return t;const n=e.map(va).filter(Boolean);if(!n.length){const o=IE();return t8.set(e,o),o}const i={customTagSet:new Set(n),allowedTagSet:Rk({customHtmlTags:e})};return t8.set(e,i),i}function Aj(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function Y1e(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function e4(e,t){const n=t.toLowerCase();for(let i=e.length-1;i>=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function J1e(e,t,n){const i=e.slice();return e4(i,"href")||i.push(["href",t]),n!=null&&!e4(i,"title")&&i.push(["title",n]),i}function hC(e){return e.map(Aj).join("")}function By(e){const t=[],n=i=>{const o=String(i??"");if(!o)return;const s=t[t.length-1];if(s?.type==="text"){s.content=`${s.content}${o}`,s.raw=`${s.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const i of e)if(i){if(i.type==="reference"||i.type==="footnote_reference"){n(String(i.raw??""));continue}if("children"in i&&Array.isArray(i.children)){t.push({...i,children:By(i.children)});continue}t.push(i)}return t}function X1e(e,t,n){let i=0;for(let o=t;o`;g.toLowerCase().includes(T.toLowerCase())||(g+=T),y=!0,v=!0}const b=[],w=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let C;for(;(C=w.exec(l))!==null;){const T=C[1],N=C[2]||C[3]||C[4]||"";b.push([T,N])}if(u?.has(a)){const T=Y1e(e);return[{type:a,tag:a,attrs:b,content:T?T.inner:h.innerTokens.length?hC(h.innerTokens):"",children:h.innerTokens.length?i(h.innerTokens,o,s,r):[],raw:T?.raw??g,loading:e.loading||v,autoClosed:y},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:b,content:g,children:m,raw:g,loading:v,autoClosed:y},h.nextIndex]}function xj(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>xj(t)).join(""):String(e.content??"")}function tme(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>xj(t)).join("")}function TE(e,t=!1){let n=e.attrs??[],i=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,i=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),s=n.find(d=>d[0]==="alt")?.[1],r=tme(i??e);let l="";r?l=r:s!=null&&String(s).length>0?l=String(s):i?.content!=null&&String(i.content).length>0?l=String(i.content):Array.isArray(i?.children)&&i.children[0]?.content?l=String(i.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,u=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:o,alt:l,title:u,raw:c,loading:t}}function nme(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function ime(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function sme(e,t,n){const i=e.slice();return t4(i,"href")||i.push(["href",t]),n!=null&&!t4(i,"title")&&i.push(["title",n]),i}function F2(e,t,n){const i=e[t],o=ome(i.attrs),s=String(t4(o,"href")??""),r=t4(o,"title"),l=r==null?null:String(r),a=sme(o,s,l);let u=t+1;const c=[];let d=!0;for(;uv.type==="strong_open")){const v=String(h.content??""),y=String(h.raw??v),b=ph(h);b.content=v.slice(0,-2),b.raw=y.replace(/\*\*$/,""),f=c.slice(),f[f.length-1]=b}const m=Lo(f,void 0,void 0,n),g=m.map(v=>{const y=v;return"content"in v?String(y.content??""):String(y.raw??"")}).join("");return{node:{type:"link",href:s,title:l,text:g,children:m,raw:`[${g}](${s}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:u0?i:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:s0?i:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:s?@[\\\]^_`{|}~]/,yme=/\p{P}/u,kme=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,bme=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,wme=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,Cme=/:\/\//,pC=1,Sj=2,Ame=4,xme=8,_j=16,Qc=32,Ry=64,lg=128,Mj=256,Sme=512,ag=1024,_me=1982;function B2(e){let t=0;for(let n=0;n=t){n++,i++;continue}n++,i++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function Pd(e){return!!e&&gme.test(e)}function zd(e){return!!e&&(vme.test(e)||yme.test(e))}function Tj(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&kme.test(e)}function Ej(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&bme.test(e)}function Ime(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||Pd(i)?!1:!(zd(i)&&!Tj(i,n)&&n&&!Pd(n)&&!zd(n))}function Tme(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||Pd(n)?!1:!(zd(n)&&!Ej(n,i)&&i&&!Pd(i)&&!zd(i))}function Eme(e,t,n=0){let i=n,o=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||Pd(i)?!1:!(zd(i)&&!Tj(i,n)&&n&&!Pd(n)&&!zd(n))}function Nme(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||Pd(n)?!1:!(zd(n)&&!Ej(n,i)&&i&&!Pd(i)&&!zd(i))}function Dme(e,t=0){let n=t,i=!1;for(;n=0&&e[s]==="\\";s--)o++;return o%2===1}const $me=/[\p{L}\p{N}]/u,Ome=/^[\p{L}\p{N}]+$/u;function mC(e){return e?$me.test(e):!1}function Lj(e){return e?Ome.test(e):!1}function zg(e,t){let n=t;for(;n0?e[t-1]:void 0,o=n=2&&i.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n=3)return i;n=i+o.len}return-1}function Hme(e){return e?wme.test(e)||Cme.test(e):!1}function Wme(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Lo(e,t,n,i){if(!e||e.length===0)return[];const o=i?.__linkifyDemotionContext,s=bv(t),r={filename:o?.filename||s.filename,explicitFilename:o?.explicitFilename||s.explicitFilename,marketTicker:o?.marketTicker||s.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(i={...i,__linkifyDemotionContext:r});const l=i,a=[];let u=null,c=0;const d=i?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function m(){u=null}function g(G,ae){const K=e.length===1?t:String(ae.content??""),re=[],be=Pme(G);if(be!==-1){T(G.slice(0,be),G.slice(0,be));const we=G.slice(be);return we&&(E({type:"text",content:we,raw:we}),c--),c++,!0}if(fme.test(G)){const we=G.indexOf("~~");we!==-1&&re.push({type:"strikethrough",index:we})}if(hme.test(G)){const we=G.indexOf("**");we!==-1&&re.push({type:"strong",index:we})}if(/[^*]*\*[^*]+/.test(G)){const we=K?Ij(K,0):G.indexOf("*");if(K&&we===-1)return!1;we!==-1&&re.push({type:"emphasis",index:we})}re.sort((we,oe)=>we.index!==oe.index?we.index-oe.index:we.type===oe.type?0:we.type==="strong"?-1:oe.type==="strong"?1:0);const ke=re[0];if(!ke)return!1;if(ke.type==="strikethrough"){const we=ke.index,oe=we>-1?G.slice(0,we):"";if(oe&&T(oe,oe),we===-1)return c++,!0;const le=G.indexOf("~~",we+2),ye=le===-1?G.slice(we+2):G.slice(we+2,le),Ae=le===-1?"":G.slice(le+2),{node:_e}=LE([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ye,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return m(),C(_e),Ae&&(E({type:"text",content:Ae,raw:Ae}),c--),c++,!0}if(ke.type==="strong"){const we=ke.index,oe=we>-1?G.slice(0,we):"";if(oe&&T(oe,oe),we===-1)return c++,!0;if(t&&we===0){let ne=!1,Ee=0;for(;Ee=2)return T(G,G),c++,!0}}if(t&&(G.match(/\*/g)||[]).length>Mme(t))return T(G.slice(oe.length),G.slice(oe.length)),c++,!0;const le=zg(G,we);if(le.len>=3){const ne=jme(G,we+le.len);if(ne!==-1){const Ee=G.slice(we+le.len,ne);if(zme(Ee)){const{node:qe}=Om([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ee,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);m(),C(qe);const ze=G.slice(ne+3);return ze&&(E({type:"text",content:ze,raw:ze}),c--),c++,!0}}}if(!Lme(G,we)){const ne=G.slice(we,we+le.len);T(ne,ne);const Ee=G.slice(we+le.len);return Ee&&(E({type:"text",content:Ee,raw:Ee}),c--),c++,!0}const ye=Dme(G,we+2);let Ae="",_e="";if(ye.index!==-1){Ae=G.slice(we+2,ye.index),_e=G.slice(ye.index+2);const ne=ye.index,Ee=zg(G,ne);if(le.intraword&&Ee.intraword&&!Lj(Ae)||!Ae&&le.len>=4&&le.intraword)return T(G.slice(oe.length),G.slice(oe.length)),c++,!0}else{if(d||ye.sawInvalidClose||le.intraword)return T(G.slice(oe.length),G.slice(oe.length)),c++,!0;Ae=G.slice(we+2),_e=""}if(!Ae&&/^\*+$/.test(_e))return T(G,G),c++,!0;const{node:pe}=Om([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:Ae,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);return m(),C(pe),_e&&(E({type:"text",content:_e,raw:_e}),c--),c++,!0}if(ke.type==="emphasis"){let we=ke.index;we===-1&&(we=0);const oe=G.slice(0,we);if(oe&&T(oe,oe),!Ime(G,we)){T(G[we],G[we]);const ne=G.slice(we+1);return ne&&(E({type:"text",content:ne,raw:ne}),c--),c++,!0}const le=zg(G,we),ye=Eme(K,G,we+1),Ae=ye.index,_e=e[c+1];if(i?.final&&_e?.type==="em_open"&&Ae!==-1&&G.slice(we+1,Ae).trim()!==G.slice(we+1,Ae)||Ae===-1&&(ye.sawInvalidClose||i?.final||le.intraword||!mC(G[we+1])))return T(G.slice(we),G.slice(we)),c++,!0;const{node:pe}=D2([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ae>-1?G.slice(we+1,Ae):G.slice(we+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(m(),C(pe),Ae!==-1&&Ae{for(let pe=0;pe<_e.length;pe++){if(_e[pe]!=="`")continue;let ne=0;for(let Ee=pe-1;Ee>=0&&_e[Ee]==="\\";Ee--)ne++;if(ne%2===0)return pe}return-1})(G);if(re===-1)return!1;let be=1;for(let _e=re+1;_eke?.type==="math_inline")||!pme.test(G))return null;const K=ae.parseInline(G,{__markstreamFinal:!!i?.final});if(!Array.isArray(K)||K.length===0)return null;const re=(K.find(ke=>ke?.type==="inline")?.children??[]).filter(ke=>!(ke?.type==="text"&&String(ke.content??"")===""));if(!re.length||!re.some(ke=>ke?.type!=="text")||re.length===1&&re[0]?.type==="text"&&String(re[0].content??"")===G)return null;const be=Lo(re,G,n,i);return be.length?be:null}function b(G){m(),a.push(G)}function w(G){m();const ae=ph(G);a.push(ae)}function C(G){b(G)}function T(G,ae){u?(u.content+=G,u.raw+=ae??G):(u={type:"text",content:String(G??""),raw:String(ae??G??"")},a.push(u))}function N(G,ae){if(!G)return;const K=Lo([{...ae,type:"text",content:G,raw:G}],G,n,i);if(K.length===1&&K[0]?.type==="text"){const re=K[0];T(String(re.content??""),String(re.raw??re.content??""));return}for(const re of K)C(re)}function I(G,ae){return String(G.markup??"").startsWith(ae)}function S(G){if(!u||G.loading!==!0||G.markup!=="\\(\\)")return;const ae=e[c-1];!ae||ae.type!=="text"||!I(ae,"\\(")||u.content.endsWith("(")&&(u.content=u.content.slice(0,-1),u.raw.endsWith("(")&&(u.raw=u.raw.slice(0,-1)),!u.content&&a[a.length-1]===u&&(a.pop(),u=null))}function _(G){return G.endsWith("](")?e[c+1]?.type==="link_open"&&e[c+1]?.markup==="linkify"&&e[c+2]?.type==="text"&&e[c+3]?.type==="link_close"&&e[c+4]?.type==="text"&&String(e[c+4]?.content??"").startsWith(")"):!1}function x(G,ae,K=B2(G)){let re=G;const be=String(ae.content??"");return(K&pC)!==0&&re.endsWith("\\")&&!I(ae,"\\\\")&&!be.endsWith("\\\\")&&(re=re.slice(0,-1)),(K&ag)!==0&&re.endsWith("(")&&!I(ae,"\\(")&&!be.endsWith("\\(")&&(re=re.slice(0,-1)),(K&Sj)!==0&&/\*+$/.test(re)&&!I(ae,"\\*")&&!be.endsWith("\\*")&&(re=re.replace(/\*+$/,"")),re}for(;c=0;ne--){const Ee=a[ne];if(Ee.type!=="text")break;le=ne,ye=String(Ee.content??"")+ye}lele==="href")?.[1],oe=String(we??"");if(t&&oe){const le=t.indexOf("](");if(le!==-1){const ye=t.indexOf(")",le+2);ye===-1?K.loading=!0:K.loading&&t.slice(le+2,ye).includes(oe)&&(K.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(K.href)&&j(K,ae-1)||B(K)||b(K)}function z(G){if(G.markup!=="linkify")return!1;const{node:ae,nextIndex:K}=F2(e,c,i);return H(ae,K)?(c=K,!0):!1}function O(G){m(),C(rme(G)),c++}function B(G){if(G.type!=="link")return!1;const ae=a[a.length-1];if(!ae||ae.type!=="text")return!1;const K=String(ae.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!K)return!1;const re=G,be=String(re.href??""),ke=String(re.text??""),we=String(K[2]??""),oe=be.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!be||!(ke===be||ke===oe||Hme(ke)))return!1;const le=String(K[1]??"");return le?(ae.content=le,ae.raw=le):a.pop(),b({...G,text:we,children:[{type:"text",content:we,raw:we}],raw:`[${we}](${be}${re.title?` "${re.title}"`:""})`}),!0}function P(G){if(G.type!=="link")return!1;const ae=G,K=String(ae.href??"");return K?H({href:K,title:ae.title==null||ae.title===""?null:String(ae.title),loading:!!ae.loading},c+1):!1}function H(G,ae){const K=a[a.length-1];if(K?.type!=="image"||K.src||!K.loading||!String(K.raw??"").endsWith("]("))return!1;const re=e[ae],be=String(re?.content??"");if(re?.type!=="text"||!be.startsWith(")"))return!1;a.pop(),u=null;const ke=String(K.alt??"");b({type:"image",src:G.href,alt:ke,title:G.title,raw:`![${ke}](${G.href}${G.title?` "${G.title}"`:""})`,loading:!!G.loading});const we=be.slice(1),oe=ph(re);return oe.content=we,oe.raw=we,h()[ae]=oe,!0}function j(G,ae=c-1){if(G.type!=="link")return!1;const K=a[a.length-1],re=e[ae];if(!K||K.type!=="text"||re?.type!=="text")return!1;const be=String(K.content??""),ke=String(re.content??"");if(!be.endsWith("!")||!ke.endsWith("!")||I(re,"\\!"))return!1;const we=be.slice(0,-1);we?(K.content=we,K.raw=we,u=K):(a.pop(),u=null);const oe=G,le=String(oe.text??oe.children?.map(_e=>String(_e?.content??_e?.raw??"")).join("")??""),ye=String(oe.href??""),Ae=oe.title==null||oe.title===""?null:String(oe.title);return b({type:"image",src:ye,alt:le,title:Ae,raw:`![${le}](${ye}${Ae?` "${Ae}"`:""})`,loading:!!oe.loading}),!0}function Z(G,ae="",K=null){const re=String(G.alt??G.raw??"");return{type:"link",href:ae,title:K,text:re,children:[G],raw:`[${re}](${ae}${K?` "${K}"`:""})`,loading:!0}}function ie(G){const ae=G.startsWith("![")?G:`![${G}`,K=ae.slice(2),re=K.indexOf("](");return{type:"image",src:"",alt:re===-1?K.replace(/\]$/,""):K.slice(0,re),title:null,raw:ae,loading:!0}}function W(G){const ae=G.indexOf("[![");if(ae===-1||typeof t=="string"&&e.length===1&&Rme(t,ae,"["))return!1;const K=G.slice(0,ae);return K&&T(K,K),b(Z(ie(G.slice(ae+1)))),c++,!0}function Q(G){if(i?.final)return!1;const ae=e[c-1];if(ae?.type!=="text"||!String(ae.content??"").endsWith("[")||I(ae,"\\["))return!1;const K=a[a.length-1];if(K?.type==="text"&&K.content.endsWith("[")){const re=K.content.slice(0,-1);re?(K.content=re,K.raw=re,u=K):(a.pop(),u=null)}return b(Z(TE(G))),c++,!0}function te(G){if(G.type!=="link")return!1;const ae=G,K=String(ae.raw??""),re=String(ae.text??"");if(!K.startsWith("[![")&&!re.startsWith("!["))return!1;const be=ae.title==null||ae.title===""?null:String(ae.title);return b(Z({type:"image",src:String(ae.href??""),alt:re.replace(/^!\[/,"").replace(/\]$/,""),title:be,raw:K.startsWith("[![")?K.slice(1):K,loading:!0})),!0}function X(G){if(!G.startsWith("]("))return!1;const ae=e[c-2];if(ae?.type==="text"&&String(ae.content??"").endsWith("[")&&I(ae,"\\["))return!1;const K=a[a.length-1];if(K?.type!=="image"&&K?.type!=="link")return!1;const re=K,be=K?.type==="link"&&Array.isArray(re.children)&&re.children.length===1&&re.children[0]?.type==="image"?a.pop():null,ke=be?be.children[0]:a.pop();if(!ke||ke.type!=="image")return!1;const we=e[c+1];let oe=String(be?.href??""),le=be?.title==null?null:String(be.title),ye=!0;if(we?.type==="link_open"){const{node:_e,nextIndex:pe}=F2(e,c+1,i);oe=_e.href,le=_e.title,ye=!0,c=pe}else{if(oe=G.slice(2),oe.includes('"')){const _e=oe.split('"');oe=String(_e[0]??"").trim(),le=_e[1]==null?null:String(_e[1]).trim()}c++}const Ae=Z(ke,oe,le);return Ae.loading=ye,b(Ae),!0}function ge(){const G=e[c-3];return e[c-2]?.type==="image"&&e[c-1]?.type==="text"&&String(e[c-1].content??"")==="]("&&G?.type==="text"&&String(G.content??"").endsWith("[")&&I(G,"\\[")}function ue(G,ae){const K=G.indexOf("[");if(K===-1)return!1;let re=G.slice(0,K);const be=G.indexOf("](",K);if(be!==-1){const ke=e[c+2];let we=G.slice(K+1,be);if(we.includes("[")){const ne=we.indexOf("[");re+=G.slice(0,K+ne+1);const Ee=K+ne+1;we=G.slice(Ee+1,be)}const oe=e[c+1];if(G.endsWith("](")&&oe?.type==="link_open"&&ke){const ne=e[c+4];let Ee=4,qe=!0;if(ne?.type==="text"){const ft=String(ne.content??"");if(ft.startsWith(")")){qe=!1;const gt=ft.slice(1);if(gt){const _t=ph(ne);_t.content=gt,_t.raw=gt,h()[c+4]=_t}else Ee++}else ft==="."&&Ee++}N(re,ae);const ze=String(ke.content??"");return i?.validateLink&&!i.validateLink(ze)?T(we,we):b({type:"link",href:ze,title:null,text:we,children:[{type:"text",content:we,raw:we}],loading:qe}),c+=Ee,!0}const le=G.indexOf(")",be),ye=le!==-1?G.slice(be+2,le):"",Ae=le===-1;let _e=re.match(/\*+$/);if(_e&&(re=re.replace(/\*+$/,"")),N(re,ae),_e||(_e=we.match(/^\*+/)),!d&&_e){const ne=_e[0].length;we=we.replace(/^\*+/,"").replace(/\*+$/,"");const Ee=[];if(ne===1?Ee.push({type:"em_open",tag:"em",nesting:1}):ne===2?Ee.push({type:"strong_open",tag:"strong",nesting:1}):ne===3&&(Ee.push({type:"strong_open",tag:"strong",nesting:1}),Ee.push({type:"em_open",tag:"em",nesting:1})),Ee.push({type:"link",href:ye,title:null,text:we,children:[{type:"text",content:we,raw:we}],loading:Ae}),ne===1){Ee.push({type:"em_close",tag:"em",nesting:-1});const{node:qe}=D2(Ee,0,i);C(qe)}else if(ne===2){Ee.push({type:"strong_close",tag:"strong",nesting:-1});const{node:qe}=Om(Ee,0,void 0,i);C(qe)}else if(ne===3){Ee.push({type:"em_close",tag:"em",nesting:-1}),Ee.push({type:"strong_close",tag:"strong",nesting:-1});const{node:qe}=Om(Ee,0,void 0,i);C(qe)}else{const{node:qe}=D2(Ee,0,i);C(qe)}}else i?.validateLink&&!i.validateLink(ye)?T(we,we):b({type:"link",href:ye,title:null,text:we,children:[{type:"text",content:we,raw:we}],loading:Ae});const pe=le!==-1?G.slice(le+1):"";return pe&&(E({type:"text",content:pe,raw:pe}),c--),c++,!0}return!1}function se(G){const ae=G.indexOf("![");if(ae===-1)return!1;const K=G.slice(0,ae);return K&&!u?u={type:"text",content:K,raw:K}:K&&u&&(u.content+=K),u&&(a.push(u),u=null),b(ie(G.slice(ae))),c++,!0}function fe(G){if(!(G?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ae=G.slice(1).match(/[^\s\]]/);if(ae===null)return c++,!0;if(ae&&/x/i.test(ae[0])){const K=ae[0]==="x"||ae[0]==="X";return b({type:"checkbox_input",checked:K,raw:K?"[x]":"[ ]"}),c++,!0}return!1}return a}function a7(e,t,n){const i=n?.__sourceLineMapper;if(!i)return{startLine:e,endLine:t};const o=i(e),s=t>e?i(t-1).endLine:i(t).startLine;return{startLine:o.startLine,endLine:Math.max(o.startLine,s)}}function NE(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let i=0;for(let o=0;oi&&e[o-1]!==` -`&&r++,{startLine:s,endLine:r}}function F0(e,t,n,i){const o=qme(e,t,n);return a7(o.startLine,o.endLine,i)}function Ume(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const i=Number(n[0]),o=Number(n[1]);return!Number.isFinite(i)||!Number.isFinite(o)?null:a7(i,o,t)}function Mi(e,t,n){if(!n?.includeSourceMap)return e;const i=Ume(t,n);if(!i)return e;if(e.sourceMap=i,e.type==="code_block"){const o=e;o.startLine=i.startLine,o.endLine=i.endLine}return e}function Vme(e,t,n,i){if(!i?.includeSourceMap)return e;const o=t?.map;if(!Array.isArray(o)||o.length<2)return e;const s=Number(o[0]),r=Number(o[1]),l=Number(n);return!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=a7(s,Math.max(r,l),i)),e}function Kme(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??""),r=s.replace(/[ \t\r\n]+$/g,"");if(r===s)break;if(r){o.content=r;break}i.pop();continue}break}}function Zme(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(s)){i.pop();continue}const r=s.replace(/[ \t\r\n\d.)]+$/g,"");r!==s&&(r?o.content=r:i.pop())}break}}function Gme(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function G1(e,t,n){const i=e[t],o=[],s=of(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&Mi(c,e[r],n),o.push(c),r=u+1}else r+=1;const l={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const a=i.attrs.find(u=>u[0]==="start");if(a){const u=Number(a[1]);return Number.isFinite(u)&&u!==0?u:1}}})(),items:o,raw:o.map(a=>a.raw).join(` -`)};return n?.includeSourceMap&&Mi(l,i,n),[l,r+1]}function Qme(e,t,n,i){const o=String(n[1]??"note"),s=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=of(i,!0);let a=t+1;for(;au.raw).join(` -`)} -:::`},a+1]}const Yme=new Set(["warning","info","note","tip","danger","caution"]);function Jme(e){let t=0;for(;t=0;g--){const v=f[g];if(v.type==="text"&&/:+/.test(v.content)){h=g;break}}const m={type:"paragraph",children:Lo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&Mi(m,e[u],n),l.push(m),a.remember(m.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[d,f]=G1(e,u,a.options());n?.includeSourceMap&&Mi(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else if(e[u].type==="blockquote_open"){const[d,f]=Q1(e,u,a.options());n?.includeSourceMap&&Mi(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else{const d=Dk(e,u,a.options());d?(l.push(d[0]),a.remember(d[0].raw),u=d[1]):u++}return[{type:"admonition",kind:o,title:s,children:l,raw:`:::${o} ${s} -${l.map(d=>d.raw).join(` -`)} -:::`},u+1]}const ege=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function tge(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const o=ege.exec(String(i.info??""));return o?Qme(e,t,o,n):null}const u7={parseContainer:(e,t,n)=>Xme(e,t,n),matchAdmonition:tge};function Q1(e,t,n){const i=[],o=of(n,!0);let s=t+1;for(;sl.raw).join(` -`)};return n?.includeSourceMap&&Mi(r,e[t],n),[r,s+1]}function nge(e){if(e.info?.startsWith("diff"))return r7(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let i=t;n?.[1]&&(i=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:i,raw:i,loading:!o}}function ige(e,t,n){const i=[];let o=t+1,s=[],r=[];const l=of(n,!0);for(;ou.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a0&&(i.push({type:"definition_item",term:s,definition:r,raw:`${s.map(u=>u.raw).join("")}: ${r.map(u=>u.raw).join(` -`)}`}),s=[]),o=a+1}else o++;return[{type:"definition_list",items:i,raw:i.map(a=>a.raw).join(` -`)},o+1]}function oge(e,t,n){const i=e[t].meta??{},o=String(i?.label??"0"),s=[],r=of(n,!0);let l=t+1;for(;la.raw).join(` -`)}`},l+1]}function sge(e,t,n){const i=e[t],o=i.attrs,s=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(c=>Array.isArray(c)&&c.length>=1&&c[0]).map(([c,d])=>[String(c),d==null||d===""?!0:String(d)])):void 0,r=String(i.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],u=String(a.content??"");return{type:"heading",level:l,text:u,...s?{attrs:s}:{},children:Lo(a.children||[],u,void 0,n),raw:u}}function rge(e,t,n){const i=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${i}(?=\s|>|/)`,"i"),s=new RegExp(String.raw`^<\s*\/\s*${i}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l$/.test(d)||r++,l=a+c+1;continue}l=a+1}return-1}function Nj(e){const t=String(e.content??"");if(/^\s*");else if(a)a=!v.includes(">");else if(u)u=!v.includes("?>");else if(v.startsWith("");else if(v.startsWith("");else if(v.startsWith("");else{const y=o(v);if(y)if(y.closing){for(let b=r.length-1;b>=0;b--)if(r[b]===y.tag){r.length=b;break}}else y.selfClosing||s(y.after,y.tag)||r.push(y.tag)}}if(d===-1||d>=t)break;c=d+1}return l||a||u||r.length>0}function Uge(e,t,n){if(!n?.length)return!1;const i=new Set(qh(n));if(!i.size)return!1;const o=c=>{const d=c.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||c==="_"||c==="-"||c===":"},s=c=>c===" "||c===" ",r=c=>{if(c[0]!=="<")return null;let d=1;for(;d"&&g!=="/")return null;const v=c.indexOf(">",d);if(v===-1)return null;let y=v-1;for(;y>=0&&s(c[y]);)y--;return{closing:f,tag:m,selfClosing:!f&&c[y]==="/",after:c.slice(v+1)}},l=(c,d)=>{const f=c.toLowerCase();let h=0;for(;h")return!0}}return!1},a=[];let u=0;for(;u=t?t:c,f=e.slice(u,d),h=f.endsWith("\r")?f.slice(0,-1):f,m=Y1(h);if(m){const g=r(h.slice(m.index));if(g)if(g.closing){for(let v=a.length-1;v>=0;v--)if(a[v]===g.tag){a.length=v;break}}else g.selfClosing||l(g.after,g.tag)||a.push(g.tag)}if(c===-1||c>=t)break;u=c+1}return a.length>0}function Vge(e,t){const n=Cge.exec(e);if(!n)return null;const i=n[1]??"",o=n.index+i.length,s=e.indexOf(` -`,o),r=e.slice(o,s===-1?e.length:s);return!Y1(r.endsWith("\r")?r.slice(0,-1):r)||Hj(e,o)||qge(e,o)||Uge(e,o,t)?null:`${e.slice(0,n.index)}${i}`}function g7(e,t,n){let i=t;for(;ii&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,s+=2;continue}s++;continue}if(t.inDollarMath){if(e.startsWith("$$",s)&&!yu(e,l)){i!=null&&o&&n+s+2>i&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,s+=2;continue}s++;continue}if(e[s]==="`"&&!yu(e,l)){const a=g7(e,s,"`"),u=Wj(e,s+a,a);if(u===-1)break;s=u+a;continue}if(e.startsWith("\\[",s)&&!yu(e,l)){t.inMath=!0,t.mathOpenOffset=n+s,s+=2;continue}if(e.startsWith("$$",s)&&!yu(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+s,s+=2;continue}s++}return r}function Kge(e,t){if(!o7(t))return e;const n=t,i=$E.get(n),o=i?.source===e?i.state:i&&e.startsWith(i.source)?qj(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:Bk(e).state;$E.set(n,{source:e,state:o});const{context:s}=o,r=s.inMath?s.mathOpenOffset:s.inDollarMath?s.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(` -`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const u=l.trim(),c=/^(?:[a-z]|pi)$/i.test(u);return cd(l)&&!c?e:e.slice(0,r)}function Zge(e,t,n,i,o){const s=f7(e),r=h7(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&p7(e)==null&&l8(t),t.inFence&&t.fenceInList&&e.trim()&&s.column=t.fenceLen&&/^\s*$/.test(l.rest)&&l8(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&s.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return jE(e,t,n,i,o)}else return jE(e,t,n,i,o);return!1}function Bk(e,t=Pge(),n=null,i=!1,o=0){const s=Hg(t);let r=Hg(t),l="",a=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,h=e.slice(u,f);Zge(h,s,o+u,n,i)&&(a=!0),d?(r=Hg(s),l=""):l=h,u=d?c+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:s,lineBuffer:l}}}function qj(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:Hg(e.committedContext),context:Hg(e.context),lineBuffer:e.lineBuffer+t}}:Bk(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function Gge(e,t){if(!o7(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,o=Fk.get(i);if(o?.source===t)return;const s=o?t.startsWith(o.source):!1,r=s&&o?t.slice(o.source.length):"",l=s&&o?qj(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):Bk(t),a=l.state,u=s&&o?l.closedOpenMath:!1;if(o&&s&&o.key===null&&o.pendingCandidate===!1&&!u&&!Wge(o.source,r)&&!jge(t)){o.source=t,o.explicitBracketMath=a;return}const c=E1e(t);(o&&(o&&!s||o.key!==c||u)||!o&&c)&&n.reset(),zge(e,t,c,a)}function Qge(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function Uj(e,t){const n=e?.map,i=t?.map;return n===i?!0:!Array.isArray(n)||!Array.isArray(i)?!1:n.length===i.length&&n.every((o,s)=>o===i[s])}function Yge(e,t){const n=e?.attrs,i=t?.attrs;if(n===i)return!0;if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length)return!1;for(let o=0;o":""}function UE(e){return{type:"paragraph",children:e,raw:e.map(t0e).join("")}}function VE(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function KE(e,t){if(e.type!=="paragraph")return null;const n=e.children,i=Array.isArray(n)?n:[];if(i.length===0)return null;const o=Fge(t);if(!o?.size)return null;let s=-1;for(let c=0;ch?.type==="hardbreak")){s=c;break}}if(s===-1)return null;const r=i.slice(0,s),l=i[s];if(!l)return null;const a=[];r.length&&a.push(UE(r)),a.push(l);const u=i.slice(s+1);return u.length&&a.push(UE(u)),a}function n0e(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),i=/<\/html>\s*$/i.test(t);return!n||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function Wg(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function i0e(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Ua(t)}\s*>\s*$`,"i").test(n)}const u8=new Set(["iframe","script","style","textarea","title"]);function Cv(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=f=>{if(e.startsWith("",f+4);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}const h=Ho(e.slice(f));if(h===-1)return null;const m=f+h+1,g=e.slice(f,m);if(/^<\s*[!?]/.test(g))return{closing:!1,end:m,selfClosing:!1,tag:""};let v=g.slice(1).trimStart();const y=v.startsWith("/");y&&(v=v.slice(1).trimStart());const b=v.match(/^([A-Z][\w:-]*)/i);return b?.[1]?{closing:y,end:m,selfClosing:/\/\s*>$/.test(g),tag:b[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},s=(f,h)=>{const m=new RegExp(String.raw`<\s*\/\s*${Ua(f)}(?=\s|>)`,"gi");m.lastIndex=h;const g=m.exec(e);if(!g||g.index==null)return null;const v=o(g.index);return v?{start:g.index,end:v.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a$/.test(u))return{raw:u,start:r,end:l+1,closed:!0};if(u8.has(i)){const f=s(i,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let c=1,d=l+1;for(;d]*$/,"")} -`}function ZE(e){return e.replace(/\r\n/g,` -`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function r0e(e,t,n){return n?e.includes(n,t)?!0:ZE(e.slice(Math.max(0,t))).includes(ZE(n)):!1}function l0e(e,t){let n=Math.max(0,t);for(;n)`,"gi");let i=-1,o;for(;(o=n.exec(e))!==null;)i=o.index;return i}function Kj(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const u0e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),c0e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function d0e(e){return/\n\s*\n/.test(e)||c0e.test(e)}function f0e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>u0e.has(String(i?.type??"").toLowerCase()))||t.some(i=>{if(i?.type!=="html_block")return!1;const o=i;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!d0e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function h0e(e){const t=[];let n=0;for(;n=e.length)break;const i=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!i?.[1])return null;const o=Cv(e,i[1],n);if(!o||o.start!==n)return null;t.push(o.raw),n=o.end}return t.length>1?t:null}function p0e(e,t,n,i){const o=n.customHtmlTags?.join("\0")??"",s=t,r=RE.get(s),l=r&&r.final===i&&r.customHtmlTags===o&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((u,c)=>l&&r.blocks[c]===u?r.children[c]:r1(u,t,n));return RE.set(s,{blocks:e,children:a,customHtmlTags:o,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function m0e(e,t,n,i){return e.map(o=>{if(o?.type!=="html_block")return o;const s=o,r=String(s.tag??"").toLowerCase();if(!r||r==="details"||Vz.has(r)||Array.isArray(s.children))return o;const l=String(o.raw??s.content??"");if(!l)return o;const a=Ho(l);if(a===-1)return o;const u=Cv(l,r,0),c=u?.closeStart??-1,d=u?.closed===!0&&c>=a+1,f=d?l.slice(a+1,c):l.slice(a+1);if(!f.trim())return o;const h=Kj(n,i),m=d?null:h0e(f),g=m?p0e(m,t,h,i):r1(f,t,h);return f0e(f,g)?{...o,children:g}:o})}function g0e(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function r1(e,t,n){return e.trim()?Gj(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function v0e(e,t,n){const i=r1(e,t,n),o=i[0];return i.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:i}function y0e(e,t,n){const i=Nj({content:e}),o=Ho(e),s=Vj(e,"summary");if(o!==-1&&s!==-1&&s>=o+1){const r=v0e(e.slice(o+1,s),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function k0e(e,t,n){const i=Ho(e);if(i===-1)return[];const o=e.slice(i+1);if(!o.trim())return[];const s=Cv(o,"summary",0);if(!s)return r1(o,t,n);const r=o.slice(0,s.start),l=o.slice(s.end);return[...r1(r,t,n),y0e(s.raw,t,n),...r1(l,t,n)]}function Zj(e,t,n,i,o,s=0){const r=[];let l=s;for(let a=0;a{const j=Vj(f,"details");return j!==-1?f.slice(0,j):f})():f,[w]=Zj(y?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,i,o,h+f.length),C=k0e(b,n,Kj(i,o)),T=g===-1?"":String(e[g].raw??Wg(e[g])??""),N=y||g!==-1&&v?.closed===!0,I=T.replace(/[\t\r\n ]+$/,""),S=N?(()=>{const j=(v?.raw??"").lastIndexOf(I);return j===-1?t.length:h+j})():t.length,_=Ho(f),x=y&&_!==-1?h+_+1:h+f.length,E=t.slice(x,S===-1?t.length:S),M=n.parse(E,{__markstreamFinal:o}),R=n.renderer.render(M,n.options,{__markstreamFinal:o}),q=S+I.length,z=N?Math.max(S+T.length,l0e(t,q)):t.length,O=N?t.slice(S,z):T,B=N?t.slice(h,z):t.slice(h),P=y&&_!==-1?f.slice(0,_+1):f,H={...u,tag:"details",attrs:Nk(f.slice(0,_+1)),raw:B,content:`${P}${R}${O}`,children:[...C,...w],loading:!o&&!N};if(i.includeSourceMap&&(H.sourceMap=F0(t,h,N?z:t.length,i)),r.push(H),l=N?z:t.length,g===-1&&!y)break;g!==-1&&(a=g)}return[r,l]}function b0e(e,t,n,i){if(!n)return e;const o=e.slice();let s=0;for(let r=0;r=d.start&&_.end<=d.end){o.splice(N,1);continue}break}T=S+I.length,o.splice(N,1)}}return o}function w0e(e){const t=l=>l===" "||l===" "||l===` -`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a{const v=g.charCodeAt(0);return v>=65&&v<=90||v>=97&&v<=122},c=g=>{const v=g.charCodeAt(0);return v>=48&&v<=57},d=g=>g==="!"||u(g),f=g=>u(g)||c(g)||g===":"||g==="-",h=g=>u(g)||c(g)||g==="_"||g==="."||g===":"||g==="-",m=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a=l.length)return!0;if(l[a]==="/"){for(a++;a=l.length}if(!h(l[a]))return!1;for(a++;a=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a=l.length)return!0;a++}else{for(;a"||v==='"'||v==="'"||v==="`")break;a++}if(a>=l.length)return!0}}}return!0},i=(l,a)=>Hj(l,a),o=String(e??""),s=o.lastIndexOf("<");if(s===-1||i(o,s))return o;if(s>0){const l=o[s-1],a=l===" "||l===" "||l===` -`||l==="\r",u=o[s-2];if(!a&&!((l==="n"||l==="r")&&u==="\\"))return o}const r=o.slice(s);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===` -`||r[1]==="\r")||!n(r)?o:o.slice(0,s)}function QE(e,t){if(e===t)return;const n=e.split(/\r?\n/),i=t.split(/\r?\n/),o=[];let s=0;for(let r=0;r{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(lString(m??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const i=m=>m===" "||m===" ",o=m=>{const g=m.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||m==="_"||m==="-"||m===":"},s=m=>{if(!m)return!1;if(m[0]===" ")return!0;let g=0;for(let v=0;v=4)return!0;continue}if(y===" ")return!0;break}return!1},r=m=>{let g=!1,v=!1;for(let y=0;y")return y}return-1},l=m=>{let g=0;for(;g{if(s(m))return-1;const v=m.replace(/^[ \t]+/,"");if(!v||v.startsWith(">")||v.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(v))return-1;let y=!1,b=0;for(;b=T.length){y=!0,b++;continue}const I=T[N];if(I==="!"||I==="?"){y=!0,b+=C+1;continue}if(I==="/"){y=!0,b+=C+1;continue}const S=N;for(;N"&&x!=="/"){y=!0,b++;continue}const E=new RegExp(String.raw`<\s*\/\s*${_}\s*>`,"i"),M=/\/\s*>$/.test(T),R=E.test(m.slice(b+C+1)),q=E.test(e.slice(g+b+C+1)),z=/[\r\n]/.test(e.slice(g+b+C+1));if(y&&n.has(_)&&!M&&!R&&(q||z))return b;y=!0,b+=C+1}return-1};let u=!1,c="",d=0,f="",h=0;for(;hh&&e[m-1]==="\r",y=g?v?m-1:m:e.length,b=e.slice(h,y),w=g?v?`\r -`:` -`:"",C=l(b);let T=b;if(!u&&!C){const N=a(b,h);if(N!==-1){const I=w||` -`;T=`${b.slice(0,N).replace(/[ \t]+$/,"")}${I}${I}${b.slice(N).replace(/^[ \t]+/,"")}`}}f+=T,f+=w,C&&(u?C.markerChar===c&&C.markerLen>=d&&/^\s*$/.test(C.rest)&&(u=!1,c="",d=0):(u=!0,c=C.markerChar,d=C.markerLen)),h=g?m+1:e.length}return f}function A0e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const i=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},s=d=>{let f=0;for(;f{let f=!1,h=!1;for(let m=0;m")return m}return-1},l=(d,f,h)=>{const m=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let v=g+1;for(;v=d.length||d[v]!=="/"){g=d.indexOf("<",g+1);continue}for(v++;vd.length){g=d.indexOf("<",g+1);continue}let y=!0;for(let w=0;w="A"&&C<="Z"?String.fromCharCode(C.charCodeAt(0)+32):C)!==m[w]){y=!1;break}}if(!y){g=d.indexOf("<",g+1);continue}let b=v+m.length;if(b")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const h=f;for(;fc&&e[d-1]==="\r",h=f?d-1:d,m=e.slice(c,h);u+=a(m),u+=f?`\r -`:` -`,c=d+1}return u}function x0e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const i=f=>f===" "||f===" ",o=f=>{let h=0,m=!1,g=0;for(;h=f.length||f[h]!==">")break;for(m=!0,h++;h{let h=0;for(;hnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",u=0,c="",d=0;for(;dd&&e[f-1]==="\r",g=h?m?f-1:f:e.length,v=e.slice(d,g),y=h?m?`\r -`:` -`:"",b=o(v),w=b?.prefix??"",C=b?.content??v,T=s(C);T&&(l?T.markerChar===a&&T.markerLen>=u&&/^\s*$/.test(T.rest)&&(l=!1,a="",u=0):(l=!0,a=T.markerChar,u=T.markerLen));let N=C;if(!l&&N.includes("{if(E.replace(/^[\t ]+/,"").startsWith("|"))return S;const M=E.slice(0,x).replace(/^[\t ]+/,"");if(M.length>0){const R=_.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",q=M.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!R||!q||R!==q)return S}return`${_} - -`});if(w){const I=w+N.split(` -`).join(` -${w}`);c+=I}else c+=N;c+=y,d=h?f+1:e.length}return c}function S0e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(M=>String(M??"").toLowerCase()));if(!n.size)return e;const i=M=>M===" "||M===" ",o=M=>{if(!M)return!1;if(M[0]===" ")return!0;let R=0;for(let q=0;q=4)return!0;continue}if(z===" ")return!0;break}return!1},s=M=>{const R=M.charCodeAt(0);return R>=65&&R<=90||R>=97&&R<=122||R>=48&&R<=57||M==="_"||M==="-"||M===":"},r=M=>{let R=0;for(;R{let R=0,q=!1,z=0;for(;R=M.length||M[R]!==">")break;for(q=!0,R++;Rr(M).startsWith("<"),u=M=>{for(let R=0;R{if(o(M))return"";const R=r(M);if(!R.startsWith("<"))return"";let q=1;for(;q=R.length||R[q]==="/"||R[q]==="!"||R[q]==="?")return"";const z=q;for(;q"&&B!=="/"?"":O},d=M=>{if(o(M))return null;const R=r(M);if(!R.startsWith("<"))return null;let q=1;for(;q=R.length)return null;const z=R[q]==="/";if(z)for(q++;q"&&H!=="/")return null;if(z)return{type:"close",name:P};if(/\/\s*>\s*$/.test(R))return{type:"open",name:P,complete:!0};const j=R.indexOf(">",q);if(j!==-1){const Z=R.slice(j+1);if(new RegExp(`<\\s*\\/\\s*${P}\\s*>`,"i").test(Z))return{type:"open",name:P,complete:!0}}return{type:"open",name:P,complete:!1}},f=M=>{if(o(M))return null;const R=r(M).replace(/[ \t]+$/,"");if(!R.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(R))return null;const q=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(q?.[1])return q[1].toLowerCase();const z=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!z?.[1]||!z[2])return null;const O=z[1].toLowerCase();return O===z[2].toLowerCase()?O:null};let h=!1,m="",g=0;const v=M=>{let R=0;for(;Rv(M),b=M=>{const R=r(M);return R?o(M)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(R):!1},w=(M,R,q)=>{let z=M,O=0;for(;zz&&e[B-1]==="\r",j=P?H?B-1:B:e.length,Z=e.slice(z,j),ie=l(Z),W=ie?.key??"";if(O>0&&R&&W!==R)break;const Q=ie?.content??Z,te=d(Q);if(te?.name===q){if(te.type==="open")te.complete||O++;else if(O>0&&(O--,O===0))return!1}else if(O>0&&(u(Q)||b(Q)))return!0;if(P)z=B+1;else break}return!1};let C="",T=0,N=!0,I=!1,S=!1,_=` -`;const x=[];let E="";for(;TT&&e[M-1]==="\r",z=R?q?M-1:M:e.length,O=e.slice(T,z),B=R?q?`\r -`:` -`:"",P=l(O),H=P?.key??"",j=P?.content??O,Z=y(j);Z&&(h?Z.markerChar===m&&Z.markerLen>=g&&/^\s*$/.test(Z.rest)&&(h=!1,m="",g=0):(h=!0,m=Z.markerChar,g=Z.markerLen));const ie=x.length>0;if(!h&&!ie){const Q=c(j),te=!!Q&&!N&&I&&S&&w(T,H,Q);Q&&!N&&(!I||te)&&(H&&E&&H===E?C+=`${H}${_}`:H||(C+=_))}if(C+=O,C+=B,B&&(_=B),!h){const Q=d(j);if(Q){if(Q.type==="open")Q.complete||x.push(Q.name);else for(let te=x.length-1;te>=0;te--)if(x[te]===Q.name){x.length=te;break}}}const W=u(j);N=W,I=!W&&a(j),S=!W&&!!f(j),E=H,T=R?M+1:e.length}return C}function _0e(e){let t=!1,n="",i=0,o=!1,s=!1,r=!1,l=0;const a=(c,d)=>{const f=m7(c);if(f){t?f.markerChar===n&&f.markerLen>=i&&/^\s*$/.test(f.rest)&&(t=!1,n="",i=0):(t=!0,n=f.markerChar,i=f.markerLen);return}if(t)return;let h=0;for(;h{for(;l=c?c:d,h=f>l&&e[f-1]==="\r"?f-1:f;if(a(e.slice(l,h)),d===-1||d>=c){l=c;break}r=!1,l=d+1}},inMath:()=>o||s||r}}function c8(e,t,n,i){let o=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const s=_0e(o);if(o=o.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(r,l,a,u)=>{s.scanTo(u+1);const c=s.inMath();return s.scanTo(u+r.length),c?`${l}\\n${a}`:r}),t||(o.endsWith("- *")&&(o=o.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*-\s*$/,r=>r.startsWith(` -`)?` -`:""):/(?:^|\n)\s*--\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*--\s*$/,r=>r.startsWith(` -`)?` -`:""):/(?:^|\n)\s*>\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*>\s*$/,r=>r.startsWith(` -`)?` -`:""):/\n\s*[*+]\s*$/.test(o)?o=o.replace(/\n\s*[*+]\s*$/,` -`):/(?:^|\n)\s*\d+\s*$/.test(o)?/^\d+$/.test(o.trim())||(o=o.replace(/(?:^|\n)\s*\d+\s*$/,r=>r.startsWith(` -`)?` -`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(o)?o=o.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(r,l,a)=>`${l}${a.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*\d+[.)]\s*$/,r=>r.startsWith(` -`)?` -`:""):/\n[[(]\n*$/.test(o)&&(o=o.replace(/(\n\[|\n\()+\n*$/g,` -`)),o=Vge(o,i.customHtmlTags)??o),i.customHtmlTags?.length&&o.includes("<")){const r=qh(i.customHtmlTags);if(r.length&&(o=C0e(o,r),o=A0e(o,r),o=S0e(o,r),o=x0e(o,r),o.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");o=o.replace(a,"$1$2$2")}}return t||(o=w0e(o)),o}function M0e(e,t,n,i){const o=e,s=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=vC.get(o);let l;if(!n&&!i.customHtmlTags?.length&&r&&r.mode===s&&t.length>=r.source.length&&t.startsWith(r.source)){const a=Math.max(0,r.source.length-Age-xge),u=c8(t.slice(a),n,e,i),c=r.source.length-a;l=u.length>=c&&u.slice(0,c)===r.safeMarkdown.slice(-c)?r.safeMarkdown.slice(0,r.safeMarkdown.length-c)+u:c8(t,n,e,i)}else l=c8(t,n,e,i);return n||(l=Kge(l,e)),vC.set(o,{source:t,safeMarkdown:l,mode:s}),l}function Gj(e,t,n={}){const i=Rj(n),o=i?La():0,s=!!n.final,r=(e??"").toString();$ge(t,n)&&(t.stream.reset(),Oge(t),vC.delete(t));const l=M0e(t,r,s,n);i&&xd(i,"safeMarkdownMs",La()-o);const a=n0e(l);if(a){if(n.includeSourceMap){const T={...n,__sourceLineMapper:QE(r,l)};a[0].sourceMap=F0(l,0,l.length,T)}const w=n.preTransformTokens,C=n.postTransformTokens;if(d7(t,n)||typeof w=="function"||typeof C=="function"){const T=qE(t,l,{__markstreamFinal:s},n),N=typeof w=="function"&&w(T)||T;typeof C=="function"&&C(N)}return OE(a,n,i,o)}const u=i?La():0,c=qE(t,l,{__markstreamFinal:s},n);if(i&&xd(i,"tokenizeMs",La()-u),!c||!Array.isArray(c))return OE([],n,i,o);const d=n.preTransformTokens,f=n.postTransformTokens;let h=c;d&&typeof d=="function"&&(h=d(h)||h);const m=t,g=typeof m.validateLink=="function"&&m.__markstreamOriginalValidateLink&&m.validateLink!==m.__markstreamOriginalValidateLink?m.validateLink:void 0,v=n.validateLink??g??m.options?.validateLink??(typeof m.validateLink=="function"?m.validateLink:void 0),y={...n,validateLink:v,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?QE(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let b=Dge(t,l,h,y,i);if(f&&typeof f=="function"){const w=f(h);if(Array.isArray(w)){const C=w[0],T=C?.type;C&&typeof T=="string"?b=Tp(w,{...y,__customHtmlBlockCursor:0},i):b=w}}if(g0e(b)){const w=i?La():0;b=b0e(b,s,l,y),b=Zj(b,l,t,y,s)[0],b=m0e(b,t,y,s),i&&xd(i,"htmlBlockPassesMs",La()-w)}if(s){const w=new WeakSet,C=T=>{if(!T||typeof T!="object"||w.has(T))return;if(w.add(T),Array.isArray(T)){for(const I of T)C(I);return}const N=T;N.type==="html_block"&&N.loading===!0&&(N.loading=!1);for(const I of Object.values(N))C(I)};C(b)}return b=Oj(b,n),n.debug&&console.log("Parsed Markdown Tree Structure:",b),$j(b,i,o)}function YE(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=of(t),o=t?.__linkifyDemotionSeed;if(Array.isArray(o)&&o.length)for(const l of o)i.remember(String(l??""));const s=t?.includeSourceMap===!0;let r=0;for(;rd.type==="html_block")){if(s)for(const d of c)Mi(d,a,t);for(const d of c)ru(d,a,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};s&&Mi(d,a,t);const f=KE(d,t);if(f){s&&VE(f,d);for(const h of f)ru(h,a,t);n.push(...f)}else ru(d,a,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const I0e=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,qg=/\d/u,T0e=/[,.!?;:,。;、!?:]/u,E0e=/\d\p{Script=Han}{1,3}$/u;function L0e(e){return e.pos>0&&e.pos+1{const u=l,c=u.posMax,d=u.pos;if(u.src.charCodeAt(d)!==r||a||s.refuseDigitRange&&L0e(u))return!1;u.pos=d+1;let f=!1;for(;u.pos]|$)/i,B0e=new Set([...kv,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),R0e=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function JE(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $0e(e){return typeof e=="string"?e:e==null?"":String(e)}function Qj(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function dd(e){return $0e(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Yj(e){return dd(e).replace(/`/g,"`")}function $k(e){return String(e??"").trim().toLowerCase()}function v7(e,t="safe"){const n=$k(e);return n?t==="escape"?!0:t==="trusted"?kv.has(n):!R0e.has(n):!1}function Jj(e,t="safe"){const n=$k(e);return n?t==="escape"?!0:t==="trusted"?kv.has(n):B0e.has(n):!1}function XE(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${Yj(i)}"`).join("")}function Xj(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(F0e);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function O0e(e,t){const n=e.split(",").map(i=>i.trim()).filter(Boolean);return n.length===0?!1:n.some(i=>{const o=i.split(/\s+/,1)[0]??"";return!o||hh(o,{tagName:t,attrName:"srcset"})})}function eH(e,t,n,i){return bhe.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?O0e(t,i):!!(whe.has(e)&&t&&hh(t,{tagName:i,attrName:e}))}function Kf(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function tH(e,t,n,i=!1){if(t!=="safe"||$k(n)!=="a")return e;const o=Kf(e,"href");if(i&&(!o||!e[o])){const a=Kf(e,"target"),u=Kf(e,"rel");return a&&delete e[a],u&&delete e[u],e}const s=Kf(e,"target");if((s?String(e[s]).trim():"").toLowerCase()!=="_blank")return e;const r=Kf(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function eL(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!Qj(r)||eH(l,s,t,n)||(i[r]=s)}return tH(i,t,n,!!Kf(e,"href"))}function nH(e,t){const n=e.toLowerCase();return Uz.has(n)?!1:JE(t,n)||JE(t,e)}function y7(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!Qj(r)||eH(l,s,t,n)||(i[r]=s)}return tH(i,t,n,!!Kf(e,"href"))}function Ug(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,i]of e)n&&(t[String(n)]=i==null?"":String(i));return t}function $y(e,t="safe",n){const i=y7(Ug(e),t,n),o=Object.entries(i).map(([s,r])=>[s,r]);return o.length>0?o:void 0}function P0e(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const i=Number(e);if(e!==""&&!Number.isNaN(i))return i}return e}function z0e(e){const t={};for(const[n,i]of Object.entries(e))t[n]=P0e(i,n);return t}function d8(e){return e.trim().length>0}function iH(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const i=e.indexOf("<",n);if(i===-1){if(nn){const r=e.slice(n,i);d8(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",i+1)){const r=e.indexOf("]]>",i);if(r!==-1){t.push({type:"text",content:e.slice(i,r+3)}),n=r+3;continue}break}if(e.startsWith("!",i+1)){const r=e.indexOf(">",i);if(r!==-1){n=r+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=Xj(e.slice(i+1,o));if(!s){const r=e.slice(i,o+1);d8(r)&&t.push({type:"text",content:r}),n=o+1;continue}if(s.isClosing)t.push({type:"tag_close",tagName:s.tagName});else{const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||Od.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r})}n=o+1}return t}function j0e(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const i=e.indexOf("<",n);if(i===-1){nn&&t.push({type:"text",content:e.slice(n,i)}),e.startsWith("![CDATA[",i+1)){const l=e.indexOf("]]>",i);if(l!==-1){t.push({type:"text",content:e.slice(i,l+3)}),n=l+3;continue}break}if(e.startsWith("!",i+1)){const l=e.indexOf(">",i);if(l!==-1){n=l+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=Xj(e.slice(i+1,o));if(!s){t.push({type:"text",content:e.slice(i,o+1)}),n=o+1;continue}if(s.isClosing){t.push({type:"tag_close",tagName:s.tagName}),n=o+1;continue}const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||Od.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r}),n=o+1}return t}function H0e(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${dd(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,o])=>o===""?` ${dd(i)}`:` ${dd(i)}="${Yj(o)}"`).join("");return e.type==="self_closing"?`<${dd(t)}${n} />`:`<${dd(t)}${n}>`}function W0e(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of iH(e))if((n.type==="tag_open"||n.type==="self_closing")&&nH(n.tagName??"",t))return!0;return!1}function l1(e,t="safe"){if(!e)return"";if(t==="escape")return dd(e);const n=j0e(e),i=[],o=[],s=[];for(const r of n){if(r.type==="text"){s.length===0&&o.push(dd(r.content??""));continue}const l=$k(r.tagName);if(!l)continue;if(Jj(l,t)){r.type==="tag_open"?s.push(l):r.type==="tag_close"&&s[s.length-1]===l&&s.pop();continue}if(s.length>0)continue;if(t==="safe"&&v7(l,t)){o.push(H0e(r));continue}if(r.type==="self_closing"){o.push(`<${l}${XE(eL(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${XE(eL(r.attrs??{},t,l))}>`),Od.has(l)||i.push(l);continue}const a=i.lastIndexOf(l);if(a===-1)continue;for(;i.length>a+1;){const c=i.pop();c&&o.push(``)}const u=i.pop();u&&o.push(``)}for(;i.length>0;){const r=i.pop();r&&o.push(``)}return o.join("")}const q0e=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],tL="http://www.w3.org/2000/svg",U0e=new Set(["script","style","iframe","object","embed","link","meta"]),V0e=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),K0e=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Z0e=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),G0e=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Q0e(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Y0e(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function J0e(e){const t=e.nodeName.toLowerCase();return t==="use"?Q0e(e):t==="image"?Y0e(e):t==="text"||t==="tspan"?!!e.textContent?.trim():G0e.has(t)}function X0e(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function eve(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),s=String(n??"").trim();return s?(i==="use"||i==="marker"||i==="clippath"||i==="mask")&&(o==="href"||o==="xlink:href")?s.startsWith("#")?s:"":i==="a"&&(o==="href"||o==="xlink:href")?hh(s,{tagName:"a",attrName:"href"})?"":s:i==="image"&&(o==="href"||o==="xlink:href"||o==="src")?hh(s,{tagName:"img",attrName:"src"})?"":s:o==="href"||o==="xlink:href"?s.startsWith("#")?s:"":hh(s,{tagName:i,attrName:o})?"":s:""}function tve(e,t){let n=t+4;for(;n{const i=n.trim();if(/^[0-9a-f]+$/i.test(i)){const o=Number.parseInt(i,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function sH(e){const t=oH(e),n=t.toLowerCase();let i=0;for(;in.test(t))||sH(t)}function nve(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function $2(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function rH(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,i=n.tagName.toLowerCase();if(!U0e.has(i)){if(i==="br"){t.push(` -`);return}for(const o of Array.from(n.childNodes))rH(o,t)}}function ive(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];rH(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const o=$2(t.getAttribute("width")),s=$2(t.getAttribute("height")),r=$2(t.getAttribute("x")),l=$2(t.getAttribute("y")),a=e.ownerDocument.createElementNS(tL,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+s/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const u=t.querySelector(".nodeLabel");if(u?.getAttribute("class")&&a.setAttribute("class",u.getAttribute("class")),i.length===1)a.textContent=i[0];else{const c=-.6*(i.length-1);for(const[d,f]of i.entries()){const h=e.ownerDocument.createElementNS(tL,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${c}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function ove(e){ive(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!V0e.has(i)){n.remove();continue}if(i==="style"&&nL(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const s of o){const r=s.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(s.name);continue}if(r==="style"&&s.value&&nL(s.value)){n.removeAttribute(s.name);continue}if(r==="srcdoc"){n.removeAttribute(s.name);continue}if(K0e.has(r)&&s.value){const l=eve(i,r,s.value);if(!l){n.removeAttribute(s.name);continue}l!==s.value&&n.setAttribute(s.name,l);continue}if(Z0e.has(r)&&s.value&&sH(s.value)){n.removeAttribute(s.name);continue}if(s.value){const l=X0e(s.value);l!==s.value&&n.setAttribute(s.name,l)}}nve(n)}}function s9t(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return ove(n),sve(n)?null:n}catch{return null}}function sve(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const s=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(s)||!Number.isFinite(r)||s<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let i=!1;for(const o of n){J0e(o)&&(i=!0);for(const s of Array.from(o.attributes))if(/\bNaN\b/i.test(s.value)||s.name==="style"&&/max-width:\s*0(?:px)?/i.test(s.value))return!0}return!i}const O2=[];function f8(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function rve(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function lve(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function iL(e=`editor-${Date.now()}`,t={}){const n=P1e(t),i=n;i.__markstreamRegisteredPluginCount=O2.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||O2.length);const o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;s=m=>h[m]??o[m]??m}else s=h=>o[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[g,...v]=m;typeof g=="function"&&n.use(g,...v)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(O2.length)for(const h of O2)if(Array.isArray(h)){const[m,...g]=h;typeof m=="function"&&n.use(m,...g)}else typeof h=="function"&&n.use(h);n.use(D0e),n.use(sue),n.use(nue);const r=yue,l=r.default??r;n.use(l),n.use(tue),n.use(eue),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,g=m.src,v=!!m.env?.__markstreamFinal,y=g.split(/\r?\n/);for(const b of m.tokens){if(b.type!=="fence"||!b.map||!b.markup)continue;const w=b.map[0],C=b.map[1],T=b.markup,N=T[0],I=T.length,S=y[Math.max(0,C-1)]??"";let _=0;for(;_w+1&&x>=I&&E===S.length,R=b;R.meta=R.meta??{},R.meta.unclosed=!M,R.meta.closed=!!M}}),n.renderer.rules.fence=(h,m)=>{const g=h[m],v=String(g.info??"").trim(),y=String(g.content??""),b=btoa(unescape(encodeURIComponent(y))),w=rve(v),C=f8(w),T=lve(`editor-${e}-${m}-${w}`),N=f8(s("common.copy"));return`
        -
        - ${f8(w.toUpperCase())} - -
        -
        -
        `};const a=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=h=>{if(!h.startsWith("["))return!1;const m=u.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const g=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(g)},d=(h,m)=>{const g=h;if(g.src[g.pos]!=="[")return!1;const v=a.exec(g.src.slice(g.pos));if(!v)return!1;const y=g.src.slice(Math.max(0,g.pos-120),g.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(y))return!1;const b=g.src.slice(g.pos+v[0].length);if(b.startsWith("](")||b.startsWith("(")||c(b))return!1;if(!m){const w=v[1],C=g.push("reference","span",0);C.content=w,C.markup=v[0],C.raw=v[0]}return g.pos+=v[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const v=String(h[m].content??"");return`${v}`};const f=n.use.bind(n);return n.use=((...h)=>(i.__markstreamHasCustomParserExtensions=!0,f(...h))),n}const ave="modulepreload",uve=function(e){return"/"+e},oL={},Yo=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let r=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(u=>{if(u=uve(u),u in oL)return;oL[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":ave,c||(f.as="script"),f.crossOrigin="",f.href=u,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};function cve({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function lH({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:i,streamRenderVersionChanged:o=!1}){const s=`${n.settledContent}${n.streamedDelta}`;return i?n.streamedDelta&&s===e?o?{settledContent:s,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:cve({nextContent:e,previousContent:t??s,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const dve={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function fve(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function aH(e){const t=fve(e);return dve[t]??t}function hve(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>aH(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function pve(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const i of e){if(typeof i!="string")continue;const o=i.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function mve(e){return pve(e)?.join("\0")??""}function gve(e,t){return`${mve(e)}\0\0${hve(t)?.join("\0")??""}`}function pp(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function sL(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var vve=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const m=rL();this.startedAt=f&&this.hasStarted?m-this.normalizedStartDelayMs:m,this.lastTick=m,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=rL();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,v=wve(m/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(v-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const y=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),b=bve(this.source.slice(this.visible.length),y,this.segmenter);b.text&&(this.visible+=b.text,this.charBudget=Math.max(0,this.charBudget-b.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:i=1e3,targetLatencyMs:o=900,catchUpLatencyMs:s=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=pp(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,pp(i,1e3,1)),this.normalizedTargetLatencyMs=pp(o,900,1),this.normalizedCatchUpLatencyMs=pp(s,350,1),this.normalizedCatchUpThreshold=sL(r,600),this.normalizedStartDelayMs=sL(a,80),this.maxCommitFps=Math.trunc(pp(l,30,1)),this.maxCharsPerCommit=Math.trunc(pp(u,80,1)),this.flushOnFinish=c,this.segmenter=kve(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function yve(e={},t){const n=new vve(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function kve(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function bve(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const s=Array.from(e).slice(0,t);return{text:s.join(""),graphemeCount:s.length}}let i="",o=0;for(const s of n.segment(e)){if(o>=t)break;i+=s.segment,o++}return{text:i,graphemeCount:o}}function rL(){return typeof performance<"u"?performance.now():Date.now()}function wve(e,t,n){return Math.min(n,Math.max(t,e))}var Cve=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const kC=Symbol.for("markstream-vue:node-lifecycle");function r9t(){}const k7=new Map;let uH="material";const Pp=new Map,lL=new Map;let bC=null;function Ave(e){k7.set(e.id,e)}function xve(e){const t=k7.get(uH);if(!t)return;const n=t.core[e];if(n)return n;const i=Pp.get(t.id);if(i){const o=i[e];if(o)return o}t.loadExtended&&!Pp.has(t.id)&&_ve(t)}function Sve(){var e,t;return(t=(e=k7.get(uH))==null?void 0:e.fallback)!=null?t:""}function _ve(e){return Cve(this,null,function*(){var t,n,i;if(Pp.has(e.id))return(t=Pp.get(e.id))!=null?t:null;let o=lL.get(e.id);return o||(o=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(s=>(Pp.set(e.id,s),bC?.(),s)).catch(()=>(Pp.set(e.id,null),null)),lL.set(e.id,o)),o})}const aL='',uL='',Mve={id:"material",core:{"":uL,plain:'',text:uL,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:aL,csharp:aL,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>Yo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Ive=Ka(0);bC=()=>{Ive.value++},Ave(Mve);const Tve={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Ok(e){var t;const n=(function(i){if(!i)return"";const o=i.trim();if(!o)return"";const[s]=o.split(/\s+/),[r]=s.split(":");return r.toLowerCase()})(e);return(t=Tve[n])!=null?t:n}function l9t(e){const t=Ok(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function a9t(e){return xve(Ok(e))||Sve()}const cL={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var Pk=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});let Pr=null,eh=!1,th=null,zk=w7;function Av(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function b7(){try{const e=globalThis;return Av(e?.katex)}catch{return null}}function w7(){return Pk(null,null,function*(){const e=b7();if(e)return e;const t=yield Yo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield Yo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Av(t)})}function cH(e){const t=Promise.resolve(e).then(n=>{var i;return th===t&&n?(Pr=(i=Av(n))!=null?i:n,Pr):null}).catch(()=>null).finally(()=>{th===t&&(th=null)});return th=t,eh=!0,t}function Eve(e){zk=e,Pr=null,eh=!1,th=null}function Lve(e){Eve(w7)}function dH(){return typeof zk=="function"}function u9t(){var e;const t=zk;if(!t||t===w7)return null;if(Pr)return Pr;const n=b7();if(n)return Pr=n,Pr;if(eh)return null;try{const i=t();return i?typeof i?.then=="function"?(cH(i),null):(Pr=(e=Av(i))!=null?e:i,Pr):null}catch{return null}}function fH(){return Pk(this,null,function*(){var e;const t=b7();if(t)return Pr=t,Pr;if(Pr)return Pr;if(th)return th;if(eh)return null;const n=zk;if(!n)return eh=!0,null;try{const i=n();if(typeof i?.then=="function")return cH(i);if(i)return Pr=(e=Av(i))!=null?e:i,eh=!0,Pr}catch{}return eh=!0,null})}function hH(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Oy=null,$f=null;const $r=new Map,uc=new Map;let B0=5;const mh=new Set;function Vg(){if($r.size{const{id:n,html:i,error:o}=t.data,s=$r.get(n);if(s)if($r.delete(n),clearTimeout(s.timeoutId),s.cleanup(),Vg(),o)s.aborted||s.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(uc.set(a,i),uc.size>200){const u=uc.keys().next().value;uc.delete(u)}}s.aborted||s.resolve(i)}},Oy.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of $r.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));$r.clear(),Nve()}}function Fve(e,t=!0,n=2e3,i){return Pk(this,null,function*(){performance.now();const o=hH(e);if(!dH()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if($f)return Promise.reject($f);const s=`${t?"d":"i"}:${o}`,r=uc.get(s);if(r)return Vg(),Promise.resolve(r);const l=Oy||($f=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),$f.name="WorkerInitError",$f.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject($f);if($r.size>=B0){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=$r.size,a.max=B0,Promise.reject(a)}return new Promise((a,u)=>{if(i?.aborted){const g=new Error("Aborted");return g.name="AbortError",void u(g)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const g=$r.get(c);if(!g)return;$r.delete(c),g.cleanup();const v=new Error("Worker render timed out");v.name="WorkerTimeout",v.code="WORKER_TIMEOUT",g.aborted||g.reject(v),Vg()},n);d=()=>{const g=$r.get(c);if(!g||g.aborted)return;g.aborted=!0,g.cleanup();const v=new Error("Aborted");v.name="AbortError",u(v)},i&&i.addEventListener("abort",d,{once:!0});const h=a,m=u;$r.set(c,{resolve:g=>{h(g)},reject:g=>{m(g)},timeoutId:f,aborted:!1,cleanup:()=>{i&&d&&i.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:o,displayMode:t})}catch(g){const v=$r.get(c);$r.delete(c),clearTimeout(f),v?.cleanup(),v?.reject(g),Vg()}})})}function c9t(e,t=!0,n){const i=`${t?"d":"i"}:${hH(e)}`;if(uc.set(i,n),uc.size>200){const o=uc.keys().next().value;uc.delete(o)}}const Bve="WORKER_BUSY";function Rve(e=2e3,t){return $r.size{let o,s=!1,r=null,l=()=>{};const a=()=>{o&&globalThis.clearTimeout(o),mh.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{s||(s=!0,a(),n())},mh.add(l),o=globalThis.setTimeout(()=>{if(s)return;s=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",i(u)},e),queueMicrotask(()=>Vg()),t&&(r=()=>{if(s)return;s=!0,a();const u=new Error("Aborted");u.name="AbortError",i(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const Pm={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function d9t(e){return Pk(this,arguments,function*(t,n=!0,i={}){var o,s,r,l;if(!dH()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=i.timeout)!=null?o:Pm.timeout,u=(s=i.waitTimeout)!=null?s:Pm.waitTimeout,c=(r=i.backoffMs)!=null?r:Pm.backoffMs,d=(l=i.maxRetries)!=null?l:Pm.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Pm.maxRetries,h=i.signal;let m=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield Fve(t,n,a,h)}catch(g){if(g?.code!==Bve||m>=f)throw g;if(m++,yield Rve(u,h).catch(()=>{}),h?.aborted){const v=new Error("Aborted");throw v.name="AbortError",v}c>0&&(yield new Promise(v=>globalThis.setTimeout(v,c*m)))}}})}function zp(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function $ve(e){var t;for(const n of e.split(/\r?\n/)){const i=n.trim();if(!i||i.startsWith("%%"))continue;const o=i.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function n4(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),i=$ve(e);return i==="gantt"?220+28*n:i==="sequencediagram"?180+26*n:i==="classdiagram"||i==="statediagram"||i==="erdiagram"?180+24*n:i==="flowchart"||i==="graph"?170+28*n:200+22*n}function i4(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function pH(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function o4(e,t=360,n=500){return pH(e,t,n)}function s4(e,t=360,n=500){return pH(e,t,n)}var Ove=Object.defineProperty,Pve=Object.defineProperties,zve=Object.getOwnPropertyDescriptors,dL=Object.getOwnPropertySymbols,jve=Object.prototype.hasOwnProperty,Hve=Object.prototype.propertyIsEnumerable,fL=(e,t,n)=>t in e?Ove(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mH=(e,t)=>{for(var n in t||(t={}))jve.call(t,n)&&fL(e,n,t[n]);if(dL)for(var n of dL(t))Hve.call(t,n)&&fL(e,n,t[n]);return e},hL=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const r4=()=>Yo(()=>import("./mermaid.core-CGrLstUA.js").then(e=>e.bp),__vite__mapDeps([2,3]));let Qu=null,jp=r4,cg=null,wC=!1,CC=!1,dg=0;function Wve(e){jp=e,dg++,Qu=null,cg=null,wC=!1,CC=!1}function qve(e){Wve(r4)}function pL(){return typeof jp=="function"}function mL(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=mH({},t),i={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:s=>typeof t.initialize=="function"?t.initialize(s):o.initialize?o.initialize(s):void 0},Pve(n,zve(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function gL(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=mH({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,i):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(i):void 0}}catch{}}function f9t(){return hL(this,null,function*(){if(Qu)return Qu;const e=(function(){try{const i=globalThis;return mL(i?.mermaid)}catch{return null}})();if(e)return Qu=e,gL(Qu),Qu;const t=jp,n=dg;return t?t===r4&&wC?null:cg||(cg=hL(null,null,function*(){let i;try{i=yield t()}catch(o){if(t===r4)return n===dg&&t===jp&&(wC=!0,(function(s){CC||(CC=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',s))})(o)),null;throw o}finally{n===dg&&t===jp&&(cg=null)}return n!==dg||t!==jp?null:i?(Qu=mL(i),gL(Qu),Qu):null}),cg):null})}let cu=null,Of=null;const Na=new Map,Pf=new Map;function h8(e){for(const t of Na.values())t.reject(e);Na.clear(),Pf.clear()}let vL=5,yL=!1;const Uve="WORKER_BUSY",kL="MERMAID_DISABLED";function Vve(e){if(cu&&cu!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",h8(n)}cu=e,Of=null;const t=e;cu.onmessage=n=>{if(cu!==t)return;const{id:i,ok:o,result:s,error:r}=n.data,l=Na.get(i);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(s))},cu.onerror=n=>{var i,o;if(cu===t)if(Na.size!==0){try{yL?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}h8(new Error(`Worker error: ${n.message}`))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},cu.onmessageerror=n=>{var i,o;if(cu===t)if(Na.size!==0){try{yL?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}h8(new Error("Worker messageerror"))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function gH(e,t,n,i){if(!pL()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=kL,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let s=Pf.get(o);return s||(s=(function(r,l,a=1400){if(!pL()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=kL,Promise.reject(c)}if(Of)return Promise.reject(Of);const u=cu||(Of=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Of.name="WorkerInitError",Of.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(Of);if(Na.size>=vL){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=Uve,c.inFlight=Na.size,c.max=vL,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,m=!1;const g=()=>{m||(m=!0,h!=null&&globalThis.clearTimeout(h),Na.delete(f))},v={resolve:y=>{g(),c(y)},reject:y=>{g(),d(y)}};Na.set(f,v);try{u.postMessage({id:f,action:r,payload:l})}catch(y){return Na.delete(f),void d(y)}h=globalThis.setTimeout(()=>{const y=new Error("Worker call timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT";const b=Na.get(f);b&&b.reject(y)},a)})})(e,t,n),Pf.set(o,s),s.then(()=>{Pf.get(o)===s&&Pf.delete(o)},()=>{Pf.get(o)===s&&Pf.delete(o)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},l.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),u(f)})})})(s,i)}function h9t(e,t,n=1400,i){return gH("canParse",{code:e,theme:t},n,i)}function p9t(e,t,n=1400,i){return gH("findPrefix",{code:e,theme:t},n,i)}var Kve=Object.defineProperty,Zve=Object.defineProperties,Gve=Object.getOwnPropertyDescriptors,bL=Object.getOwnPropertySymbols,Qve=Object.prototype.hasOwnProperty,Yve=Object.prototype.propertyIsEnumerable,wL=(e,t,n)=>t in e?Kve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dt=(e,t)=>{for(var n in t||(t={}))Qve.call(t,n)&&wL(e,n,t[n]);if(bL)for(var n of bL(t))Yve.call(t,n)&&wL(e,n,t[n]);return e},Dn=(e,t)=>Zve(e,Gve(t)),fo=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const Jve="__global__",p8="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",AC=(()=>{const e=globalThis;if(e[p8])return e[p8];const t={scopedCustomComponents:{},revision:Ka(0)};return e[p8]=t,t})(),CL=AC.revision,Xve=Symbol("markstreamCustomComponents"),e2e=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function xv(e){return e2e.has(String(e).trim().toLowerCase())}function t2e(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function m8(e={}){const t={};for(const[n,i]of Object.entries(e))if(i!=null){t[n]=i;for(const o of new Set([va(n),va(t2e(n))]))!o||xv(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i)}return t}function gs(e){const t=Jt(Xve,null);return D(()=>{var n;return CL.value,(function(i,o={}){return CL.value,Dt(Dt(Dt({},m8(AC.scopedCustomComponents[Jve]||{})),m8(o)),m8((function(s){return s&&AC.scopedCustomComponents[s]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const n2e=["aria-label"],i2e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},o2e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},$i=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},Bl=$i(lt({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(k(),L("svg",o2e,[...n[1]||(n[1]=[A("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),A("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(k(),L("svg",i2e,[...n[0]||(n[0]=[A("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,n2e))}),[["__scopeId","data-v-be21ab83"]]);Bl.install=e=>{e.component(Bl.__name,Bl)};const s2e={class:"emoji-node"},cl=$i(lt({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",s2e,F(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);cl.install=e=>{e.component(cl.__name,cl)};const r2e=["id"],l2e=["title"],Rl=$i(lt({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const i=document.querySelector(t);i?i.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(i,o)=>(k(),L("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[A("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+F(e.node.id)+"]",9,l2e)],8,r2e))}}),[["__scopeId","data-v-c1463a29"]]);Rl.install=e=>{e.component(Rl.__name,Rl)};const vH=(()=>{try{return!1}catch{}return!1})();function g8(e){vH&&console.warn(e)}function AL(e,t="safe",n){return y7(e,t,n)}function yH(e){return z0e(e)}function v8(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function C7(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=$y((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),v8(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),v8(r.value)]):Object.entries(o).map(([r,l])=>[r,v8(l)]):null,t,n);var o;if(!i)return;const s=yH(Ug(i));return Object.keys(s).length>0?s:void 0}function xL(e,t,n=!1){const i=Object.entries(t??{}),o=i.length>0?i.map(([s,r])=>r===""?` ${s}`:` ${s}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function zm(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function y8(e,t,n,i,o,s,r=!1){const l=(function(d,f){return nH(d,f)})(e,i);if(kv.has(e.toLowerCase())||!l&&Jj(e,s))return null;if(!l&&v7(e,s))return r?[xL(e,t,!0)]:[xL(e,t),...n,``];const a=y7(t,s,e),u=a.key,c=u!=null&&u!==""?u:o;if(l){const d=i[e]||i[e.toLowerCase()],f=yH(a);return Tn(d,Dn(Dt({},f),{key:c}),n.length>0?n:void 0)}return Tn(e,Dn(Dt({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function kH(e,t){return W0e(e,t)}function l4(e,t,n="safe"){if(!e)return[];try{return(function(s,r,l="safe"){let a=0;const u=[],c=[];for(const d of s)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=y8(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);zm(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===f){h=m;break}if(h!==-1)for(;u.length>h;){const m=u.pop(),g=y8(m.tagName,m.attrs||{},m.children,r,m.autoKey,l);u.length>0?zm(u[u.length-1].children,g):zm(c,g),m.tagName.toLowerCase()!==f&&u.length>h&&g8(`Auto-closing unclosed tag: <${m.tagName}>`)}else g8(`Ignoring closing tag with no matching opening tag: `)}for(;u.length>0;){const d=u.pop(),f=y8(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?zm(u[u.length-1].children,f):zm(c,f),g8(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(iH(e),t,n)}catch(o){return i=o,vH&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const a2e=["innerHTML"],$l=$i(lt({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Jt("markstreamHtmlPolicy",void 0),i=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=gs(()=>t.customId),s=lt({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(i.value==="escape")return{mode:"html",content:l1(l,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=l4(l,o.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!kH(l,o.value))return{mode:"html",content:l1(l,i.value)};const a=l4(l,o.value,i.value);return a===null?{mode:"html",content:l1(l,i.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(k(),L("span",{key:0,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[U(p(s),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(k(),L("span",{key:1,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},F(r.value.content),3)):(k(),L("span",{key:2,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,a2e))}}),[["__scopeId","data-v-d17f12b0"]]);$l.install=e=>{e.component($l.__name,$l)};const u2e={class:"inline-code"},c2e={key:0},xr=$i(lt({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=q1(),i=Jt("markstreamFade",void 0),o=Jt("markstreamTextStreamState",void 0),s=Jt("markstreamStreamVersion",void 0),r=D(()=>{const b=n.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var b;return String((b=t.node.code)!=null?b:"")}),u=D(()=>!l.value),c=D(()=>{var b;const w=(b=n["index-key"])!=null?b:n.indexKey;return w==null||w===""?"":String(w)}),d=V(t.node.code),f=V(""),h=V(0);let m;function g(){m?.(),m=void 0}function v(){g(),f.value&&(d.value=d.value+f.value,f.value="")}We([()=>t.node.code,c,l],([b])=>{const w=String(b??""),C=c.value,T=lH({nextContent:w,persistedContent:C?o?.get(C):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=T.settledContent,f.value=T.streamedDelta,T.appended?(h.value+=1,(function(){if(!f.value||m||!s)return;const N=s.value;m=We(()=>s.value,I=>{I!==N&&v()},{flush:"sync"})})()):f.value||g(),C&&o?.set(C,w)},{immediate:!0}),Gd(g);const y=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(b,w)=>(k(),L("code",u2e,[u.value?(k(),L(De,{key:0},[$e(F(a.value),1)],64)):(k(),L(De,{key:1},[d.value?(k(),L("span",c2e,F(d.value),1)):ee("",!0),f.value?(k(),L("span",{key:1,class:Re(["inline-code-stream-delta",[y.value]]),onAnimationend:v},F(f.value),35)):ee("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);xr.install=e=>{e.component(xr.__name,xr)};const xC=V(!1),SL=V(""),_L=V("top"),Kg=V(null),Zg=V(null),SC=V(null),_C=V(null),ML=V(null);let Py=null,zy=null,MC=0;function bH(){Py&&(clearTimeout(Py),Py=null),zy&&(clearTimeout(zy),zy=null)}let P2=!1,z2=null,IL=!1;function d2e(e,t,n="top",i=!1,o,s){if(!e)return;const r=++MC;bH();const l=()=>fo(null,null,function*(){var a,u;if(yield(function(){return fo(this,null,function*(){if(!P2&&!IL&&typeof document<"u"){z2!=null||(z2=fo(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([Yo(()=>import("./vue.runtime.esm-bundler-Ii2EKmOx.js"),[]),Yo(()=>import("./Tooltip-3Kylewm2.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:xC.value,"anchor-el":Kg.value,content:SL.value,placement:_L.value,id:Zg.value,originX:SC.value,originY:_C.value,isDark:(m=ML.value)!=null?m:void 0})}}).mount(h),P2=!0}));try{yield z2}catch(c){P2=!1,z2=null,IL=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),P2&&r===MC){Zg.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Kg.value=e,SL.value=t,_L.value=n,SC.value=(a=o?.x)!=null?a:null,_C.value=(u=o?.y)!=null?u:null,ML.value=typeof s=="boolean"?s:null,xC.value=!0;try{e.setAttribute("aria-describedby",Zg.value)}catch{}}});i?l():Py=setTimeout(l,80)}function f2e(e=!1){MC+=1,bH();const t=()=>{if(Kg.value&&Zg.value)try{Kg.value.removeAttribute("aria-describedby")}catch{}xC.value=!1,Kg.value=null,Zg.value=null,SC.value=null,_C.value=null};e?t():zy=setTimeout(t,120)}const h2e={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},p2e=Symbol("markstreamI18nFallback");function wH(e,t){var n;return(n=t?.[e])!=null?n:h2e[e]}const IC=(e,t)=>{var n;return(n=wH(e,t))!=null?n:(function(i){return(i.split(".").pop()||i).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function TL(e,t){return{t(n){const i=wH(n,t);if(e.te&&i!=null&&!e.te(n))return IC(n,t);const o=e.t(n);return o===n&&i!=null?IC(n,t):o}}}function m2e(){const e=(function(){var n,i,o;try{const s=ps(),r=p2e,l=s?.provides,a=(n=s?.appContext)==null?void 0:n.provides;return(o=(i=l?.[r])!=null?i:a?.[r])!=null?o:null}catch{}return null})(),t=(function(){var n,i;try{const o=ps(),s=o?.proxy,r=s?.$t;if(typeof r=="function"){const u=s?.$te;return{t:r.bind(s),te:typeof u=="function"?u.bind(s):void 0}}const l=(i=(n=o?.appContext)==null?void 0:n.config)==null?void 0:i.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return TL(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return TL({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>IC(n,e)}}const CH=Symbol("ViewportPriority"),AH=Symbol("ViewportPriorityOptions"),xH=Symbol("OffscreenHeavyNodeDeferral"),g2e=D(()=>!1),Th="400px";function A7(){return Jt(AH,void 0)}function x7(){return Jt(xH,g2e)}function v2e(e,t){var n,i;const o=typeof window<"u"&&typeof document<"u",s=typeof t=="boolean"?V(t):t,r=o?(n=window.requestIdleCallback)!=null?n:I=>window.setTimeout(()=>I({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(i=window.cancelIdleCallback)!=null?i:I=>window.clearTimeout(I):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function g(I){if(!I)return"viewport";let S=a.get(I);return S||(S=u++,a.set(I,S)),String(S)}function v(){if(h!=null){try{l?.(h)}catch{}h=null}}function y(I){if(I){const S=c.get(I);if(S&&!S.targets.size){try{S.io.disconnect()}catch{}c.delete(I)}}d.size||f.size||v()}function b(I){const S=d.get(I);if(!S)return;const _=c.get(S.bucketKey);if(!S.visible.value){S.visible.value=!0;try{S.resolve()}catch{}}try{_?.io.unobserve(I)}catch{}_?.targets.delete(I),d.delete(I),f.delete(I),y(S.bucketKey)}function w(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const I=f.values().next().value;I&&(f.delete(I),b(I),f.size&&w())},{timeout:1200}))}function C(I,S){if(!o||typeof IntersectionObserver>"u")return null;const _=(function(z,O){var B,P,H;return{root:(B=e?.(z??null))!=null?B:null,rootMargin:(P=O?.rootMargin)!=null?P:Th,threshold:(H=O?.threshold)!=null?H:0}})(I,S),x=[g((E=_).root),E.rootMargin,E.threshold].join("\0");var E;const M=c.get(x);if(M)return{key:x,bucket:M};let R;try{R=new IntersectionObserver(z=>{for(const O of z)(O.isIntersecting||O.intersectionRatio>0)&&b(O.target)},{root:_.root,rootMargin:_.rootMargin,threshold:_.threshold})}catch{return null}const q={io:R,targets:new Map};return c.set(x,q),{key:x,bucket:q}}function T(){if(o&&s.value)for(const[I,S]of Array.from(d.entries())){const _=C(I,S.opts);if(!_){b(I);continue}if(_.key===S.bucketKey)continue;const x=S.bucketKey,E=c.get(x);try{E?.io.unobserve(I)}catch{}E?.targets.delete(I),S.bucketKey=_.key,_.bucket.targets.set(I,S),_.bucket.io.observe(I),y(x)}}We(s,I=>{if(!I){for(const S of Array.from(d.keys()))b(S);v()}},{flush:"sync"});const N=(I,S)=>{const _=V(!1);let x,E=!1;const M=new Promise(O=>{x=()=>{E||(E=!0,O())}}),R=()=>{const O=d.get(I);if(!O)return f.delete(I),void y();const B=c.get(O.bucketKey);try{B?.io.unobserve(I)}catch{}B?.targets.delete(I),d.delete(I),f.delete(I),y(O.bucketKey)};if(!o||!s.value)return _.value=!0,x(),{isVisible:_,whenVisible:M,destroy:R};const q=C(I,S);if(!q)return _.value=!0,x(),{isVisible:_,whenVisible:M,destroy:R};const z={resolve:x,visible:_,bucketKey:q.key,opts:S};return d.set(I,z),q.bucket.targets.set(I,z),q.bucket.io.observe(I),o&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,T()})),S?.allowIdle!==!1&&(f.add(I),w()),{isVisible:_,whenVisible:M,destroy:R}};return N.refresh=T,ii(CH,N),N}function S7(){var e,t;const n=Jt(CH,void 0);if(n)return n;const i=new WeakMap,o=new Map,s=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=h=>{if(!h)return;const m=o.get(h);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}o.delete(h)}},d=h=>{const m=i.get(h);if(!m)return;const g=o.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{g?.io.unobserve(h)}catch{}i.delete(h),g?.targets.delete(h),s.delete(h),c(m.bucketKey),s.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&s.size&&(r=l(()=>{r=null;const h=s.values().next().value;h&&(s.delete(h),d(h),s.size&&f())},{timeout:1200}))};return(h,m)=>{const g=V(!1);let v,y=!1;const b=new Promise(T=>{v=()=>{y||(y=!0,T())}}),w=()=>{const T=i.get(h);if(!T)return s.delete(h),void(s.size||u());const N=o.get(T.bucketKey);try{N?.io.unobserve(h)}catch{}i.delete(h),N?.targets.delete(h),s.delete(h),c(T.bucketKey),s.size||u()},C=(T=>{var N,I;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const S=(R=>{var q,z;return[(q=R?.rootMargin)!=null?q:Th,(z=R?.threshold)!=null?z:0].join("\0")})(T),_=o.get(S);if(_)return{key:S,bucket:_};const x=(N=T?.rootMargin)!=null?N:Th;let E;try{E=new IntersectionObserver(R=>{for(const q of R)(q.isIntersecting||q.intersectionRatio>0)&&d(q.target)},{root:null,rootMargin:x,threshold:(I=T?.threshold)!=null?I:0})}catch{return null}const M={io:E,targets:new Set};return o.set(S,M),{key:S,bucket:M}})(m);return C?(i.set(h,{resolve:v,visible:g,bucketKey:C.key}),C.bucket.targets.add(h),C.bucket.io.observe(h),m?.allowIdle!==!1&&(s.add(h),f()),{isVisible:g,whenVisible:b,destroy:w}):(g.value=!0,v(),{isVisible:g,whenVisible:b,destroy:w})}}function y2e(e,t){var n,i;const o=(i=(n=e.indexKey)!=null?n:t["index-key"])!=null?i:t.indexKey;return o==null||o===""?"":String(o)}const k2e=["data-markstream-viewport-pending"],b2e=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],w2e={key:1,class:"image-placeholder"},C2e={key:1,class:"image-node__raw-text"},A2e={key:2,class:"image-shimmer-overlay"},x2e={key:1,class:"image-node__raw-text"},S2e={key:3,class:"image-error"},Sd=$i(lt({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,i,o;const s=e,r=t,l=V(!1),a=V(!1),u=V(""),c=V("primary"),d=V(null),f=q1(),h=Jt(kC,null),m=S7(),g=A7(),v=x7(),y=D(()=>YT(s.node.src)),b=D(()=>YT(s.fallbackSrc)),w=(o=(i=(n=ps())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:o.call(i,"img"),C=typeof window<"u"&&w?.getAttribute("src")===(y.value||b.value),T=V(typeof window>"u"||C||!v.value),N=Ka(null);let I="",S=null;const _=D(()=>u.value),x=D(()=>!s.lazy),E=D(()=>typeof window<"u"&&v.value&&!C),M=D(()=>!E.value||T.value),R=D(()=>M.value?_.value:""),q=D(()=>{var ue,se;return(se=(ue=g?.value.heavyBlockMargin)!=null?ue:g?.value.rootMargin)!=null?se:Th}),z=D(()=>!s.node.loading&&c.value!=="failed"&&u.value.length>0),O=D(()=>c.value==="failed"),B=D(()=>(!x.value||E.value&&!T.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),P=D(()=>y2e(s,f));function H(ue=P.value){ue&&d.value&&h?.reportHeight(ue,d.value.offsetHeight)}function j(ue=P.value){ue&&ht(()=>{H(ue)})}function Z(){S&&(clearTimeout(S),S=null)}function ie(){const ue=P.value;ue&&I!==ue&&(I&&h?.markSettled(I),Z(),I=ue,h?.markPending(ue),typeof window<"u"&&(S=window.setTimeout(()=>{I===ue&&(j(ue),W())},8e3)))}function W(){return fo(this,null,function*(){const ue=I;ue&&(Z(),I="",yield ht(),H(ue),h?.markSettled(ue))})}function Q(){if(c.value==="primary"&&b.value&&b.value!==u.value)return c.value="fallback",u.value=b.value,l.value=!1,a.value=!1,void j();c.value="failed",a.value=!0,r("error",u.value),j()}function te(){l.value=!0,a.value=!1,r("load",_.value),j()}function X(ue){ue.preventDefault(),l.value&&!a.value&&r("click",[ue,_.value])}const{t:ge}=m2e();return We([y,b,()=>s.node.loading],()=>(l.value=!1,a.value=!1,s.node.loading||y.value?(u.value=y.value,void(c.value="primary")):b.value?(u.value=b.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&We([d,E],([ue,se],fe,G)=>{var ae;if((ae=N.value)==null||ae.destroy(),N.value=null,!se||T.value)return void(T.value=!0);if(!ue)return void(T.value=!1);let K=!0;const re=m(ue,{rootMargin:q.value,allowIdle:!1});N.value=re,T.value=re.isVisible.value,re.whenVisible.then(()=>{K&&N.value===re&&(T.value=!0)}),G(()=>{K=!1,re.destroy(),N.value===re&&(N.value=null)})},{immediate:!0}),We([z,l,a,_,()=>s.lazy,M],([ue,se,fe,G,ae,K])=>ue&&G&&!fe&&K?se?(W(),void j()):ae?(ie(),void j()):void(se||fe||ie()):(W(),void j()),{flush:"post",immediate:!0}),ti(()=>{var ue;(ue=N.value)==null||ue.destroy(),N.value=null,(function(){const se=I;se&&(Z(),I="",h?.markSettled(se))})()}),(ue,se)=>{var fe,G,ae,K,re;return k(),L("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":E.value&&!T.value?"true":void 0},[z.value?(k(),L("img",{key:0,src:R.value||void 0,alt:String((G=(fe=s.node.alt)!=null?fe:s.node.title)!=null?G:""),title:String((K=(ae=s.node.title)!=null?ae:s.node.alt)!=null?K:""),class:Re(["image-node__img",{"is-loading":!x.value&&!l.value,"is-loaded":x.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:s.lazy?"lazy":void 0,fetchpriority:x.value?"high":void 0,decoding:x.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(re=s.node.alt)!=null?re:p(ge)("image.preview"),onError:Q,onLoad:te,onClick:X},null,42,b2e)):ee("",!0),e.node.loading&&!a.value?(k(),L("span",w2e,[s.usePlaceholder?Un(ue.$slots,"placeholder",{key:0,node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[0]||(se[0]=A("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",C2e,F(e.node.raw),1))])):ee("",!0),B.value&&!e.node.loading?(k(),L("span",A2e,[s.usePlaceholder?Un(ue.$slots,"placeholder",{key:0,node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[1]||(se[1]=A("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",x2e,F(e.node.raw),1))])):ee("",!0),O.value?(k(),L("span",S2e,[Un(ue.$slots,"error",{node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[2]||(se[2]=A("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[A("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),A("span",null,F(p(ge)("image.loadError")),1)],!0)])):ee("",!0)],8,k2e)}}}),[["__scopeId","data-v-046e82ac"]]);Sd.install=e=>{e.component(Sd.__name,Sd)};const _2e={key:2},Pu=lt({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=gs(()=>t.customId),i=Jt("markstreamHtmlPolicy",void 0),o=Jt("markstreamNestedRendererProps",void 0),s=D(()=>{var m;return(m=i?.value)!=null?m:"safe"}),r=D(()=>{var m,g;const v=(m=o?.value)!=null?m:{};return Dn(Dt({},v),{customId:(g=t.customId)!=null?g:v.customId,htmlPolicy:s.value})}),l=wu({loader:()=>Promise.resolve().then(()=>R7),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),u=D(()=>!!(a.value&&n.value[t.node.type]&&!xv(String(t.node.type)))),c=D(()=>u.value?C7(t.node,s.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var m;return String((m=t.node.content)!=null?m:"")}),h=D(()=>{var m,g;return String((g=(m=t.node.content)!=null?m:t.node.raw)!=null?g:"")});return(m,g)=>a.value&&u.value?(k(),de(Po(a.value),ui({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:ce(()=>[d.value?(k(),de(p(l),ui({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(k(),de(p(l),ui({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(k(),de(Po(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(k(),L("span",_2e,F(h.value),1)):ee("",!0)}}),EL=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function M2e(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Dn(Dt(Dt({},EL),n),{enabled:(t=n.enabled)==null||t})}return Dt({},EL)}function _7(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,i=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=i}function SH(e){var t,n;const i=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(i.length<3)return"";const o=i[0];if(o!=="`"&&o!=="~"||i[1]!==o||i[2]!==o)return"";let s=3;for(;i[s]===o;)s+=1;return i.slice(s).trim()}function LL(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function I2e(e){var t;return e.diff===!0||LL(e.language)||LL(SH(String((t=e.raw)!=null?t:"")))}function T2e(e,t,n){const i=(function(o){const s=SH(o);if(!s)return"";const r=s.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:i||t,caption:i?n?`Diff / ${t}`:t:""}}const E2e=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],L2e={key:0,translate:"no",class:"markstream-pre__diff-code"},N2e={class:"markstream-pre__diff-pane-content"},D2e={class:"markstream-pre__diff-number","aria-hidden":"true"},F2e={class:"markstream-pre__diff-content"},B2e={class:"markstream-pre__diff-content-inner"},R2e={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},$2e=["textContent"],O2e=["textContent"],ol=lt({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(X,ge){const ue=String(X??"");return ge?ue:ue.replace(/\r\n$|\n$|\r$/,"")}const i=D(()=>{var X,ge,ue;const se=String((ge=(X=t.node)==null?void 0:X.language)!=null?ge:"");return String((ue=String(se).split(/\s+/g)[0])!=null?ue:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=D(()=>`language-${i.value}`),s=D(()=>{var X;return t.loading===!0||((X=t.node)==null?void 0:X.loading)===!0}),r=D(()=>{var X;return n((X=t.node)==null?void 0:X.code,s.value)});let l="",a=1;const u=D(()=>(function(X){let ge=0,ue=1;X.startsWith(l)&&(ge=l.length,ue=a,ge>0&&X[ge-1]==="\r"&&X[ge]===` -`&&ge++);for(let se=ge;ser.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const X=u.value;X{var X;return t.showLineNumbers===!0&&((X=t.node)==null?void 0:X.diff)===!0}),g=D(()=>m.value&&t.diffInline===!0),v=D(()=>{const X=Number(t.reservedHeightPx);if(!Number.isFinite(X)||X<=0)return;const ge=`${Math.ceil(X)}px`;return s.value?{maxHeight:ge,overflow:"auto"}:{height:ge,minHeight:ge,maxHeight:ge,overflow:"auto"}}),y=["diff ","index ","--- ","+++ ","@@ "];function b(X){return String(X??"").trim().length===0}function w(X,ge="context",ue={}){const se=b(X);return{code:X,kind:se&&ge!=="hunk"&&ge!=="spacer"&&!ue.preserveBlankKind?"context":ge,empty:se}}function C(X){const ge=n(X,s.value);return ge?ge.split(/\r\n|\n|\r/):[]}function T(X,ge){return!b(X[ge])||gey.some(ue=>ge.startsWith(ue)))}function _(X,ge){return ge||!X.startsWith(" ")||X.startsWith(" ")?X:` ${X}`}function x(X,ge){const ue=X.length,se=ge.length,fe=[];let G=0;for(;G=G&&re>=G&&X[K]===ge[re];)ae.unshift({originalIndex:K,modifiedIndex:re}),K--,re--;const be=K-G+1,ke=re-G+1;if(be<=0||ke<=0||s.value||(be+1)*(ke+1)>15e5)return fe.concat(ae);const we=ke+1,oe=new Uint32Array((be+1)*(ke+1));for(let _e=be-1;_e>=0;_e--)for(let pe=ke-1;pe>=0;pe--){const ne=_e*we+pe;if(X[G+_e]===ge[G+pe])oe[ne]=oe[(_e+1)*we+pe+1]+1;else{const Ee=oe[(_e+1)*we+pe],qe=oe[_e*we+pe+1];oe[ne]=Ee>=qe?Ee:qe}}const le=[];let ye=0,Ae=0;for(;ye=oe[ye*we+Ae+1]?ye++:Ae++;return fe.concat(le,ae)}function E(X){var ge;const ue=(function(){var re,be;const ke=t.diffHideUnchangedRegions;if(ke==null||ke===!1)return null;const we=ke===!0?{}:ke;return we.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((re=we.contextLineCount)!=null?re:2)),minimumLineCount:Math.max(1,Math.floor((be=we.minimumLineCount)!=null?be:4))}})();if(!ue||X.length<1||X.length>2||X.length===2&&X[0].lines.length!==X[1].lines.length)return X;const se=X[0].lines,fe=(ge=X[1])==null?void 0:ge.lines,G=re=>se[re].kind==="context"&&(fe===void 0||fe[re].kind==="context"&&se[re].code===fe[re].code),ae=[];let K=0;for(;K=ue.minimumLineCount){const ke=re+(re===0?0:ue.contextLineCount),we=be-(be===se.length?0:ue.contextLineCount);we-ke>=ue.minimumLineCount&&ae.push({start:ke,end:we})}K===re&&K++}return ae.length?X.map((re,be)=>{const ke=[];let we=0;for(const oe of ae)ke.push(...re.lines.slice(we,oe.start)),ke.push({code:be===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${re.key}-collapsed-${oe.start}-${oe.end}`,number:""}),we=oe.end;return ke.push(...re.lines.slice(we)),Dn(Dt({},re),{lines:ke})}):X}const M=D(()=>{var X,ge,ue,se;if(!m.value)return[];const fe=(function(be){const ke=be.some(oe=>N(oe)),we=be.some(oe=>I(oe));return ke&&we||(function(){var oe,le,ye,Ae;if(i.value==="diff")return!0;const _e=(Ae=(ye=String((le=(oe=t.node)==null?void 0:oe.raw)!=null?le:"").split(/\r?\n/,1)[0])==null?void 0:ye.trim())!=null?Ae:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(_e)})()&&(ke||we)})(c.value),G=(function(){var be,ke;return((be=t.node)==null?void 0:be.originalCode)!=null||((ke=t.node)==null?void 0:ke.updatedCode)!=null})();if(g.value){const be=G?(function(ke,we){const oe=C(ke),le=C(we),ye=x(oe,le);if(ye.length>0){const qe=[];let ze=0,ft=0;for(const gt of ye){for(;ze=_e&&ne>=_e&&oe[pe]===le[ne];)Ee.unshift(Dn(Dt({},w(le[ne])),{key:`inline-suffix-${ne}`,number:ne+1})),pe--,ne--;for(let qe=_e;qe<=pe;qe++)Ae.push(Dn(Dt({},w(oe[qe],"removed",{preserveBlankKind:T(oe,qe)})),{key:`inline-removed-source-${qe}`,number:qe+1}));for(let qe=_e;qe<=ne;qe++)Ae.push(Dn(Dt({},w(le[qe],"added",{preserveBlankKind:T(le,qe)})),{key:`inline-added-source-${qe}`,number:qe+1}));return Ae.concat(Ee)})((X=t.node)==null?void 0:X.originalCode,(ge=t.node)==null?void 0:ge.updatedCode):(function(ke){const we=[];let oe=1,le=1;const ye=S(ke);for(const[Ae,_e]of ke.entries())if(_e.startsWith("@@")){const pe=_e.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);pe&&(oe=Number(pe[1]),le=Number(pe[2])),we.push(Dn(Dt({},w(_e,"hunk")),{key:`inline-hunk-${Ae}`,number:""}))}else if(N(_e))we.push(Dn(Dt({},w(_(_e.slice(1),ye),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${Ae}`,number:oe++}));else if(I(_e))we.push(Dn(Dt({},w(_(_e.slice(1),ye),"added",{preserveBlankKind:!0})),{key:`inline-added-${Ae}`,number:le++}));else{const pe=ye&&_e.startsWith(" ")?_e.slice(1):_e;we.push(Dn(Dt({},w(pe)),{key:`inline-context-${Ae}`,number:le})),oe++,le++}return we})(c.value);return E([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:be}])}if(!fe&&G)return(function(be,ke){const we=C(be),oe=C(ke),le=x(we,oe),ye=[],Ae=[];let _e=0,pe=0,ne=0;const Ee=(qe,ze)=>{const ft=Math.max(qe-_e,ze-pe);for(let gt=0;gtDn(Dt({},be),{key:`original-${ke}`,number:ke+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:K.map((be,ke)=>Dn(Dt({},be),{key:`modified-${ke}`,number:ke+1}))}])}),R=D(()=>{var X,ge;if(t.showLineNumbers!==!0)return;let ue=m.value?1:u.value;if(m.value){ue=Math.max(ue,C((X=t.node)==null?void 0:X.originalCode).length,C((ge=t.node)==null?void 0:ge.updatedCode).length);for(const fe of M.value)for(const G of fe.lines)typeof G.number=="number"&&(ue=Math.max(ue,G.number))}const se=`${Math.max(2,String(ue).length)}ch`;return{"--markstream-pre-line-number-width":se,"--markstream-pre-diff-line-number-width":se,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),q=D(()=>M.value.some(X=>X.lines.some(ge=>ge.kind==="collapsed"))),z=D(()=>{const X=i.value;return X?`Code block: ${X}`:"Code block"}),O=V(null),B=V([]);let P=null,H=!1,j=null;function Z(X){const ge=Number.parseFloat(String(X??""));return Number.isFinite(ge)&&ge>0?ge:0}function ie(X,ge){var ue;if(!X)return ge;if(X.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const se=X.querySelector(".markstream-pre__diff-content"),fe=se?.getBoundingClientRect(),G=(ue=fe?.height)!=null?ue:0;return Math.max(ge,Math.ceil(G))}function W(){H||typeof window>"u"||(P!=null&&window.cancelAnimationFrame(P),P=window.requestAnimationFrame(()=>{P=null,H||(function(){var X,ge;P=null;const ue=O.value;if(!ue||!m.value||g.value||!ue.classList.contains("is-wrap"))return void(B.value.length&&(B.value=[]));const se=(function(ke){const we=window.getComputedStyle(ke),oe=Z(we.getPropertyValue("--markstream-pre-diff-line-height"));if(oe>0)return oe;const le=Z(we.lineHeight);return le>0?le:18})(ue),fe=Array.from(ue.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),G=Array.from(ue.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),ae=Math.max(fe.length,G.length),K=[];for(let ke=0;ke{const oe=be[we];return oe&&Math.abs(ke.rowHeight-oe.rowHeight)<=.5&&Math.abs(ke.originalHeight-oe.originalHeight)<=.5&&Math.abs(ke.modifiedHeight-oe.modifiedHeight)<=.5})||(B.value=K)})()}))}function Q(X){j?.disconnect(),j=null,X&&m.value&&!g.value&&typeof ResizeObserver<"u"&&(j=new ResizeObserver(()=>{W()}),j.observe(X))}function te(X,ge){const ue=B.value[X];if(!ue)return;const se=ge==="original"?ue.originalHeight:ue.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(ue.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(se)}px`}}return We(O,X=>{Q(X),ht(()=>W())},{flush:"post"}),We([m,g,M],()=>{Q(O.value),ht(()=>W())},{flush:"post",immediate:!0}),ti(()=>{H=!0,P!=null&&(window.cancelAnimationFrame(P),P=null),j?.disconnect(),j=null}),(X,ge)=>(k(),L("pre",{ref_key:"preRef",ref:O,style:on([v.value,R.value]),class:Re([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":g.value,"markstream-pre--diff-collapsed":q.value}]),"aria-busy":s.value,"aria-label":z.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(k(),L("code",L2e,[(k(!0),L(De,null,Ct(M.value,ue=>(k(),L("span",{key:ue.key,class:Re(["markstream-pre__diff-pane",ue.className])},[A("span",N2e,[(k(!0),L(De,null,Ct(ue.lines,(se,fe)=>(k(),L("span",{key:se.key,class:Re(["markstream-pre__diff-line",[`markstream-pre__diff-line--${se.kind}`,{"markstream-pre__diff-line--empty":se.empty}]]),style:on(te(fe,ue.key))},[ge[0]||(ge[0]=A("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),A("span",D2e,F(se.number),1),A("span",F2e,[A("span",B2e,F(se.code),1)])],6))),128))])],2))),128))])):(k(),L(De,{key:1},[t.showLineNumbers?(k(),L("span",R2e,[A("span",{class:"markstream-pre__line-numbers-text",textContent:F(h.value)},null,8,$2e)])):ee("",!0),A("code",{translate:"no",class:"markstream-pre__code",textContent:F(r.value)},null,8,O2e)],64))],14,E2e))}});ol.install=e=>{e.component(ol.__name,ol)};const Wo=$i(lt({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=q1(),i=Jt("markstreamFade",void 0),o=Jt("markstreamTextStreamState",void 0),s=Jt("markstreamStreamVersion",void 0),r=D(()=>{const T=n.fade;return T===""||T===!0||T==="true"||T!==!1&&T!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var T;const N=(T=n["index-key"])!=null?T:n.indexKey;return N==null||N===""?"":String(N)}),u=V(t.node.content),c=V(""),d=V(0),f=V(t.node.content);let h;const m=V(null),g=V(null);let v="",y=null;function b(){h?.(),h=void 0}function w(){b(),c.value&&(u.value=u.value+c.value,c.value="")}We([u,m,g],function(){var T,N;const I=m.value;if(!I)return;const S=String((T=u.value)!=null?T:""),_=g.value;return y||(y=I.firstChild,v=(N=y?.data)!=null?N:""),S.startsWith(v)?!y&&S?(I.textContent=S,y=I.firstChild,void(v=S)):void(S.length>v.length&&_&&(_.appendChild(document.createTextNode(S.slice(v.length))),v=S)):(I.textContent=S,y=I.firstChild,_&&(_.textContent=""),void(v=S))},{immediate:!0}),We([()=>t.node.content,a,l],([T])=>{const N=String(T??""),I=a.value,S=lH({nextContent:N,persistedContent:I?o?.get(I):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=S.settledContent,c.value=S.streamedDelta,S.appended?(d.value+=1,(function(){if(!c.value||h||!s)return;const _=s.value;h=We(()=>s.value,x=>{x!==_&&w()},{flush:"sync"})})()):c.value||b(),I&&o?.set(I,N)},{immediate:!0}),Gd(b);const C=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(T,N)=>(k(),L("span",{class:Re([[e.node.center?"text-node-center":""],"text-node"])},[ai(A("span",{ref_key:"settledTextEl",ref:m},F(f.value),513),[[Go,u.value!==""]]),ai(A("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[Go,u.value!==""]]),c.value?(k(),L("span",{key:0,class:Re(["text-node-stream-delta",[C.value]]),onAnimationend:w},F(c.value),35)):ee("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function fg(e,t,n){return lt({name:e,inheritAttrs:!1,setup(i,{attrs:o,slots:s}){var r,l;const a=S7(),u=A7(),c=x7(),d=typeof window<"u"&&((l=(r=ps())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=V(typeof window>"u"||d||!c.value),h=Ka(null);let m=null;function g(v){const y=v&&"$el"in v?v.$el:v;h.value=y instanceof HTMLElement?y:null}return typeof window<"u"&&We([h,c],([v,y],b,w)=>{if(m?.destroy(),m=null,!y||f.value)return void(f.value=!0);if(!v)return;let C=!0;const T=a(v,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=T,f.value=T.isVisible.value,T.whenVisible.then(()=>{C&&m===T&&(f.value=!0)}),w(()=>{C=!1,T.destroy(),m===T&&(m=null)})},{immediate:!0}),ti(()=>{m?.destroy(),m=null}),()=>Tn(f.value?t:n,Dn(Dt({},o),{ref:g}),s)}})}Wo.install=e=>{e.component(Wo.__name,Wo)};const a4=lt({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var i,o,s,r,l,a,u;const c=Ok(String((o=(i=n.node)==null?void 0:i.language)!=null?o:"")),d=cL[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):cL[""]),f=I2e(n.node),h=T2e(String((r=(s=n.node)==null?void 0:s.raw)!=null?r:""),d,f),m=n.monacoOptions,g=f&&((l=n.estimatedDiffInline)!=null?l:_7(m??{},typeof window>"u"?0:window.innerWidth)),v=m?.diffAppearance,y=v==="dark"||v!=="light"&&n.isDark===!0,b=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,w=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:b===12?18:Math.max(12,Math.round(1.5*b)),C=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,T=f?0:8,N=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:T,I=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:T,S=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",_=Dt(Dt({fontSize:`${b}px`,lineHeight:`${w}px`,tabSize:C,paddingTop:`${N}px`,paddingBottom:`${I}px`,"--markstream-pre-line-number-top":`${N}px`},f?{"--markstream-pre-diff-line-height":`${w}px`}:{}),S?{"--markstream-code-font-family":S}:{}),x=()=>Tn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[Tn("svg",{class:"action-icon",width:"14",height:"14"})]),E=n.isShowPreview!==!1&&(c==="html"||c==="svg"),M=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||E&&n.showPreviewButton!==!1,R=z=>{if(z!=null)return typeof z=="number"?`${z}px`:String(z)},q=Dt(Dt(Dt({"--markstream-code-layout-character-width":"1ch"},R(n.minWidth)?{minWidth:R(n.minWidth)}:{}),R(n.maxWidth)?{maxWidth:R(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--markstream-code-fallback-bg, var(--code-bg, #fff))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return Tn("div",Dn(Dt({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":y,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[q,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:Tn("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[Tn("div",{class:"code-header-main",style:{minWidth:0,flex:"1 1 auto",display:"flex",alignItems:"center",gap:"var(--ms-gap-header-main, 0.625rem)",overflow:"hidden"}},[Tn("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",style:{display:"inline-flex",width:"1rem",height:"1rem",flex:"0 0 auto"}}),Tn("div",{class:"code-header-copy",style:{minWidth:0,display:"grid",gap:"2px"}},[Tn("div",{class:"code-header-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--ms-text-label, 0.75rem)",fontWeight:"500",color:"var(--code-action-fg)"}},h.title),h.caption?Tn("div",{class:"code-header-caption",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.75rem",color:"var(--code-line-number)"}},h.caption):null])]),Tn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?Tn("div",{class:"code-diff-stats","aria-hidden":"true"},[Tn("span",{class:"code-diff-stat removed"},"-0"),Tn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:x(),n.showCollapseButton===!1?null:x(),M?Tn("div",{class:"relative"},[x()]):null])]),Tn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Tn(ol,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:g,diffHideUnchangedRegions:f?M2e(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:_,"data-markstream-code-loading":"1"})]),Tn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Tn("div",{class:"loading-skeleton"},[Tn("div",{class:"skeleton-line"}),Tn("div",{class:"skeleton-line"}),Tn("div",{class:"skeleton-line short"})])]),Tn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),k8=fg("ViewportDeferredCodeBlockNode",wu({loader:()=>fo(null,null,function*(){try{return(yield Yo(()=>import("./CodeBlockNode-TQKPIcUp.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer (or "stream-monaco" as a fallback).',e),ol}}),loadingComponent:a4,delay:0,suspensible:!1}),a4),Za=wu(()=>fo(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,i,o,s;return Tn(Wo,Dn(Dt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))};try{return yield fH(),(yield Yo(()=>import("./index7-ClRJOaWc.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,i,o,s;return Tn(Wo,Dn(Dt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))}})),_H=wu(()=>fo(null,null,function*(){try{return yield fH(),(yield Yo(()=>import("./index6-RUyA_B9p.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,i,o;return Tn(Wo,Dn(Dt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(i=e.node.content)!=null?i:""}$$`}}))}})),Hr=$i(lt({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(k(),L("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=i=>t.$emit("click",i,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=i=>t.$emit("mouseEnter",i,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=i=>t.$emit("mouseLeave",i,e.node.id,e.messageId,e.threadId))},F(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Hr.install=e=>{e.component(Hr.__name,Hr)};const P2e={class:"superscript-node"},dl=$i(lt({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,strong:Wr,emphasis:Vr,footnote_reference:Rl,strikethrough:qr,highlight:Ol,insert:hl,subscript:fl,emoji:cl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("sup",P2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"superscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);dl.install=e=>{e.component(dl.__name,dl)};const z2e={class:"subscript-node"},fl=$i(lt({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,strong:Wr,emphasis:Vr,footnote_reference:Rl,strikethrough:qr,highlight:Ol,insert:hl,superscript:dl,emoji:cl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("sub",z2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"subscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);fl.install=e=>{e.component(fl.__name,fl)};const j2e={class:"strong-node"},Wr=$i(lt({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,emphasis:Vr,strikethrough:qr,highlight:Ol,insert:hl,subscript:fl,superscript:dl,emoji:cl,footnote_reference:Rl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("strong",j2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"strong"}-${l}`,components:i.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Wr.install=e=>{e.component(Wr.__name,Wr)};const H2e={class:"strikethrough-node"},qr=$i(lt({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,strong:Wr,emphasis:Vr,highlight:Ol,insert:hl,subscript:fl,superscript:dl,emoji:cl,footnote_reference:Rl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("del",H2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"strikethrough"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);qr.install=e=>{e.component(qr.__name,qr)};const W2e=["href","title","aria-label","aria-hidden","target","rel"],q2e=["aria-hidden"],U2e={class:"link-text-wrapper relative inline-flex"},V2e={class:"leading-[normal] link-text"},Ur=$i(lt({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Jt("markstreamShowTooltips",void 0),i=D(()=>{const y=n?.value;return typeof y=="boolean"?y:t.showTooltip}),o=D(()=>{var y,b,w,C,T;const N=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",I=(y=t.animationOpacity)!=null?y:.35,S=Math.max(.12,Math.min(.5*I,I)),_={"--underline-height":`${(b=t.underlineHeight)!=null?b:2}px`,"--underline-bottom":N,"--underline-opacity":String(I),"--underline-rest-opacity":String(S),"--underline-duration":`${(w=t.animationDuration)!=null?w:1.6}s`,"--underline-timing":(C=t.animationTiming)!=null?C:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(T=t.animationIteration)!=null?T:"infinite"};return t.color&&(_["--link-color"]=t.color),_}),s=gs(()=>t.customId),r=D(()=>Dt({text:Wo,strong:Wr,strikethrough:qr,emphasis:Vr,image:Sd,html_inline:$l,inline_code:xr},s.value)),l=q1(),a=D(()=>{var y,b;const w=(y=t.node)==null?void 0:y.attrs;if(!w||typeof w!="object")return{};const C={};if(Array.isArray(w))for(const T of w)Array.isArray(T)&&T[0]&&(C[String(T[0])]=String((b=T[1])!=null?b:""));else for(const[T,N]of Object.entries(w))T&&N!=null&&N!==!1&&(C[T]=N===!0?"":String(N));return AL(C,"safe","a")}),u=D(()=>Dt(Dt({},l),a.value)),c=D(()=>{var y,b;return AL({href:String((b=(y=t.node)==null?void 0:y.href)!=null?b:"")},"safe","a").href}),d=D(()=>{if(!c.value)return;const y=u.value.target;return(typeof y=="string"?y.trim():String(y??"").trim())||(Ihe(c.value)?"_blank":void 0)}),f=D(()=>{var y;return String((y=d.value)!=null?y:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!c.value)return;const y=u.value.rel,b=new Set((typeof y=="string"?y:String(y??"")).split(/\s+/).filter(Boolean)),w=new Set(Array.from(b).filter(C=>C.toLowerCase()!=="opener"));return f.value&&(w.add("noopener"),w.add("noreferrer")),w.size>0?Array.from(w).join(" "):void 0}),m=D(()=>{const y=Dt({},u.value);return delete y.title,delete y.href,delete y.target,delete y.rel,y});function g(){i.value&&f2e()}const v=D(()=>{var y,b;const w=(y=t.node)==null?void 0:y.title;return typeof w=="string"&&w.trim().length>0?w:String((b=c.value)!=null?b:"")});return(y,b)=>{var w,C;return e.node.loading?(k(),L("span",ui({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:o.value}),[A("span",U2e,[A("span",V2e,[U(p(Wo),{class:"leading-[normal] link-text",node:{type:"text",content:String((w=e.node.text)!=null?w:""),raw:String((C=e.node.text)!=null?C:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),b[1]||(b[1]=A("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,q2e)):(k(),L("a",ui({key:0,class:"link-node",href:c.value,title:i.value?"":v.value,"aria-label":`Link: ${v.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:o.value,onMouseenter:b[0]||(b[0]=T=>(function(N){var I,S,_,x;if(!i.value)return;const E=N,M=E?.clientX!=null&&E?.clientY!=null?{x:E.clientX,y:E.clientY}:void 0,R=((I=t.node)==null?void 0:I.title)||((S=c.value)!=null&&S.includes("xn--")&&((x=(_=t.node)==null?void 0:_.text)!=null&&x.includes("://"))?t.node.text:c.value)||"";d2e(N.currentTarget,R,"top",!1,M)})(T)),onMouseleave:g}),[(k(!0),L(De,null,Ct(e.node.children,(T,N)=>(k(),de(p(Pu),{key:`${e.indexKey||"emphasis"}-${N}`,components:r.value,node:T,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${N}`},null,8,["components","node","custom-id","index-key"]))),128))],16,W2e))}}}),[["__scopeId","data-v-367e6ca4"]]);Ur.install=e=>{e.component(Ur.__name,Ur)};const K2e={class:"insert-node"},hl=$i(lt({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,strong:Wr,emphasis:Vr,strikethrough:qr,highlight:Ol,subscript:fl,superscript:dl,emoji:cl,footnote_reference:Rl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("ins",K2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"insert"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);hl.install=e=>{e.component(hl.__name,hl)};const Z2e={class:"highlight-node"},Ol=$i(lt({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,strong:Wr,emphasis:Vr,strikethrough:qr,insert:hl,subscript:fl,superscript:dl,emoji:cl,footnote_reference:Rl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("mark",Z2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"highlight"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Ol.install=e=>{e.component(Ol.__name,Ol)};const G2e={class:"emphasis-node"},Vr=$i(lt({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,html_inline:$l,strong:Wr,strikethrough:qr,highlight:Ol,insert:hl,subscript:fl,superscript:dl,emoji:cl,footnote_reference:Rl,math_inline:Za,reference:Hr},n.value));return(o,s)=>(k(),L("em",G2e,[(k(!0),L(De,null,Ct(e.node.children,(r,l)=>(k(),de(p(Pu),{key:`${e.indexKey||"emphasis"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Vr.install=e=>{e.component(Vr.__name,Vr)};const Q2e={class:"hard-break"},_d=$i(lt({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("br",Q2e))}),[["__scopeId","data-v-50c58f70"]]);_d.install=e=>{e.component(_d.__name,_d)};const R0=lt({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Et({checkbox:Bl,checkbox_input:Bl,emoji:cl,emphasis:Vr,hardbreak:_d,highlight:Ol,inline_code:xr,insert:hl,link:Ur,reference:Hr,strikethrough:qr,strong:Wr,subscript:fl,superscript:dl,text:Wo}),i=gs(()=>t.customId),o=D(()=>{const s=i.value;return Object.keys(s).length>0?Dt(Dt({},n),s):n});return(s,r)=>(k(!0),L(De,null,Ct(e.nodes,(l,a)=>(k(),de(p(Pu),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function TC(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(TC)}function u4(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(TC))return e;if(!t||e.length!==1)return null;const i=e[0];if(i?.type!=="paragraph"||!Array.isArray(i.children))return null;const o=i.children;return(n||o.length>0)&&o.every(TC)?o:null}function Eh(e){var t,n;if(!e?.length)return null;let i="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;i+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return i}const Y2e=["cite"],J2e={key:0,dir:"auto",class:"paragraph-node"},X2e=["custom-id"],jy=$i(lt({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=gs(()=>t.customId),i=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),s=D(()=>u4(t.node.children,!i.value)),r=D(()=>t.fade!==!1||o.value?null:Eh(s.value));return ii("markstreamShowTooltips",D(()=>t.showTooltips)),ii("markstreamFade",D(()=>t.fade)),(l,a)=>(k(),L("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[s.value?(k(),L("p",J2e,[r.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(r.value),9,X2e)):(k(),de(p(R0),{key:1,nodes:s.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(k(),de(p(pl),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,Y2e))}}),[["__scopeId","data-v-abfecebc"]]);jy.install=e=>{e.component(jy.__name,jy)};const eye={class:"definition-list"},tye={class:"definition-term"},nye={class:"definition-desc"},Hy=$i(lt({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("dl",eye,[(k(!0),L(De,null,Ct(t.node.items,(o,s)=>(k(),L(De,{key:s},[A("dt",tye,[U(p(pl),{"index-key":`definition-term-${t.indexKey}-${s}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),A("dd",nye,[U(p(pl),{"index-key":`definition-desc-${t.indexKey}-${s}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[1]||(i[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Hy.install=e=>{e.component(Hy.__name,Hy)};const iye=["href","title"],Gg=$i(lt({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(i){var o;if(i.preventDefault(),typeof document>"u")return;const s=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(s);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(i,o)=>(k(),L("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,iye))}}),[["__scopeId","data-v-e1eb37b6"]]);Gg.install=e=>{e.component(Gg.__name,Gg)};const oye=["id"],sye={class:"flex-1"},Wy=lt({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[A("div",sye,[U(p(pl),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,oye))}});Wy.install=e=>{e.component(Wy.__name,Wy)};const rye=["custom-id"],EC=$i(lt({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=gs(()=>t.customId),i=Jt("markstreamFade",void 0),o=D(()=>i?.value!==!1||n.value.text?null:Eh(t.node.children)),s=D(()=>Dt({text:Wo,inline_code:xr,link:Ur,image:Sd,strong:Wr,emphasis:Vr,strikethrough:qr,highlight:Ol,insert:hl,subscript:fl,superscript:dl,emoji:cl,checkbox:Bl,checkbox_input:Bl,footnote_reference:Rl,hardbreak:_d,math_inline:Za,reference:Hr},n.value));return(r,l)=>(k(),de(Po(`h${e.node.level}`),ui({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:ce(()=>[o.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(o.value),9,rye)):(k(!0),L(De,{key:1},Ct(e.node.children,(a,u)=>(k(),de(p(Pu),{key:u,components:s.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),jk=EC;jk.install=e=>{e.component(EC.__name,EC)};const lye={key:0,dir:"auto",class:"paragraph-node"},aye=["custom-id"],uye={dir:"auto",class:"paragraph-node"},cye=["custom-id"],a1=$i(lt({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),i=gs(()=>t.customId),o=D(()=>!!i.value.paragraph),s=D(()=>!!i.value.text),r=D(()=>{var h;return u4((h=n.value)==null?void 0:h.children,!o.value)}),l=D(()=>{var h;if(o.value)return null;const m=(h=n.value)==null?void 0:h.children;if(!Array.isArray(m)||m.length<2)return null;const g=m[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const v=m.slice(1);if(!v.every(b=>b?.type==="list"))return null;const y=u4([g]);return y?{paragraphChildren:y,nestedLists:v}:null});function a(){return t.fade===!1&&!s.value}const u=D(()=>a()?Eh(r.value):null),c=D(()=>{var h;return a()?Eh((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return ii("markstreamShowTooltips",D(()=>t.showTooltips)),ii("markstreamFade",D(()=>t.fade)),(h,m)=>{var g,v;return k(),L("li",ui({class:"list-item",dir:"auto"},f.value),[r.value?(k(),L("p",lye,[u.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(u.value),9,aye)):(k(),de(p(R0),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(k(),L(De,{key:1},[A("p",uye,[c.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(c.value),9,cye)):(k(),de(p(R0),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(k(!0),L(De,null,Ct(l.value.nestedLists,(y,b)=>(k(),de(p(pl),{key:b,nodes:[y],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${b}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:m[0]||(m[0]=w=>h.$emit("copy",w))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(k(),de(p(pl),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(v=(g=n.value)==null?void 0:g.children)!=null?v:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=y=>h.$emit("copy",y))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);a1.install=e=>{e.component(a1.__name,a1)};const u1=$i(lt({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=gs(()=>e.customId),n=D(()=>t.value.list_item||a1);return(i,o)=>(k(),de(Po(e.node.ordered?"ol":"ul"),{class:Re(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:ce(()=>[(k(!0),L(De,null,Ct(e.node.items,(s,r)=>{var l;return k(),de(Po(n.value),ui({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:s,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>i.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);u1.install=e=>{e.component(u1.__name,u1)};const dye={key:2,class:"html-block-node__raw"},fye=["innerHTML"],hye={key:1,class:"html-block-node__placeholder"},Qg=$i(lt({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Jt("markstreamHtmlPolicy",void 0),i=Jt("markstreamNestedRendererProps",void 0),o=D(()=>{var M,R;return(R=(M=t.htmlPolicy)!=null?M:n?.value)!=null?R:"safe"}),s=D(()=>{var M,R;const q=(M=i?.value)!=null?M:{};return Dn(Dt({},q),{customId:(R=t.customId)!=null?R:q.customId,htmlPolicy:o.value})}),r=wu({loader:()=>Promise.resolve().then(()=>R7),suspensible:!1}),l=D(()=>{const M=$y(t.node.attrs,o.value);if(!M)return;const R=Ug(M);return Object.keys(R).length>0?R:void 0}),a=D(()=>{const M=String(t.node.tag||"").trim(),R=$y(t.node.attrs,o.value,M);if(!R)return;const q=Ug(R);return Object.keys(q).length>0?q:void 0}),u=gs(()=>t.customId),c=lt({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=V(null),f=V(typeof window>"u"),h=V(t.node.content),m=D(()=>Array.isArray(t.node.children)?t.node.children:[]),g=D(()=>String(t.node.tag||"div")),v=D(()=>{var M;if(g.value.trim().toLowerCase()!=="details"||(M=t.node.attrs)!=null&&M.some(([q])=>String(q).toLowerCase()==="open"))return null;const R=m.value[0];return R?.type==="html_block"&&String(R.tag||"").toLowerCase()==="summary"?R:null}),y=D(()=>{var M;return Eh((M=v.value)==null?void 0:M.children)}),b=D(()=>{const M=v.value;if(!M)return;const R=$y(M.attrs,o.value,"summary");if(!R)return;const q=Ug(R);return Object.keys(q).length>0?q:void 0}),w=D(()=>y.value==null?m.value:m.value.slice(1)),C=D(()=>{const M=g.value.trim().toLowerCase();return Vz.has(M)||v7(M,o.value)}),T=D(()=>m.value.length>0&&!!t.node.tag&&!C.value),N=D(()=>{var M,R,q;if(T.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(M=h.value)!=null?M:""};const z=(R=h.value)!=null?R:t.node.content;if(!z)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:l1(z,o.value)};if(t.node.loading){const B=l4(z,u.value,o.value);return B===null?{mode:"text",content:(q=t.node.raw)!=null?q:z}:{mode:"dynamic",nodes:B}}if(!kH(z,u.value))return{mode:"html",content:l1(z,o.value)};const O=l4(z,u.value,o.value);return O===null?{mode:"html",content:l1(z,o.value)}:{mode:"dynamic",nodes:O}}),I=S7(),S=A7(),_=x7(),x=Ka(null),E=!!t.node.loading;return typeof window<"u"?(We([()=>d.value,()=>S?.value.heavyBlockMargin,()=>S?.value.rootMargin],([M],R,q)=>{var z,O,B,P;if((O=(z=x.value)==null?void 0:z.destroy)==null||O.call(z),x.value=null,!E)return f.value=!0,void(h.value=t.node.content);if(!M)return void(f.value=!1);let H=!0;const j=(P=(B=S?.value.heavyBlockMargin)!=null?B:S?.value.rootMargin)!=null?P:Th,Z=I(M,{rootMargin:j,allowIdle:!_.value});x.value=Z,f.value=f.value||Z.isVisible.value,Z.whenVisible.then(()=>{H&&x.value===Z&&(f.value=!0)}),q(()=>{H=!1,Z.destroy(),x.value===Z&&(x.value=null)})},{immediate:!0}),We(()=>t.node.content,M=>{E&&!f.value||(h.value=M)})):f.value=!0,ti(()=>{var M,R;(R=(M=x.value)==null?void 0:M.destroy)==null||R.call(M),x.value=null}),(M,R)=>(k(),de(Po(T.value?g.value:"div"),ui({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(_)&&!f.value?"true":void 0},T.value?a.value:void 0),{default:ce(()=>[f.value?(k(),L(De,{key:0},[N.value.mode==="structured"?(k(),L(De,{key:0},[y.value!==null?(k(),L(De,{key:0},[A("summary",VG(L$(b.value)),F(y.value),17),w.value.length?(k(),de(p(r),ui({key:0},s.value,{nodes:w.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ee("",!0)],64)):(k(),de(p(r),ui({key:1},s.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):N.value.mode==="dynamic"?(k(),de(p(c),{key:1,nodes:N.value.nodes},null,8,["nodes"])):N.value.mode==="text"?(k(),L("pre",dye,F(N.value.content),1)):(k(),L("div",ui({key:3},l.value,{innerHTML:N.value.content}),null,16,fye))],64)):(k(),L("div",hye,[Un(M.$slots,"placeholder",{node:e.node},()=>[R[0]||(R[0]=A("span",{class:"html-block-node__placeholder-bar"},null,-1)),R[1]||(R[1]=A("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),R[2]||(R[2]=A("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Qg.install=e=>{e.component(Qg.__name,Qg)};const pye={dir:"auto",class:"paragraph-node"},mye=["custom-id"],gh=$i(lt({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=gs(()=>t.customId),i=Jt("markstreamHtmlPolicy",void 0),o=Jt("markstreamFade",void 0),s=Jt("markstreamParseOptions",void 0),r=Jt("markstreamCustomMarkdownIt",void 0),l=Jt("markstreamNestedRendererProps",void 0),a=D(()=>{var S;return(S=i?.value)!=null?S:"safe"}),u=D(()=>{var S;return(S=t.parseOptions)!=null?S:s?.value}),c=D(()=>{var S;return(S=t.customMarkdownIt)!=null?S:r?.value}),d=D(()=>{var S,_;return(_=t.customHtmlTags)!=null?_:(S=l?.value)==null?void 0:S.customHtmlTags}),f=D(()=>{var S,_;const x=(S=l?.value)!=null?S:{};return Dn(Dt({},x),{customId:(_=t.customId)!=null?_:x.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=wu({loader:()=>Promise.resolve().then(()=>R7),suspensible:!1});function m(S){var _;return S.type==="text"&&String((_=S.content)!=null?_:"").trim()===""}const g=D(()=>t.node.children.filter(S=>!m(S))),v=D(()=>g.value.length>0&&g.value.every(S=>S.type==="image"||(function(_){var x;const E=(function(M){return M.type==="link"&&Array.isArray(M.children)?M.children.filter(R=>!m(R)):[]})(_);return E.length===1&&((x=E[0])==null?void 0:x.type)==="image"})(S))),y=D(()=>new Set(qh(d.value))),b=D(()=>{if(!v.value||g.value.length<=1)return t.node.children;const S=[];for(let _=0;_0,M=t.node.children.slice(_+1).some(R=>!m(R));E&&M&&S.push(Dn(Dt({},x),{content:" ",raw:" "}))}return S}),w=D(()=>o?.value===!1&&!n.value.text),C=D(()=>w.value?Eh(b.value):null);function T(S,_){return{node:S,"index-key":`${t.indexKey}-${_}`,"custom-id":t.customId,"custom-html-tags":d.value}}const N=D(()=>Dt({inline_code:xr,image:Sd,link:Ur,hardbreak:_d,emphasis:Vr,strong:Wr,strikethrough:qr,highlight:Ol,insert:hl,subscript:fl,superscript:dl,html_inline:$l,html_block:Qg,emoji:cl,checkbox:Bl,math_inline:Za,checkbox_input:Bl,reference:Hr,footnote_anchor:Gg,footnote_reference:Rl,text:Wo},n.value)),I=D(()=>b.value.map((S,_)=>{var x;const E=(function(M){var R,q,z,O;if(M.type==="html_block"||M.type==="html_inline"){const B=String((R=M.tag)!=null?R:"").trim().toLowerCase()||Yz(M.content);if(B&&!y.value.has(B)&&Jz((q=M.content)!=null?q:M.raw,B)){const P=String((O=(z=M.content)!=null?z:M.raw)!=null?O:"");return{child:{type:"text",content:P,raw:P},component:Wo,isCustomComponent:!1}}}return{child:M,component:N.value[M.type],isCustomComponent:!!(n.value[M.type]&&!xv(String(M.type)))}})(S);return Dn(Dt({},E),{index:_,key:`${t.indexKey||"paragraph"}-${_}`,customAttrs:E.isCustomComponent?C7(E.child,a.value):void 0,hasSlotChildren:Array.isArray(E.child.children)&&E.child.children.length>0,slotContent:String((x=E.child.content)!=null?x:""),originalChild:S})}));return(S,_)=>(k(),L("p",pye,[C.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(C.value),9,mye)):(k(!0),L(De,{key:1},Ct(I.value,x=>{return k(),L(De,{key:x.key},[v.value&&m(x.originalChild)?(k(),L(De,{key:0},[$e(F((E=x.originalChild,String((M=E.content)!=null?M:""))),1)],64)):x.isCustomComponent?(k(),de(Po(x.component),ui({key:1,ref_for:!0},x.customAttrs,{node:x.child,loading:x.child.loading,"index-key":x.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:ce(()=>[x.hasSlotChildren?(k(),de(p(h),ui({key:0,ref_for:!0},f.value,{nodes:x.child.children,"index-key":x.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):x.slotContent?(k(),de(p(h),ui({key:1,ref_for:!0},f.value,{content:x.slotContent,final:!x.child.loading,"index-key":`${x.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(k(),de(Po(x.component),ui({key:2,ref_for:!0},T(x.child,x.index)),null,16))],64);var E,M}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);gh.install=e=>{e.component(gh.__name,gh)};const gye={class:"table-node-wrapper"},vye=["aria-busy"],yye={key:0},kye=["custom-id"],bye=["aria-label","onPointerdown"],wye=["custom-id"],Cye={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Yg=$i(lt({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var y;return(y=t.node.loading)!=null&&y}),i=D(()=>{var y;return(y=t.node.rows)!=null?y:[]}),o=V(null),s=V([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>s.value.some(y=>Number.isFinite(y)&&y>0)),u=D(()=>a.value?s.value.map(y=>y>0?{width:`${y}px`}:void 0):[]);ii("markstreamShowTooltips",D(()=>t.showTooltips)),ii("markstreamFade",D(()=>t.fade));const c=gs(()=>t.customId),d=D(()=>!!c.value.text),f=D(()=>!!c.value.paragraph),h=new WeakMap;function m(y){const b=t.fade===!1&&!d.value,w=!f.value,C=h.get(y);if(C?.children===y.children&&C.textFastPath===b&&C.paragraphFastPath===w)return C.info;const T=u4(y.children,w,!0),N={simpleChildren:T,plainText:T&&b?Eh(T):null};return h.set(y,{children:y.children,textFastPath:b,paragraphFastPath:w,info:N}),N}function g(y){if(!r)return;y.preventDefault();const b=r.startWidth+r.nextStartWidth,w=Math.min(48,Math.floor(b/2)),C=Math.max(w,Math.min(b-w,Math.round(r.startWidth+y.clientX-r.startX))),T=[...r.widths];T[r.index]=C,T[r.index+1]=b-C,s.value=T}function v(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),r=null)}return We(l,()=>{v(),s.value=[]}),ti(v),(y,b)=>(k(),L("div",gye,[A("table",{ref_key:"tableRef",ref:o,class:Re(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(k(),L("colgroup",yye,[(k(!0),L(De,null,Ct(e.node.header.cells,(w,C)=>(k(),L("col",{key:C,style:on(u.value[C])},null,4))),128))])):ee("",!0),A("thead",null,[A("tr",null,[(k(!0),L(De,null,Ct(e.node.header.cells,(w,C)=>(k(),L("th",{key:C,dir:"auto",class:Re([w.align==="right"?"text-right":w.align==="center"?"text-center":"text-left"])},[m(w).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(m(w).plainText),9,kye)):m(w).simpleChildren?(k(),de(p(R0),{key:1,nodes:m(w).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${C}`},null,8,["nodes","custom-id","index-key"])):(k(),de(p(pl),{key:2,nodes:w.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[0]||(b[0]=T=>y.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),C(function(N,I){if(I.button!==0)return;const S=(function(){var E;const M=(E=o.value)==null?void 0:E.querySelectorAll("thead th");return Array.from(M??[],R=>Math.round(R.getBoundingClientRect().width))})(),_=S[N],x=S[N+1];_&&x&&(I.preventDefault(),r={index:N,startX:I.clientX,startWidth:_,nextStartWidth:x,widths:S},s.value=S,window.addEventListener("pointermove",g),window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v))})(C,T)},null,40,bye)):ee("",!0)],2))),128))])]),A("tbody",null,[(k(!0),L(De,null,Ct(i.value,(w,C)=>(k(),L("tr",{key:C},[(k(!0),L(De,null,Ct(w.cells,(T,N)=>(k(),L("td",{key:N,class:Re([T.align==="right"?"text-right":T.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(T).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},F(m(T).plainText),9,wye)):m(T).simpleChildren?(k(),de(p(R0),{key:1,nodes:m(T).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${C}-${N}`},null,8,["nodes","custom-id","index-key"])):(k(),de(p(pl),{key:2,nodes:T.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[1]||(b[1]=I=>y.$emit("copy",I))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,vye),U(ko,{name:"table-node-fade"},{default:ce(()=>[n.value?(k(),L("div",Cye,[Un(y.$slots,"loading",{isLoading:n.value},()=>[b[2]||(b[2]=A("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),b[3]||(b[3]=A("span",{class:"sr-only"},"Loading",-1))],!0)])):ee("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Yg.install=e=>{e.component(Yg.__name,Yg)};const Aye={class:"hr-node"},qy=$i({},[["render",function(e,t){return k(),L("hr",Aye)}],["__scopeId","data-v-39b2349c"]]);qy.install=e=>{e.component(qy.__name,qy)};const xye={class:"unknown-node"},LC=lt({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(k(),L("div",xye,F(e.node.raw),1))}),Uy=$i(lt({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),i=gs(()=>t.customId),o=D(()=>Dt({text:Wo,paragraph:gh,heading:jk,inline_code:xr,link:Ur,image:Sd,strong:Wr,emphasis:Vr,strikethrough:qr,insert:hl,subscript:fl,superscript:dl,checkbox:Bl,checkbox_input:Bl,hardbreak:_d,math_inline:Za,reference:Hr,list:u1,math_block:_H,table:Yg},i.value));return(s,r)=>(k(),L("div",ui({class:n.value},e.node.attrs),[(k(!0),L(De,null,Ct(e.node.children,(l,a)=>{return k(),de(Po((u=l.type,o.value[u]||LC)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);Uy.install=e=>{e.component(Uy.__name,Uy)};const Sye=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],NL=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function _ye(e){if(e<=255)return Sye[e];let t=0,n=NL.length-1;for(;t<=n;){const i=t+n>>1,o=NL[i];if(eo[1]))return o[2];t=i+1}}return"L"}const Mye=/[ \t\n\r\f]+/g,Iye=/[\t\n\r\f]| {2,}|^ | $/;let b8=null;const Tye=new RegExp("\\p{Script=Arabic}","u"),jd=new RegExp("\\p{M}","u"),M7=new RegExp("\\p{Nd}","u");function DL(e){return Tye.test(e)}function FL(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function Au(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(FL(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(FL(n))return!0}}return!1}const Eye=new Set([" "," ","⁠","\uFEFF"]),Lye=new Set(["-","‐","–","—"]);function MH(e,t){return!((function(n){const i=Jg(n);return i!==null&&Eye.has(i)})(e)||t&&((function(n){const i=Jg(n);return i!==null&&(I7.has(i)||Lh.has(i))})(e)||(function(n){const i=Jg(n);return i!==null&&Lye.has(i)})(e)))}const I7=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Hk=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),T7=new Set(["'","’"]),Lh=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Nye=new Set([":",".","،","؛"]),Dye=new Set(["၏"]),Fye=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Bye(e){if(E7(e))return!0;let t=!1;for(const n of e)if(Lh.has(n)||d4(n))t=!0;else if(!t||!jd.test(n))return!1;return t}function Rye(e){for(const t of e)if(!I7.has(t)&&!Lh.has(t))return!1;return e.length>0}function $ye(e){if(E7(e))return!0;for(const t of e)if(!(Hk.has(t)||T7.has(t)||jd.test(t)||d4(t)))return!1;return e.length>0}function E7(e){let t=!1;for(const n of e)if(n!=="\\"&&!jd.test(n)){if(!(Hk.has(n)||Lh.has(n)||T7.has(n)))return!1;t=!0}return t}function c4(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function Jg(e){if(e.length===0)return null;const t=c4(e,e.length);return e.slice(t)}const Oye=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function d4(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,i){for(let o=0;o=i[o]&&n<=i[o+1])return!0;return!1})(t,Oye)}function Pye(e){const t=(function(n){for(const i of n)if(!jd.test(i))return i;return null})(e);return t!==null&&M7.test(t)}function zye(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(jd.test(i))n--;else{if(!Hk.has(i)&&!T7.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function jye(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function BL(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const l=o.repeat(r);return e[i]=l,l}function RL(e,t){return e&&t!==null&&Nye.has(t)}function Hye(e){const t=Jg(e);return t!==null&&Dye.has(t)}function Wye(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function NC(e){let t=e.length;for(;t>0;){const n=c4(e,t),i=e.slice(n,t);if(Fye.has(i))return!0;if(!Lh.has(i))return!1;t=n}return!1}function qye(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` -`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const Uye=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ia(e){return e.length===1?e[0]:e.join("")}function Vye(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Ia(n)}function Kye(e,t,n,i){if(!Uye.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=qye(c,i),f=d==="text"&&t;s===null||d!==s||f!==a?(s!==null&&o.push({text:Ia(r),isWordLike:a,kind:s,start:l}),s=d,r=[c],l=n+u,a=f,u+=c.length):(r.push(c),u+=c.length)}return s!==null&&o.push({text:Ia(r),isWordLike:a,kind:s,start:l}),o}function w8(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Zye=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Gye(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Zye.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!e9e.has(e)&&!Xye.test(e)&&Jye.test(e)}function $L(e){let t=!1;for(const n of e)if(!jd.test(n)){if(!IH(n))return!1;t=!0}return t}function t9e(e,t,n,i){const o=!t&&$L(e),s=!i&&$L(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const f=c4(c,d),h=c.slice(f,d);if(!jd.test(h))return h;d=f}return null})(a);return u!==null&&d4(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=c4(a,u),d=a.slice(c,u);if(!jd.test(d))return IH(d)||d4(d);u=c}return!1})(e);return!!(o||s||l)&&!Au(e)&&!Au(n)&&(t||o||r)&&(i||s)}function OL(e){for(const t of e)if(M7.test(t))return!0;return!1}function Vy(e){if(e.length===0)return!1;for(const t of e)if(!M7.test(t)&&!Yye.has(t))return!1;return!0}function n9e(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let i=0;for(let o=0;o0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,u,c){var d,f,h;const m=(b8===null&&(b8=new Intl.Segmenter(void 0,{granularity:"word"})),b8);let g=0;const v=[],y=[],b=[],w=[],C=[],T=[],N=[],I=[],S=[],_=[],x=[],E=[];for(const O of m.segment(a))for(const B of Kye(O.segment,(d=O.isWordLike)!=null&&d,O.index,c)){let P=function(){T[X]!==null&&(y[X]=[BL(v,T,N,X)],T[X]=null),y[X].push(B.text),b[X]=b[X]||B.isWordLike,I[X]=I[X]||Z,S[X]=S[X]||ie,_[X]=Q,x[X]=te,E[X]=RL(S[X],W)};const H=B.kind==="text",j=jye(B.text,B.isWordLike,B.kind),Z=Au(B.text),ie=DL(B.text),W=Jg(B.text),Q=NC(B.text),te=Hye(B.text),X=g-1;u.carryCJKAfterClosingQuote&&H&&g>0&&w[X]==="text"&&Z&&I[X]&&_[X]||H&&g>0&&w[X]==="text"&&Rye(B.text)&&I[X]||H&&g>0&&w[X]==="text"&&x[X]?P():H&&g>0&&w[X]==="text"&&B.isWordLike&&ie&&E[X]?(P(),b[X]=!0):j!==null&&g>0&&w[X]==="text"&&T[X]===j?N[X]=((f=N[X])!=null?f:1)+1:H&&!B.isWordLike&&g>0&&w[X]==="text"&&!I[X]&&(Bye(B.text)||B.text==="-"&&b[X])?P():(v[g]=B.text,y[g]=[B.text],b[g]=B.isWordLike,w[g]=B.kind,C[g]=B.start,T[g]=j,N[g]=j===null?0:1,I[g]=Z,S[g]=ie,_[g]=Q,x[g]=te,E[g]=RL(ie,W),g++)}for(let O=0;Onull);let R=-1;for(let O=g-1;O>=0;O--){const B=v[O];if(B.length!==0){if(w[O]==="text"&&!b[O]&&R>=0&&w[R]==="text"&&($ye(B)||B==="-"&&Pye(v[R]))){const P=(h=M[R])!=null?h:[];P.push(B),M[R]=P,C[R]=C[O],v[O]="";continue}R=O}}for(let O=0;OZ+1){B.push(Ia(te)),P.push(ge),H.push("text"),j.push(O.starts[Z]),Z=X;continue}}B.push(ie),P.push(Q),H.push(W),j.push(O.starts[Z]),Z++}return{len:B.length,texts:B,isWordLike:P,kinds:H,starts:j}})((function(O){const B=[],P=[],H=[],j=[];for(let Z=0;Z1;for(let te=0;te=O.len||w8(O.kinds[W]))continue;const Q=[],te=O.starts[W];let X=W;for(;X0&&(B.push(Ia(Q)),P.push(!0),H.push("text"),j.push(te),Z=X-1)}return{len:B.length,texts:B,isWordLike:P,kinds:H,starts:j}})((function(O){const B=O.texts.slice(),P=O.isWordLike.slice(),H=O.kinds.slice(),j=O.starts.slice();for(let ie=0;ie=0&&!MH(u.texts[w-1],c)&&b(w),g<0&&(g=w),v=v||Au(C))}return b(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:m}})(s,r,t.breakKeepAllAfterPunctuation):r;return Dt({normalized:s,chunks:n9e(l,o)},l)}let mp=null;const PL=new Map;let gp=null;const o9e=new RegExp("\\p{Emoji_Presentation}","u"),s9e=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let C8=null;const zL=new Map;function DC(){if(mp!==null)return mp;if(typeof OffscreenCanvas<"u")return mp=new OffscreenCanvas(1,1).getContext("2d"),mp;if(typeof document<"u")return mp=document.createElement("canvas").getContext("2d"),mp;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Uc(e,t){let n=t.get(e);return n===void 0&&(n={width:DC().measureText(e).width,containsCJK:Au(e)},t.set(e,n)),n}function f4(){if(gp!==null)return gp;if(typeof navigator>"u")return gp={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},gp;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return gp={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},gp}function TH(){return C8===null&&(C8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),C8}function r9e(e){return o9e.test(e)||e.includes("️")}function Ef(e,t,n){return n===0?t.width:t.width-(function(i,o){return o.emojiCount===void 0&&(o.emojiCount=(function(s){let r=0;const l=TH();for(const a of l.segment(s))r9e(a.segment)&&r++;return r})(i)),o.emojiCount})(e,t)*n}function l9e(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function jL(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function HL(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function L7(e,t){return t===0?0:e+t}function c9e(e,t,n,i,o){return L7(i,t==="tab"?o+(function(s,r){return s.letterSpacing!==0&&s.spacingGraphemeCounts[r]>0?s.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function WL(e,t,n,i){return L7(i,t==="tab"?0:e.lineEndFitAdvances[n])}function qL(e,t,n,i,o){return L7(i,t==="tab"?o:e.lineEndPaintAdvances[n])}function d9e(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function f9e(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function j2(e,t,n){let i=t;for(;iP){if(ke!==null&&oe>K){X(ae,oe,le),ye=oe,we=j2(ke,we,ye+1),oe=-1,le=0;continue}X(),ue(ae,ye,Ae)}else j+=Ae,ie=ae,W=ye+1;else ue(ae,ye,Ae);const _e=ye+1;ke!==null&&ke[we]===_e&&(oe=_e,le=j,we++),ye++}Z&&ie===ae&&W===be.length&&(ie=ae+1,W=0)}let G=0;for(;G=q.length)));){const ae=q[G],K=jL(z[G]);if(Z)if(j+ae>P){if(K){se(G,ae),X(G+1,0,j-ae),G++;continue}if(Q>=0){if(ie>Q||ie===Q&&W>0){X();continue}X(Q,0,te);continue}if(ae>P&&O[G]!==null){X(),fe(G,0),G++;continue}X()}else se(G,ae),K&&(Q=G+1,te=j-ae),G++;else ae>P&&O[G]!==null?fe(G,0):ge(G,ae),K&&(Q=G+1,te=j-ae),G++}return Z&&X(),H})(n,i);const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:u}=n;if(o.length===0||u.length===0)return 0;const c=f4(),d=i+c.lineFitEpsilon;let f=0,h=0,m=!1,g=0,v=0,y=-1,b=0,w=null;function C(){y=-1,b=0,w=null}function T(M=g,R=v,q){f++,h=0,m=!1,C()}function N(M,R){m=!0,g=M+1,v=0,h=R}function I(M,R,q){m=!0,g=M,v=R+1,h=q}function S(M,R){m?(h+=R,g=M+1,v=0):N(M,R)}function _(M,R,q,z,O,B){if(!R)return;const P=WL(n,M,q,O);qL(n,M,q,O,z),y=q+1,b=h-B+P,w=M}function x(M,R){var q;const z=r[M],O=(q=l[M])!=null?q:null;let B=O===null?-1:j2(O,0,R+1),P=-1,H=R;for(;Hd){if(O!==null&&P>R){T(M,P),H=P,B=j2(O,B,H+1),P=-1;continue}T(),I(M,H,j)}else h=W,g=M,v=H+1}else I(M,H,j);const Z=H+1;O!==null&&O[B]===Z&&(P=Z,B++),H++}m&&g===M&&v===z.length&&(g=M+1,v=0)}function E(M){f++,C()}for(let M=0;M=R.endSegmentIndex)));){const z=s[q],O=jL(z),B=u9e(n,m,q),P=z==="tab"?a9e(h+B,n.tabStopAdvance):o[q],H=B+P,j=c9e(n,z,q,B,P);if(z!=="soft-hyphen")if(m){if(h+j>d){const Z=h+WL(n,z,q,B);if(qL(n,z,q,B,P),w==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){T(y,0);continue}if(O&&Z<=d){S(q,H),T(q+1,0),q++;continue}if(y>=0&&b<=d){if(g>y||g===y&&v>0){T();continue}const ie=y;T(ie,0),q=ie;continue}if(j>d&&r[q]!==null){T(),x(q,0),q++;continue}T();continue}S(q,H),_(z,O,q,P,B,H),q++}else j>d&&r[q]!==null?x(q,0):N(q,P),_(z,O,q,P,B,H),q++;else m&&(g=q+1,v=0,y=q+1,b=h+a,w=z),q++}m&&(R.consumedEndSegmentIndex,T(R.consumedEndSegmentIndex,0))}return f})(e,t)}let A8=null;function N7(){return A8===null&&(A8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),A8}function p9e(e,t){const n=[];let i=[],o=0,s=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,l=!1)}function u(d,f,h){i=[d],o=f,s=h,r=NC(d),l=Hk.has(d)}function c(d,f){i.push(d),s=s||f;const h=NC(d);r=d.length===1&&Lh.has(d)&&r||h,l=!1}for(const d of N7().segment(e)){const f=d.segment,h=Au(f);i.length!==0?l||I7.has(f)||Lh.has(f)||t.carryCJKAfterClosingQuote&&h&&r?c(f,h):s||h?(a(),u(f,d.index,h)):c(f,h):u(f,d.index,h)}return a(),n}function m9e(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(l){if(!(o<0)){if(s)o+1===l?i.push(t[o]):(function(a,u){const c=t[a].start,d=u=0&&!MH(t[l-1].text,n)&&r(l),o<0&&(o=l),s=s||Au(a.text)}return r(t.length),i}function UL(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=N7();for(const o of i.segment(e))n++;return n}function g9e(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function v9e(e,t,n,i,o){const s=f4(),{cache:r,emojiCorrection:l}=(function(E,M){DC().font=E;const R=(function(O){let B=PL.get(O);return B||(B=new Map,PL.set(O,B)),B})(E),q=(function(O){const B=O.match(/(\d+(?:\.\d+)?)\s*px/);return B?parseFloat(B[1]):16})(E),z=M?(function(O,B){let P=zL.get(O);if(P!==void 0)return P;const H=DC();H.font=O;const j=H.measureText("😀").width;if(P=0,j>B+.5&&typeof document<"u"&&document.body!==null){const Z=document.createElement("span");Z.style.font=O,Z.style.display="inline-block",Z.style.visibility="hidden",Z.style.position="absolute",Z.textContent="😀",document.body.appendChild(Z);const ie=Z.getBoundingClientRect().width;document.body.removeChild(Z),j-ie>.5&&(P=j-ie)}return zL.set(O,P),P})(E,q):0;return{cache:R,fontSize:q,emojiCorrection:z}})(t,(a=e.normalized,s9e.test(a)));var a;const u=Ef("-",Uc("-",r),l)+(o===0?0:2*o),c=8*Ef(" ",Uc(" ",r),l),d=o!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],m=[],g=[];let v=e.chunks.length<=1&&!d;const y=null,b=[],w=[],C=[],T=null,N=Array.from({length:e.len});function I(E,M,R,q,z,O,B,P,H){z!=="text"&&z!=="space"&&z!=="zero-width-break"&&(v=!1),f.push(M),h.push(R),m.push(q),g.push(z),b.push(B),w.push(P),d&&C.push(H)}function S(E,M,R,q,z){const O=Uc(E,r),B=d?UL(E,M):0,P=(function(ie,W,Q){return W>1?ie+(W-1)*Q:ie})(Ef(E,O,l),B,o),H=M==="space"||M==="preserved-space"||M==="zero-width-break"?0:P,j=H===0?0:H+(B>0?o:0),Z=M==="space"||M==="zero-width-break"?0:P;if(z&&q&&E.length>1){let ie="sum-graphemes";o!==0?ie="segment-prefixes":Vy(E)?ie="pair-context":s.preferPrefixWidthsForBreakableRuns&&(ie="segment-prefixes");const W=(function(te,X,ge,ue,se){if(X.breakableFitAdvances!==void 0&&X.breakableFitMode===se)return X.breakableFitAdvances;X.breakableFitMode=se;const fe=TH(),G=[];for(const be of fe.segment(te))G.push(be.segment);if(G.length<=1)return X.breakableFitAdvances=null,X.breakableFitAdvances;if(se==="sum-graphemes"){const be=[];for(const ke of G){const we=Uc(ke,ge);be.push(Ef(ke,we,ue))}return X.breakableFitAdvances=be,X.breakableFitAdvances}if(se==="pair-context"||G.length>96){const be=[];let ke=null,we=0;for(const oe of G){const le=Ef(oe,Uc(oe,ge),ue);if(ke===null)be.push(le);else{const ye=ke+oe,Ae=Uc(ye,ge);be.push(Ef(ye,Ae,ue)-we)}ke=oe,we=le}return X.breakableFitAdvances=be,X.breakableFitAdvances}const ae=[];let K="",re=0;for(const be of G){K+=be;const ke=Ef(K,Uc(K,ge),ue);ae.push(ke-re),re=ke}return X.breakableFitAdvances=ae,X.breakableFitAdvances})(E,O,r,l,ie),Q=W===null||i==="keep-all"?null:(function(te){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(te))return null;const X=[];let ge=0;for(const ue of N7().segment(te))ge++,g9e(ue.segment)&&X.push(ge);return X.length===0?null:X})(E);return void I(E,P,j,Z,M,R,W,Q,B)}I(E,P,j,Z,M,R,null,null,B)}for(let E=0;E=55296&&te<=56319&&Q+1=56320&&se<=57343&&(X=se-56320+(te-55296<<10)+65536,ge=2)}const ue=_ye(X);ue!=="R"&&ue!=="AL"&&ue!=="AN"||(P=!0);for(let se=0;se=0&&B[te]==="ET";te--)B[te]="EN";for(te=Q+1;te0?B[Q-1]:ie)!=="L"?"R":"L";if(X===((te{const e=globalThis;if(e[x8])return e[x8];const t={configs:{},controllers:{},revision:Ka(0),preparedCache:new Map,blockEstimateCache:new Map};return e[x8]=t,t})();let jm=null;const S8=Cs.revision;function VL(e){var t;return e&&(t=Cs.configs[e])!=null?t:null}function KL(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function k9e(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function _8(e){var t,n,i;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const s of e){if(!k9e(s))return null;s.type==="text"?o+=String((t=s.content)!=null?t:""):s.type==="emoji"?o+=String((i=(n=s.name)!=null?n:s.raw)!=null?i:""):s.type==="hardbreak"&&(o+=` -`)}return o.length>0?o:null}function M8(e,t,n){var i,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var s;if(jm!=null)return jm;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return jm=!!((s=r.getContext)!=null&&s.call(r,"2d")),jm}catch{return jm=!1,!1}})())return null;try{const s=Math.round(100*t)/100,r=[(i=n.whiteSpace)!=null?i:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,s,e].join("\0"),l=Cs.blockEstimateCache.get(r);if(l)return Cs.blockEstimateCache.delete(r),Cs.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",u=(function(h,m,g){const v=`${g}\0${m}\0${h}`,y=Cs.preparedCache.get(v);if(y)return Cs.preparedCache.delete(v),Cs.preparedCache.set(v,y),y.prepared;const b=(function(w,C,T){return(function(N,I,S,_){var x,E;const M=(x=_?.wordBreak)!=null?x:"normal",R=(E=_?.letterSpacing)!=null?E:0;return v9e(i9e(N,f4(),_?.whiteSpace,M),I,!1,M,R)})(w,C,0,T)})(h,m,{whiteSpace:g});for(Cs.preparedCache.set(v,{prepared:b});Cs.preparedCache.size>240;){const w=Cs.preparedCache.keys().next().value;if(!w)break;Cs.preparedCache.delete(w)}return b})(e,n.font,a),c=(function(h,m,g){const v=h9e(h,m);return{lineCount:v,height:v*g}})(u,Math.max(24,s-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,c.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Cs.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Cs.blockEstimateCache.size>4e3;){const h=Cs.blockEstimateCache.keys().next().value;if(!h)break;Cs.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function EH(e,t,n){var i,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const s=_8(e.children);return s&&n.paragraph?M8(s,t,n.paragraph):null}if(e.type==="heading"){const s=Number(e.level||0),r=_8(e.children),l=n.headings[s];return r&&l?M8(r,t,l):null}if(e.type==="list_item"){const s=Array.isArray(e.children)?e.children:[];if(s.length!==1||((i=s[0])==null?void 0:i.type)!=="paragraph"||!n.listItem)return null;const r=_8((o=s[0])==null?void 0:o.children);return r?M8(r,t,n.listItem):null}if(e.type==="list"){const s=Array.isArray(e.items)?e.items:[];if(!s.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of s){const a=EH(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function Hm(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function Lf(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function I8(e,t,n=0){return e.diff?_7(t??{},n)?(function(i){const o=Lf(i.raw);if(o){const s=o.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,s.filter(r=>!y9e.some(l=>r.startsWith(l))).length):Math.max(1,s.length)}return Hm(Lf(i.originalCode))+Hm(Lf(i.updatedCode))})(e):(function(i){const o=i.originalCode,s=i.updatedCode;if(o!=null||s!=null)return Math.max(Hm(Lf(o)),Hm(Lf(s)));const r=Lf(i.code).split(/\r?\n/);let l=0,a=0;for(const u of r)u.startsWith("+")&&!u.startsWith("+++")?a++:u.startsWith("-")&&!u.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):Hm(Lf(e.code,e.loading===!0))}function b9e(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function T8(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const i=window.getComputedStyle(t),o=e.offsetHeight,s=KL(i.lineHeight,1.5*KL(i.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:b9e(i),lineHeight:s,wrapperOverhead:Math.max(0,o-s),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const w9e=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function ZL(e,t={}){var n;const i={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return i;const s=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(s))w9e.has(r)||o.has(r)||l.enumerable&&"value"in l&&(i[r]=l.value);return i}function GL(e,t,n,i){var o;const s=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,s);if(!i.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,s-r),a=[-l,l];let u=a[0],c=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=i.getNormalizedScrollTop(e,t,!1),m=Math.abs(h-r);md&&(e.scrollTop=u)}function QL(e,t){let n=0,i=null,o=null;const s=()=>{const r=o;o=null,i=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);o=r,a<=0?(i&&(clearTimeout(i),i=null),n=l,o=null,e(...r)):i||(i=setTimeout(s,a))}}function YL(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const LH=Symbol("MarkstreamMathBlockMinHeightCache");function m9t(){return Jt(LH,null)}const C9e=new Set(["text","inline_code","emoji","footnote_reference"]),A9e=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function Wm(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function Nf(e,t,n,i=22){const o=String(e??"");if(!o)return n;const s=Math.max(18,Math.floor(Math.max(320,t)/8)),r=o.split(/\r?\n/).length,l=Math.ceil(o.length/s),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*i+12))}function NH(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(C9e.has(i))return!0;if(!A9e.has(i))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(NH)}function FC(e){var t,n,i,o,s,r,l,a;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((i=(n=u.content)!=null?n:u.raw)!=null?i:"");if(c==="inline_code")return String((r=(s=(o=u.code)!=null?o:u.content)!=null?s:u.raw)!=null?r:"");if(c==="emoji")return String((a=(l=u.name)!=null?l:u.raw)!=null?a:"");if(typeof u.text=="string")return u.text;const d=[];for(const f of["children","items","cells","rows"]){const h=u[f];if(Array.isArray(h)){const m=h.map(FC).filter(Boolean).join(" ");m&&d.push(m)}}return d.join(" ").replace(/\s+/g," ").trim()}function DH(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const i=t[n];return Array.isArray(i)&&i.some(DH)})}function x9e(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),i=e.split(/\r?\n/).length,o=Math.ceil(e.length/n),s=Math.max(1,i,o);return 30+26*Math.max(0,s-1)}function S9e(e,t){var n,i,o,s,r,l,a,u,c,d,f,h,m,g;if(!e||typeof e!="object")return 32;const v=e,y=String((n=v.type)!=null?n:""),b=Number.isFinite(t)&&t>0?t:640;switch(y){case"heading":return(function(w){var C;const T=Number((C=w.level)!=null?C:w.depth);return T>=4?20:T===3?30:T===2?32:44})(v);case"paragraph":return(function(w,C){const T=String(w??"");if(!T)return 28;const N=Math.max(18,Math.floor(Math.max(320,C)/8)),I=T.split(/\r?\n/).length,S=Math.ceil(T.length/N);return Math.max(1,I,S)<=1?28:Nf(T,C,34)})(String((o=(i=v.raw)!=null?i:v.content)!=null?o:""),b);case"list":return(function(w,C){var T;const N=Array.isArray(w.items)?w.items:[];if(!N.length)return 48;const I=Math.max(48,30*N.length+12);let S=12;for(const E of N)S+=x9e(FC(E)||String((T=E.raw)!=null?T:""),C);const _=Math.max(0,S-I);if(N.length>20){const E=Math.round(2.4*N.length);return Math.round(I+Math.max(E,Math.min(_,3*N.length)))}if(_<=0)return I;const x=N.length>8?8*N.length:_;return Math.round(I+Math.min(_,x))})(v,b);case"list_item":return Nf(String((r=(s=v.raw)!=null?s:v.content)!=null?r:""),b,34);case"blockquote":return Nf(String((a=(l=v.raw)!=null?l:v.content)!=null?a:""),b,56);case"table":return(function(w,C){const T=[...w.header?[w.header]:[],...Array.isArray(w.rows)?w.rows:[]];if(!T.length){const N=Array.isArray(w.children)?w.children.length:3;return Math.max(120,38*N+48)}return Math.max(120,Math.round(4+T.reduce((N,I)=>N+(function(S,_){const x=Math.max(1,S.length),E=Math.max(80,(_-32)/x),M=Math.max(10,Math.floor(E/8)),R=Math.max(1,...S.map(q=>{var z;const O=FC(q)||String((z=q?.raw)!=null?z:"");return Math.ceil(O.length/M)||1}));return 54+34*Math.max(0,R-1)+(x<=3&&S.some(DH)?14:0)})((function(S){var _;return Array.isArray(S?.cells)&&(_=S.cells)!=null?_:[]})(I),C),0)))})(v,b);case"code_block":{const w=String((u=v.language)!=null?u:"").trim().toLowerCase(),C=String((d=(c=v.code)!=null?c:v.raw)!=null?d:"");return w==="mermaid"?o4(n4(C)):w==="infographic"?s4(i4(C)):Nf(C,b,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(w,C){var T,N,I;const S=w.match(/^\s*]*)>/i);return S&&!/(?:^|\s)open(?:\s|=|$)/i.test((T=S[1])!=null?T:"")?Nf(((I=(N=w.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:N[1])==null?void 0:I.replace(/<[^>]*>/g,"").trim())||"Details",C,28,28):Nf(w,C,96)})(String((h=(f=v.raw)!=null?f:v.content)!=null?h:""),b);case"thematic_break":return 24;default:return Nf(String((g=(m=v.raw)!=null?m:v.content)!=null?g:""),b,40)}}function JL(e,t,n){return Math.min(Math.max(e,t),n)}const _9e=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],M9e=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],I9e=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),FH=["raw","content","code","originalCode","updatedCode"],XL=new WeakMap,eN=new WeakMap;let T9e=1;function Ma(){return typeof performance<"u"?performance.now():Date.now()}function tN(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Ll(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=XL.get(t);return n||(n=T9e++,XL.set(t,n)),String(n)}function nN(e,t,n,i={}){var o,s;const r=i.includeFinal!==!1,l={md:Ll(t),customMarkdownIt:Ll(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(s=e.streamParse)!=null?s:"auto",validateLink:Ll(e.validateLink),preTransformTokens:Ll(e.preTransformTokens),postTransformTokens:Ll(e.postTransformTokens),postTransformNodes:Ll(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function iN(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` -`,t-1)+1;return e.slice(n,t).trim()}function oN(e){const t=BH(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function BH(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function RH(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function D7(e){const t=String(e??"");return`${t.length}:${RH(t)}`}function BC(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?D7(r):`${r.length}:${RH(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Ll(e)}`;if(typeof e!="object")return typeof e;const i=e,o=t.get(i);if(o)return`cycle:${o}`;if(n>=6)return`object:${Ll(i)}`;const s=Ll(i);if(t.set(i,s),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>BC(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(u=>`${u}:${BC(r[u],t,n+1)}`).join(";")}`}return typeof e}function h4(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function $H(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>h4(i)?Hd(i,t,n+1):$H(i,t,n+1)).join(",")}`:h4(e)?Hd(e,t,n):BC(e,t,n)}function E9e(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!FH.includes(i)).map(i=>{const o=e[i];return typeof o=="string"?`${i}=s:${D7(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${i}=${String(o)}`:typeof o=="function"?`${i}=fn:${Ll(o)}`:I9e.has(i)&&(Array.isArray(o)||typeof o=="object")?`${i}=${$H(o,t,n+1)}`:o&&typeof o=="object"?`${i}=object:${Ll(o)}`:""}).filter(Boolean).join(";")}function L9e(e){return FH.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${D7(n)}`:""}).filter(Boolean).join(";")}function Hd(e,t=new WeakMap,n=0){const i=eN.get(e);if(i)return i;const o=e,s=t.get(o);if(s)return`node-cycle:${s}`;if(n>=6)return`node:${e.type}:${Ll(o)}`;const r=Ll(o);t.set(o,r);const l=(function(a,u,c){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(m=>Hd(m,u,c+1)).join("|"):"";return[a.type,L9e(d),E9e(d,u,c),f.length,h].join(":")})(e,t,n);return eN.set(o,l),l}function OH(e,t){return Hd(e)===Hd(t)}function F7(e,t,n){const i=Ma(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ma()-i,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function sN(e,t,n){return F7(t,n,()=>Hd(e))}function PH(e,t,n){return sN(e,n,"stabilizeSignatureMs")===sN(t,n,"stabilizeSignatureMs")}function H2(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function rN(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function lN(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function N9e(e,t){return e.length===t.length&&e===t}function B7(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const i=e,o=t,s=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(o).filter(c=>c!=="type"&&c!=="children").sort();if(s.length!==r.length)return!1;for(let c=0;c{i=B7(e,t)}),i??PH(e,t,n)}function B9e(e,t){const n={};for(const i of _9e){const o=e[i],s=t?.[i];typeof o=="number"&&(n[i]=o-(typeof s=="number"?s:0))}return n}function R9e(e,t){var n;const i=iL(t.instanceMsgId),o=new Map,s=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=V(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const f=(function(){let q="",z=0,O=!1,B=!1,P=!1,H=!1;function j(){q="",z=0,O=!1,B=!1,P=!1,H=!1}function Z(ie){let W=!1;for(let Q=0;Q{if(!ie||!W.startsWith(ie)||W.length<=ie.length)return j(),[!0,0];let Q=0;q!==ie&&(j(),Z(ie),Q=ie.length);const te=W.slice(ie.length),X=Z(te);return q=W,[X,Q+te.length]}})();let h,m=0,g=0,v=Ma(),y=-1,b=0;function w(q){y=Number.isInteger(q)?q:0,b+=1}function C(){h&&(clearTimeout(h),h=void 0)}function T(){C();const q=t.renderContent.value;r.value!==q&&(r.value=q),v=Ma()}We([t.renderContent,t.effectiveFinal,s],([q,z,O])=>{r.value!==q&&(!O||z||(function(B,P){if(!B&&P||P.length<=80||P.length\s*|`{3,}|~{3,})/.test(H))||H.endsWith(` -`)&&!(function(j){const Z=iN(j);if(oN(Z))return!1;const ie=BH(Z);return ie.length>=2&&ie.some(W=>W.trim())})(P))})(r.value,q)?T():(function(){if(g+=1,h)return;const B=Math.max(0,(function(P){const H=P.parseCoalesceMs;return typeof H=="number"&&Number.isFinite(H)&&H>=0?H:80})(e)-(Ma()-v));B<=0?T():h=setTimeout(T,B)})())},{flush:"sync",immediate:!0}),Gd(C);const N=D(()=>{var q,z,O,B;return Fhe(e.customHtmlTags,(q=e.parseOptions)==null?void 0:q.customHtmlTags,(B=(O=(z=t.customComponentsMap)==null?void 0:z.value)!=null?O:{},Object.entries(B).map(([P,H])=>{const j=va(P);return H==null||!j||xv(j)||Uz.has(j)||kv.has(j)?"":j}).filter(Boolean)))}),I=D(()=>{const{key:q,tags:z}=Bhe(N.value);if(!q)return i;const O=o.get(q);if(O)return O;const B=iL(t.instanceMsgId,{customHtmlTags:z});return o.set(q,B),B}),S=D(()=>{const q=I.value;if(!e.customMarkdownIt)return q;const z=e.customMarkdownIt(q);return q.__markstreamHasCustomParserExtensions=!0,z.__markstreamHasCustomParserExtensions=!0,z}),_=D(()=>{var q,z;const O=(q=e.parseOptions)!=null?q:{},B=t.effectiveFinal.value,P=N.value,H=B!=null,j=P.length>0;return H||j||O.streamParse==null?Dt(Dt(Dn(Dt({},O),{streamParse:(z=O.streamParse)==null||z}),H?{final:B}:{}),j?{customHtmlTags:P}:{}):O}),x=D(()=>{var q;return new Set(((q=_.value.customHtmlTags)!=null?q:[]).map(z=>String(z).trim().toLowerCase()).filter(Boolean))}),E=D(()=>nN(_.value,S.value,e.customMarkdownIt,{includeFinal:!0})),M=D(()=>nN(_.value,S.value,e.customMarkdownIt,{includeFinal:!1}));We([E,M],([q,z],[O,B])=>{O&&(q===O&&z===B||(T(),z!==B&&(l=[],c="")))},{flush:"sync"});const R=D(()=>{var q,z,O,B,P,H,j,Z,ie,W,Q;if((q=e.nodes)!=null&&q.length)return l=[],c="",w(0),Et(e.nodes.slice());const te=r.value;if(!te)return l=[],c="",w(-1),[];const X=t.debugPerformanceEnabled.value,ge=X?Ma():0,ue=S.value,se=E.value,fe=M.value;a&&se!==a&&(function(ze){var ft,gt;(gt=(ft=ze.stream)==null?void 0:ft.reset)==null||gt.call(ft)})(ue),u&&fe!==u&&(l=[],c="");const G=Object.keys((O=(z=t.customComponentsMap)==null?void 0:z.value)!=null?O:{}).length>0||typeof _.value.postTransformNodes=="function";G!==d&&(l=[],c="");const ae=!G&&l.length>0&&te.startsWith(c)&&fe===u,K=X?tN(ue):null,re=X?{}:void 0,be=lN(ue),ke=!be&&!G,we=Dt(Dt(Dn(Dt({},_.value),{__reuseStableTopLevelNodes:ke}),be?{__disableStreamParse:!0}:{}),re?{__timing:re}:{}),oe=Gj(te,ue,we),le=X?Ma():0,ye=X?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Ae,_e=X?H2(oe.length):void 0,pe=0,ne=0,Ee=0;if(ae){const ze=X?Ma():0,[ft,gt]=(function(Pt){var Ht,jt;const[Te,Fe]=Pt.scanGlobalReferenceAppend(Pt.previousContent,Pt.content),Ke=Pt.parseOptions;return[Pt.previousDirtyStartIndex>0&&Ke.final!==!0&&!Pt.customMarkdownIt&&!lN(Pt.md)&&!Te&&typeof Ke.preTransformTokens!="function"&&typeof Ke.postTransformTokens!="function"&&typeof Ke.postTransformNodes!="function"&&((jt=(Ht=Ke.customHtmlTags)==null?void 0:Ht.length)!=null?jt:0)===0?Pt.previousDirtyStartIndex:0,Fe]})({content:te,previousContent:c,previousDirtyStartIndex:y,parseOptions:_.value,customMarkdownIt:e.customMarkdownIt,md:ue,scanGlobalReferenceAppend:f});Ee=gt;const _t=ft<=0;if(ye){const Pt=(function(Ht,jt,Te,Fe={}){var Ke;if(!jt.length)return{nodes:Ht,metrics:H2(Ht.length)};const rt=(Ke=Fe.scanStartIndex)!=null?Ke:0,Nt=Fe.reuseDirtyTail!==!1,Lt=(function(en,it,dt,wt=0){const dn=Math.min(en.length,it.length);for(let Gt=Math.min(dn,Math.max(0,wt));GtHd(ze[_t]))})(Ae,ye,ne):(function(ze,ft=0){for(let gt=Math.max(0,ft);gt((P=K?.total)!=null?P:0);t.logPerf(ft?"parse(stream)":"parse(sync)",Dt(Dt(Dt({rendererId:t.instanceMsgId,ms:Math.round(Ma()-ge),nodes:Ae.length,contentLength:te.length,parseCommitCount:m,parseCoalescedCount:g,nodeReuseMs:qe,referenceDefinitionScanChars:Ee,signatureMs:(H=ye?.signatureMs)!=null?H:0,stabilizeSignatureMs:(j=ye?.stabilizeSignatureMs)!=null?j:0,primeSignatureMs:(Z=ye?.primeSignatureMs)!=null?Z:0,signatureCallCount:(ie=ye?.signatureCallCount)!=null?ie:0,stabilizeSignatureCallCount:(W=ye?.stabilizeSignatureCallCount)!=null?W:0,primeSignatureCallCount:(Q=ye?.primeSignatureCallCount)!=null?Q:0,stabilizeMs:pe},_e??{}),re?Object.fromEntries(M9e.map(gt=>{var _t;return[gt,(_t=re[gt])!=null?_t:0]})):{}),ze?{streamMode:ze.lastMode,streamDelta:B9e(ze,K),streamStats:ze}:{}))}return Et(Ae)});return{effectiveCustomHtmlTags:N,effectiveCustomHtmlTagsSet:x,mdBase:I,mdInstance:S,mergedParseOptions:_,getParsedNodesDirtyStartIndex:()=>y,getParsedNodesRevision:()=>b,parsedNodes:R}}function $9e(e){const{isClient:t}=e,n=V(new Set),i=new Map,o=new Map,s=new Map;function r(u){if(!t)return;const c=s.get(u);c!=null&&(window.clearTimeout(c),s.delete(u))}function l(){if(t)for(const u of s.values())window.clearTimeout(u);s.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:i,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:s,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((g=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!g)return;var m,g;const v=n.value,y=v.has(f);if(h){if(y)return;const w=new Set(v);return w.add(f),void(n.value=w)}if(!y)return;const b=new Set(v);b.delete(f),n.value=b})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f{const c=o.getSnapshot();t.value=c.source,n.value=c.visible,i.value=c.done},r=o.subscribe(s);s();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),u=D(()=>i.value&&a.value);return uv()&&Gd(()=>{r(),o.destroy()}),{source:t,visible:n,done:i,final:u,caughtUp:a,pendingChars:l,enqueue:c=>o.enqueue(c),finish:c=>o.finish(c),flush:()=>o.flush(),reset:c=>o.reset(c),pause:()=>o.pause(),resume:()=>o.resume()}}const P9e={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},aN=/auto|scroll|overlay/i;function z9e(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return aN.test(t)||aN.test(n)}function j9e(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const H9e={class:"m-0 p-0"},W9e=["data-probe"],q9e=$i(lt(Dn(Dt({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(i){var o,s;return(s=(o=t.headingNodes)==null?void 0:o[i])!=null?s:null}return(i,o)=>(k(),L("div",{class:"height-estimation-probes",style:on({width:`${e.width}px`}),"aria-hidden":"true"},[A("div",{ref:s=>e.setParagraphWrapper(s),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[U(p(gh),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),A("div",{ref:s=>e.setListItemWrapper(s),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[A("ul",H9e,[U(p(a1),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),A("div",{ref:s=>e.setListWrapper(s),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[U(p(u1),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(k(),L(De,null,Ct(6,s=>A("div",{key:`probe-heading-${s}`,ref_for:!0,ref:r=>e.setHeadingWrapper(s,r),class:Re(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${s}`},[U(p(jk),{node:n(s),"index-key":`probe-heading-${s}`},null,8,["node","index-key"])],10,W9e)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),uN=lt({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return s4((i=zp(e.estimatedPreviewHeightPx))!=null?i:i4(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Tn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?Tn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[Tn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Tn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Tn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Tn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>Tn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,Tn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Tn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Tn("div",{class:"absolute inset-0"},[Tn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),cN=lt({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return o4((i=zp(e.estimatedPreviewHeightPx))!=null?i:n4(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Tn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?Tn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[Tn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Tn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Tn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>Tn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Tn("span",{class:"action-icon block"})])))]):null,Tn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Tn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Tn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),U9e={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Rs(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const V9e=["data-custom-id"],K9e=["data-node-index","data-node-type"],dN="typewriter-simple-cursor-target",zH=$i(lt(Dn(Dt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const i=e,o=n;function s($){if(!(typeof Event<"u"&&$ instanceof Event))return typeof $=="string"&&o("copy-code",$),void o("copy",$)}const r=ps(),l=Jt("markstreamNestedRendererProps",void 0);function a($){const J=r?.vnode.props;return!!J&&(Object.prototype.hasOwnProperty.call(J,$)||Object.prototype.hasOwnProperty.call(J,String($).replace(/[A-Z]/g,he=>`-${he.toLowerCase()}`)))}function u($){var J,he;const me=i[$];return a($)?me:(he=(J=l?.value)==null?void 0:J[$])!=null?he:me}const c=D(()=>{return($=u("mode"))==="chat"||$==="minimal"||$==="docs"?$:"docs";var $}),d=D(()=>YL(u("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>u("domMode")==="minimal"?"minimal":"full"),m=D(()=>{return($={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":$.codeRenderer==="pre"||$.codeRenderer==="shiki"||$.codeRenderer==="monaco"?$.codeRenderer:$.renderCodeBlocksAsPre===!1||$.mode==="docs"?"monaco":"pre";var $}),g=D(()=>U9e[c.value]),v=D(()=>{var $;return($=u("showTooltips"))!=null?$:g.value.showTooltips}),y=D(()=>{var $;return($=u("fade"))!=null?$:g.value.fade}),b=D(()=>{var $;return($=u("batchRendering"))!=null?$:g.value.batchRendering}),w=D(()=>{var $;return($=u("initialRenderBatchSize"))!=null?$:g.value.initialRenderBatchSize}),C=D(()=>{var $;return($=u("renderBatchSize"))!=null?$:g.value.renderBatchSize}),T=D(()=>{var $;return($=u("renderBatchDelay"))!=null?$:g.value.renderBatchDelay}),N=D(()=>{var $;return($=u("renderBatchBudgetMs"))!=null?$:g.value.renderBatchBudgetMs}),I=D(()=>{var $;return($=u("renderBatchIdleTimeoutMs"))!=null?$:g.value.renderBatchIdleTimeoutMs}),S=D(()=>{var $;return($=u("deferNodesUntilVisible"))!=null?$:g.value.deferNodesUntilVisible}),_=D(()=>{var $;return($=u("maxLiveNodes"))!=null?$:g.value.maxLiveNodes}),x=D(()=>{var $;return($=u("liveNodeBuffer"))!=null?$:g.value.liveNodeBuffer}),E=D(()=>{var $;return($=u("nodeVirtual"))!=null?$:g.value.nodeVirtual}),M={get content(){return i.content},get nodes(){return i.nodes},get final(){return i.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return i.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return v.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return i.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return i.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return y.value},get batchRendering(){return b.value},get initialRenderBatchSize(){return w.value},get renderBatchSize(){return C.value},get renderBatchDelay(){return T.value},get renderBatchBudgetMs(){return N.value},get renderBatchIdleTimeoutMs(){return I.value},get deferNodesUntilVisible(){return S.value},get maxLiveNodes(){return _.value},get liveNodeBuffer(){return x.value},get nodeVirtual(){return E.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function R($){o("height-change",$)}function q($){o("virtual-state-change",$)}function z($){o("anchor-change",$)}const O=V(),B=V(null),P=V(null),H=V(null),j=po({1:null,2:null,3:null,4:null,5:null,6:null}),Z=V(!1),ie=new Map,W=V(0),Q=V(0),te=V({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function X($,J){return typeof $!="string"?J:$.trim()||J}function ge($){const J=Number($);return Number.isFinite(J)&&J>0?Math.max(1,Math.trunc(J)):640}const ue=D(()=>{var $;const J=($=M.viewportPriorityOptions)!=null?$:{},he=X(J.rootMargin,Th);return{rootMargin:he,heavyBlockMargin:X(J.heavyBlockMargin,he),maxTargets:ge(J.maxTargets)}}),se=D(()=>{var $;return($=ue.value.rootMargin)!=null?$:Th}),fe=D(()=>{var $;return($=ue.value.maxTargets)!=null?$:640});function G(){var $,J;if((($=i.virtualScroll)==null?void 0:$.enabled)!==!0)return null;const he=(J=i.virtualScroll)==null?void 0:J.scrollRoot;return ae(typeof he=="function"?he():he)}function ae($){return $?typeof HTMLElement<"u"&&$ instanceof HTMLElement?$:typeof $=="object"&&"value"in $?ae($.value):typeof $=="object"&&"$el"in $?ae($.$el):null:null}ii(AH,ue);const{isClient:K,renderAsFragment:re,debugPerformanceEnabled:be,resolvedShowTooltips:ke,resolvedHtmlPolicy:we,inheritedSmoothStreaming:oe,ownsTypewriterCursor:le}=(function($){const J=typeof window<"u",he=q1(),me=Jt("markstreamHtmlPolicy",void 0),Le=Jt("markstreamTypewriterCursor",void 0),Oe=Jt("markstreamSmoothStreaming",void 0),Ze=D(()=>$.renderAsFragment===!0),et=D(()=>!!($.debugPerformance&&J&&typeof console<"u")),mt=D(()=>{var pt;if(typeof $.showTooltips=="boolean")return $.showTooltips;const Qe=(pt=he.showTooltips)!=null?pt:he["show-tooltips"];return Qe===""||Qe===!0||Qe==="true"||Qe!==!1&&Qe!=="false"&&void 0}),tt=D(()=>{var pt,Qe;return(Qe=(pt=$.htmlPolicy)!=null?pt:me?.value)!=null?Qe:"safe"}),ut=D(()=>Le?.value!==!0);return{isClient:J,renderAsFragment:Ze,debugPerformanceEnabled:et,resolvedShowTooltips:mt,resolvedHtmlPolicy:tt,inheritedSmoothStreaming:Oe,inheritedTypewriterCursor:Le,ownsTypewriterCursor:ut}})(M),{resolveViewportRoot:ye,resolveScrollContainer:Ae,isReverseFlexScrollRoot:_e,getNormalizedScrollTop:pe,getOffsetTopWithinRoot:ne}=(function($,J){function he(){var et,mt;return(mt=(et=J.scrollRoot)==null?void 0:et.call(J))!=null?mt:null}function me(et){if(typeof window>"u")return null;const mt=he();if(mt)return mt;const tt=et??$.value;if(!tt)return null;const ut=tt.ownerDocument||document,pt=ut.scrollingElement||ut.documentElement;let Qe=tt;for(;Qe&&Qe!==ut.body&&Qe!==pt;){if(z9e(window.getComputedStyle(Qe))&&j9e(Qe))return Qe;Qe=Qe.parentElement}return null}function Le(et){if(!J.isClient)return!1;try{const mt=window.getComputedStyle(et);return!!(mt.display||"").toLowerCase().includes("flex")&&(mt.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Oe(et,mt,tt){var ut,pt;if(tt)return Ze(mt);const Qe=et.scrollTop;if(!Le(et))return Qe;const ct=Qe<0?-Qe:Qe;return Math.max(0,((ut=et.scrollHeight)!=null?ut:0)-((pt=et.clientHeight)!=null?pt:0))-ct}function Ze(et){var mt,tt,ut,pt,Qe;const ct=Number((mt=et.scrollingElement)==null?void 0:mt.scrollTop),At=Number((ut=(tt=et.documentElement)==null?void 0:tt.scrollTop)!=null?ut:0),yt=Number((Qe=(pt=et.body)==null?void 0:pt.scrollTop)!=null?Qe:0);return Math.max(0,Number.isFinite(ct)?ct:0,Number.isFinite(At)?At:0,Number.isFinite(yt)?yt:0)}return{resolveViewportRoot:me,resolveScrollContainer:function(et){var mt,tt,ut,pt;const Qe=he();if(Qe)return Qe;const ct=me((mt=et??$.value)!=null?mt:null);if(ct)return ct;const At=(pt=(ut=et?.ownerDocument)!=null?ut:(tt=$.value)==null?void 0:tt.ownerDocument)!=null?pt:typeof document<"u"?document:null;return At?.scrollingElement||At?.documentElement||null},isReverseFlexScrollRoot:Le,getNormalizedScrollTop:Oe,getOffsetTopWithinRoot:function(et,mt){const tt=mt.ownerDocument||et.ownerDocument||document;if((function(ct,At){return ct===At.documentElement||ct===At.body||ct===At.scrollingElement})(mt,tt))return et.getBoundingClientRect().top+Ze(tt);const ut=mt.getBoundingClientRect(),pt=et.getBoundingClientRect(),Qe=Oe(mt,tt,!1);return pt.top-ut.top+Qe}}})(O,{isClient:K,scrollRoot:G});ii("markstreamShowTooltips",ke),ii("markstreamHtmlPolicy",we),ii("markstreamTypewriter",f),ii("markstreamFade",D(()=>M.fade!==!1)),ii("markstreamTypewriterCursor",D(()=>!0)),ii("markstreamTextStreamState",ie),ii("markstreamStreamVersion",W),ii("markstreamParseOptions",D(()=>M.parseOptions)),ii("markstreamCustomMarkdownIt",D(()=>M.customMarkdownIt));const{smoothStreamingEnabled:Ee,renderContent:qe,requestedFinal:ze,effectiveFinal:ft}=(function($,J){const he=O9e(Dt(Dt({},P9e),$.smoothStreamingOptions)),me=D(()=>{var Qe,ct,At;return $.smoothStreaming!==!1&&!((Qe=$.nodes)!=null&&Qe.length)&&($.smoothStreaming===!0||!((ct=J.inheritedSmoothStreaming)!=null&&ct.value))&&($.smoothStreaming===!0||YL($.typewriter)!=="off"||((At=$.maxLiveNodes)!=null?At:0)<=0)}),Le=V(!J.isClient||$.smoothStreaming===!0);yn(()=>{Le.value=!0});const Oe=D(()=>Le.value&&me.value),Ze=D(()=>{var Qe;return Oe.value?he.visible.value:(Qe=$.content)!=null?Qe:""}),et=D(()=>{var Qe,ct;const At=(Qe=$.parseOptions)!=null?Qe:{};return(ct=$.final)!=null?ct:At.final}),mt=D(()=>{const Qe=et.value;return Oe.value&&Qe!=null?!!Qe&&he.caughtUp.value:Qe});let tt=0,ut=!1;function pt(){tt=0,ut=!1}return We([()=>$.content,()=>$.nodes,Oe,et],([Qe,ct,At,yt])=>{if(ct?.length)return pt(),void he.reset("");const Wt=Qe??"";if(!At)return pt(),he.reset(Wt),void(yt&&he.finish({flush:!0}));const It=he.source.value;if(Wt){if(Wt!==It)if(Wt.startsWith(It)){const tn=Wt.slice(It.length),un=he.pendingChars.value;tn.length<=8?(tt++,ut||tt>=2&&un<=8?(ut=!0,he.reset(Wt)):he.enqueue(tn)):(pt(),he.enqueue(tn))}else pt(),he.reset(Wt)}else pt(),he.reset("");yt&&he.finish()},{immediate:!0}),{smoothStream:he,smoothStreamingEligible:me,smoothStreamingEnabled:Oe,renderContent:Ze,requestedFinal:et,effectiveFinal:mt}})(M,{isClient:K,inheritedSmoothStreaming:oe}),gt=ze.value===!0;ii("markstreamSmoothStreaming",Ee);const _t=V(!1),Pt=V(!1),Ht=V(!1);let jt="",Te=!1,Fe=null;function Ke(){K&&Fe!=null&&(window.clearTimeout(Fe),Fe=null)}function rt(){_t.value=!1,Ke()}function Nt($,J){if(!be.value)return;const he=(function(){if(!be.value)return null;const me=it(Lt),Le=it(Qt),Oe=Math.max(en,Le);if(me<=0&&Oe<=0)return null;const Ze={total:me,maxPerFrame:Oe,byLabel:(et=Lt,Object.fromEntries(Array.from(et.entries()).sort((mt,tt)=>tt[1]-mt[1]||mt[0].localeCompare(tt[0]))))};var et;return Lt.clear(),Qt.clear(),en=0,Ze})();console.info(`[markstream-vue][perf] ${$}`,he?Dn(Dt({},J),{layoutReads:he}):J)}We([()=>M.indexKey,()=>M.customId],()=>{var $,J;rt(),Pt.value=!1,Ht.value=!(($=i.nodes)!=null&&$.length)&&ze.value!==!0&&!!i.content,jt=(J=qe.value)!=null?J:"",Te=jt.length>0},{flush:"sync"}),We([()=>i.content,()=>i.nodes,ze],([$,J,he])=>{!J?.length&&he!==!0&&$&&(Ht.value=!0)},{flush:"sync",immediate:!0}),We([qe,()=>i.nodes,ze],([$,J,he])=>{const me=$??"";return J?.length||he===!0?(rt(),Pt.value=!1,jt=me,void(Te=!0)):(me.length>0&&(Ht.value=!0),Te?(jt&&me.length>jt.length&&me.startsWith(jt)?(_t.value=!0,Pt.value=!0,K&&(Ke(),Fe=window.setTimeout(()=>{var Le;Fe=null,ft.value===!0||(Le=i.nodes)!=null&&Le.length||(op(),_t.value=!1,Wu())},1200))):(me.length"u")return null;const Oe=window;if(Oe.__markstreamLayoutReadPerformance)return Oe.__markstreamLayoutReadPerformance;const Ze={total:0,maxPerFrame:0,byLabel:{}};return Oe.__markstreamLayoutReadPerformance=Ze,Ze})();Le&&(Le.total=Number(Le.total||0)+1,Le.byLabel[me]=Number(Le.byLabel[me]||0)+1,Le.currentFrameTotal=Number(Le.currentFrameTotal||0)+1,Le.frameScheduled||(Le.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>wt(Le),0):queueMicrotask(()=>wt(Le)):window.requestAnimationFrame(()=>wt(Le))))})($),Ut||(Ut=!0,K&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(dt):typeof queueMicrotask!="function"?setTimeout(dt,0):queueMicrotask(dt)))}function Gt($,J){return dn($),J()}const ri=M.customId?`renderer-${M.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,ci=(function($){const J=new Map;return{scope:$,cache:J,clear:()=>J.clear()}})(ri),ji=ri;ii(LH,ci);const xi=gs(()=>M.customId),{effectiveCustomHtmlTagsSet:Uo,mergedParseOptions:ot,parsedNodes:Ue,getParsedNodesDirtyStartIndex:st,getParsedNodesRevision:_n}=R9e(M,{instanceMsgId:ri,renderContent:qe,effectiveFinal:ft,smoothStreamingEnabled:Ee,debugPerformanceEnabled:be,customComponentsMap:xi,logPerf:Nt});We(Ue,()=>{_t.value||ci.clear(),W.value+=1},{immediate:!0});const bt=D(()=>({customId:M.customId,customHtmlTags:ot.value.customHtmlTags,parseOptions:M.parseOptions,customMarkdownIt:M.customMarkdownIt,htmlPolicy:we.value,viewportPriority:M.viewportPriority,viewportPriorityOptions:ue.value,mode:c.value,domMode:M.domMode,codeRenderer:m.value,codeBlockStream:M.codeBlockStream,codeBlockDarkTheme:M.codeBlockDarkTheme,codeBlockLightTheme:M.codeBlockLightTheme,codeBlockMonacoOptions:M.codeBlockMonacoOptions,renderCodeBlocksAsPre:M.renderCodeBlocksAsPre,codeBlockMinWidth:M.codeBlockMinWidth,codeBlockMaxWidth:M.codeBlockMaxWidth,codeBlockProps:M.codeBlockProps,mermaidProps:M.mermaidProps,d2Props:M.d2Props,infographicProps:M.infographicProps,showTooltips:ke.value,themes:M.themes,langs:M.langs,isDark:M.isDark,typewriter:f.value,smoothStreamingOptions:M.smoothStreamingOptions,parseCoalesceMs:M.parseCoalesceMs,fade:M.fade}));ii("markstreamNestedRendererProps",bt);const Zn=D(()=>Ue.value),vs=D(()=>Ue.value.length),go=V(null),Ls=V(null),Hs=V(null),ys=V(null),Vo=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),Ti=!Vo&&M.customId?VL(M.customId):null,Tr=D(()=>Ti?(S8.value,VL(M.customId)):null),vo=D(()=>{var $;return!!(!re.value&&M.customId&&!Vo&&(($=Tr.value)!=null&&$.enabled))}),no=D(()=>!!(K&&vo.value)),_o=D(()=>{var $;return!!(!re.value&&(($=i.virtualScroll)!=null&&$.enabled))}),Er=D(()=>_o.value),Bo=V(!1);yn(()=>{Bo.value=!0});const Qn=D(()=>!!(K&&_o.value));ii("markstreamHostScrollManaged",Qn);const Zi=D(()=>!!(Bo.value&&Qn.value)),yi=D(()=>no.value||Qn.value),Hi=D(()=>no.value||Zi.value),io=D(()=>{var $;return yi.value&&(($=Tr.value)==null?void 0:$.textEstimation)!==!1});function ki(){const $=Q.value||Gt("getMeasuredContainerWidth.clientWidth",()=>{var J;return((J=O.value)==null?void 0:J.clientWidth)||0});return Number.isFinite($)&&$>0?$:0}const di=D(()=>{const $=ki();return $>0?Math.max(1,Math.round($)):640}),bi=D(()=>{var $,J;return!(ft.value!==!0||_o.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||($=i.nodes)!=null&&$.length||Ht.value||!(((J=M.maxLiveNodes)!=null?J:0)<=0))}),oo=D(()=>{var $;return bi.value?50:Math.max(1,($=M.maxLiveNodes)!=null?$:320)}),so=D(()=>{var $;return bi.value?16:Math.max(0,($=M.liveNodeBuffer)!=null?$:60)}),Mn=D(()=>{var $;return!re.value&&M.nodeVirtual!==!1&&!((($=M.maxLiveNodes)!=null?$:0)<=0&&!bi.value)&&(M.nodeVirtual===!0?Ue.value.length>0:Ue.value.length>oo.value)}),Ns=D(()=>Mn.value||no.value||Qn.value),Ws=D(()=>M.viewportPriority!==!1),Jo=D(()=>!!Ws.value&&!Z.value);var ks;ks=D(()=>Ws.value),ii(xH,ks);const ro=D(()=>{var $;return!(re.value||M.deferNodesUntilVisible===!1||(($=M.maxLiveNodes)!=null?$:0)<=0||Mn.value||Ue.value.length>900||M.viewportPriority===!1)}),eo=v2e($=>{var J;return ye((J=$??O.value)!=null?J:null)},Ws),{requestFrame:to,cancelFrame:Gi,hasIdleCallback:je,isTestEnv:xe}=(function($){const J=$.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,he=$.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,me=$.isClient&&typeof window.requestIdleCallback=="function",Le=(function(){var Oe;if(typeof globalThis>"u"||!("process"in globalThis))return;const Ze=(Oe=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Oe.value;return Ze?.env})();return{requestFrame:J,cancelFrame:he,hasIdleCallback:me,isTestEnv:Le?.NODE_ENV==="test"}})({isClient:K}),Pe=D(()=>ft.value===!0&&!_o.value),{resolvedBatchSize:rn,resolvedInitialBatch:Yn,batchingEnabled:ei,incrementalRenderingActive:Qi,renderedCount:Vn,previousRenderContext:qs,adaptiveBatchSize:bs,previousBatchConfig:Je}=(function($,J){var he;const me=D(()=>{var pt;const Qe=Math.trunc((pt=$.renderBatchSize)!=null?pt:80);return Number.isFinite(Qe)?Math.max(0,Qe):0}),Le=D(()=>{var pt;const Qe=Math.trunc((pt=$.initialRenderBatchSize)!=null?pt:me.value);return Number.isFinite(Qe)?Math.max(0,Qe):me.value}),Oe=D(()=>!J.renderAsFragment.value&&$.batchRendering!==!1&&me.value>0&&J.isClient&&!J.isTestEnv),Ze=V(0),et=V({key:$.indexKey,total:0}),mt=V(Math.max(1,me.value||1)),tt=D(()=>{var pt,Qe,ct;return Oe.value&&!((pt=J.continuousStreaming)!=null&&pt.value)&&!((Qe=J.forceFullRenderFinalContent)!=null&&Qe.value)&&((ct=$.maxLiveNodes)!=null?ct:0)<=0}),ut=V({batchSize:me.value,initial:Le.value,delay:(he=$.renderBatchDelay)!=null?he:16,enabled:tt.value});return{resolvedBatchSize:me,resolvedInitialBatch:Le,batchingEnabled:Oe,incrementalRenderingActive:tt,renderedCount:Ze,previousRenderContext:et,adaptiveBatchSize:mt,previousBatchConfig:ut}})(M,{isClient:K,isTestEnv:xe,renderAsFragment:re,forceFullRenderFinalContent:Pe,continuousStreaming:D(()=>Pt.value&&ft.value!==!0)}),Ve=D(()=>{var $;return!re.value&&M.batchRendering!==!1&&rn.value>0&&!xe&&(($=M.maxLiveNodes)!=null?$:0)<=0&&!Pe.value}),St=D(()=>Ve.value),Rt=D(()=>yi.value||St.value),Fn=D(()=>{var $;return Rt.value&&(($=Tr.value)==null?void 0:$.codeBlockEstimation)!==!1}),fi=new Map,Mo=new Map,Io=new WeakMap;let ni=null;const Ro=new WeakMap,mi=new Map,cr=[];let Ni=[],Us=[],Vs=-1;const Ds=Ka(cr),$o=new Set,zu=V(0);let Ks=0;const Ul=V(0),pf=D(()=>(Ul.value,Array.from(fi.entries()).sort(($,J)=>$[0]-J[0]))),Vl=V(null),Ko=V(null);let Fs,Cl=null,Ya=0,Lr=null;function lo(){Fs.markFallbackHeightPrefixDirty()}function Ja($){return Fs.getFallbackNodeHeight($)}function Zs($,J){return Fs.estimateHeightRange($,J)}function yo($){return Fs.estimateIndexForOffset($)}const{activeRestoreAnchor:Xo,getRelativeScrollTopWithinContainer:Yr,setRelativeScrollTopWithinContainer:Kl,resolveAnchorOffset:Zl,clearRestoreReconcile:Nr,scheduleRestoreReconcile:Al,captureRestoreAnchor:Xa,restoreAnchor:Gl,getAnchorDrift:ju}=(function($){const{isClient:J,containerRef:he,parsedNodeCount:me,requestFrame:Le,cancelFrame:Oe,resolveScrollContainer:Ze,getNormalizedScrollTop:et,getOffsetTopWithinRoot:mt,isReverseFlexScrollRoot:tt,estimateIndexForOffset:ut,estimateHeightRange:pt,getFallbackNodeHeight:Qe,clamp:ct}=$,At=V(null);let yt=null,Wt=[];function It(){const wn=Ze(),jn=he.value;if(!wn||!jn)return null;const Xn=wn.ownerDocument||jn.ownerDocument||document;if(wn===Xn.documentElement||wn===Xn.body||wn===Xn.scrollingElement){const Wi=jn.getBoundingClientRect();return Math.max(0,-Wi.top)}return Math.max(0,et(wn,Xn,!1)-mt(jn,wn))}function tn(wn){var jn;const Xn=Ze(),Wi=he.value;if(!Xn||!Wi)return;const Ys=Math.max(0,wn),Bs=Xn.ownerDocument||Wi.ownerDocument||document,Sa=Bs.defaultView||(typeof window<"u"?window:null);if(Xn===Bs.documentElement||Xn===Bs.body||Xn===Bs.scrollingElement){const iu=et(Xn,Bs,!0)+Wi.getBoundingClientRect().top;return void((jn=Sa?.scrollTo)==null||jn.call(Sa,0,Math.max(0,iu+Ys)))}GL(Xn,Bs,mt(Wi,Xn)+Ys,{isReverseFlexScrollRoot:iu=>{var Tm;return(Tm=tt?.(iu))!=null&&Tm},getNormalizedScrollTop:et})}function un(wn){const jn=me.value,Xn=ct(wn.nodeIndex,0,Math.max(0,jn-1));return pt(0,Xn)+Math.max(0,wn.offsetWithinNodePx)}function bn(){if(yt!=null&&(Oe?.(yt),yt=null),J)for(const wn of Wt)window.clearTimeout(wn);Wt=[]}function gn(wn){const jn=un(wn),Xn=It();Xn!=null&&Math.abs(Xn-jn)<=.5||tn(jn)}return{activeRestoreAnchor:At,getRelativeScrollTopWithinContainer:It,setRelativeScrollTopWithinContainer:tn,resolveAnchorOffset:un,clearRestoreReconcile:bn,applyRestoreAnchor:gn,scheduleRestoreReconcile:function(){At.value&&J&&yt==null&&(yt=Le?Le(()=>{yt=null,At.value&&gn(At.value)}):null,yt==null&&At.value&&gn(At.value))},captureRestoreAnchor:function(){const wn=It(),jn=me.value;if(wn==null||jn<=0)return null;const Xn=ct(ut(wn+1),0,jn-1),Wi=pt(0,Xn),Ys=Qe(Xn);return{nodeIndex:Xn,offsetWithinNodePx:ct(wn-Wi,0,Math.max(0,Ys-1))}},restoreAnchor:function(wn){const jn=me.value;if(At.value={nodeIndex:ct(wn.nodeIndex,0,Math.max(0,jn-1)),offsetWithinNodePx:Math.max(0,wn.offsetWithinNodePx)},bn(),gn(At.value),J)for(const Xn of[0,120,280,480])Wt.push(window.setTimeout(()=>{At.value&&gn(At.value)},Xn))},getAnchorDrift:function(wn){const jn=It();return jn==null?null:jn-un(wn)}}})({isClient:K,containerRef:O,parsedNodeCount:vs,requestFrame:to,cancelFrame:Gi,resolveScrollContainer:()=>Vl.value||Ae(),getNormalizedScrollTop:pe,getOffsetTopWithinRoot:ne,isReverseFlexScrollRoot:_e,estimateIndexForOffset:yo,estimateHeightRange:Zs,getFallbackNodeHeight:Ja,clamp:Qs}),{nodeHeights:Y,heightStats:ve,heightTreeSize:Be,heightSumTree:He,heightKnownTree:Ye,averageNodeHeight:Xe,resetHeightMeasurements:vt,pruneHeightMeasurements:$t,rebuildHeightTrees:Vt,recordNodeHeight:pn,removeNodeHeights:In,exportHeightCache:Bn,importHeightCache:an,fenwickRangeSum:An}=(function($={}){const J=po({}),he=po({total:0,count:0}),me=V(0),Le=V([]),Oe=V([]);function Ze(){for(const Qe of Object.keys(J))delete J[Number(Qe)];he.total=0,he.count=0,me.value=0,Le.value=[],Oe.value=[]}function et(Qe,ct,At){for(let yt=ct+1;yt0;yt-=yt&-yt)At+=Qe[yt];return At}function tt(Qe){me.value=Qe;const ct=new Array(Qe+1).fill(0),At=new Array(Qe+1).fill(0);for(const[yt,Wt]of Object.entries(J)){const It=Number(yt),tn=Number(Wt);!Number.isFinite(It)||It<0||It>=Qe||!Number.isFinite(tn)||tn<=0||(et(ct,It,tn),et(At,It,1))}Le.value=ct,Oe.value=At}function ut(Qe){if(!Number.isInteger(Qe)||Qe<0)return!1;const ct=J[Qe];if(!Number.isFinite(ct)||ct<=0)return!1;if(delete J[Qe],he.total=Math.max(0,he.total-ct),he.count=Math.max(0,he.count-1),me.value>Qe){const At=Le.value,yt=Oe.value;At.length&&yt.length&&(et(At,Qe,-ct),et(yt,Qe,-1))}return!0}const pt=D(()=>he.count>0?Math.max(12,he.total/he.count):32);return{nodeHeights:J,heightStats:he,heightTreeSize:me,heightSumTree:Le,heightKnownTree:Oe,averageNodeHeight:pt,resetHeightMeasurements:Ze,pruneHeightMeasurements:function(Qe){if(Qe<=0)return void Ze();let ct=0,At=0;for(const[yt,Wt]of Object.entries(J)){const It=Number(yt),tn=Number(Wt);!Number.isFinite(It)||It<0||It>=Qe||!Number.isFinite(tn)||tn<=0?delete J[It]:(ct+=tn,At++)}he.total=ct,he.count=At},rebuildHeightTrees:tt,recordNodeHeight:function(Qe,ct,At={}){(function(yt,Wt,It={}){var tn;if(!Number.isFinite(Wt)||Wt<=0)return!1;const un=J[yt];if(un&&(It.allowShrink===!1&&Wtyt){const bn=Le.value,gn=Oe.value;if(bn.length&&gn.length)if(un){const wn=Wt-un;wn!==0&&et(bn,yt,wn)}else et(bn,yt,Wt),et(gn,yt,1)}It.notify!==!1&&((tn=$.onHeightRecorded)==null||tn.call($))})(Qe,ct,Dn(Dt({},At),{notify:!0}))},removeNodeHeight:function(Qe,ct={}){var At;const yt=ut(Qe);return yt&&ct.notify!==!1&&((At=$.onHeightRecorded)==null||At.call($)),yt},removeNodeHeights:function(Qe,ct={}){var At;let yt=0;for(const Wt of Qe)ut(Number(Wt))&&yt++;return yt>0&&ct.notify!==!1&&((At=$.onHeightRecorded)==null||At.call($)),yt},exportHeightCache:function(){return Object.entries(J).map(([Qe,ct])=>({index:Number(Qe),height:Number(ct)})).filter(Qe=>Number.isFinite(Qe.index)&&Qe.index>=0&&Number.isFinite(Qe.height)&&Qe.height>0).sort((Qe,ct)=>Qe.index-ct.index)},importHeightCache:function(Qe,ct={}){var At;if(!Array.isArray(Qe))return;const yt=me.value;let Wt=!1;if(ct.mode!=="merge"){const It=Object.keys(J);if(It.length>0){for(const tn of It)delete J[Number(tn)];Wt=!0}}for(const It of Qe){const tn=Number(It.index),un=Number(It.height);if(!Number.isInteger(tn)||tn<0||yt>0&&tn>=yt||!Number.isFinite(un)||un<=0)continue;const bn=J[tn];bn&&Math.abs(bn-un)<=1||(J[tn]=un,Wt=!0)}Wt&&((function(){let It=0,tn=0;const un=me.value;for(const[bn,gn]of Object.entries(J)){const wn=Number(bn),jn=Number(gn);!Number.isFinite(wn)||wn<0||un>0&&wn>=un||!Number.isFinite(jn)||jn<=0?delete J[wn]:(It+=jn,tn++)}he.total=It,he.count=tn})(),yt>0&&tt(yt),(At=$.onHeightRecorded)==null||At.call($))},fenwickRangeSum:function(Qe,ct,At){if(At<=ct)return 0;const yt=mt(Qe,At-1);return ct<=0?yt:yt-mt(Qe,ct-1)}}})({onHeightRecorded:()=>{lo(),Qn.value&&Am(),Xo.value&&Al(),Ko.value&&tp(),uo("node-resize")}});function Hn($){Number.isInteger($)&&$>=0&&$o.add($)}function Wn($){for(const J of $)Hn(Number(J))}function Di($){Ks++;let J=!0;try{const he=$();return J=he!==!1,he}finally{Ks--,Ks===0&&J&&zu.value++}}function ao(){Ni=[],Us=[],Vs=-1,$o.clear(),Ds.value=cr}function dr(){ao(),Di(()=>vt()),mi.clear()}function Dc($){!Number.isInteger($)||$<0||$>=Ue.value.length||mi.set($,fm($))}function xl($,J,he={}){const me=Y[$];Hn($),pn($,J,he);const Le=Y[$];return Object.is(me,Le)?($o.delete($),!1):(Le&&Le>0?Dc($):me&&mi.delete($),!0)}function wa($,J){const he=Gt("getNodeLayoutHeight.slot.offsetHeight",()=>{var me,Le;return(Le=(me=fi.get($))==null?void 0:me.offsetHeight)!=null?Le:0});return he>0?he:Gt("getNodeLayoutHeight.content.offsetHeight",()=>J.offsetHeight)}function Me($,J={}){J.mode!=="merge"?ao():Wn($.map(he=>he.index)),Di(()=>an($,J)),qb()}const Ne=D(()=>ro.value&&Jo.value),nt=D(()=>{var $;return!re.value&&M.batchRendering!==!1&&rn.value>0&&(($=M.maxLiveNodes)!=null?$:0)<=0}),Ft=D(()=>!re.value&>&&ft.value===!0&&!Mn.value&&!_o.value&&!vo.value&&!Ne.value&&!nt.value),fn=D(()=>!!eo&&Ne.value),$n=D(()=>Mn.value||Qn.value),{focusIndex:Gn,liveRange:zn,updateLiveRange:bo}=(function($,J){const{parsedNodeCount:he,virtualizationEnabled:me,maxLiveNodesResolved:Le,liveNodeBufferResolved:Oe,clamp:Ze}=J,et=Oe??D(()=>{var ut;return Math.max(0,(ut=$.liveNodeBuffer)!=null?ut:60)}),mt=V(0),tt=po({start:0,end:0});return{liveNodeBufferResolved:et,focusIndex:mt,liveRange:tt,updateLiveRange:function(){const ut=he.value;if(!me.value||ut===0)return tt.start=0,void(tt.end=ut);const pt=Math.min(Le.value,ut),Qe=et.value,ct=Ze(mt.value-Qe,0,Math.max(0,ut-pt));tt.start=ct,tt.end=Math.min(ut,ct+pt)}}})(M,{parsedNodeCount:vs,virtualizationEnabled:Mn,maxLiveNodesResolved:oo,liveNodeBufferResolved:so,clamp:Qs}),Gs=new Map,Sl=new Map,Ca=new Map,mf=[],Aa=new Map,xa=new Set,Zh=V(0);let eu=!1;const Hv=D(()=>(Zh.value,xa.size)),es=new Map,Ql=new Map,am=V(0),um=D(()=>{am.value;let $=0;for(const J of es.values())$+=Math.max(0,J);return $});let fr=null;const Ie=D(()=>{if(!Mn.value)return Ue.value.length;const $=so.value,J=Math.max(zn.end+$,Yn.value),he=Math.min(Ue.value.length,J);return Math.max(Vn.value,he)});function at(){eu||(eu=!0,queueMicrotask(()=>{eu=!1,Zh.value+=1}))}function Ge($,J,he="node-resize"){if(!K||typeof window>"u")return null;const me=window.setTimeout(()=>{xa.delete(me)&&at();try{J()}finally{uo(he)}},Math.max(0,$));return xa.add(me),at(),me}function kt($){K&&$!=null&&(xa.delete($)&&at(),window.clearTimeout($))}function Yt(){if(K&&typeof window<"u")for(const $ of xa)window.clearTimeout($);xa.size&&(xa.clear(),at()),mf.length=0,Ca.clear()}function mn($){B.value=$}function En($){P.value=$}function Jn($){H.value=$}const{cancelScheduledFocusSync:xn,scheduleFocusSync:gi}=(function($){const{isClient:J,containerRef:he,virtualizationEnabled:me,requestFrame:Le,cancelFrame:Oe,syncFocusToScroll:Ze}=$;let et=null;function mt(){var ut,pt,Qe;return(Qe=(pt=(ut=he.value)==null?void 0:ut.ownerDocument)==null?void 0:pt.defaultView)!=null?Qe:typeof window<"u"?window:null}function tt(){if(!et)return;const ut=mt();et.viaTimeout?ut?ut.clearTimeout(et.id):clearTimeout(et.id):Oe?.(et.id),et=null}return{cancelScheduledFocusSync:tt,scheduleFocusSync:function(ut={}){if(!me.value)return;if(!J)return void Ze(!0);if(ut.immediate)return tt(),void Ze(!0);if(et)return;const pt=()=>{et=null,Ze()};if(Le)return void(et={id:Le(pt),viaTimeout:!1});const Qe=mt();et={id:Qe?Qe.setTimeout(pt,16):setTimeout(pt,16),viaTimeout:!0}}}})({isClient:K,containerRef:O,virtualizationEnabled:Mn,requestFrame:to,cancelFrame:Gi,syncFocusToScroll:function($=!1){var J;if(!Mn.value)return;const he=Vl.value||Ae();if(!he)return;const me=he.ownerDocument||((J=O.value)==null?void 0:J.ownerDocument)||document,Le=me?.defaultView||(typeof window<"u"?window:null),Oe=he===me?.documentElement||he===me?.body,Ze=Ue.value.length;if(Ze<=0)return;if(!Oe&&Ze>0&&_e(he)){const yt=Gt("syncFocusToScroll.clientHeight",()=>he.clientHeight||0),Wt=Gt("syncFocusToScroll.scrollTop",()=>he.scrollTop),It=Wt<0?-Wt:Wt;return void Wv(Qs((et=Math.max(0,It)+.5*Math.max(0,yt),Fs.estimateIndexForOffsetFromEnd(et)),0,Math.max(0,Ze-1)),$)}var et;const mt=(function(yt,Wt,It,tn){const un=O.value;if(!un)return null;const bn=tn?0:Gt("syncFocusToScroll.model.root.getBoundingClientRect",()=>yt.getBoundingClientRect().top),gn=Gt("syncFocusToScroll.model.container.getBoundingClientRect",()=>un.getBoundingClientRect().top),wn=Math.max(0,bn-gn),jn=tn?Gt("syncFocusToScroll.model.viewport.clientHeight",()=>{var Xn,Wi,Ys,Bs;return(Bs=(Ys=(Wi=It?.innerHeight)!=null?Wi:(Xn=Wt.documentElement)==null?void 0:Xn.clientHeight)!=null?Ys:yt.clientHeight)!=null?Bs:0}):Gt("syncFocusToScroll.model.root.clientHeight",()=>yt.clientHeight);return Qs(yo(wn+.5*Math.max(0,jn)),0,Math.max(0,Ue.value.length-1))})(he,me,Le,Oe);if(mt!=null)return void Wv(mt,$);const tt=Oe?null:Gt("syncFocusToScroll.root.getBoundingClientRect",()=>he.getBoundingClientRect()),ut=Oe?0:tt.top,pt=Oe?Gt("syncFocusToScroll.viewport.clientHeight",()=>{var yt,Wt;return(Wt=(yt=Le?.innerHeight)!=null?yt:he.clientHeight)!=null?Wt:0}):tt.bottom,Qe=pf.value;let ct=null,At=null;for(const[yt,Wt]of Qe){if(!Wt)continue;const It=Gt("syncFocusToScroll.slot.getBoundingClientRect",()=>Wt.getBoundingClientRect());It.bottom<=ut||It.top>=pt||(ct==null&&(ct=yt),At=yt)}if(ct==null||At==null){const yt=O.value;if(!yt)return;const Wt=Oe?{top:0}:Gt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>he.getBoundingClientRect()),It=Gt("syncFocusToScroll.fallback.scrollTop",()=>pe(he,me,Oe)),tn=Oe?(()=>{const bn=Gt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>yt.getBoundingClientRect()),gn=(Oe?0:Wt.top)-bn.top;return Math.max(0,gn)})():(()=>{const bn=ne(yt,he);return Math.max(0,It-bn)})(),un=Oe?Gt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var bn,gn,wn,jn;return(jn=(wn=(gn=Le?.innerHeight)!=null?gn:(bn=me?.documentElement)==null?void 0:bn.clientHeight)!=null?wn:he.clientHeight)!=null?jn:0}):Gt("syncFocusToScroll.fallback.root.clientHeight",()=>he.clientHeight);return void Wv(Qs(yo(tn+.5*Math.max(0,un)),0,Math.max(0,Ue.value.length-1)),!0)}Wv(Math.round((ct+At)/2),$)}}),{visibleNodeIndices:hr,nodeVisibilityHandles:ws,nodeVisibilityWatchStops:_l,nodeVisibilityFallbackTimers:tu,clearVisibilityFallback:nu,markNodeVisible:Fc,cleanupNodeVisibility:GZ,destroyNodeVisibilityState:wb}=$9e({isClient:K,shouldTrackVisibleNodeIndices:()=>Ne.value,shouldCleanupNodeVisibility:()=>Mn.value,onNodeMarkedVisible:$=>{Mn.value?gi():Gn.value=Qs($,0,Math.max(0,Ue.value.length-1))},onNodeVisibilityCleaned:$=>{fi.delete($)&&n_()}}),{cleanupScrollListener:TS,setupScrollListener:QZ}=(function($){const{isClient:J,virtualizationEnabled:he,listenerEnabled:me,scrollRootElement:Le,resolveScrollContainer:Oe,scheduleFocusSync:Ze,onScroll:et}=$;let mt=null,tt=null;function ut(){mt&&(mt(),mt=null),tt=null,Le.value=null}function pt(Qe){const ct=$.getScrollTop?$.getScrollTop(Qe):Qe.scrollTop;return Math.max(0,Number.isFinite(ct)?Math.abs(ct):0)}return{cleanupScrollListener:ut,setupScrollListener:function(){if(!J)return;if(!((Qe=me?.value)!=null?Qe:he.value))return void ut();var Qe;const ct=Oe();if(!ct)return void ut();if(Le.value===ct&&mt)return;ut(),tt=pt(ct);const At=()=>{if(et?.(),he.value){const yt=(function(Wt){const It=pt(Wt),tn=tt;tt=It;const un=Math.max(480,.75*(Wt.clientHeight||0));return tn==null?It>un?{immediate:!0}:void 0:Math.abs(It-tn)>un?{immediate:!0}:void 0})(ct);yt?Ze(yt):Ze()}};ct.addEventListener("scroll",At,{passive:!0}),Le.value=ct,mt=()=>{ct.removeEventListener("scroll",At)}}}})({isClient:K,virtualizationEnabled:Mn,listenerEnabled:$n,scrollRootElement:Vl,resolveScrollContainer:Ae,scheduleFocusSync:gi,onScroll:function(){const $=Ko.value;if(!$)return;const J=dm();if(!J||(function(me){if(vm()>=Ya)return Lr=null,!1;const Le=Lr;if(Le==null)return!0;const Oe=Math.abs(me.scrollTop-Le)<=2;return Oe||(Lr=null),Oe})(J))return;const he=qS(J);he!=null?(he<-32||Math.abs(Math.max(0,he)-Math.max(0,$.distanceFromBottomPx))>32)&&ep("restore"):ep("restore")},getScrollTop:$=>{var J;const he=$.ownerDocument||((J=O.value)==null?void 0:J.ownerDocument)||document,me=$===he.documentElement||$===he.body||$===he.scrollingElement;return Gt("scrollListener.getScrollTop",()=>pe($,he,me))}});function Wv($,J=!1){const he=Qs($,0,Math.max(0,Ue.value.length-1));!J&&Math.abs(he-Gn.value)<=1||(Gn.value=he,bo())}function Qs($,J,he){return Math.min(Math.max($,J),he)}function Cb($=Ue.value.length){const J=st();return!Number.isInteger(J)||J<0?$:Qs(J,0,$)}function Ab($){return $?.firstElementChild}function ES($,J){var he;return $?(he=$.matches)!=null&&he.call($,J)?$:$.querySelector(J):null}function YZ($,J){$<1||$>6||(j[$]=J)}function LS(){if(!yi.value)return void(Q.value=0);const $=Gt("updateExperimentContainerWidth.clientWidth",()=>{var J,he;return(he=(J=O.value)==null?void 0:J.clientWidth)!=null?he:0});Q.value=$>0?$:0}let cm=null;function xb(){cm?.disconnect(),cm=null}const NS=fg("ViewportDeferredMarkdownCodeBlockNode",wu({loader:()=>fo(null,null,function*(){return(yield Yo(()=>import("./index5-DPyXoDa2.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:a4,delay:0,suspensible:!1}),a4);function DS($){return $===NS}const FS=D(()=>m.value==="pre"?ol:m.value==="shiki"?NS:k8);function BS(){var $;return(($=M.codeBlockProps)==null?void 0:$.showHeader)!==!1}function RS($,J,he){const me=Y[J],Le=typeof me=="number"&&me>0;if(io.value&&!Le&&!(function(Oe){return!!xi.value.paragraph&&(Oe.type==="paragraph"||Oe.type==="list_item"||Oe.type==="list")})($)){const Oe=EH($,he,te.value);if(Oe)return Oe}if(Fn.value&&$.type==="code_block"){const Oe=(function(Ze){if(Ze.type!=="code_block")return null;const et=p_(Ze,Xv(Ze));return DS(et)?"markdown":et===ol?"pre":et===FS.value||et===k8?"monaco":null})($);if(Oe==="monaco"||Oe==="markdown"||Oe==="pre")return(function(Ze,et){var mt,tt,ut;if(!Ze||Ze.type!=="code_block")return null;const pt=et.rendererKind,Qe=pt!=="pre"&&et.showHeader!==!1,ct=!!Ze.diff;let At=0,yt=500;if(pt==="monaco"){const It=(mt=et.monacoOptions)!=null?mt:{},tn=I8(Ze,It,et.width),un=(function(gn){const wn=typeof gn?.fontSize=="number"&&gn.fontSize>0?gn.fontSize:12;return typeof gn?.lineHeight=="number"&&gn.lineHeight>0?gn.lineHeight:Math.round(1.5*wn)})(It),bn=(function(gn,wn){var jn,Xn;const Wi=typeof((jn=gn?.padding)==null?void 0:jn.top)=="number"?gn.padding.top:wn?0:8,Ys=typeof((Xn=gn?.padding)==null?void 0:Xn.bottom)=="number"?gn.padding.bottom:wn?0:8;return Math.max(0,Wi)+Math.max(0,Ys)})(It,ct);yt=typeof It.MAX_HEIGHT=="number"&&It.MAX_HEIGHT>0?It.MAX_HEIGHT:500,At=Math.round(tn*un+bn)}else if(pt==="markdown"){const It=I8(Ze);At=Math.round(21*It+32)}else{const It=I8(Ze);At=Math.round(28*It),yt=Number.POSITIVE_INFINITY}const Wt=Math.max(1,Math.min(At,yt));return Dt({kind:"code-block",height:Math.round(Wt+(Qe?40:0)),contentHeight:Wt,rendererKind:pt},ct&&pt==="monaco"?{diffInline:_7((tt=et.monacoOptions)!=null?tt:{},(ut=et.width)!=null?ut:0)}:{})})($,{rendererKind:Oe,monacoOptions:M.codeBlockMonacoOptions,showHeader:BS(),width:he})}return null}Jp(()=>{if(zu.value,Ks>0)return;const $=Ue.value,J=_n();if(!$.length||!Rt.value)return Ni=[],Us=[],Vs=-1,$o.clear(),void(Ds.value=cr);const he=Q.value||Gt("estimatedNodeHeights.clientWidth",()=>{var tt;return((tt=O.value)==null?void 0:tt.clientWidth)||0});if(!Number.isFinite(he)||he<=0)return Ni=[],Us=[],Vs=-1,$o.clear(),void(Ds.value=cr);const me=(function(tt){return[Math.round(tt),io.value,Fn.value,te.value,M.codeBlockMonacoOptions,BS(),m.value,xi.value,S8.value]})(he),Le=Ni.length<=$.length&&(Ze=me,(Oe=Us).length===Ze.length&&Oe.every((tt,ut)=>Object.is(tt,Ze[ut])));var Oe,Ze;const et=Le&&Vs===J?$.length:Le?Cb($.length):0,mt=Le?Array.from($o):[];Ni.length=$.length;for(let tt=et;tt<$.length;tt++)Ni[tt]=RS($[tt],tt,he);for(const tt of mt)tt>=0&&tt<$.length&&ttDs.value);Fs=(function($){let J=!0,he=[0],me="";function Le(ut){var pt;const Qe=$.nodeHeights[ut];if(Number.isFinite(Qe)&&Qe>0)return Qe;const ct=$.parsedNodes.value[ut],At=ct?.type,yt=!!((pt=$.hasCustomParagraphComponent)!=null&&pt.call($)),Wt=$.estimatedNodeHeights.value[ut],It=Wt?.height;if(!(function(un,bn,gn){return!!(gn&&bn?.kind==="simple-text"&&(un==="paragraph"||un==="list_item"||un==="list"))})(At,Wt,yt)&&Number.isFinite(It)&&It>0)return It;const tn=S9e(ct,$.getContainerWidth()||640);return At==="heading"||At==="paragraph"&&tn<=28&&(function(un,bn){if(bn)return!1;const gn=un.children;return!Array.isArray(gn)||!gn.length||gn.every(NH)})(ct,yt)?tn:Math.max($.averageNodeHeight.value,tn)}function Oe(){var ut;const pt=$.parsedNodes.value.length,Qe=$.getPrefixCacheKeyParts().join(":");if(!J&&me===Qe)return he;const ct=new Array(pt+1);ct[0]=0;for(let At=0;At=((pt=At[ct])!=null?pt:0))return ct-1;let yt=0,Wt=ct-1,It=ct-1;for(;yt<=Wt;){const tn=yt+Wt>>1;((Qe=At[tn+1])!=null?Qe:0)>=ut?(It=tn,Wt=tn-1):yt=tn+1}return It}function et(ut,pt){var Qe,ct;if(ut>=pt)return 0;if($.heightEstimationActive.value)return(function(Wt,It){var tn,un;const bn=$.parsedNodes.value.length,gn=JL(Math.trunc(Wt),0,bn),wn=JL(Math.trunc(It),gn,bn);if(gn>=wn)return 0;const jn=Oe();return((tn=jn[wn])!=null?tn:0)-((un=jn[gn])!=null?un:0)})(ut,pt);if($.heightTreeSize.value!==$.parsedNodes.value.length){let Wt=0;for(let It=ut;Itgn<=0?0:$.fenwickRangeSum(yt,0,gn)+(gn-$.fenwickRangeSum(Wt,0,gn))*At;let tn=0,un=Qe.length-1,bn=Qe.length-1;for(;tn<=un;){const gn=tn+un>>1;It(gn+1)>=ut?(bn=gn,un=gn-1):tn=gn+1}return bn}let ct=ut;for(let At=0;At0||ut++}return ut}return{markFallbackHeightPrefixDirty:function(){J=!0},getFallbackNodeHeight:Le,estimateHeightRange:et,estimateIndexForOffset:mt,estimateIndexForOffsetFromEnd:function(ut){var pt,Qe;const ct=$.parsedNodes.value;if(!ct.length)return 0;if(ut<=0)return Math.max(0,ct.length-1);if($.heightEstimationActive.value){const yt=(pt=Oe()[ct.length])!=null?pt:0;return Ze(Math.max(0,yt-ut))}if($.heightTreeSize.value===ct.length){const yt=et(0,ct.length);return mt(Math.max(0,yt-ut))}let At=ut;for(let yt=ct.length-1;yt>=0;yt--){const Wt=(Qe=$.nodeHeights[yt])!=null?Qe:$.averageNodeHeight.value;if(At<=Wt)return yt;At-=Wt}return 0},getEstimatedNodeHeightCount:tt,buildVirtualHeightSummary:function(ut){var pt;const Qe=$.parsedNodes.value.length;return{totalNodes:Qe,measuredCount:$.heightStats.count,estimatedCount:tt(),averageNodeHeight:$.averageNodeHeight.value,topSpacerHeight:ut.topSpacerHeight,bottomSpacerHeight:ut.bottomSpacerHeight,estimatedTotalHeight:et(0,Qe),width:(pt=ut.width)!=null?pt:$.getContainerWidth()}}}})({parsedNodes:Ue,nodeHeights:Y,heightStats:ve,heightTreeSize:Be,heightSumTree:He,heightKnownTree:Ye,averageNodeHeight:Xe,heightEstimationActive:yi,estimatedNodeHeights:Gh,getContainerWidth:ki,hasCustomParagraphComponent:()=>!!xi.value.paragraph,getPrefixCacheKeyParts:()=>{var $;const J=Wm(Q.value||Gt("getFallbackHeightPrefix.clientWidth",()=>{var me;return((me=O.value)==null?void 0:me.clientWidth)||0})),he=(($=i.virtualScroll)==null?void 0:$.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[Ue.value.length,ve.count,Math.round(ve.total),Math.round(100*Xe.value),he,J,yi.value?1:0,S8.value,W.value,xi.value.paragraph?1:0]},fenwickRangeSum:An}),We(()=>Ue.value.length,$=>{var J;lo(),$<=0?dr():($$t(J))),$!==Be.value&&Vt($))},{immediate:!0});const JZ=D(()=>{if(!Mn.value)return Ue.value.map((me,Le)=>({node:me,index:Le}));const $=Ue.value.length,J=Qs(zn.start,0,$),he=Qs(zn.end,J,$);return Ue.value.slice(J,he).map((me,Le)=>({node:me,index:J+Le}))}),Sb=D(()=>Mn.value?Zs(0,Math.min(zn.start,Ue.value.length)):0),_b=D(()=>{if(!Mn.value)return 0;const $=Ue.value.length;return Zs(Math.min(zn.end,$),$)});function $S(){return Fs.buildVirtualHeightSummary({topSpacerHeight:Sb.value,bottomSpacerHeight:_b.value,width:gf()})}function XZ(){const $=Ue.value,J=$S();return Dn(Dt({},J),{probe:{paragraphReady:!!te.value.paragraph,listItemReady:!!te.value.listItem,listWrapperOverhead:te.value.listWrapperOverhead,headingReadyLevels:Object.entries(te.value.headings).filter(([,he])=>!!he).map(([he])=>Number(he))},nodes:$.map((he,me)=>{var Le,Oe,Ze,et,mt,tt,ut,pt,Qe;return{index:me,type:he.type,estimateKind:(Oe=(Le=Gh.value[me])==null?void 0:Le.kind)!=null?Oe:null,rendererKind:(et=(Ze=Gh.value[me])==null?void 0:Ze.rendererKind)!=null?et:null,estimatedHeight:(tt=(mt=Gh.value[me])==null?void 0:mt.height)!=null?tt:null,estimatedContentHeight:(pt=(ut=Gh.value[me])==null?void 0:ut.contentHeight)!=null?pt:null,measuredHeight:(Qe=Y[me])!=null?Qe:null}})})}function Mb(){return i.indexKey!=null?String(i.indexKey):_o.value?`virtual-${wo()}`:"markdown-renderer"}function OS($){const J=String($),he=`${Mb()}-`;if(!J.startsWith(he))return null;const me=J.slice(he.length).match(/^(\d+)(?:$|-)/);if(!me)return null;const Le=Number(me[1]);return!Number.isInteger(Le)||Le<0||Le>=Ue.value.length?null:Le}function wo(){var $,J,he;const me=($=i.virtualScroll)==null?void 0:$.sessionKey;return String(me!=null&&me!==""?me:(he=(J=i.indexKey)!=null?J:M.customId)!=null?he:ri)}function ts(){var $;const J=($=i.virtualScroll)==null?void 0:$.threadKey;return J==null||J===""?void 0:String(J)}const eG=D(()=>{var $,J,he;return(he=ts())!=null?he:String((J=($=i.indexKey)!=null?$:M.customId)!=null?J:ri)});function Ib($){var J;return($??"")===((J=ts())!=null?J:"")}function Hu(){var $,J,he;return J=($=i.virtualScroll)==null?void 0:$.measurementKey,he=(function(){const me=m.value;return(function(Le){var Oe,Ze;const et=Le.renderer,mt=et==="monaco"?Le.codeBlockMonacoOptions:void 0,tt=Le.codeBlockProps,ut=et==="shiki";return[Le.isDark?"dark":"light",et==="monaco"?"code-rich":et==="pre"?"code-pre":"code-shiki",Le.codeBlockStream===!1?"code-static":"code-stream",Rs(Le.codeBlockMinWidth),Rs(Le.codeBlockMaxWidth),...ut?[gve((Oe=tt?.themes)!=null?Oe:Le.themes,(Ze=tt?.langs)!=null?Ze:Le.langs)]:[],Rs(mt?.fontSize),Rs(mt?.lineHeight),Rs(mt?.fontFamily),Rs(mt?.tabSize),Rs(mt?.MAX_HEIGHT),Rs(mt?.wordWrap),Rs(mt?.wrappingIndent),Rs(mt?.padding),Rs(tt?.showHeader),Rs(tt?.showCopyButton),Rs(tt?.showExpandButton),Rs(tt?.showPreviewButton),Rs(tt?.showCollapseButton),Rs(tt?.showFontSizeButtons)].join("\0")})({renderer:me,isDark:M.isDark,codeBlockStream:M.codeBlockStream,codeBlockMinWidth:M.codeBlockMinWidth,codeBlockMaxWidth:M.codeBlockMaxWidth,codeBlockMonacoOptions:me==="monaco"?M.codeBlockMonacoOptions:void 0,codeBlockProps:M.codeBlockProps,themes:me==="shiki"?M.themes:void 0,langs:me==="shiki"?M.langs:void 0})})(),[J==null?"":String(J),he].join("\0")}function gf(){return ki()}const qv=D(()=>Wm(gf())),Ml=D(()=>[Hu(),qv.value].join("\0")),tG=D(()=>{var $;return _o.value?["virtual",($=ts())!=null?$:"",wo(),Ml.value].join("\0"):i.indexKey});function Qh(){am.value+=1}function Tb($){return!(!$||!Number.isInteger($.index)||$.index<0||$.index>=Ue.value.length||$.sessionKey!==wo()||$.threadKey!==ts()||$.layoutEpochKey!==Ml.value)}function PS($){const J=String($),he=Ql.get(J);return he?Tb(he)?he.index:null:OS(J)}function zS($="async-node"){(es.size||Ql.size)&&(es.clear(),Ql.clear(),Qh(),uo($))}const Yh=Jt(kC,null),Eb={reportHeight($,J){if(!Qn.value)return;const he=PS($);if(he==null)return;const me=Gs.get(he);if(!me)return;const Le=Number(J),Oe=wa(he,me);(function(Ze,et,mt={}){Di(()=>xl(Ze,et,mt))})(he,Number.isFinite(Le)&&Le>0?Math.max(Le,Oe||0):Oe)},markPending($){if(!Qn.value)return;const J=OS($);J!=null&&(function(he,me){var Le;const Oe=Ql.get(he);if(Oe&&Tb(Oe))return es.set(he,Math.max(0,(Le=es.get(he))!=null?Le:0)+1),Qh(),void uo("async-node");es.set(he,1),Ql.set(he,(function(Ze){return{index:Ze,sessionKey:wo(),threadKey:ts(),layoutEpochKey:Ml.value}})(me)),Qh(),uo("async-node")})(String($),J)},markSettled($){if(!Qn.value)return;const J=String($),he=PS($);(he!=null||(function(me){return es.has(String(me))})(J))&&(function(me){var Le;const Oe=(Le=es.get(me))!=null?Le:0;return!(Oe<=0||(Oe<=1?(es.delete(me),Ql.delete(me)):es.set(me,Oe-1),Qh(),Oe===1&&uo("async-node"),0))})(J)&&he!=null&&Wu()}};function nG(){let $=0;for(const J of Gs.values())$+=Gt("getVisibleDomHeight.offsetHeight",()=>{var he;return(he=J?.offsetHeight)!=null?he:0});return Math.ceil(Math.max(0,$))}ii(kC,{reportHeight($,J){Eb.reportHeight($,J),Yh?.reportHeight($,J)},markPending($){Eb.markPending($),Yh?.markPending($)},markSettled($){Eb.markSettled($),Yh?.markSettled($)}});let Lb,Nb=null,Jh=null;function Uv($){return $!==!1&&$!=null&&$!==""}function jS(){return Mn.value?(function(){if(!Mn.value)return!0;const $=Ue.value.length,J=Qs(zn.start,0,$),he=Qs(zn.end,J,$);if(J>=he)return!0;for(let me=J;me=Ie.value}function Db(){return ft.value===!0&&!_t.value&&um.value===0&&xa.size===0&&Aa.size===0&&fr==null&&jS()}function HS(){var $,J;if((($=i.virtualScroll)==null?void 0:$.settleMode)!=="manual"||Nb===wo()&&Lb===ts())return!0;const he=(J=i.virtualScroll)==null?void 0:J.settledToken;return!!Uv(he)&&Jh===xm(he)}function Fb(){return Db()&&HS()}function iG($,J){return J.totalNodes<=0?$==="final"?"final":"estimate":J.measuredCount>=J.totalNodes?$==="final"?"final":"measured":J.measuredCount>0||J.estimatedCount>0?"mixed":"estimate"}function vf($="manual",J){const he=$S(),me=(function(Le){return Le||(ft.value!==!0?Ue.value.length>0?"streaming":"estimating":!jS()||Aa.size>0||fr!=null?"measuring":Fb()?"settled":"settling")})(J);return{sessionKey:wo(),threadKey:ts(),phase:me,nodeCount:he.totalNodes,liveRange:{start:zn.start,end:zn.end},renderedCount:Vn.value,measuredCount:he.measuredCount,estimatedCount:he.estimatedCount,averageNodeHeight:he.averageNodeHeight,topSpacerHeight:he.topSpacerHeight,bottomSpacerHeight:he.bottomSpacerHeight,visibleDomHeight:nG(),totalHeight:WS(),width:he.width,final:ft.value===!0,stable:Fb(),confidence:iG(me,he),reason:$}}function dm(){const $=Vl.value||Ae(),J=O.value;if(!$||!J)return null;const he=$.ownerDocument||J.ownerDocument||document,me=$===he.documentElement||$===he.body||$===he.scrollingElement,Le=Gt("getScrollBox.scrollTop",()=>pe($,he,me)),Oe=Gt("getScrollBox.scrollHeight",()=>{var et,mt,tt,ut,pt;return me?Math.max((mt=(et=he.documentElement)==null?void 0:et.scrollHeight)!=null?mt:0,(ut=(tt=he.body)==null?void 0:tt.scrollHeight)!=null?ut:0,(pt=$.scrollHeight)!=null?pt:0):$.scrollHeight}),Ze=Gt("getScrollBox.clientHeight",()=>{var et;return me?((et=he.documentElement)==null?void 0:et.clientHeight)||$.clientHeight||0:$.clientHeight});return{root:$,doc:he,isViewportRoot:me,scrollTop:Le,scrollHeight:Oe,clientHeight:Ze}}function WS(){const $=Ue.value.length,J=Math.max(0,Zs(0,$)),he=Gt("getRendererLogicalHeight.offsetHeight",()=>{var Le,Oe;return(Oe=(Le=O.value)==null?void 0:Le.offsetHeight)!=null?Oe:0}),me=Math.max(0,he>0?he:Gt("getRendererLogicalHeight.scrollHeight",()=>{var Le,Oe;return(Oe=(Le=O.value)==null?void 0:Le.scrollHeight)!=null?Oe:0}));return $<=0?Math.ceil(he):Mn.value?J>0?Math.max(1,Math.ceil(J),(function(){let Le=Sb.value+_b.value;for(const Oe of fi.values())Oe&&(Le+=Math.max(0,Gt("getVirtualizedDomLogicalHeight.offsetHeight",()=>Oe.offsetHeight||0)));return Math.ceil(Math.max(0,Le))})(),(function(Le,Oe){return Le<=0||Oe<=0?0:Oe<=Le+Math.max(512,.05*Le)?Math.ceil(Oe):0})(J,me)):Math.max(1,Math.ceil(me)):Qn.value?J>0||ve.count>0||Fs.getEstimatedNodeHeightCount()>0?(Qi.value&&Vn.value,Math.max(1,Math.ceil(me),Math.ceil(J))):Math.ceil(me):Math.max(1,Math.ceil(me),Math.ceil(J))}function qS($){const J=O.value;if(!J)return null;const he=Gt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>J.getBoundingClientRect());return(function(Le){return Le.isViewportRoot?Le.clientHeight:Gt("getViewportBottomInRoot.getBoundingClientRect",()=>Le.root.getBoundingClientRect().bottom)})($)-he.bottom}function oG($={}){const J=$.requireViewport!==!1,he=(function(Oe=64){const Ze=dm(),et=O.value;if(!Ze||!et)return!1;const mt=(function(ut){if(ut.isViewportRoot)return{top:0,bottom:ut.clientHeight};const pt=Gt("getVirtualViewportRect.getBoundingClientRect",()=>ut.root.getBoundingClientRect());return{top:pt.top,bottom:pt.bottom}})(Ze),tt=Gt("isRendererNearVirtualViewport.getBoundingClientRect",()=>et.getBoundingClientRect());return tt.bottom>=mt.top-Oe&&tt.top<=mt.bottom+Oe})();if(J&&!he)return null;const me=(function(){const Oe=dm(),Ze=O.value;if(!Oe||!Ze||Math.max(0,Oe.scrollHeight-Oe.scrollTop-Oe.clientHeight)>64)return null;const et=qS(Oe);return et==null?null:et>=-8&&et<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,et)}:null})();if(me)return{anchor:me,captured:!0};const Le=Xa();if(Le)return{anchor:{type:"node",nodeIndex:Le.nodeIndex,offsetWithinNodePx:Le.offsetWithinNodePx},captured:he};if($.allowFallback===!0){const Oe=(function(){const Ze=Ue.value.length;return Ze<=0?null:{type:"node",nodeIndex:Qs(Gn.value,0,Math.max(0,Ze-1)),offsetWithinNodePx:0}})();return Oe?{anchor:Oe,captured:!1}:null}return null}function Bb($){let J=2166136261;for(let he=0;he<$.length;he++)J^=$.charCodeAt(he),J=Math.imul(J,16777619);return(J>>>0).toString(36)}function sG($,J){let he=$;for(let me=0;me8192?`${me.slice(0,8192)}...${me.length}`:me;return`${me.length}:${Bb(Le)}`})($)}`;if(typeof $=="function")return"fn";if(typeof $!="object")return typeof $;if(J.has($))return"cycle";if(he>=6)return"max-depth";J.add($);try{if(Array.isArray($)){if($.length<=160){const tt=[];for(let ut=0;ut<$.length;ut++)tt.push(Vv($[ut],J,he+1));return`a:${$.length}:${tt.join(",")}`}const Oe=[],Ze=[],et=Math.max(0,$.length-32);let mt=2166136261;for(let tt=0;tt<$.length;tt++){const ut=Vv($[tt],J,he+1);mt=sG(mt,ut),tt<32&&Oe.push(ut),tt>=et&&Ze.push(ut)}return[`a:${$.length}`,`h=${Oe.join(",")}`,`t=${Ze.join(",")}`,`all=${(mt>>>0).toString(36)}`].join(":")}const me=$,Le=Object.keys(me).filter(Oe=>{const Ze=me[Oe];return Oe!=="parent"&&Oe!=="el"&&Oe!=="component"&&(Ze==null||typeof Ze=="string"||typeof Ze=="number"||typeof Ze=="boolean"||rG.has(Oe))}).sort();return`o:${Le.length}:${Le.map(Oe=>`${Oe}=${Vv(me[Oe],J,he+1)}`).join(";")}`}finally{J.delete($)}}let Rb=-1,$b="",yf=[2166136261];function fm($){const J=Ue.value[$];return J?Bb(Vv(J)):""}function lG($,J){let he=$;for(let me=0;me>>0}function Ob(){var $,J;const he=W.value;if(Rb===he)return $b;const me=Ue.value.length;let Le=Cb(me);(Rb!==he-1||Le>me||yf.length>>0).toString(36),Rb=he,$b}function Xh($,J={}){var he;const me=J.includeHeightCache===!0,Le=(he=J.includeContentHash)!=null?he:me,Oe=me?(function(et){const mt=(function(){var yt,Wt;const It=Number((Wt=(yt=i.virtualScroll)==null?void 0:yt.heightCacheLimit)!=null?Wt:5e3);return!Number.isFinite(It)||It<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(It))})();if(!Number.isFinite(mt)||et.length<=mt)return et;const tt=new Map,ut=yt=>{!yt||tt.size>=mt||tt.set(yt.index,yt)},pt=Ue.value.length,Qe=Qs(zn.start-2*so.value,0,pt),ct=Qs(zn.end+2*so.value,Qe,pt);for(const yt of et)yt.index>=Qe&&yt.index=0&&tt.sizeyt.index-Wt.index).slice(0,mt)})(Bn().map(et=>{var mt;const tt=Ue.value[et.index];return tt?Dn(Dt({},et),{nodeType:String((mt=tt.type)!=null?mt:""),signature:fm(et.index)}):null}).filter(et=>!!et)):[],Ze=oG({allowFallback:J.allowAnchorFallback===!0,requireViewport:J.requireViewport});return Ze||Oe.length||J.includeEmptyState===!0?Dn(Dt({sessionKey:$.sessionKey,threadKey:$.threadKey},Ze?{anchor:Ze.anchor,anchorCaptured:Ze.captured}:{anchorCaptured:!1}),{metrics:$,width:$.width,contentHash:Le?Ob():void 0,measurementKey:Hu()||void 0,heightCache:Oe.length?Oe:void 0}):null}function Pb($){var J,he;const me=dm();if(!me)return;const Le=(function(et){const mt=O.value;if(!mt)return null;const tt=ne(mt,et.root),ut=Ue.value.length,pt=Gt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>mt.offsetHeight||0),Qe=Math.max(0,pt>0?pt:ut>0?Gt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>mt.scrollHeight||0):0),ct=WS();return tt+Math.max(Qe,ct)})(me);if(Le==null)return;const Oe=Math.max(0,$.distanceFromBottomPx),Ze=Math.max(0,Le-me.clientHeight-Oe);(function(et){Ya=vm()+120,Lr=et})(Ze),me.isViewportRoot?(he=(J=me.doc.defaultView)==null?void 0:J.scrollTo)==null||he.call(J,0,Ze):GL(me.root,me.doc,Ze,{isReverseFlexScrollRoot:_e,getNormalizedScrollTop:pe})}const zb=[];function US(){if(K)for(Cl!=null&&(Gi?.(Cl),Cl=null);zb.length;){const $=zb.pop();$!=null&&window.clearTimeout($)}}function ep($){const J=!!Ko.value;Ko.value=null,Ya=0,Lr=null,US(),J&&$&&uo($)}function tp(){if(!Ko.value||!K||Cl!=null)return;const $=()=>{Cl=null;const J=Ko.value;J&&Pb(J)};Cl=to?to($):null,Cl==null&&$()}function VS($,J={}){const he=Ue.value.length;return he<=0?[]:$.filter(me=>!(!Number.isInteger(me.index)||me.index<0||me.index>=he)&&!(!Number.isFinite(me.height)||me.height<=0)&&!(J.requireSignature&&!me.signature)&&!(J.requireCompatibilityMetadata&&!me.nodeType&&!me.signature)&&(function(Le){var Oe;const Ze=Ue.value[Le.index];return!(!Ze||Le.nodeType&&Le.nodeType!==String((Oe=Ze.type)!=null?Oe:"")||Le.signature&&Le.signature!==fm(Le.index))})(me))}function KS($){const J=Wm(gf()),he=Wm($);return J!==-1&&he!==-1&&J===he}function jb($){var J;const he=Number($?.width);if(Number.isFinite(he)&&he>0)return he;const me=Number((J=$?.metrics)==null?void 0:J.width);return Number.isFinite(me)&&me>0?me:null}function ZS($){var J;return $.sessionKey===wo()&&!!Ib($.threadKey)&&((J=$.measurementKey)!=null?J:"")===Hu()&&!!KS(jb($))&&!!(function(he){const me=he.heightCache;return!!me?.length&&(GS(he)?me.some(Le=>!!(Le.nodeType||Le.signature)):me.some(Le=>!!Le.signature))})($)}function GS($){return!!($.contentHash&&$.contentHash===Ob())}function aG($){return!GS($)}let kf=null,bf=null,Kv=null,hm=null,pm=null;function Hb($){var J;const he=$.map(Le=>{var Oe,Ze;return[Le.index,Math.round(10*Le.height),(Oe=Le.nodeType)!=null?Oe:"",(Ze=Le.signature)!=null?Ze:""].join("")}).join(""),me=Wm(gf());return[(J=ts())!=null?J:"",wo(),Hu(),Ue.value.length,me,$.length,Bb(he)].join(":")}function QS($=(J=>(J=i.virtualScroll)==null?void 0:J.heightCache)()){if(!Qn.value||!$?.length||Ue.value.length<=0||!KS((J=i.virtualScroll)==null?void 0:J.heightCacheWidth))return!1;var J;const he=VS($,{requireSignature:!0});if(!he.length)return!1;const me=Hb(he);return me===kf?(bf="standalone",!0):(Me(he,{mode:"merge"}),lo(),kf=me,bf="standalone",km(),uo("restore"),!0)}function Wb($,J={}){var he,me,Le;if(!Qn.value||!$||$.sessionKey!==wo()||!Ib($.threadKey)||Ue.value.length<=0)return!1;const Oe=!!((he=$.heightCache)!=null&&he.length)&&!Zv(),Ze=!$.anchor||$.anchorCaptured===!1&&J.allowUncapturedAnchor!==!0?null:$.anchor,et=J.restoreAnchor===!0&&!!Ze&&!Zv()&&Number(jb($))>0;let mt=!1;if((me=$.heightCache)!=null&&me.length&&ZS($)){const ut=VS($.heightCache,{requireCompatibilityMetadata:!$.contentHash,requireSignature:aG($)});ut.length&&(Me(ut,{mode:"merge"}),lo(),kf=Hb(ut),bf="restore",km(),mt=!0)}if(Oe||et)return!1;if(!J.restoreAnchor||!Ze)return mt&&uo("restore"),!0;const tt=(function(ut,pt){var Qe;const ct=ut.anchor,At=ct?ct.type==="bottom"?`bottom:${Math.round(ct.distanceFromBottomPx)}`:`node:${ct.nodeIndex}:${Math.round(ct.offsetWithinNodePx)}`:"none";return[(Qe=ts())!=null?Qe:"",wo(),Hu(),qv.value,pt,At].join(":")})($,(Le=J.restoreToken)!=null?Le:"imperative");return Kv===tt?(mt&&uo("restore"),!0):(Kv=tt,(function(ut){const pt=()=>{if(ut.type==="node")return ep(),void Gl({nodeIndex:ut.nodeIndex,offsetWithinNodePx:ut.offsetWithinNodePx});if(Nr(),Xo.value=null,Ko.value=ut,US(),Pb(ut),K)for(const Qe of[0,120,280,480])zb.push(window.setTimeout(()=>{const ct=Ko.value;ct&&Pb(ct)},Qe))};(function(Qe){if(!Mn.value)return!1;const ct=Ue.value.length;return!(ct<=0||(Gn.value=Qe.type==="node"?Qs(Qe.nodeIndex,0,ct-1):ct-1,bo(),0))})(ut)?ht(pt):pt()})(Ze),uo("restore"),!0)}function Zv(){const $=gf();return Number.isFinite($)&&$>0}function YS($){var J;return $.sessionKey===wo()&&!!Ib($.threadKey)&&(Ue.value.length<=0||!(!((J=$.heightCache)!=null&&J.length)||Zv())||!(!($.anchor&&Number(jb($))>0)||Zv()))}function qb(){mi.clear();for(const $ of Object.keys(Y)){const J=Number($);Number.isInteger(J)&&J>=0&&J{let J=!1,he=null;const me=()=>{J||(J=!0,he!=null&&window.clearTimeout(he),$())};if(to)return to(me),void(he=window.setTimeout(me,50));he=window.setTimeout(me,0)})}function Ub($,J=ts(),he=Ml.value){return wo()===$&&ts()===J&&Ml.value===he}function Vb(){return fo(this,arguments,function*($={}){var J,he,me,Le,Oe;const Ze=wo(),et=ts(),mt=Ml.value,tt=(J=$.frames)!=null?J:2,ut=(he=$.timeoutMs)!=null?he:120,pt=(me=$.reason)!=null?me:"manual",Qe=$.expectedSettledTokenKey,ct=$.flushPendingTimers===!0,At=vf(pt),yt=()=>Dn(Dt({},At),{phase:At.final?"settling":At.phase,stable:!1,confidence:At.confidence==="final"?"mixed":At.confidence,reason:pt}),Wt=()=>Ub(Ze,et,mt)&&(Qe==null||ym()===Qe);for(let bn=0;bnwindow.setTimeout(gn,bn))})(ut),!Wt()||(ct&&Yt(),Wu(),mm(),!Wt()))return yt();const It=Db();It&&(Nb=Ze,Lb=et,((Le=i.virtualScroll)==null?void 0:Le.settleMode)==="manual"&&Qe!=null&&Uv((Oe=i.virtualScroll)==null?void 0:Oe.settledToken)&&ym()===Qe&&(Jh=xm(i.virtualScroll.settledToken)));const tn=Wt()&&It&&HS(),un=vf(pt,tn?"final":void 0);return Yb(un,!0),un})}let Kb="content",wf=null,Cf=null,Zb=0,gm=null,np=null,Gb=null,Qb=null;function vm(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function XS($){var J,he;const me=gm;if(!me)return!0;const Le=(he=(J=i.virtualScroll)==null?void 0:J.heightDiffThresholdPx)!=null?he:1;return Math.abs($.totalHeight-me.totalHeight)>Le||$.sessionKey!==me.sessionKey||$.phase!==me.phase||$.stable!==me.stable||$.final!==me.final||$.threadKey!==me.threadKey||$.nodeCount!==me.nodeCount||$.measuredCount!==me.measuredCount||$.width!==me.width}function ym($=(J=>(J=i.virtualScroll)==null?void 0:J.settledToken)()){return Rs($)}function e_($,J){var he,me;return[$,J.sessionKey,(he=J.threadKey)!=null?he:"",Hu(),Ob(),Rs((me=i.virtualScroll)==null?void 0:me.settledToken),Math.round(J.totalHeight),Math.round(J.width)].join("\0")}function km(){Gb=null,Qb=null,np=null}function uG($){const J=$.heightCache;return J?.length?Hb(J):""}function bm($){var J,he,me;const Le=$.metrics,Oe=$.anchor?(Ze=$.anchor).type==="bottom"?`bottom:${Math.round(Ze.distanceFromBottomPx)}`:`node:${Ze.nodeIndex}:${Math.round(Ze.offsetWithinNodePx)}`:"none";var Ze;return[$.sessionKey,(J=$.threadKey)!=null?J:"",(he=$.measurementKey)!=null?he:Hu(),(me=$.contentHash)!=null?me:"",uG($),Oe,$.anchorCaptured?1:0,Le.liveRange.start,Le.liveRange.end,Le.renderedCount,Le.nodeCount,Math.round(Le.totalHeight),Math.round(Le.width),Le.phase,Le.stable?1:0].join("\0")}function Yb($,J=!1){if(!Qn.value||(function(Ze=!1){return!Ze&&_o.value&&!Zi.value})(J))return;const he=J||XS($),me=(function(Ze,et=!1){return et||Ze.stable||Ze.phase==="final"?{state:Xh(Ze,{includeHeightCache:!0})}:{state:Xh(Ze)}})($,J),Le=me.state,Oe=!!(Le&&(he||(function(Ze,et=!1){return!!et||bm(Ze)!==np})(Le,J)));if(he&&(R($),gm=$,Zb=vm()),Le&&Oe&&(q(Le),Le.anchor&&z(Le.anchor),np=bm(Le)),$.stable){const Ze=e_("settled",$);if(Ze!==Gb){Gb=Ze;const et=Xh($,{includeHeightCache:!0});et&&(q(et),np=bm(et)),(function(mt){o("render-settled",mt)})($)}}if($.phase==="final"){const Ze=e_("final",$);if(Ze!==Qb){Qb=Ze;const et=Xh($,{includeHeightCache:!0});et&&(q(et),np=bm(et)),(function(mt){o("render-final",mt)})($)}}}function Jb(){wf!=null&&(Gi?.(wf),wf=null),Cf!=null&&K&&(window.clearTimeout(Cf),Cf=null)}function t_(){wf=null,Cf=null,(function($){if(Aa.size>0||fr!=null)return!0;switch($){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Kb)&&(Wu(),mm()),Yb(vf(Kb))}function uo($){var J,he;if(!Qn.value||(Kb=$,wf!=null||Cf!=null))return;const me=Math.max(0,(he=(J=i.virtualScroll)==null?void 0:J.emitIntervalMs)!=null?he:32),Le=Math.max(0,me-(vm()-Zb)),Oe=()=>{Cf=null,wf=to?to(t_):null,wf==null&&t_()};K&&Le>0?Cf=window.setTimeout(Oe,Le):Oe()}function n_(){Ul.value+=1}function Gv($){if(Qi.value&&$>=Vn.value){const J=Ue.value[$],he=ze.value===!0&&ft.value!==!0&&$>=Ue.value.length-2,me=J?.type==="code_block"||J?.type==="image"||J?.type==="mermaid"||J?.type==="infographic";if(!he||me)return!1}return!Ne.value||$=fe.value&&(Z.value||(Z.value=!0,wb()),!fn.value||!eo))return ip($),void(J&&Fc($,!0));if(${if(tu.delete(Oe),!Ne.value||hr.value.has(Oe))return;const mt=fi.get(Oe);if(!mt)return;const tt=Ae(mt),ut=mt.ownerDocument||document,pt=ut.defaultView||window,Qe=!tt||tt===ut.documentElement||tt===ut.body,ct=!Qe&&tt?Gt("nodeVisibilityFallback.root.getBoundingClientRect",()=>tt.getBoundingClientRect()):null,At=Qe?0:ct.top,yt=Qe?Gt("nodeVisibilityFallback.clientHeight",()=>{var It,tn;return(tn=(It=pt.innerHeight)!=null?It:tt?.clientHeight)!=null?tn:0}):ct.bottom,Wt=Gt("nodeVisibilityFallback.node.getBoundingClientRect",()=>mt.getBoundingClientRect());Wt.bottom>=At-500&&Wt.top<=yt+500&&Fc(Oe,!0)},1800+Ze);tu.set(Oe,et)})($);let Le=null;Le=We(()=>me.isVisible.value,Oe=>{if(Oe){nu($),Fc($,!0),Le?.(),_l.delete($),ws.get($)===me&&ws.delete($);try{me.destroy()}catch{}}},{immediate:!0}),_l.set($,Le),Mn.value&&gi()}function Xb(){fr=null,Di(()=>{let $=!1;for(const[J,he]of Aa)Aa.delete(J),Gs.get(J)===he.el&&Sl.get(J)===he.version&&($=xl(J,he.height,{allowShrink:he.allowShrink})||$);return $})}function op(){fr!=null&&(Gi?.(fr),fr=null),Aa.clear()}function Yv($,J){(function(he,me,Le){var Oe;if(!Number.isFinite(Le)||Le<=0||Gs.get(he)!==me)return;const Ze=Sl.get(he);if(Ze==null)return;const et=Ue.value[he],mt=_t.value&&ft.value!==!0&&!((Oe=i.nodes)!=null&&Oe.length)&&he>=Ue.value.length-2,tt=!(et?.loading===!0||mt),ut=Aa.get(he),pt=ut?ut.allowShrink&&tt:tt,Qe=ut&&!pt?Math.max(ut.height,Le):Le;Aa.set(he,{height:Qe,allowShrink:pt,version:Ze,el:me}),fr==null&&(fr=to?to(Xb):null,fr==null&&Xb())})($,J,wa($,J))}function Wu(){for(const[$,J]of Gs)J&&Yv($,J)}function i_(){ni?.disconnect(),ni=null,Mo.clear()}function e3(){for(;mf.length;)kt(mf.pop())}We(Zi,$=>{$&&uo("content")},{flush:"post"}),t({getVirtualMetrics:vf,captureVirtualState:function($={}){var J;return Xh(vf("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:$.allowFallbackAnchor===!0,requireViewport:$.requireViewport===!0,includeEmptyState:(J=$.includeEmptyState)==null||J})},restoreVirtualState:function($,J={}){const he=J.restoreAnchor===!0,me=J.restoreToken==null?"imperative":String(J.restoreToken);hm=$,pm={restoreAnchor:he,restoreToken:me,allowUncapturedAnchor:J.allowUncapturedAnchor===!0},!Wb($,{restoreAnchor:he,restoreToken:me,allowUncapturedAnchor:J.allowUncapturedAnchor===!0})&&YS($)||(hm=null,pm=null)},forceMeasure:function($="manual"){return fo(this,null,function*(){yield ht(),yield JS(),Wu(),mm(),yield ht();const J=vf($);return Yb(J,!0),J})},settle:Vb,scrollToNode:function($,J="start"){ep(),Nr();const he=Ue.value.length;if(he<=0)return;const me=Qs($,0,he-1),Le=()=>{var Oe;const Ze=Zl({nodeIndex:me,offsetWithinNodePx:0}),et=Ja(me),mt=dm(),tt=(Oe=mt?.clientHeight)!=null?Oe:0,ut=Yr();let pt=Ze;if(J==="center")pt=Ze-tt/2+et/2;else if(J==="end")pt=Ze-tt+et;else if(J==="nearest"&&ut!=null){if(Ze>=ut&&Ze+et<=ut+tt)return;pt=ZeNs.value,$=>{if(!$){i_();for(const J of Ca.values())for(const he of J)kt(he);Ca.clear(),Sl.clear(),e3(),op()}},{immediate:!0}),We(ft,$=>{$&&(function(){if(K&&ft.value&&Gs.size){e3();for(const J of[80,240,640]){const he=Ge(J,()=>{for(const[me,Le]of Gs)Le&&Yv(me,Le)},"final");he!=null&&mf.push(he)}}})(),uo($?"final":"content")});const cG=QL(()=>uo("content"),16),dG=QL(()=>uo("batch"),16);We([()=>Ue.value.length,()=>Vn.value],()=>{Ko.value&&tp(),cG()},{flush:"post",immediate:!0}),We([()=>zn.start,()=>zn.end],()=>{dG()},{flush:"post"});const{cleanupBatchScheduler:fG}=(function($){const{props:J,isClient:he,isTestEnv:me,parsedNodesIdentity:Le,parsedNodeCount:Oe,desiredRenderedCount:Ze,datasetKey:et,batchingEnabled:mt,incrementalRenderingActive:tt,resolvedBatchSize:ut,resolvedInitialBatch:pt,renderedCount:Qe,adaptiveBatchSize:ct,previousRenderContext:At,previousBatchConfig:yt,requestFrame:Wt,cancelFrame:It,hasIdleCallback:tn,cleanupNodeVisibility:un,onDatasetKeyChanged:bn,onDatasetChanged:gn}=$;let wn=null,jn="raf",Xn=null,Wi=0,Ys=!1,Bs=!1;const Sa=new Set,iu=new Set;function Tm(){if(he){wn!=null&&(jn==="raf"&&It?It(wn):jn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(wn):jn==="timeout"&&window.clearTimeout(wn),wn=null),Wi+=1;for(const pr of Sa)It&&It(pr);for(const pr of iu)window.clearTimeout(pr);Sa.clear(),iu.clear(),Xn=null,Ys=!1,Bs=!1}}function r2(){return typeof performance<"u"?performance.now():Date.now()}function w_(pr){(function(qu){var Rc;if(!tt.value)return;const Uu=Math.max(2,(Rc=J.renderBatchBudgetMs)!=null?Rc:6),Vu=Math.max(1,ut.value||1),_a=Math.max(1,Math.floor(Vu/4));qu>1.5*Uu?ct.value=Math.max(_a,Math.floor(.8*ct.value)):qu<.6*Uu&&ct.value=Uu)return;const Vu=Math.max(1,pr),_a=()=>{const lp=r2();wn=null;const Em=Xn??Vu;Xn=null;const ap=r2();Qe.value=Math.min(Uu,Qe.value+Em),un(Qe.value),(function(l3,l2){if(!he)return void w_(l2);Ys=!0;const S_=++Wi;ht().then(()=>{var __;if(S_!==Wi)return;const DG=r2(),FG=Math.max(l2,DG-l3),M_=()=>{S_===Wi&&w_(FG)};if(Wt){let xf=null,up=null,T_=!1;const E_=()=>{T_||(T_=!0,xf!==null&&(Sa.delete(xf),xf=null),up!==null&&(iu.delete(up),window.clearTimeout(up),up=null),M_())};return xf=Wt(()=>{E_()}),Sa.add(xf),up=window.setTimeout(()=>{xf!==null&&It&&It(xf),E_()},Math.max(32,(__=J.renderBatchIdleTimeoutMs)!=null?__:120)),void iu.add(up)}const I_=window.setTimeout(()=>{iu.delete(I_),M_()},0);iu.add(I_)})})(lp,r2()-ap)};if(!he||Xr.immediate)return void _a();const $c=Math.max(0,(qu=J.renderBatchDelay)!=null?qu:16);if(Xn=Xn!=null?Math.max(Xn,Vu):Vu,wn==null){if(!me&&tn&&window.requestIdleCallback){const lp=Math.max(0,(Rc=J.renderBatchIdleTimeoutMs)!=null?Rc:120);return jn="idle",void(wn=window.requestIdleCallback(()=>_a(),{timeout:lp}))}if(Wt&&!me)return jn="raf",void(wn=Wt(()=>{$c===0?_a():(jn="timeout",wn=window.setTimeout(()=>_a(),$c))}));jn="timeout",wn=window.setTimeout(()=>_a(),$c)}}function A_(pr,Xr={}){Ys?Bs=!0:pr==null?x_():C_(pr,Xr)}function x_(){tt.value&&C_(mt.value?Math.max(1,Math.round(ct.value)):Math.max(1,ut.value))}return We([Le,Oe,et,tt,ut,pt,()=>J.renderBatchDelay],()=>{var pr;const Xr=Oe.value,qu=At.value,Rc=et.value,Uu=!Object.is(Rc,qu.key),Vu=Xr!==qu.total,_a=Uu||Vu;At.value={key:Rc,total:Xr};const $c=yt.value,lp=(pr=J.renderBatchDelay)!=null?pr:16,Em=$c.batchSize!==ut.value||$c.initial!==pt.value||$c.delay!==lp||$c.enabled!==tt.value;yt.value={batchSize:ut.value,initial:pt.value,delay:lp,enabled:tt.value},Uu&&bn(Xr),(_a||Em||!tt.value)&&Tm(),(_a||Em)&&(ct.value=Math.max(1,ut.value||1)),_a&&gn();const ap=Ze.value;if(!Xr)return Qe.value=0,void un(0);if(!tt.value)return Qe.value=ap,void un(Qe.value);const l3=Uu||qu.total===0;Qe.value=l3||Em?Math.min(ap,pt.value):Math.min(Qe.value,ap);const l2=Math.max(1,pt.value||ut.value||Xr);Qe.value{tt.value&&(typeof Xr=="number"&&pr<=Xr||pr>Qe.value&&A_())}),{cleanupBatchScheduler:Tm}})({props:M,isClient:K,isTestEnv:xe,parsedNodesIdentity:Zn,parsedNodeCount:vs,desiredRenderedCount:Ie,datasetKey:tG,batchingEnabled:ei,incrementalRenderingActive:Qi,resolvedBatchSize:rn,resolvedInitialBatch:Yn,renderedCount:Vn,adaptiveBatchSize:bs,previousRenderContext:qs,previousBatchConfig:Je,requestFrame:to,cancelFrame:Gi,hasIdleCallback:je,cleanupNodeVisibility:GZ,onDatasetKeyChanged:$=>{op(),dr(),lo(),km(),$>0&&Vt($)},onDatasetChanged:()=>{Mn.value&&gi({immediate:!0})}});We([$n,Mn,()=>O.value,()=>G()],([$,J])=>{if(!$)return TS(),void xn();QZ(),J?gi({immediate:!0}):xn()},{flush:"post",immediate:!0}),We([()=>Ue.value.length,()=>Mn.value],$=>fo(null,[$],function*([J,he]){he&&J&&K&&(yield ht(),gi({immediate:!0}))}),{flush:"post"}),We(yi,$=>{$&&(function(){var J;if(go.value&&Ls.value&&Hs.value&&((J=ys.value)!=null&&J[1]))return;const he=Et({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),me=Et({type:"list_item",children:[he],raw:"- Probe paragraph text"}),Le=Et({type:"list",ordered:!1,items:[me],raw:"- Probe paragraph text"});go.value=he,Ls.value=me,Hs.value=Le;const Oe={1:null,2:null,3:null,4:null,5:null,6:null};for(let Ze=1;Ze<=6;Ze++)Oe[Ze]=Et({type:"heading",level:Ze,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Ze)} Probe heading`});ys.value=Oe})()},{immediate:!0}),We([()=>O.value,yi],()=>{if(!yi.value)return xb(),void(Q.value=0);LS(),xb(),yi.value&&O.value&&typeof ResizeObserver<"u"&&(cm=new ResizeObserver(()=>{LS(),Xo.value&&Al(),Ko.value&&tp(),uo("resize")}),cm.observe(O.value))},{immediate:!0}),We([yi,di,Ml],()=>fo(null,null,function*(){if(!yi.value)return te.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void lo();yield ht(),(function(){if(!yi.value||typeof window>"u")return te.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void lo();const $={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},J=ES(Ab(B.value),".paragraph-node");$.paragraph=T8(B.value,J,"pre-wrap");const he=Ab(P.value),me=he?.querySelector(".paragraph-node");$.listItem=T8(P.value,me,"pre-wrap");const Le=Gt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Ze,et;return(et=(Ze=H.value)==null?void 0:Ze.offsetHeight)!=null?et:0}),Oe=Gt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Ze,et;return(et=(Ze=P.value)==null?void 0:Ze.offsetHeight)!=null?et:0});$.listWrapperOverhead=Math.max(0,Le-Oe);for(let Ze=1;Ze<=6;Ze++){const et=ES(Ab(j[Ze]),`h${Ze}`);$.headings[Ze]=T8(j[Ze],et,"pre-wrap")}te.value=$,lo()})()}),{flush:"post",immediate:!0}),We(()=>Ue.value.length,()=>{Mn.value&&gi({immediate:!0})}),We([yi,Q],()=>{lo(),Mn.value&&gi({immediate:!0}),Xo.value&&Al(),Ko.value&&tp(),uo("resize")},{immediate:!1}),We(()=>Ne.value,$=>{if($)for(const[J,he]of fi)Qv(J,he);else if(wb(),Mn.value)gi({immediate:!0});else for(const[J,he]of fi)he&&Fc(J,!0)},{immediate:!1}),We([se,fe,()=>G()],()=>{var $;($=eo.refresh)==null||$.call(eo);for(const[J,he]of fi)Qv(J,he)},{immediate:!1}),We([()=>M.viewportPriority,()=>Ue.value.length,fe],([$,J,he])=>{if($!==!1){if(Z.value&&(J<=200||J<=he)){Z.value=!1;for(const[me,Le]of fi)Qv(me,Le)}}else Z.value=!1}),We(()=>Vn.value,()=>{Mn.value&&gi({immediate:!0})}),We([Gn,oo,so,()=>Ue.value.length,Mn],()=>{bo()},{immediate:!0});let wm=null,Cm=!1,sp=null;function Am(){wm=null,Nb=null,Lb=void 0,Jh=null,km()}function t3(){op(),dr(),lo(),mi.clear();const $=Ue.value.length;$>0&&Vt($),qb()}function n3(){Jb(),Yt(),gm=null,kf=null,bf=null,Kv=null,hm=null,pm=null,Cm=!1,Am(),zS("restore"),Nr(),ep()}function xm($){var J;return[(J=ts())!=null?J:"",wo(),Hu(),qv.value,ym($),Ue.value.length,Math.round(Zs(0,Ue.value.length)),Math.round(gf()),ve.count,Math.round(ve.total)].join(":")}function o_(){return fo(this,null,function*(){var $,J,he,me;const Le=($=i.virtualScroll)==null?void 0:$.settledToken,Oe=ym(Le),Ze=wo(),et=ts(),mt=Ml.value;if(Qn.value&&((J=i.virtualScroll)==null?void 0:J.settleMode)==="manual"&&Uv(Le))if(Db()){if(xm(Le)!==Jh&&!Cm){Cm=!0;try{const tt=yield Vb({reason:"manual",expectedSettledTokenKey:Oe}),ut=ym()===Oe;Ub(Ze,et,mt)&&tt.sessionKey===Ze&&tt.threadKey===et&&ut&&tt.stable&&tt.phase==="final"&&(Jh=xm((he=i.virtualScroll)==null?void 0:he.settledToken))}finally{Cm=!1,yield ht();const tt=(me=i.virtualScroll)==null?void 0:me.settledToken,ut=Uv(tt)?xm(tt):"";Ub(Ze,et,mt)&&ut&&Jh!==ut&&o_()}}}else uo("manual")})}We(Qn,($,J)=>{if($!==J){if(!$)return n3(),void Jb();n3(),t3(),sp=Ml.value,uo("content")}},{flush:"post"}),We([Qn,Ml],([$,J])=>{$?sp!=null?sp!==J&&(sp=J,(function(he="resize"){op(),dr(),lo(),mi.clear();const me=Ue.value.length;me>0&&Vt(me),qb(),kf=null,bf=null,Kv=null,gm=null,Cm=!1,Am(),QS(),ht(()=>{Wu(),Xo.value&&Al(),Ko.value&&tp(),uo(he)})})("resize")):sp=J:sp=null},{flush:"post",immediate:!0}),We([Qn,()=>wo(),()=>ts()],([$])=>{$&&(n3(),t3(),zS("content"),uo("content"))}),We([Qn,()=>wo(),()=>ts(),Ml,()=>Ue.value.length],([$])=>{$&&(function(J="async-node"){let he=!1;for(const[me,Le]of Array.from(Ql.entries()))Tb(Le)||(Ql.delete(me),es.delete(me),he=!0);he&&(Qh(),uo(J))})("async-node")},{flush:"post"}),We([Qn,()=>{var $;return($=i.virtualScroll)==null?void 0:$.sessionKey},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>i.indexKey,()=>W.value],([$])=>{$&&(km(),(function(J="content"){if(!Qn.value)return;const he=[],me=Ue.value.length,Le=Cb(me);for(const Oe of Array.from(mi.keys())){if(Oe>=me){he.push(Oe);continue}if(Oe=me&&mi.delete(Oe);he.length&&((function(Oe,Ze={}){const et=Array.from(Oe,Number);Wn(et);let mt=0;if(Di(()=>(mt=In(et,Ze),mt>0)),mt>0)(function(tt){for(const ut of tt)mi.delete(ut)})(et);else for(const tt of et)$o.delete(tt)})(he,{notify:!1}),lo(),Am(),Xo.value&&Al(),Ko.value&&tp(),uo(J))})("content"))},{flush:"post",immediate:!0}),We([Qn,()=>Ue.value.length,()=>wo(),()=>ts()],([$,J,he,me],[Le,Oe,Ze,et])=>{$&&Le&&he===Ze&&me===et&&J!==Oe&&Am()},{flush:"post"}),We([Qn,()=>{var $;return($=i.virtualScroll)==null?void 0:$.heightCache},()=>{var $;return($=i.virtualScroll)==null?void 0:$.heightCacheWidth},()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>Ue.value.length,()=>wo(),Q],()=>{QS()},{flush:"post",immediate:!0}),We([Qn,()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreAnchor},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>Ue.value.length,()=>wo(),Q],$=>fo(null,[$],function*([J,he]){if(!J||!he)return;yield ht();const me=(function(){var Le;const Oe=(Le=i.virtualScroll)==null?void 0:Le.restoreAnchor;return Oe==null||Oe===!1?null:Oe===!0?"true":String(Oe)})();Wb(he,{restoreAnchor:me!=null,restoreToken:me??void 0})}),{flush:"post",immediate:!0}),We([Qn,Q,()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey}],([$])=>{var J;if(!$)return;const he=(J=i.virtualScroll)==null?void 0:J.restoreState;he&&kf&&bf==="restore"&&(ZS(he)||(t3(),kf=null,bf=null,uo("resize")))},{flush:"post"}),We([Qn,()=>Ue.value.length,()=>wo(),Q],$=>fo(null,[$],function*([J]){var he;const me=hm,Le=pm;J&&me&&(yield ht(),!Wb(me,{restoreAnchor:Le?.restoreAnchor===!0,restoreToken:(he=Le?.restoreToken)!=null?he:"imperative",allowUncapturedAnchor:Le?.allowUncapturedAnchor===!0})&&YS(me)||(hm=null,pm=null))}),{flush:"post",immediate:!0}),We([Qn,ft,()=>{var $;return($=i.virtualScroll)==null?void 0:$.settleMode},()=>wo(),()=>ts(),Ml,um,Hv,()=>Vn.value,Ie,()=>ve.count,()=>ve.total],([$,J,he])=>{if(!$||J!==!0||he==="manual"||!Fb())return;const me=(function(){var Le;const Oe=Ue.value.length;return[(Le=ts())!=null?Le:"",wo(),Hu(),qv.value,Oe,Math.round(Zs(0,Oe)),Math.round(gf()),ve.count,Math.round(ve.total)].join(":")})();wm!==me&&(wm=me,Vb({reason:"final"}).then(Le=>{Le.stable||wm!==me||(wm=null)}))},{flush:"post",immediate:!0}),We([Qn,ft,()=>{var $;return($=i.virtualScroll)==null?void 0:$.settleMode},()=>{var $;return($=i.virtualScroll)==null?void 0:$.settledToken},()=>wo(),()=>ts(),Ml,um,Hv,()=>Vn.value,Ie,()=>Ue.value.length,()=>ve.count,()=>ve.total],()=>{o_()},{flush:"post",immediate:!0}),We([()=>Ue.value.length,Mn,oo,so,()=>zn.start,()=>zn.end],([$,J,he,me,Le,Oe])=>{be.value&&Nt("virtualization",{nodes:$,virtualization:J,maxLiveNodes:he,buffer:me,focusIndex:Gn.value,scroll:J?(()=>{const Ze=Vl.value||Ae();return Ze?{reverse:_e(Ze),scrollTop:Math.round(Ze.scrollTop),scrollTopAbs:Math.round(Math.abs(Ze.scrollTop)),scrollHeight:Math.round(Ze.scrollHeight),clientHeight:Math.round(Ze.clientHeight)}:null})():null,liveRange:{start:Le,end:Oe},rendered:Vn.value})}),We([()=>M.customId],([$],J,he)=>{if(!$||Vo)return;const me=(function(Le,Oe){return Le?(Cs.controllers[Le]=Oe,()=>{Cs.controllers[Le]===Oe&&delete Cs.controllers[Le]}):()=>{}})($,{captureRestoreAnchor:Xa,restoreAnchor:Gl,getAnchorDrift:ju,getReport:XZ});he(()=>{me()})},{immediate:!0}),ti(()=>{(function(){if(Qn.value)try{Wu(),mm();const $=vf("manual");XS($)&&(R($),gm=$,Zb=vm());const J=Xh($,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});J&&(q(J),J.anchor&&z(J.anchor),np=bm(J))}catch{}})(),fG(),wb(),Ke(),i_();for(const $ of Ca.values())for(const J of $)kt(J);Ca.clear(),Sl.clear(),mi.clear(),e3(),op(),xb(),Nr(),ep(),Jb(),TS(),xn()});const hG=fg("ViewportDeferredMermaidBlockNode",wu({loader:()=>fo(null,null,function*(){try{return(yield Yo(()=>import("./index11-DNt97Omj.js"),__vite__mapDeps([7,5]))).default}catch($){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',$),ol}}),loadingComponent:cN,delay:0}),cN),pG=fg("ViewportDeferredInfographicBlockNode",wu({loader:()=>fo(null,null,function*(){try{return(yield Yo(()=>import("./index10-C0TQjdWb.js"),[])).default}catch($){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',$),ol}}),loadingComponent:uN,delay:0}),uN),mG=fg("ViewportDeferredD2BlockNode",wu(()=>fo(null,null,function*(){try{return(yield Yo(()=>import("./index8-Dx-vzK_w.js"),[])).default}catch($){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',$),ol}})),ol),s_={text:Wo,paragraph:gh,heading:jk,code_block:k8,list:u1,list_item:a1,blockquote:jy,table:Yg,definition_list:Hy,footnote:Wy,footnote_reference:Rl,footnote_anchor:Gg,admonition:Ky,vmr_container:Uy,hardbreak:_d,link:Ur,image:Sd,thematic_break:qy,math_inline:Za,math_block:_H,strong:Wr,emphasis:Vr,strikethrough:qr,highlight:Ol,insert:hl,subscript:fl,superscript:dl,emoji:cl,checkbox:Bl,checkbox_input:Bl,inline_code:xr,html_inline:$l,reference:Hr,html_block:Qg},gG=D(()=>Mb()),r_=D(()=>ZL(M.codeBlockProps)),vG=D(()=>ZL(M.codeBlockProps,{omit:["langs"]})),l_=D(()=>Dt(Dt({stream:M.codeBlockStream,darkTheme:M.codeBlockDarkTheme,lightTheme:M.codeBlockLightTheme,monacoOptions:M.codeBlockMonacoOptions,themes:M.themes,langs:m.value==="shiki"?M.langs:void 0,minWidth:M.codeBlockMinWidth,maxWidth:M.codeBlockMaxWidth},typeof ke.value=="boolean"?{showTooltips:ke.value}:{}),vG.value)),a_=D(()=>Dt(Dn(Dt({},l_.value),{langs:M.langs}),r_.value));function u_($){return typeof $=="boolean"?$:void 0}const yG=D(()=>{const $=M.codeBlockProps||{},J={},he=u_($.showLineNumbers);he!==void 0&&(J.showLineNumbers=he);const me=u_($.diffInline);me!==void 0&&(J.diffInline=me);const Le=(function(Oe){const Ze=Number(Oe);return Number.isFinite(Ze)&&Ze>0?Ze:void 0})($.reservedHeightPx);return Le!==void 0&&(J.reservedHeightPx=Le),J}),kG=D(()=>Dt(Dt({stream:M.codeBlockStream,darkTheme:M.codeBlockDarkTheme,lightTheme:M.codeBlockLightTheme,themes:M.themes,langs:M.langs,minWidth:M.codeBlockMinWidth,maxWidth:M.codeBlockMaxWidth},typeof ke.value=="boolean"?{showTooltips:ke.value}:{}),r_.value)),bG=D(()=>Dt({},M.mermaidProps||{})),c_=D(()=>Dt({},M.d2Props||{})),wG=D(()=>Dt({},M.infographicProps||{})),Sm=D(()=>({typewriter:f.value,fade:M.fade,customHtmlTags:ot.value.customHtmlTags})),CG=D(()=>Dt(Dt({},Sm.value),typeof ke.value=="boolean"?{showTooltip:ke.value}:{})),AG=D(()=>Dt(Dt({},Sm.value),typeof ke.value=="boolean"?{showTooltips:ke.value}:{})),xG=D(()=>Dt(Dt({},Sm.value),typeof ke.value=="boolean"?{showTooltips:ke.value}:{})),SG=D(()=>Dt(Dt({},Sm.value),typeof ke.value=="boolean"?{showTooltips:ke.value}:{}));function _G($){return Array.isArray($.children)&&$.children.length>0}const Jv=D(()=>JZ.value.map($=>{var J,he,me,Le,Oe,Ze,et,mt;let tt=(function(It){var tn,un,bn,gn,wn,jn,Xn;if(It.type!=="code_block")return It;const Wi=It,Ys=[String((tn=Wi.language)!=null?tn:""),String((un=Wi.loading)!=null?un:""),String((bn=Wi.diff)!=null?bn:""),String((gn=Wi.code)!=null?gn:""),String((wn=Wi.originalCode)!=null?wn:""),String((jn=Wi.updatedCode)!=null?jn:""),String((Xn=Wi.raw)!=null?Xn:"")].join("\0"),Bs=Ro.get(Wi);if(Bs&&Bs.signature===Ys)return Bs.node;const Sa=Dt({},Wi);return Ro.set(Wi,{signature:Ys,node:Sa}),Sa})($.node);const ut=Xv(tt);let pt=p_(tt,ut);if((tt.type==="html_block"||tt.type==="html_inline")&&pt===s_[tt.type]){const It=tt,tn=String((J=It.tag)!=null?J:"").trim().toLowerCase()||Yz(It.content);if(tn){const un=xi.value[tn];if(Uo.value.has(tn)&&un)pt=un,tt=Dn(Dt({},It),{type:tn,tag:tn,content:$he(It.content,tn)});else if(Jz((he=It.content)!=null?he:It.raw,tn)){const bn=String((Le=(me=It.content)!=null?me:It.raw)!=null?Le:"");tt.type==="html_inline"?(pt=Wo,tt={type:"text",content:bn,raw:bn}):(pt=gh,tt={type:"paragraph",children:[{type:"text",content:bn,raw:bn}],raw:bn})}}}const Qe=tt.type==="code_block"&&m.value==="pre"&&pt===ol&&!i3(xi.value,ut);let ct=Dt({},(function(It,tn,un){const bn=tn??Xv(It);if(It.type==="code_block"){const gn=bn?i3(xi.value,bn):void 0;if(un&&m.value==="pre"&&!gn&&un===ol)return yG.value;if(un&&bn&&un===gn)return bn==="mermaid"?f_(It):bn==="infographic"?h_(It):bn==="d2"||bn==="d2lang"?c_.value:a_.value;if(un&&un===xi.value.code_block)return a_.value;if(DS(un))return kG.value}return bn==="mermaid"?f_(It):bn==="infographic"?h_(It):bn==="d2"||bn==="d2lang"?c_.value:It.type==="link"?CG.value:It.type==="list"?AG.value:It.type==="blockquote"?xG.value:It.type==="table"?SG.value:It.type==="code_block"?l_.value:Sm.value})(tt,ut,pt));const At=yi.value?Gh.value[$.index]:null;tt.type==="code_block"&&At?.kind==="code-block"&&(ct=Dn(Dt({},ct),Qe?{reservedHeightPx:(Oe=At.height)!=null?Oe:At.contentHeight}:{estimatedHeightPx:At.height,estimatedContentHeightPx:At.contentHeight,estimatedDiffInline:At.diffInline})),Qe||tt.type!=="code_block"||ut!=="mermaid"||zp(ct.estimatedPreviewHeightPx)!=null||(ct=Dn(Dt({},ct),{estimatedPreviewHeightPx:o4(n4(String((Ze=tt.code)!=null?Ze:"")))})),Qe||tt.type!=="code_block"||ut!=="infographic"||zp(ct.estimatedPreviewHeightPx)!=null||(ct=Dn(Dt({},ct),{estimatedPreviewHeightPx:s4(i4(String((et=tt.code)!=null?et:"")))})),tt.type==="math_block"&&(ct=Dn(Dt({},ct),{cacheScope:ji}));const yt=(function(It,tn){const un=String(It.type);return!xv(un)&&xi.value[un]===tn})(tt,pt),Wt=yt?C7(tt,we.value):void 0;return Dn(Dt({},$),{node:tt,component:pt,bindings:ct,customBindings:Dt(Dt({},Wt??{}),ct),rendersCustomNode:yt,hasSlotChildren:_G(tt),slotContent:String((mt=tt.content)!=null?mt:""),isCodeBlock:tt.type==="code_block",indexKey:`${gG.value}-${$.index}`,vnodeKey:`${eG.value}\0${$.index}\0${tt.type}`})}));function Xv($){var J;return $?.type==="code_block"?String((J=$.language)!=null?J:"").trim().toLowerCase():""}function i3($,J){const he=J.trim().toLowerCase();if(he)for(const me of[he,Ok(he),aH(he)]){const Le=me&&$[me];if(Le)return Le}}function d_($,J,he,me){var Le,Oe;const Ze=Dt({},$.value);return zp(Ze.estimatedPreviewHeightPx)==null&&(Ze.estimatedPreviewHeightPx=me(he(String((Le=J?.code)!=null?Le:"")),void 0,Ze.maxHeight==="none"?null:(Oe=zp(Ze.maxHeight))!=null?Oe:void 0)),Ze}function f_($){return d_(bG,$,n4,o4)}function h_($){return d_(wG,$,i4,s4)}function p_($,J){if(!$)return LC;const he=xi.value,me=he[String($.type)];if($.type==="code_block"){const Le=J??Xv($),Oe=Le?i3(he,Le):void 0;return Oe||(m.value==="pre"?he.code_block||ol:Le==="mermaid"?he.mermaid||hG:Le==="infographic"?he.infographic||pG:Le==="d2"||Le==="d2lang"?he.d2||mG:me||he.code_block||FS.value)}return me||s_[String($.type)]||LC}function o3($){o("click",$)}function MG($){var J;(J=$.target)!=null&&J.closest("[data-node-index]")&&o("mouseover",$)}function IG($){var J;(J=$.target)!=null&&J.closest("[data-node-index]")&&o("mouseout",$)}function m_($){o("mouseover",$)}function g_($){o("mouseout",$)}const Af=V(null),Jr=V(!1),_m=V(null),TG=D(()=>!(M.domMode!=="minimal"||re.value||M.fade!==!1||f.value||Jr.value||Ve.value||Mn.value||Er.value||vo.value||ro.value||Object.keys(xi.value).length!==0));let Mm,rp=null,s3=0,e2=0,t2=0;const v_=["code_block","admonition","table","math_block","html_block","image","thematic_break"],EG=new Set(v_),y_=[".typewriter-cursor",".height-estimation-probes",...v_.map($=>`[data-node-type="${$}"]`),"script","style"].join(",");function k_($){if(!$||typeof $!="object")return!1;const J=$.type;return typeof J=="string"&&EG.has(J)}function n2($){var J,he;if(!$||typeof $!="object")return 0;const me=$,Le=(he=(J=me.raw)!=null?J:me.content)!=null?he:me.code;if(typeof Le=="string")return Le.length;const Oe=me.children;if(Array.isArray(Oe))return Oe.reduce((et,mt)=>et+n2(mt),0);const Ze=me.items;return Array.isArray(Ze)?Ze.reduce((et,mt)=>et+n2(mt),0):0}function i2(){Mm&&(clearTimeout(Mm),Mm=void 0)}function r3(){s3+=1,rp!=null&&(Gi?.(rp),rp=null)}function Im(){r3(),Bc(),Af.value&&(Af.value.style.visibility="hidden")}function LG($){var J;if($.nodeType!==Node.TEXT_NODE||!((J=$.textContent)!=null?J:"").trim())return!1;const he=$.parentElement;return!!he&&!he.closest(y_)}function NG($){let J=$.lastChild;for(;J;){if(LG(J))return J;if(J.nodeType===Node.ELEMENT_NODE){const he=J;if(!he.matches(y_)&&he.lastChild){J=he.lastChild;continue}}for(;J&&J!==$&&!J.previousSibling;)J=J.parentNode;if(!J||J===$)break;J=J.previousSibling}return null}function b_(){const $=Jv.value;for(let J=$.length-1;J>=0;J--){const he=$[J];if(!he||k_(he.node)||!Gv(he.index))continue;const me=fi.get(he.index);if(!me)continue;const Le=NG(me);if(Le)return Le}return null}function Bc(){_m.value&&(_m.value.classList.remove(dN),_m.value=null)}function o2(){if(d.value!=="simple"||!K||!Jr.value||!O.value)return void Bc();const $=b_(),J=$?(function(he){var me;const Le=(me=he.parentElement)==null?void 0:me.closest(".text-node");return Le instanceof HTMLElement?Le:he.parentElement})($):null;J!==_m.value&&(Bc(),J&&(J.classList.add(dN),_m.value=J))}function s2(){if(d.value!=="precise"||!K||!Jr.value||rp!=null)return;const $=s3,J=()=>{rp=null,$===s3&&(function(){var he,me;if(d.value!=="precise"||!(K&&Jr.value&&O.value&&Af.value))return;const Le=O.value,Oe=Af.value;Oe.style.visibility="hidden";const Ze=b_();if(!Ze)return;let et=0,mt=0,tt=20,ut=!1;if(Ze?.textContent){const pt=Ze.textContent.length,Qe=document.createRange();Qe.setStart(Ze,Math.max(0,pt-1)),Qe.setEnd(Ze,pt);const ct=typeof Qe.getClientRects=="function"?Qe.getClientRects():void 0,At=(me=ct?.[ct.length-1])!=null?me:(he=Ze.parentElement)==null?void 0:he.getBoundingClientRect();if(At){const yt=Gt("typewriterCursor.root.getBoundingClientRect",()=>Le.getBoundingClientRect());et=At.right-yt.left+Le.scrollLeft,mt=At.top-yt.top+Le.scrollTop,tt=At.height||tt,ut=!0}Qe.detach()}ut&&(Oe.style.transform=`translate(${Math.max(0,et)}px, ${Math.max(0,mt)}px)`,Oe.style.height=`${tt}px`,Oe.style.visibility="visible")})()};to?rp=to(J):J()}return We([qe,()=>i.content,()=>i.nodes,()=>M.typewriter,ft],()=>fo(null,null,function*(){var $,J;if(!K||re.value||!le.value)return;if(ft.value)return Jr.value=!1,i2(),void Im();if(($=i.nodes)!=null&&$.length)return Jr.value=!1,i2(),Im(),e2=((J=i.content)!=null?J:"").length,void(t2=qe.value.length);const he=(function(){var et,mt;return(et=i.nodes)!=null&&et.length?i.nodes.reduce((tt,ut)=>tt+n2(ut),0):((mt=i.content)!=null?mt:"").length})(),me=(function(){var et;return(et=i.nodes)!=null&&et.length?i.nodes.reduce((mt,tt)=>mt+n2(tt),0):qe.value.length})(),Le=!k_(Ue.value[Ue.value.length-1]),Oe=he>e2,Ze=me>t2;if(!f.value||!Le||!Oe&&!Ze)return f.value&&Le||(Jr.value=!1,Im()),e2=he,void(t2=me);e2=he,t2=me,Jr.value=!0,d.value==="precise"&&Af.value&&(Af.value.style.visibility="hidden"),i2(),yield ht(),d.value==="simple"?o2():(Bc(),s2()),Mm=setTimeout(()=>{Mm=void 0,Jr.value=!1},3e3)}),{flush:"post",immediate:!0}),We(Jr,$=>fo(null,null,function*(){$?(yield ht(),d.value!=="simple"?(Bc(),d.value==="precise"&&s2()):o2()):Im()}),{flush:"post"}),We(d,()=>fo(null,null,function*(){if(K&&!re.value&&le.value&&Jr.value){if(yield ht(),d.value==="simple")return r3(),void o2();Bc(),d.value!=="precise"?Im():s2()}}),{flush:"post"}),We([()=>Vn.value,()=>zn.start,()=>zn.end],()=>fo(null,null,function*(){K&&!re.value&&le.value&&Jr.value&&(yield ht(),d.value!=="simple"?(Bc(),d.value==="precise"&&s2()):o2())}),{flush:"post"}),ti(()=>{i2(),r3(),Bc(),ci.clear()}),($,J)=>{const he=uY("NodeRenderer",!0);return p(re)?(k(!0),L(De,{key:0},Ct(Jv.value,me=>(k(),L(De,{key:me.vnodeKey},[me.rendersCustomNode?(k(),de(Po(me.component),ui({key:0,ref_for:!0},me.customBindings,{node:me.node,loading:me.node.loading,"index-key":me.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onClick:o3,onMouseover:m_,onMouseout:g_,onCopy:J[0]||(J[0]=Le=>s(Le)),onHandleArtifactClick:J[1]||(J[1]=Le=>o("handleArtifactClick",Le))}),{default:ce(()=>[me.hasSlotChildren?(k(),de(he,ui({key:0,ref_for:!0},bt.value,{nodes:me.node.children,"index-key":me.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):me.slotContent?(k(),de(he,ui({key:1,ref_for:!0},bt.value,{content:me.slotContent,final:!me.node.loading,"index-key":`${me.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(Po(me.component),ui({key:1,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onClick:o3,onMouseover:m_,onMouseout:g_,onCopy:J[2]||(J[2]=Le=>s(Le)),onHandleArtifactClick:J[3]||(J[3]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(k(),L("div",{key:1,ref_key:"containerRef",ref:O,class:Re(["markstream-vue markdown-renderer",[{dark:M.isDark},{virtualized:Mn.value},{"virtual-scroll-coordinated":Zi.value},{"stable-layout":Ft.value},{"typewriter-simple-cursor":Jr.value&&d.value==="simple"}]]),"data-custom-id":M.customId,onClick:o3,onMouseover:MG,onMouseout:IG},[Hi.value||Mn.value?(k(),L(De,{key:0},[Hi.value?(k(),de(q9e,{key:0,width:di.value,"flow-root":Mn.value||Zi.value,"paragraph-node":go.value,"list-item-node":Ls.value,"list-node":Hs.value,"heading-nodes":ys.value,"set-paragraph-wrapper":mn,"set-list-item-wrapper":En,"set-list-wrapper":Jn,"set-heading-wrapper":YZ},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ee("",!0),Mn.value?(k(),L("div",{key:1,class:"node-spacer",style:on({height:`${Sb.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],64)):ee("",!0),TG.value?(k(!0),L(De,{key:1},Ct(Jv.value,me=>(k(),L(De,{key:me.vnodeKey},[Gv(me.index)?(k(),de(Po(me.component),ui({key:0,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onMouseover:J[4]||(J[4]=Le=>o("mouseover",Le)),onMouseout:J[5]||(J[5]=Le=>o("mouseout",Le)),onCopy:J[6]||(J[6]=Le=>s(Le)),onHandleArtifactClick:J[7]||(J[7]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ee("",!0)],64))),128)):(k(!0),L(De,{key:2},Ct(Jv.value,me=>(k(),L("div",{key:me.vnodeKey,ref_for:!0,ref:Le=>Qv(me.index,Le),class:"node-slot","data-node-index":me.index,"data-node-type":me.node.type},[Gv(me.index)?(k(),L("div",{key:0,ref_for:!0,ref:Le=>(function(Oe,Ze){var et;Ze||(function(pt){const Qe=`${Mb()}-${pt}`;let ct=!1;for(const At of Array.from(es.keys())){const yt=Ql.get(At);(yt?.index===pt||At===Qe||At.startsWith(`${Qe}-`))&&(es.delete(At),Ql.delete(At),ct=!0)}ct&&(Qh(),uo("async-node"))})(Oe),Aa.delete(Oe),(function(pt){var Qe;const ct=((Qe=Sl.get(pt))!=null?Qe:0)+1;Sl.set(pt,ct)})(Oe);const mt=Ca.get(Oe);if(mt){for(const pt of mt)kt(pt);Ca.delete(Oe)}if((function(pt){const Qe=Mo.get(pt);Qe&&(ni?.unobserve(Qe),Io.delete(Qe),Mo.delete(pt))})(Oe),!Ze||!Ns.value)return Gs.delete(Oe),void Sl.delete(Oe);Gs.set(Oe,Ze);const tt=()=>{Yv(Oe,Ze)};queueMicrotask(tt);const ut=(ni||typeof ResizeObserver>"u"||(ni=new ResizeObserver(pt=>{if(pt.length)for(const Qe of pt){const ct=Io.get(Qe.target),At=Mo.get(ct??-1);ct!=null&&At&&Yv(ct,At)}else Wu()})),ni);if(ut&&(Mo.set(Oe,Ze),Io.set(Ze,Oe),ut.observe(Ze)),typeof window<"u"){const pt=((et=Ue.value[Oe])==null?void 0:et.type)==="code_block"?[16,80,240,800]:ft.value?[80]:[];if(pt.length){const Qe=pt.map(ct=>Ge(ct,tt,"node-resize")).filter(ct=>ct!=null);Qe.length&&Ca.set(Oe,Qe)}}})(me.index,Le),class:"node-content"},[me.isCodeBlock?me.rendersCustomNode?(k(),de(Po(me.component),ui({key:1,ref_for:!0},me.customBindings,{node:me.node,loading:me.node.loading,"index-key":me.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[12]||(J[12]=Le=>s(Le)),onHandleArtifactClick:J[13]||(J[13]=Le=>o("handleArtifactClick",Le))}),{default:ce(()=>[me.hasSlotChildren?(k(),de(he,ui({key:0,ref_for:!0},bt.value,{nodes:me.node.children,"index-key":me.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):me.slotContent?(k(),de(he,ui({key:1,ref_for:!0},bt.value,{content:me.slotContent,final:!me.node.loading,"index-key":`${me.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(Po(me.component),ui({key:2,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[14]||(J[14]=Le=>s(Le)),onHandleArtifactClick:J[15]||(J[15]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(k(),de(ko,{key:0,name:"fade",css:M.fade!==!1,appear:M.fade!==!1},{default:ce(()=>[me.rendersCustomNode?(k(),de(Po(me.component),ui({key:0,ref_for:!0},me.customBindings,{node:me.node,loading:me.node.loading,"index-key":me.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[8]||(J[8]=Le=>s(Le)),onHandleArtifactClick:J[9]||(J[9]=Le=>o("handleArtifactClick",Le))}),{default:ce(()=>[me.hasSlotChildren?(k(),de(he,ui({key:0,ref_for:!0},bt.value,{nodes:me.node.children,"index-key":me.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):me.slotContent?(k(),de(he,ui({key:1,ref_for:!0},bt.value,{content:me.slotContent,final:!me.node.loading,"index-key":`${me.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(Po(me.component),ui({key:1,node:me.node,loading:me.node.loading,"index-key":me.indexKey},{ref_for:!0},me.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onCopy:J[10]||(J[10]=Le=>s(Le)),onHandleArtifactClick:J[11]||(J[11]=Le=>o("handleArtifactClick",Le))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(k(),L("div",{key:1,class:"node-placeholder",style:on({height:`${Ja(me.index)}px`})},null,4))],8,K9e))),128)),Jr.value&&d.value==="precise"?(k(),L("span",{key:3,ref_key:"typewriterCursorRef",ref:Af,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ee("",!0),Mn.value?(k(),L("div",{key:4,class:"node-spacer",style:on({height:`${_b.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],42,V9e))}}})),[["__scopeId","data-v-a9489508"]]),pl=zH;pl.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",pl.__name,pl.name].filter(n=>!!n));for(const n of t)e.component(n,zH)};const R7=Object.freeze(Object.defineProperty({__proto__:null,default:pl},Symbol.toStringTag,{value:"Module"})),Z9e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},G9e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Q9e={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Y9e={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},J9e={class:"admonition-title"},X9e=["aria-expanded","aria-controls"],e4e=["id"],Ky=$i(lt({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const i=e,o=t,s=D(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;const u=i.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=V(!!i.node.collapsible&&!((n=i.node.open)==null||n));function l(){i.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(k(),L("div",{class:Re(["admonition",[`admonition-${i.node.kind}`]])},[A("div",{id:a,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(k(),L("svg",Z9e,[...c[1]||(c[1]=[A("circle",{cx:"12",cy:"12",r:"10"},null,-1),A("path",{d:"M12 16v-4"},null,-1),A("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(k(),L("svg",G9e,[...c[2]||(c[2]=[A("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),A("path",{d:"M9 18h6"},null,-1),A("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(k(),L("svg",Q9e,[...c[3]||(c[3]=[A("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"},null,-1),A("path",{d:"M12 9v4"},null,-1),A("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(k(),L("svg",Y9e,[...c[4]||(c[4]=[A("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),A("path",{d:"M12 8v4"},null,-1),A("path",{d:"M12 16h.01"},null,-1)])])):ee("",!0),A("span",J9e,F(s.value),1),i.node.collapsible?(k(),L("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(k(),L("svg",{style:on({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...c[5]||(c[5]=[A("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,X9e)):ee("",!0)]),ai(A("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[U(p(pl),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:c[0]||(c[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,e4e),[[Go,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Ky.install=e=>{e.component(Ky.__name,Ky)};const RC=()=>Yo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let W2=null,q2=RC,U2=null,fN=!1,hN=!1;function g9t(){return fo(this,null,function*(){if(W2)return W2;const e=q2;return e?e===RC&&fN?null:U2||(U2=fo(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===RC)return e===q2&&(fN=!0,(function(i){hN||(hN=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',i))})(n)),null;throw n}finally{e===q2&&(U2=null)}return e!==q2?null:t?(W2=(function(n){var i;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(i=n.default)!=null?i:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),W2):null}),U2):null})}let V2=null,jH=null,K2=null;function v9t(){return typeof jH=="function"}function y9t(){return fo(this,null,function*(){if(V2)return V2;const e=jH;return e?K2||(K2=fo(null,null,function*(){const t=yield e(),n=(function(i){var o,s,r;if(!i)return null;const l=(o=i.default)!=null?o:i,a=typeof l=="function"&&typeof((s=l.prototype)==null?void 0:s.render)=="function"?l:(r=i.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(V2=n,V2):null}).finally(()=>{K2=null}),K2):null})}const k9t=Symbol("markstreamLanguageIconResolver");function t4e(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function n4e(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}let pN=!1;function HH(){pN||typeof Worker>"u"||(pN=!0,Dve(new t4e),Vve(new n4e))}HH();function fd(e,t,n="/api/v1"){return`${e}${n}${t.startsWith("/")?t:`/${t}`}`}function mN(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}const $7={},p4=Symbol("resolveImage");class ku extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class na extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class O7 extends Error{size;limit;constructor(t){super(`file too large to preview: ${t.size} bytes (limit ${t.limit})`),this.name="FileTooLargeError",this.size=t.size,this.limit=t.limit}}function qi(e){return e instanceof ku||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Wk(e){return e instanceof na||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}function i4e(e){return Wk(e)&&typeof e.cause=="object"&&e.cause!==null&&e.cause.name==="TimeoutError"}function o4e(e){return e instanceof O7||typeof e=="object"&&e!==null&&e.name==="FileTooLargeError"&&typeof e.limit=="number"}const s4e=41301,r4e=40922;function gN(e){return qi(e)&&e.code===r4e}const Yu=3e4,Z2=5*6e4,vN=5*6e4,WH="0123456789ABCDEFGHJKMNPQRSTVWXYZ",$C=500,qH=40101;function yN(e,t){for(const[n,i]of Object.entries(t))if(i!==void 0)if(Array.isArray(i))for(const o of i)o!==void 0&&e.append(n,String(o));else e.set(n,String(i))}function G2(e=Yu){try{return AbortSignal.timeout(e)}catch{return}}function l4e(e,t){let n="",i=e;for(let o=0;oWH[n%32]).join("")}function qm(){return`${l4e(Date.now(),10)}${a4e(16)}`}function kN(e){try{const t=[];return e.forEach((n,i)=>{typeof n=="string"?t.push({field:i,value:n}):t.push({field:i,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function E8(e){try{const t=await e.text();return t?t.length>$C?`${t.slice(0,$C)}...`:t:void 0}catch{return}}class bN{constructor(t){this.opts=t,this.tracer=t.tracer??$7}tracer;async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t,n,i){let o=fd(this.opts.origin,t,this.opts.restBasePath);if(n){const c=new URLSearchParams;yN(c,n);const d=c.toString();d&&(o=`${o}?${d}`)}const s=qm(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"GET",path:t,url:o,requestId:s});let a;try{a=await fetch(o,{method:"GET",headers:r,signal:G2()})}catch(c){throw this.tracer.restFailure?.({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c}),new na({message:`Network error calling GET ${t}`,cause:c,method:"GET",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Yu,timestamp:Date.now(),durationMs:Date.now()-l})}if(a.ok){this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:0,msg:""});const c=Number(a.headers.get("content-length")??0);if(i?.maxBytes!==void 0&&c>i.maxBytes)throw a.body?.cancel(),new O7({size:c,limit:i.maxBytes});return a.blob()}let u;try{u=await a.clone().json()}catch{}throw this.checkAuthRequired(a,u?.code??0),this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u?.code??a.status,msg:u?.msg??a.statusText,envelopeRequestId:u?.request_id}),new ku({code:u?.code??a.status,msg:u?.msg??a.statusText,requestId:u?.request_id??s,details:u?.details,timestamp:Date.now(),durationMs:Date.now()-l})}async post(t,n,i){return this.request("POST",t,n,void 0,i?.allowCodes,i?.timeoutMs)}async postZip(t,n,i){const o="POST",s=fd(this.opts.origin,t,this.opts.restBasePath),r=qm(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();this.tracer.restRequest?.({method:o,path:t,url:s,requestId:r,body:i});let u;try{u=await fetch(s,{method:o,headers:l,body:JSON.stringify(n),signal:G2(Z2)})}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new na({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"fetch",timeoutMs:Z2,timestamp:Date.now(),durationMs:Date.now()-a})}const c=u.headers.get("content-type")??void 0,d=c?.split(";",1)[0]?.trim().toLowerCase();if(!u.ok||d!=="application/zip"){let h;try{h=await u.clone().json()}catch{}if(this.checkAuthRequired(u,h?.code??0),!u.ok||h!==void 0&&h.code!==0){const v=h?.code??u.status,y=h?.msg??u.statusText;throw this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:v,msg:y,envelopeRequestId:h?.request_id}),new ku({code:v,msg:y,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const m=u.clone(),g=new TypeError(`Expected application/zip, received ${c??"no content type"}`);throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:g}),new na({message:`Invalid ZIP response from ${o} ${t}`,cause:g,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:Z2,status:u.status,statusText:u.statusText,contentType:c,bodyPreview:await E8(m),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await u.blob()}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:h}),new na({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:Z2,status:u.status,statusText:u.statusText,contentType:c,timestamp:Date.now(),durationMs:Date.now()-a})}return this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:u.headers.get("content-disposition")??void 0}}async postForm(t,n,i){if(i?.onUploadProgress!==void 0)return this.postFormXhr(t,n,i.onUploadProgress);const o=fd(this.opts.origin,t,this.opts.restBasePath),s=qm(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:kN(n)});let a;try{a=await fetch(o,{method:"POST",headers:r,body:n,signal:G2()})}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:d}),new na({message:`Network error calling POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Yu,timestamp:Date.now(),durationMs:Date.now()-l})}let u;const c=a.clone();try{u=await a.json()}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:a.status,error:d}),new na({message:`Failed to parse JSON response from POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Yu,status:a.status,statusText:a.statusText,contentType:a.headers.get("content-type")??void 0,bodyPreview:await E8(c),timestamp:Date.now(),durationMs:Date.now()-l})}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u.code,msg:u.msg,envelopeRequestId:u.request_id,data:u.data}),this.checkAuthRequired(a,u.code),u.code!==0){const d=u.code??a.status;throw new ku({code:d,msg:u.msg??a.statusText,requestId:u.request_id??s,details:u.details,timestamp:Date.now(),durationMs:Date.now()-l})}return u.data}postFormXhr(t,n,i){const o=fd(this.opts.origin,t,this.opts.restBasePath),s=qm(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();return this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:kN(n)}),new Promise((a,u)=>{const c=new XMLHttpRequest;c.open("POST",o),c.timeout=Yu;for(const[d,f]of Object.entries(r))c.setRequestHeader(d,f);c.upload.onprogress=d=>{d.lengthComputable&&i(d.loaded,d.total)},c.onerror=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c.statusText||"network error"}),u(new na({message:`Network error calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Yu,timestamp:Date.now(),durationMs:Date.now()-l}))},c.ontimeout=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:"timeout"}),u(new na({message:`Timeout calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Yu,timestamp:Date.now(),durationMs:Date.now()-l}))},c.onload=()=>{let d;try{d=JSON.parse(c.responseText)}catch(f){this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:c.status,error:f}),u(new na({message:`Failed to parse JSON response from POST ${t}`,cause:f,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Yu,status:c.status,statusText:c.statusText,bodyPreview:c.responseText.slice(0,$C),timestamp:Date.now(),durationMs:Date.now()-l}));return}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:c.status,durationMs:Date.now()-l,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthStatus(c.status,d.code),d.code!==0){const f=d.code??c.status;u(new ku({code:f,msg:d.msg??c.statusText,requestId:d.request_id??s,details:d.details,timestamp:Date.now(),durationMs:Date.now()-l}));return}a(d.data)},c.send(n)})}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,i,o,s=[],r=Yu){let l=fd(this.opts.origin,n,this.opts.restBasePath);if(o){const m=new URLSearchParams;yN(m,o);const g=m.toString();g&&(l=`${l}?${g}`)}const a=qm(),u={"X-Request-Id":a};this.addClientHeaders(u),i!==void 0&&(u["Content-Type"]="application/json; charset=utf-8");const c=Date.now();this.tracer.restRequest?.({method:t,path:n,url:l,requestId:a,body:i});let d;try{d=await fetch(l,{method:t,headers:u,body:i!==void 0?JSON.stringify(i):void 0,signal:G2(r)})}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"fetch",durationMs:Date.now()-c,error:m}),new na({message:`Network error calling ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"fetch",timeoutMs:r,timestamp:Date.now(),durationMs:Date.now()-c})}let f;const h=d.clone();try{const m=await d.text();f=d.status===204&&m===""?{code:0,msg:"",data:null,request_id:a}:JSON.parse(m)}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"parse",durationMs:Date.now()-c,status:d.status,error:m}),new na({message:`Failed to parse JSON response from ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"parse",timeoutMs:r,status:d.status,statusText:d.statusText,contentType:d.headers.get("content-type")??void 0,bodyPreview:await E8(h),timestamp:Date.now(),durationMs:Date.now()-c})}if(this.tracer.restResponse?.({method:t,path:n,requestId:a,status:d.status,durationMs:Date.now()-c,code:f.code,msg:f.msg,envelopeRequestId:f.request_id,data:f.data}),this.checkAuthRequired(d,f.code),f.code!==0&&!s.includes(f.code))throw new ku({code:typeof f.code=="number"?f.code:d.status,msg:typeof f.msg=="string"&&f.msg.length>0?f.msg:`HTTP ${d.status}${d.statusText?` ${d.statusText}`:""}`,requestId:f.request_id??a,details:f.details,timestamp:Date.now(),durationMs:Date.now()-c});return f.data}addClientHeaders(t){const n=this.opts.credentialStore?.getToken();n!==void 0&&(t.Authorization=`Bearer ${n}`);const i=this.opts.identity;i!==void 0&&(t["X-Kimi-Client-Id"]=i.clientId,t["X-Kimi-Client-Name"]=i.clientName,t["X-Kimi-Client-Version"]=i.clientVersion,t["X-Kimi-Client-Ui-Mode"]=i.clientUiMode)}checkAuthRequired(t,n){this.checkAuthStatus(t.status,n)}checkAuthStatus(t,n){(t===401||n===qH)&&this.opts.credentialStore?.markAuthRequired?.()}}function UH(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function wN(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function fu(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,archivedAt:e.archived_at,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:UH(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function Q2(e){const t=e.activity.status;return{id:e.id,title:e.meta.title??e.meta.last_prompt??e.id.slice(0,12),createdAt:new Date(e.meta.created_at).toISOString(),updatedAt:new Date(e.meta.updated_at).toISOString(),busy:t==="running",pendingInteraction:t==="approval"?"approval":t==="question"?"question":void 0,lastTurnReason:t==="failed"?"failed":void 0,archived:e.meta.archived,archivedAt:e.meta.archived_at==null?void 0:new Date(e.meta.archived_at).toISOString(),lastPrompt:e.meta.last_prompt??void 0,cwd:e.workspace.cwd??"",model:"",pullRequest:e.git===void 0?void 0:e.git.pull_request,usage:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalCostUsd:0,contextTokens:0,contextLimit:0,turnCount:0},messageCount:0,lastSeq:0,workspaceId:e.workspace.id.length>0?e.workspace.id:void 0}}function Xg(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function CN(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:e.kind==="session_media"?{kind:"sessionMedia",fileId:e.file_id}:{kind:"url",url:e.url}}function P7(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:CN(e.source)};case"video":return{type:"video",source:CN(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function VH(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(P7),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function KH(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:t.kind==="sessionMedia"?n={kind:"session_media",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function u4e(e){return{content:e.content.map(KH),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function c4e(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function d4e(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function f4e(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function h4e(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(f4e),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function p4e(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(h4e),createdAt:e.created_at}}function m4e(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function g4e(e){const t={};for(const[n,i]of Object.entries(e.answers))t[n]=m4e(i);return{answers:t,method:e.method,note:e.note}}function OC(e,t){if(typeof e.run_in_background!="boolean")throw new Error(`task wire missing required run_in_background (id ${e.id})`);return{id:e.id,agentId:e.agent_id??t,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,model:e.model,thinkingEffort:e.thinking_effort,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function AN(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function Vc(e,t){const n=e[t];return typeof n=="string"?n:void 0}function vp(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Jl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function ZH(e){if(!e||typeof e!="object")return null;const t=e,n=Vc(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const i=t.budget,o=i&&typeof i=="object"?i:{};return{goalId:Vc(t,"goalId")??Vc(t,"goal_id")??"goal",objective:Vc(t,"objective")??"",completionCriterion:Vc(t,"completionCriterion")??Vc(t,"completion_criterion"),status:n,turnsUsed:vp(t,"turnsUsed")??vp(t,"turns_used")??0,tokensUsed:vp(t,"tokensUsed")??vp(t,"tokens_used")??0,wallClockMs:vp(t,"wallClockMs")??vp(t,"wall_clock_ms")??0,terminalReason:Vc(t,"terminalReason")??Vc(t,"terminal_reason"),budget:{tokenBudget:Jl(o,"tokenBudget")??Jl(o,"token_budget"),remainingTokens:Jl(o,"remainingTokens")??Jl(o,"remaining_tokens"),turnBudget:Jl(o,"turnBudget")??Jl(o,"turn_budget"),remainingTurns:Jl(o,"remainingTurns")??Jl(o,"remaining_turns"),wallClockBudgetMs:Jl(o,"wallClockBudgetMs")??Jl(o,"wall_clock_budget_ms"),remainingWallClockMs:Jl(o,"remainingWallClockMs")??Jl(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function v4e(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:fu(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:fu(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":{const n=t.payload?.sessionId??t.payload?.session_id;if(typeof n!="string"||n.length===0)return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};const i=t.payload?.workspace_id;return{type:"sessionArchived",sessionId:n,workspaceId:typeof i=="string"&&i.length>0?i:void 0}}case"event.workspace.created":return{type:"workspaceCreated",workspace:Xg(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Xg(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:UH(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=ZH(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:VH(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(P7),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:d4e(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at,feedback:t.payload.feedback,selectedLabel:t.payload.selected_label};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:p4e(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:OC(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.plugin.changed":return{type:"pluginsChanged"};case"event.capability.changed":return{type:"capabilityChanged",capabilityId:t.payload.capability_id,install:t.payload.install};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:PC(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function y4e(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function yp(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function xN(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function PC(e){const t={};for(const[n,i]of Object.entries(e.providers))t[n]={type:i.type,baseUrl:i.base_url,defaultModel:i.default_model,hasApiKey:i.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function k4e(e){return e.session_id}function b4e(e){return e.seq}function w4e(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function SN(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const C4e={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function A4e(e,t){switch(t.op){case"reset":return x4e(e,t);case"turn.upsert":return _4e(e,t.turn);case"step.upsert":return I4e(e,t.turnId,t.step);case"frame.upsert":return E4e(e,t);case"append":return N4e(e,t);case"marker.upsert":return MN(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return MN(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return B4e(e,t.task);case"interaction.upsert":return R4e(e,t.interaction);case"attachment.upsert":return O4e(e,t.attachment);case"todo.upsert":return z4e(e,t.todo);case"prompt.upsert":return H4e(e,t.prompt);case"meta.merge":return U4e(e,t.meta);case"items.remove":return F4e(e,t.ids)}}function x4e(e,t){const n=new Set;for(const i of t.snapshot.interactions)i.state==="pending"&&n.add(i.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(i=>[i.taskId,i])),interactions:new Map(t.snapshot.interactions.map(i=>[i.interactionId,i])),attachments:new Map(t.snapshot.attachments.map(i=>[i.attachmentId,i])),todos:new Map(t.snapshot.todos.map(i=>[i.todoId,i])),prompts:new Map(t.snapshot.prompts.map(i=>[i.promptId,i])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function _N(e,t){return{...e,kind:"turn",steps:[...t]}}function GH(e){return{kind:"turn",turnId:e,ordinal:w4e(e),state:"running",origin:{kind:"other"},steps:[]}}function S4e(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function M1(e,t){const n=e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}function z7(e,t){const n=[...e];let i=n.length;for(let o=0;ot.ordinal){i=o;break}}return n.splice(i,0,t),n}function qk(e,t,n){return e.map(i=>i.kind==="turn"&&i.turnId===t?n(i):i)}function _4e(e,t){const n=M1(e,t.turnId);return n?M4e(n,t)?{state:e,changed:!1}:{state:{...e,items:qk(e.items,t.turnId,i=>_N(t,i.steps))},changed:!0}:{state:{...e,items:z7(e.items,_N(t,[]))},changed:!0}}function M4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function I4e(e,t,n){const i=M1(e,t)??GH(t),o=i.steps.findIndex(u=>u.stepId===n.stepId);let s,r=!0;if(o>=0){const u=i.steps[o];u&&T4e(u,n)?(r=!1,s=i.steps):s=i.steps.map(c=>c.stepId===n.stepId?{...n,kind:"step",frames:c.frames}:c)}else s=[...i.steps,{...n,kind:"step",frames:[]}].toSorted((u,c)=>u.ordinal-c.ordinal);if(!r)return{state:e,changed:!1};const l={...i,steps:[...s]},a=M1(e,t)?qk(e.items,t,()=>l):z7(e.items,l);return{state:{...e,items:a},changed:!0}}function T4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function E4e(e,t){const n=M1(e,t.turnId)??GH(t.turnId),i=n.steps.find(c=>c.stepId===t.stepId)??S4e(t.stepId,t.turnId),o=i.frames.findIndex(c=>c.frameId===t.frame.frameId);let s;if(o>=0){const c=i.frames[o];if(c!==void 0&&L4e(c,t.frame))return{state:e,changed:!1};s=i.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else s=[...i.frames,t.frame];const r={...i,frames:[...s]},l=n.steps.some(c=>c.stepId===t.stepId)?n.steps.map(c=>c.stepId===t.stepId?r:c):[...n.steps,r].toSorted((c,d)=>c.ordinal-d.ordinal),a={...n,steps:l},u=M1(e,t.turnId)?qk(e.items,t.turnId,()=>a):z7(e.items,a);return{state:{...e,items:u},changed:!0}}function L4e(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail:!1}function N4e(e,t){if(t.target.type==="task")return D4e(e,t);const{turnId:n,stepId:i,frameId:o}=t.target,s=M1(e,n),r=s?.steps.find(f=>f.stepId===i),l=r?.frames.find(f=>f.frameId===o);if(!s||!r||!l||l.kind!=="text"&&l.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const a=QH(l.text,t.offset,t.text);if(a.gap)return{state:e,changed:!1,gap:a.gap};if(!a.changed)return{state:e,changed:!1};const u={...l,text:a.text},c={...r,frames:r.frames.map(f=>f.frameId===o?u:f)},d={...s,steps:s.steps.map(f=>f.stepId===i?c:f)};return{state:{...e,items:qk(e.items,n,()=>d)},changed:!0}}function D4e(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,i=e.tasks.get(n),o=i?.outputTail??"",s=QH(o,t.offset,t.text);if(s.gap)return{state:e,changed:!1,gap:s.gap};if(!s.changed)return{state:e,changed:!1};const r=i?{...i,outputTail:s.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:s.text},l=new Map(e.tasks);return l.set(n,r),{state:{...e,tasks:l},changed:!0}}function QH(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const i=e.length-t;return e.slice(t)!==n.slice(0,i)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(i>0?n.slice(i):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function MN(e,t,n,i){if(e.items.some(s=>zC(s)===n)){let s=!1;const r=e.items.map(l=>zC(l)!==n||l===t?l:(s=!0,t));return s?{state:{...e,items:r},changed:!0}:{state:e,changed:!1}}if(i!==void 0){const s=[...e.items];let r=s.length;for(let l=0;l=i){r=l;break}}return s.splice(r,0,t),{state:{...e,items:s},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function zC(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function F4e(e,t){const n=new Set(t),i=e.items.filter(l=>l.kind==="turn"&&n.has(l.turnId)),o=e.items.filter(l=>!n.has(zC(l)));if(o.length===e.items.length)return{state:e,changed:!1};let s=e.pendingInteractions,r=e.interactions;if(i.length>0){const l=new Set,a=new Set(s),u=new Set;for(const c of i)for(const d of c.steps)for(const f of d.frames)f.kind==="tool"&&l.add(f.toolCallId);for(const c of r.values())c.toolCallId!==void 0&&l.has(c.toolCallId)&&(u.add(c.interactionId),a.delete(c.interactionId));if(u.size>0){const c=new Map(r);for(const d of u)c.delete(d);r=c}s=a}return{state:{...e,items:o,interactions:r,pendingInteractions:s},changed:!0}}function B4e(e,t){const n=e.tasks.get(t.taskId);if(n&&q4e(n,t))return{state:e,changed:!1};const i=new Map(e.tasks);return i.set(t.taskId,t),{state:{...e,tasks:i},changed:!0}}function R4e(e,t){const n=e.interactions.get(t.interactionId);if(n&&$4e(n,t))return{state:e,changed:!1};const i=new Map(e.interactions);i.set(t.interactionId,t);let o=e.pendingInteractions;if(t.state==="pending"){if(!o.has(t.interactionId)){const s=new Set(o);s.add(t.interactionId),o=s}}else if(o.has(t.interactionId)){const s=new Set(o);s.delete(t.interactionId),o=s}return{state:{...e,interactions:i,pendingInteractions:o},changed:!0}}function $4e(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function O4e(e,t){const n=e.attachments.get(t.attachmentId);if(n&&P4e(n,t))return{state:e,changed:!1};const i=new Map(e.attachments);return i.set(t.attachmentId,t),{state:{...e,attachments:i},changed:!0}}function P4e(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function z4e(e,t){const n=e.todos.get(t.todoId);if(n&&j4e(n,t))return{state:e,changed:!1};const i=new Map(e.todos);return i.set(t.todoId,t),{state:{...e,todos:i},changed:!0}}function j4e(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function H4e(e,t){const n=e.prompts.get(t.promptId);if(n&&W4e(n,t))return{state:e,changed:!1};const i=new Map(e.prompts);return i.set(t.promptId,t),{state:{...e,prompts:i},changed:!0}}function W4e(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function q4e(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function U4e(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,swarm:t.modes.swarm===null?void 0:t.modes.swarm??e.meta.modes?.swarm,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,i=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,o={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.swarm===void 0&&n.tower===void 0?void 0:n,agent:i};return o.goal===e.meta.goal&&o.activity===e.meta.activity&&o.modes===e.meta.modes&&o.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:o},changed:!0}}class V4e{constructor(t){this.agentId=t}#e=C4e;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let i,o=this.#e;for(const s of t){const r=A4e(o,s);if(r.gap){i={target:s.target,...r.gap};continue}r.changed&&(o=r.state,n.push(s))}if(this.#e=o,n.length>0){const s={agentId:this.agentId,ops:n};for(const r of this.#t)r(s)}return{accepted:n,gap:i}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,i=this.#e.hasMoreOlder;if(t!==void 0){const o=n.reduce((s,r)=>r.kind==="turn"?s+1:s,0);if(o>t.tailTurns){const s=o-t.tailTurns,r=[];let l=0;for(const a of n)if(a.kind==="turn"){if(l+=1,l<=s)continue;r.push(a)}else l>s&&r.push(a);n=r,i=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:i}}}function Mt(e,t,n){function i(l,a){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,a);const u=r.prototype,c=Object.keys(u);for(let d=0;dn?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class c1 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class YH extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const JH={};function Wd(e){return JH}function XH(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function jC(e,t){return typeof t=="bigint"?t.toString():t}function Uk(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function j7(e){return e==null}function H7(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function K4e(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const a=i.match(/\d?e-(\d?)/);a?.[1]&&(o=Number.parseInt(a[1]))}const s=n>o?n:o,r=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return r%l/10**s}const IN=Symbol("evaluating");function zi(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==IN)return i===void 0&&(i=IN,i=n()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Uh(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function sf(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function TN(e){return JSON.stringify(e)}function Z4e(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const eW="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function $0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const G4e=Uk(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function I1(e){if($0(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!($0(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function tW(e){return I1(e)?{...e}:Array.isArray(e)?[...e]:e}const Q4e=new Set(["string","number","symbol"]);function T1(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rf(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function Sn(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Y4e(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const J4e={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function X4e(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=sf(e._zod.def,{get shape(){const r={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(r[l]=n.shape[l])}return Uh(this,"shape",r),r},checks:[]});return rf(e,s)}function eke(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=sf(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete r[l]}return Uh(this,"shape",r),r},checks:[]});return rf(e,s)}function tke(e,t){if(!I1(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(s,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=sf(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Uh(this,"shape",s),s}});return rf(e,o)}function nke(e,t){if(!I1(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=sf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Uh(this,"shape",i),i}});return rf(e,n)}function ike(e,t){const n=sf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Uh(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return rf(e,n)}function oke(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=sf(t._zod.def,{get shape(){const l=t._zod.def.shape,a={...l};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)a[u]=e?new e({type:"optional",innerType:l[u]}):l[u];return Uh(this,"shape",a),a},checks:[]});return rf(t,r)}function ske(e,t,n){const i=sf(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const r in n){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=new e({type:"nonoptional",innerType:o[r]}))}else for(const r in o)s[r]=new e({type:"nonoptional",innerType:o[r]});return Uh(this,"shape",s),s}});return rf(t,i)}function Hp(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Y2(e){return typeof e=="string"?e:e?.message}function qd(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Y2(e.inst?._zod.def?.error?.(e))??Y2(t?.error?.(e))??Y2(n.customError?.(e))??Y2(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function W7(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function O0(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const nW=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,jC,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},iW=Mt("$ZodError",nW),oW=Mt("$ZodError",nW,{Parent:Error});function rke(e,t=n=>n.message){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}function lke(e,t=n=>n.message){const n={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>i({issues:r}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let r=n,l=0;for(;l(t,n,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new c1;if(r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>qd(a,s,Wd())));throw eW(l,o?.callee),l}return r.value},U7=e=>async(t,n,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>qd(a,s,Wd())));throw eW(l,o?.callee),l}return r.value},Vk=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new c1;return s.issues.length?{success:!1,error:new(e??iW)(s.issues.map(r=>qd(r,o,Wd())))}:{success:!0,data:s.value}},ake=Vk(oW),Kk=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>qd(r,o,Wd())))}:{success:!0,data:s.value}},uke=Kk(oW),cke=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return q7(e)(t,n,o)},dke=e=>(t,n,i)=>q7(e)(t,n,i),fke=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return U7(e)(t,n,o)},hke=e=>async(t,n,i)=>U7(e)(t,n,i),pke=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Vk(e)(t,n,o)},mke=e=>(t,n,i)=>Vk(e)(t,n,i),gke=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Kk(e)(t,n,o)},vke=e=>async(t,n,i)=>Kk(e)(t,n,i),yke=/^[cC][^\s-]{8,}$/,kke=/^[0-9a-z]+$/,bke=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wke=/^[0-9a-vA-V]{20}$/,Cke=/^[A-Za-z0-9]{27}$/,Ake=/^[a-zA-Z0-9_-]{21}$/,xke=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ske=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,EN=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_ke=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mke="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ike(){return new RegExp(Mke,"u")}const Tke=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Eke=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Lke=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Nke=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Dke=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sW=/^[A-Za-z0-9_-]*$/,Fke=/^\+[1-9]\d{6,14}$/,rW="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Bke=new RegExp(`^${rW}$`);function lW(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Rke(e){return new RegExp(`^${lW(e)}$`)}function $ke(e){const t=lW({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${rW}T(?:${i})$`)}const Oke=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Pke=/^-?\d+$/,aW=/^-?\d+(?:\.\d+)?$/,zke=/^(?:true|false)$/i,jke=/^[^A-Z]*$/,Hke=/^[^a-z]*$/,bl=Mt("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),uW={number:"number",bigint:"bigint",object:"date"},cW=Mt("$ZodCheckLessThan",(e,t)=>{bl.init(e,t);const n=uW[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?i.value<=t.value:i.value{bl.init(e,t);const n=uW[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Wke=Mt("$ZodCheckMultipleOf",(e,t)=>{bl.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):K4e(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),qke=Mt("$ZodCheckNumberFormat",(e,t)=>{bl.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,s]=J4e[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,n&&(l.pattern=Pke)}),e._zod.check=r=>{const l=r.value;if(n){if(!Number.isInteger(l)){r.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?r.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):r.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}ls&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Uke=Mt("$ZodCheckMaxLength",(e,t)=>{var n;bl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!j7(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const r=W7(o);i.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Vke=Mt("$ZodCheckMinLength",(e,t)=>{var n;bl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!j7(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const r=W7(o);i.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Kke=Mt("$ZodCheckLengthEquals",(e,t)=>{var n;bl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!j7(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===t.length)return;const r=W7(o),l=s>t.length;i.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Zk=Mt("$ZodCheckStringFormat",(e,t)=>{var n,i;bl.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Zke=Mt("$ZodCheckRegex",(e,t)=>{Zk.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Gke=Mt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=jke),Zk.init(e,t)}),Qke=Mt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Hke),Zk.init(e,t)}),Yke=Mt("$ZodCheckIncludes",(e,t)=>{bl.init(e,t);const n=T1(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Jke=Mt("$ZodCheckStartsWith",(e,t)=>{bl.init(e,t);const n=new RegExp(`^${T1(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Xke=Mt("$ZodCheckEndsWith",(e,t)=>{bl.init(e,t);const n=new RegExp(`.*${T1(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),ebe=Mt("$ZodCheckOverwrite",(e,t)=>{bl.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class tbe{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(` -`).filter(r=>r),o=Math.min(...i.map(r=>r.length-r.trimStart().length)),s=i.map(r=>r.slice(o)).map(r=>" ".repeat(this.indent*2)+r);for(const r of s)this.content.push(r)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(` -`))}}const nbe={major:4,minor:3,patch:6},No=Mt("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nbe;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(r,l,a)=>{let u=Hp(r),c;for(const d of l){if(d._zod.def.when){if(!d._zod.def.when(r))continue}else if(u)continue;const f=r.issues.length,h=d._zod.check(r);if(h instanceof Promise&&a?.async===!1)throw new c1;if(c||h instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await h,r.issues.length!==f&&(u||(u=Hp(r,f)))});else{if(r.issues.length===f)continue;u||(u=Hp(r,f))}}return c?c.then(()=>r):r},s=(r,l,a)=>{if(Hp(r))return r.aborted=!0,r;const u=o(l,i,a);if(u instanceof Promise){if(a.async===!1)throw new c1;return u.then(c=>e._zod.parse(c,a))}return e._zod.parse(u,a)};e._zod.run=(r,l)=>{if(l.skipChecks)return e._zod.parse(r,l);if(l.direction==="backward"){const u=e._zod.parse({value:r.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(c=>s(c,r,l)):s(u,r,l)}const a=e._zod.parse(r,l);if(a instanceof Promise){if(l.async===!1)throw new c1;return a.then(u=>o(u,i,l))}return o(a,i,l)}}zi(e,"~standard",()=>({validate:o=>{try{const s=ake(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return uke(e,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),V7=Mt("$ZodString",(e,t)=>{No.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Oke(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),So=Mt("$ZodStringFormat",(e,t)=>{Zk.init(e,t),V7.init(e,t)}),ibe=Mt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ske),So.init(e,t)}),obe=Mt("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=EN(i))}else t.pattern??(t.pattern=EN());So.init(e,t)}),sbe=Mt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_ke),So.init(e,t)}),rbe=Mt("$ZodURL",(e,t)=>{So.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),lbe=Mt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ike()),So.init(e,t)}),abe=Mt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ake),So.init(e,t)}),ube=Mt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=yke),So.init(e,t)}),cbe=Mt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=kke),So.init(e,t)}),dbe=Mt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bke),So.init(e,t)}),fbe=Mt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=wke),So.init(e,t)}),hbe=Mt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Cke),So.init(e,t)}),pbe=Mt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=$ke(t)),So.init(e,t)}),mbe=Mt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Bke),So.init(e,t)}),gbe=Mt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Rke(t)),So.init(e,t)}),vbe=Mt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=xke),So.init(e,t)}),ybe=Mt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Tke),So.init(e,t),e._zod.bag.format="ipv4"}),kbe=Mt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Eke),So.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),bbe=Mt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Lke),So.init(e,t)}),wbe=Mt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Nke),So.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const r=Number(s);if(`${r}`!==s)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function fW(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Cbe=Mt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Dke),So.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{fW(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Abe(e){if(!sW.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fW(n)}const xbe=Mt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=sW),So.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Abe(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Sbe=Mt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Fke),So.init(e,t)});function _be(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Mbe=Mt("$ZodJWT",(e,t)=>{So.init(e,t),e._zod.check=n=>{_be(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),hW=Mt("$ZodNumber",(e,t)=>{No.init(e,t),e._zod.pattern=e._zod.bag.pattern??aW,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),Ibe=Mt("$ZodNumberFormat",(e,t)=>{qke.init(e,t),hW.init(e,t)}),Tbe=Mt("$ZodBoolean",(e,t)=>{No.init(e,t),e._zod.pattern=zke,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Ebe=Mt("$ZodUnknown",(e,t)=>{No.init(e,t),e._zod.parse=n=>n}),Lbe=Mt("$ZodNever",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function LN(e,t,n){e.issues.length&&t.issues.push(...Wp(n,e.issues)),t.value[n]=e.value}const Nbe=Mt("$ZodArray",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let r=0;rLN(u,n,r))):LN(a,n,r)}return s.length?Promise.all(s).then(()=>n):n}});function m4(e,t,n,i,o){if(e.issues.length){if(o&&!(n in i))return;t.issues.push(...Wp(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function pW(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=Y4e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function mW(e,t,n,i,o,s){const r=[],l=o.keySet,a=o.catchall._zod,u=a.def.type,c=a.optout==="optional";for(const d in t){if(l.has(d))continue;if(u==="never"){r.push(d);continue}const f=a.run({value:t[d],issues:[]},i);f instanceof Promise?e.push(f.then(h=>m4(h,n,d,t,c))):m4(f,n,d,t,c)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const Dbe=Mt("$ZodObject",(e,t)=>{if(No.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...l};return Object.defineProperty(t,"shape",{value:a}),a}})}const i=Uk(()=>pW(t));zi(e._zod,"propValues",()=>{const l=t.shape,a={};for(const u in l){const c=l[u]._zod;if(c.values){a[u]??(a[u]=new Set);for(const d of c.values)a[u].add(d)}}return a});const o=$0,s=t.catchall;let r;e._zod.parse=(l,a)=>{r??(r=i.value);const u=l.value;if(!o(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l;l.value={};const c=[],d=r.shape;for(const f of r.keys){const h=d[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},a);g instanceof Promise?c.push(g.then(v=>m4(v,l,f,u,m))):m4(g,l,f,u,m)}return s?mW(c,u,l,a,i.value,e):c.length?Promise.all(c).then(()=>l):l}}),Fbe=Mt("$ZodObjectJIT",(e,t)=>{Dbe.init(e,t);const n=e._zod.parse,i=Uk(()=>pW(t)),o=f=>{const h=new tbe(["shape","payload","ctx"]),m=i.value,g=w=>{const C=TN(w);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};h.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const w of m.keys)v[w]=`key_${y++}`;h.write("const newResult = {};");for(const w of m.keys){const C=v[w],T=TN(w),I=f[w]?._zod?.optout==="optional";h.write(`const ${C} = ${g(w)};`),I?h.write(` - if (${C}.issues.length) { - if (${T} in input) { - payload.issues = payload.issues.concat(${C}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${T}, ...iss.path] : [${T}] - }))); - } - } - - if (${C}.value === undefined) { - if (${T} in input) { - newResult[${T}] = undefined; - } - } else { - newResult[${T}] = ${C}.value; - } - - `):h.write(` - if (${C}.issues.length) { - payload.issues = payload.issues.concat(${C}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${T}, ...iss.path] : [${T}] - }))); - } - - if (${C}.value === undefined) { - if (${T} in input) { - newResult[${T}] = undefined; - } - } else { - newResult[${T}] = ${C}.value; - } - - `)}h.write("payload.value = newResult;"),h.write("return payload;");const b=h.compile();return(w,C)=>b(f,w,C)};let s;const r=$0,l=!JH.jitless,u=l&&G4e.value,c=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=i.value);const m=f.value;return r(m)?l&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),c?mW([],m,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function NN(e,t,n,i){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Hp(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(r=>qd(r,i,Wd())))}),t)}const gW=Mt("$ZodUnion",(e,t)=>{No.init(e,t),zi(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),zi(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),zi(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),zi(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>H7(s.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return i(o,s);let r=!1;const l=[];for(const a of t.options){const u=a._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)l.push(u),r=!0;else{if(u.issues.length===0)return u;l.push(u)}}return r?Promise.all(l).then(a=>NN(a,o,e,s)):NN(l,o,e,s)}}),Bbe=Mt("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gW.init(e,t);const n=e._zod.parse;zi(e._zod,"propValues",()=>{const o={};for(const s of t.options){const r=s._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,a]of Object.entries(r)){o[l]||(o[l]=new Set);for(const u of a)o[l].add(u)}}return o});const i=Uk(()=>{const o=t.options,s=new Map;for(const r of o){const l=r._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const a of l){if(s.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);s.set(a,r)}}return s});e._zod.parse=(o,s)=>{const r=o.value;if(!$0(r))return o.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),o;const l=i.value.get(r?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:r,path:[t.discriminator],inst:e}),o)}}),Rbe=Mt("$ZodIntersection",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},i),r=t.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([a,u])=>DN(n,a,u)):DN(n,s,r)}});function HC(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(I1(e)&&I1(t)){const n=Object.keys(t),i=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of i){const r=HC(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};o[s]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;il.l&&l.r).map(([l])=>l);if(s.length&&o&&e.issues.push({...o,keys:s}),Hp(e))return e;const r=HC(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const $be=Mt("$ZodRecord",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!I1(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],r=t.keyType._zod.values;if(r){n.value={};const l=new Set;for(const u of r)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const c=t.valueType._zod.run({value:o[u],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...Wp(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...Wp(u,c.issues)),n.value[u]=c.value)}let a;for(const u in o)l.has(u)||(a=a??[],a.push(u));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let a=t.keyType._zod.run({value:l,issues:[]},i);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&aW.test(l)&&a.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(a=d)}if(a.issues.length){t.mode==="loose"?n.value[l]=o[l]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(d=>qd(d,i,Wd())),input:l,path:[l],inst:e});continue}const c=t.valueType._zod.run({value:o[l],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...Wp(l,d.issues)),n.value[a.value]=d.value})):(c.issues.length&&n.issues.push(...Wp(l,c.issues)),n.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),Obe=Mt("$ZodEnum",(e,t)=>{No.init(e,t);const n=XH(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(o=>Q4e.has(typeof o)).map(o=>typeof o=="string"?T1(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const r=o.value;return i.has(r)||o.issues.push({code:"invalid_value",values:n,input:r,inst:e}),o}}),Pbe=Mt("$ZodLiteral",(e,t)=>{if(No.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?T1(i):i?T1(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),i}}),zbe=Mt("$ZodTransform",(e,t)=>{No.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new YH(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(r=>(n.value=r,n));if(o instanceof Promise)throw new c1;return n.value=o,n}});function FN(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const vW=Mt("$ZodOptional",(e,t)=>{No.init(e,t),e._zod.optin="optional",e._zod.optout="optional",zi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),zi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${H7(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>FN(s,n.value)):FN(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),jbe=Mt("$ZodExactOptional",(e,t)=>{vW.init(e,t),zi(e._zod,"values",()=>t.innerType._zod.values),zi(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),Hbe=Mt("$ZodNullable",(e,t)=>{No.init(e,t),zi(e._zod,"optin",()=>t.innerType._zod.optin),zi(e._zod,"optout",()=>t.innerType._zod.optout),zi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${H7(n.source)}|null)$`):void 0}),zi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),Wbe=Mt("$ZodDefault",(e,t)=>{No.init(e,t),e._zod.optin="optional",zi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>BN(s,t)):BN(o,t)}});function BN(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const qbe=Mt("$ZodPrefault",(e,t)=>{No.init(e,t),e._zod.optin="optional",zi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),Ube=Mt("$ZodNonOptional",(e,t)=>{No.init(e,t),zi(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>RN(s,e)):RN(o,e)}});function RN(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Vbe=Mt("$ZodCatch",(e,t)=>{No.init(e,t),zi(e._zod,"optin",()=>t.innerType._zod.optin),zi(e._zod,"optout",()=>t.innerType._zod.optout),zi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>qd(r,i,Wd()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>qd(s,i,Wd()))},input:n.value}),n.issues=[]),n)}}),Kbe=Mt("$ZodPipe",(e,t)=>{No.init(e,t),zi(e._zod,"values",()=>t.in._zod.values),zi(e._zod,"optin",()=>t.in._zod.optin),zi(e._zod,"optout",()=>t.out._zod.optout),zi(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const s=t.out._zod.run(n,i);return s instanceof Promise?s.then(r=>J2(r,t.in,i)):J2(s,t.in,i)}const o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>J2(s,t.out,i)):J2(o,t.out,i)}});function J2(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Zbe=Mt("$ZodReadonly",(e,t)=>{No.init(e,t),zi(e._zod,"propValues",()=>t.innerType._zod.propValues),zi(e._zod,"values",()=>t.innerType._zod.values),zi(e._zod,"optin",()=>t.innerType?._zod?.optin),zi(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then($N):$N(o)}});function $N(e){return e.value=Object.freeze(e.value),e}const Gbe=Mt("$ZodCustom",(e,t)=>{bl.init(e,t),No.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then(s=>ON(s,n,i,e));ON(o,n,i,e)}});function ON(e,t,n,i){if(!e){const o={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(O0(o))}}var PN;class Qbe{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Ybe(){return new Qbe}(PN=globalThis).__zod_globalRegistry??(PN.__zod_globalRegistry=Ybe());const hg=globalThis.__zod_globalRegistry;function Jbe(e,t){return new e({type:"string",...Sn(t)})}function Xbe(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Sn(t)})}function zN(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Sn(t)})}function e3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Sn(t)})}function t3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Sn(t)})}function n3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Sn(t)})}function i3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Sn(t)})}function o3e(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Sn(t)})}function s3e(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Sn(t)})}function r3e(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Sn(t)})}function l3e(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Sn(t)})}function a3e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Sn(t)})}function u3e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Sn(t)})}function c3e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Sn(t)})}function d3e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Sn(t)})}function f3e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Sn(t)})}function h3e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Sn(t)})}function p3e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Sn(t)})}function m3e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Sn(t)})}function g3e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Sn(t)})}function v3e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Sn(t)})}function y3e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Sn(t)})}function k3e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Sn(t)})}function b3e(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Sn(t)})}function w3e(e,t){return new e({type:"string",format:"date",check:"string_format",...Sn(t)})}function C3e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Sn(t)})}function A3e(e,t){return new e({type:"string",format:"duration",check:"string_format",...Sn(t)})}function x3e(e,t){return new e({type:"number",checks:[],...Sn(t)})}function S3e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Sn(t)})}function _3e(e,t){return new e({type:"boolean",...Sn(t)})}function M3e(e){return new e({type:"unknown"})}function I3e(e,t){return new e({type:"never",...Sn(t)})}function jN(e,t){return new cW({check:"less_than",...Sn(t),value:e,inclusive:!1})}function L8(e,t){return new cW({check:"less_than",...Sn(t),value:e,inclusive:!0})}function HN(e,t){return new dW({check:"greater_than",...Sn(t),value:e,inclusive:!1})}function N8(e,t){return new dW({check:"greater_than",...Sn(t),value:e,inclusive:!0})}function WN(e,t){return new Wke({check:"multiple_of",...Sn(t),value:e})}function yW(e,t){return new Uke({check:"max_length",...Sn(t),maximum:e})}function g4(e,t){return new Vke({check:"min_length",...Sn(t),minimum:e})}function kW(e,t){return new Kke({check:"length_equals",...Sn(t),length:e})}function T3e(e,t){return new Zke({check:"string_format",format:"regex",...Sn(t),pattern:e})}function E3e(e){return new Gke({check:"string_format",format:"lowercase",...Sn(e)})}function L3e(e){return new Qke({check:"string_format",format:"uppercase",...Sn(e)})}function N3e(e,t){return new Yke({check:"string_format",format:"includes",...Sn(t),includes:e})}function D3e(e,t){return new Jke({check:"string_format",format:"starts_with",...Sn(t),prefix:e})}function F3e(e,t){return new Xke({check:"string_format",format:"ends_with",...Sn(t),suffix:e})}function J1(e){return new ebe({check:"overwrite",tx:e})}function B3e(e){return J1(t=>t.normalize(e))}function R3e(){return J1(e=>e.trim())}function $3e(){return J1(e=>e.toLowerCase())}function O3e(){return J1(e=>e.toUpperCase())}function P3e(){return J1(e=>Z4e(e))}function z3e(e,t,n){return new e({type:"array",element:t,...Sn(n)})}function j3e(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Sn(n)})}function H3e(e){const t=W3e(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(O0(i,n.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(O0(o))}},e(n.value,n)));return t}function W3e(e,t){const n=new bl({check:"custom",...Sn(t)});return n._zod.check=e,n}function bW(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??hg,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function hs(e,t,n={path:[],schemaPath:[]}){var i;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const f=r.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,c)}const d=e._zod.parent;d&&(r.ref||(r.ref=d),hs(d,t,c),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&Object.assign(r.schema,a),t.io==="input"&&Fr(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((i=r.schema).default??(i.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function wW(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const a=i.get(l);if(a&&a!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,r[0])}}const o=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(r[0])?.id,f=e.external.uri??(m=>m);if(d)return{ref:f(d)};const h=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=h,{defId:h,ref:`${f("__shared")}#/${l}/${h}`}}if(r[1]===n)return{ref:"#"};const u=`#/${l}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:u+c}},s=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:a,defId:u}=o(r);l.def={...l.schema},u&&(l.defId=u);const c=l.schema;for(const d in c)delete c[d];c.$ref=a};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){s(r);continue}if(e.external){const u=e.external.registry.get(r[0])?.id;if(t!==r[0]&&u){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(l.cycle){s(r);continue}if(l.count>1&&e.reused==="ref"){s(r);continue}}}function CW(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=r=>{const l=e.seen.get(r);if(l.ref===null)return;const a=l.def??l.schema,u={...a},c=l.ref;if(l.ref=null,c){i(c);const f=e.seen.get(c),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(a.allOf=a.allOf??[],a.allOf.push(h)):Object.assign(a,h),Object.assign(a,u),r._zod.parent===c)for(const g in a)g==="$ref"||g==="allOf"||g in u||delete a[g];if(h.$ref&&f.def)for(const g in a)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(a[g])===JSON.stringify(f.def[g])&&delete a[g]}const d=r._zod.parent;if(d&&d!==c){i(d);const f=e.seen.get(d);if(f?.schema.$ref&&(a.$ref=f.schema.$ref,f.def))for(const h in a)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(a[h])===JSON.stringify(f.def[h])&&delete a[h]}e.override({zodSchema:r,jsonSchema:a,path:l.path??[]})};for(const r of[...e.seen.entries()].reverse())i(r[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const l=r[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const r=JSON.parse(JSON.stringify(o));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:v4(t,"input",e.processors),output:v4(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function Fr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Fr(i.element,n);if(i.type==="set")return Fr(i.valueType,n);if(i.type==="lazy")return Fr(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Fr(i.innerType,n);if(i.type==="intersection")return Fr(i.left,n)||Fr(i.right,n);if(i.type==="record"||i.type==="map")return Fr(i.keyType,n)||Fr(i.valueType,n);if(i.type==="pipe")return Fr(i.in,n)||Fr(i.out,n);if(i.type==="object"){for(const o in i.shape)if(Fr(i.shape[o],n))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(Fr(o,n))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(Fr(o,n))return!0;return!!(i.rest&&Fr(i.rest,n))}return!1}const q3e=(e,t={})=>n=>{const i=bW({...n,processors:t});return hs(e,i),wW(i,e),CW(i,e)},v4=(e,t,n={})=>i=>{const{libraryOptions:o,target:s}=i??{},r=bW({...o??{},target:s,io:t,processors:n});return hs(e,r),wW(r,e),CW(r,e)},U3e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},V3e=(e,t,n,i)=>{const o=n;o.type="string";const{minimum:s,maximum:r,format:l,patterns:a,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof r=="number"&&(o.maxLength=r),l&&(o.format=U3e[l]??l,o.format===""&&delete o.format,l==="time"&&delete o.format),u&&(o.contentEncoding=u),a&&a.size>0){const c=[...a];c.length===1?o.pattern=c[0].source:c.length>1&&(o.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},K3e=(e,t,n,i)=>{const o=n,{minimum:s,maximum:r,format:l,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof l=="string"&&l.includes("int")?o.type="integer":o.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c),typeof s=="number"&&(o.minimum=s,typeof c=="number"&&t.target!=="draft-04"&&(c>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof r=="number"&&(o.maximum=r,typeof u=="number"&&t.target!=="draft-04"&&(u<=r?delete o.maximum:delete o.exclusiveMaximum)),typeof a=="number"&&(o.multipleOf=a)},Z3e=(e,t,n,i)=>{n.type="boolean"},G3e=(e,t,n,i)=>{n.not={}},Q3e=(e,t,n,i)=>{},Y3e=(e,t,n,i)=>{const o=e._zod.def,s=XH(o.entries);s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),n.enum=s},J3e=(e,t,n,i)=>{const o=e._zod.def,s=[];for(const r of o.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(r))}else s.push(r);if(s.length!==0)if(s.length===1){const r=s[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),s.every(r=>typeof r=="boolean")&&(n.type="boolean"),s.every(r=>r===null)&&(n.type="null"),n.enum=s},X3e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},e8e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},t8e=(e,t,n,i)=>{const o=n,s=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(o.minItems=r),typeof l=="number"&&(o.maxItems=l),o.type="array",o.items=hs(s.element,t,{...i,path:[...i.path,"items"]})},n8e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const r=s.shape;for(const u in r)o.properties[u]=hs(r[u],t,{...i,path:[...i.path,"properties",u]});const l=new Set(Object.keys(r)),a=new Set([...l].filter(u=>{const c=s.shape[u]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));a.size>0&&(o.required=Array.from(a)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=hs(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},i8e=(e,t,n,i)=>{const o=e._zod.def,s=o.inclusive===!1,r=o.options.map((l,a)=>hs(l,t,{...i,path:[...i.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=r:n.anyOf=r},o8e=(e,t,n,i)=>{const o=e._zod.def,s=hs(o.left,t,{...i,path:[...i.path,"allOf",0]}),r=hs(o.right,t,{...i,path:[...i.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,a=[...l(s)?s.allOf:[s],...l(r)?r.allOf:[r]];n.allOf=a},s8e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object";const r=s.keyType,a=r._zod.bag?.patterns;if(s.mode==="loose"&&a&&a.size>0){const c=hs(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const d of a)o.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=hs(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=hs(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const u=r._zod.values;if(u){const c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(o.required=c)}},r8e=(e,t,n,i)=>{const o=e._zod.def,s=hs(o.innerType,t,i),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},l8e=(e,t,n,i)=>{const o=e._zod.def;hs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},a8e=(e,t,n,i)=>{const o=e._zod.def;hs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},u8e=(e,t,n,i)=>{const o=e._zod.def;hs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},c8e=(e,t,n,i)=>{const o=e._zod.def;hs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType;let r;try{r=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},d8e=(e,t,n,i)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;hs(s,t,i);const r=t.seen.get(e);r.ref=s},f8e=(e,t,n,i)=>{const o=e._zod.def;hs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},AW=(e,t,n,i)=>{const o=e._zod.def;hs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},h8e=Mt("ZodISODateTime",(e,t)=>{pbe.init(e,t),Fo.init(e,t)});function p8e(e){return b3e(h8e,e)}const m8e=Mt("ZodISODate",(e,t)=>{mbe.init(e,t),Fo.init(e,t)});function g8e(e){return w3e(m8e,e)}const v8e=Mt("ZodISOTime",(e,t)=>{gbe.init(e,t),Fo.init(e,t)});function y8e(e){return C3e(v8e,e)}const k8e=Mt("ZodISODuration",(e,t)=>{vbe.init(e,t),Fo.init(e,t)});function b8e(e){return A3e(k8e,e)}const w8e=(e,t)=>{iW.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>lke(e,n)},flatten:{value:n=>rke(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,jC,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,jC,2)}},isEmpty:{get(){return e.issues.length===0}}})},ya=Mt("ZodError",w8e,{Parent:Error}),C8e=q7(ya),A8e=U7(ya),x8e=Vk(ya),S8e=Kk(ya),_8e=cke(ya),M8e=dke(ya),I8e=fke(ya),T8e=hke(ya),E8e=pke(ya),L8e=mke(ya),N8e=gke(ya),D8e=vke(ya),Do=Mt("ZodType",(e,t)=>(No.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:v4(e,"input"),output:v4(e,"output")}}),e.toJSONSchema=q3e(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(sf(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>rf(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>C8e(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>x8e(e,n,i),e.parseAsync=async(n,i)=>A8e(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>S8e(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>_8e(e,n,i),e.decode=(n,i)=>M8e(e,n,i),e.encodeAsync=async(n,i)=>I8e(e,n,i),e.decodeAsync=async(n,i)=>T8e(e,n,i),e.safeEncode=(n,i)=>E8e(e,n,i),e.safeDecode=(n,i)=>L8e(e,n,i),e.safeEncodeAsync=async(n,i)=>N8e(e,n,i),e.safeDecodeAsync=async(n,i)=>D8e(e,n,i),e.refine=(n,i)=>e.check(M5e(n,i)),e.superRefine=n=>e.check(I5e(n)),e.overwrite=n=>e.check(J1(n)),e.optional=()=>VN(e),e.exactOptional=()=>p5e(e),e.nullable=()=>KN(e),e.nullish=()=>VN(KN(e)),e.nonoptional=n=>b5e(e,n),e.array=()=>Ii(e),e.or=n=>s5e([e,n]),e.and=n=>a5e(e,n),e.transform=n=>ZN(e,f5e(n)),e.default=n=>v5e(e,n),e.prefault=n=>k5e(e,n),e.catch=n=>C5e(e,n),e.pipe=n=>ZN(e,n),e.readonly=()=>S5e(e),e.describe=n=>{const i=e.clone();return hg.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return hg.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return hg.get(e);const i=e.clone();return hg.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),xW=Mt("_ZodString",(e,t)=>{V7.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(i,o,s)=>V3e(e,i,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(T3e(...i)),e.includes=(...i)=>e.check(N3e(...i)),e.startsWith=(...i)=>e.check(D3e(...i)),e.endsWith=(...i)=>e.check(F3e(...i)),e.min=(...i)=>e.check(g4(...i)),e.max=(...i)=>e.check(yW(...i)),e.length=(...i)=>e.check(kW(...i)),e.nonempty=(...i)=>e.check(g4(1,...i)),e.lowercase=i=>e.check(E3e(i)),e.uppercase=i=>e.check(L3e(i)),e.trim=()=>e.check(R3e()),e.normalize=(...i)=>e.check(B3e(...i)),e.toLowerCase=()=>e.check($3e()),e.toUpperCase=()=>e.check(O3e()),e.slugify=()=>e.check(P3e())}),F8e=Mt("ZodString",(e,t)=>{V7.init(e,t),xW.init(e,t),e.email=n=>e.check(Xbe(B8e,n)),e.url=n=>e.check(o3e(R8e,n)),e.jwt=n=>e.check(k3e(Y8e,n)),e.emoji=n=>e.check(s3e($8e,n)),e.guid=n=>e.check(zN(qN,n)),e.uuid=n=>e.check(e3e(X2,n)),e.uuidv4=n=>e.check(t3e(X2,n)),e.uuidv6=n=>e.check(n3e(X2,n)),e.uuidv7=n=>e.check(i3e(X2,n)),e.nanoid=n=>e.check(r3e(O8e,n)),e.guid=n=>e.check(zN(qN,n)),e.cuid=n=>e.check(l3e(P8e,n)),e.cuid2=n=>e.check(a3e(z8e,n)),e.ulid=n=>e.check(u3e(j8e,n)),e.base64=n=>e.check(g3e(Z8e,n)),e.base64url=n=>e.check(v3e(G8e,n)),e.xid=n=>e.check(c3e(H8e,n)),e.ksuid=n=>e.check(d3e(W8e,n)),e.ipv4=n=>e.check(f3e(q8e,n)),e.ipv6=n=>e.check(h3e(U8e,n)),e.cidrv4=n=>e.check(p3e(V8e,n)),e.cidrv6=n=>e.check(m3e(K8e,n)),e.e164=n=>e.check(y3e(Q8e,n)),e.datetime=n=>e.check(p8e(n)),e.date=n=>e.check(g8e(n)),e.time=n=>e.check(y8e(n)),e.duration=n=>e.check(b8e(n))});function Ot(e){return Jbe(F8e,e)}const Fo=Mt("ZodStringFormat",(e,t)=>{So.init(e,t),xW.init(e,t)}),B8e=Mt("ZodEmail",(e,t)=>{sbe.init(e,t),Fo.init(e,t)}),qN=Mt("ZodGUID",(e,t)=>{ibe.init(e,t),Fo.init(e,t)}),X2=Mt("ZodUUID",(e,t)=>{obe.init(e,t),Fo.init(e,t)}),R8e=Mt("ZodURL",(e,t)=>{rbe.init(e,t),Fo.init(e,t)}),$8e=Mt("ZodEmoji",(e,t)=>{lbe.init(e,t),Fo.init(e,t)}),O8e=Mt("ZodNanoID",(e,t)=>{abe.init(e,t),Fo.init(e,t)}),P8e=Mt("ZodCUID",(e,t)=>{ube.init(e,t),Fo.init(e,t)}),z8e=Mt("ZodCUID2",(e,t)=>{cbe.init(e,t),Fo.init(e,t)}),j8e=Mt("ZodULID",(e,t)=>{dbe.init(e,t),Fo.init(e,t)}),H8e=Mt("ZodXID",(e,t)=>{fbe.init(e,t),Fo.init(e,t)}),W8e=Mt("ZodKSUID",(e,t)=>{hbe.init(e,t),Fo.init(e,t)}),q8e=Mt("ZodIPv4",(e,t)=>{ybe.init(e,t),Fo.init(e,t)}),U8e=Mt("ZodIPv6",(e,t)=>{kbe.init(e,t),Fo.init(e,t)}),V8e=Mt("ZodCIDRv4",(e,t)=>{bbe.init(e,t),Fo.init(e,t)}),K8e=Mt("ZodCIDRv6",(e,t)=>{wbe.init(e,t),Fo.init(e,t)}),Z8e=Mt("ZodBase64",(e,t)=>{Cbe.init(e,t),Fo.init(e,t)}),G8e=Mt("ZodBase64URL",(e,t)=>{xbe.init(e,t),Fo.init(e,t)}),Q8e=Mt("ZodE164",(e,t)=>{Sbe.init(e,t),Fo.init(e,t)}),Y8e=Mt("ZodJWT",(e,t)=>{Mbe.init(e,t),Fo.init(e,t)}),SW=Mt("ZodNumber",(e,t)=>{hW.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(i,o,s)=>K3e(e,i,o),e.gt=(i,o)=>e.check(HN(i,o)),e.gte=(i,o)=>e.check(N8(i,o)),e.min=(i,o)=>e.check(N8(i,o)),e.lt=(i,o)=>e.check(jN(i,o)),e.lte=(i,o)=>e.check(L8(i,o)),e.max=(i,o)=>e.check(L8(i,o)),e.int=i=>e.check(UN(i)),e.safe=i=>e.check(UN(i)),e.positive=i=>e.check(HN(0,i)),e.nonnegative=i=>e.check(N8(0,i)),e.negative=i=>e.check(jN(0,i)),e.nonpositive=i=>e.check(L8(0,i)),e.multipleOf=(i,o)=>e.check(WN(i,o)),e.step=(i,o)=>e.check(WN(i,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function vn(e){return x3e(SW,e)}const J8e=Mt("ZodNumberFormat",(e,t)=>{Ibe.init(e,t),SW.init(e,t)});function UN(e){return S3e(J8e,e)}const X8e=Mt("ZodBoolean",(e,t)=>{Tbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Z3e(e,n,i)});function Sv(e){return _3e(X8e,e)}const e5e=Mt("ZodUnknown",(e,t)=>{Ebe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Q3e()});function Ss(){return M3e(e5e)}const t5e=Mt("ZodNever",(e,t)=>{Lbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>G3e(e,n,i)});function n5e(e){return I3e(t5e,e)}const i5e=Mt("ZodArray",(e,t)=>{Nbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>t8e(e,n,i,o),e.element=t.element,e.min=(n,i)=>e.check(g4(n,i)),e.nonempty=n=>e.check(g4(1,n)),e.max=(n,i)=>e.check(yW(n,i)),e.length=(n,i)=>e.check(kW(n,i)),e.unwrap=()=>e.element});function Ii(e,t){return z3e(i5e,e,t)}const o5e=Mt("ZodObject",(e,t)=>{Fbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>n8e(e,n,i,o),zi(e,"shape",()=>t.shape),e.keyof=()=>xo(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ss()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ss()}),e.strict=()=>e.clone({...e._zod.def,catchall:n5e()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>tke(e,n),e.safeExtend=n=>nke(e,n),e.merge=n=>ike(e,n),e.pick=n=>X4e(e,n),e.omit=n=>eke(e,n),e.partial=(...n)=>oke(MW,e,n[0]),e.required=(...n)=>ske(IW,e,n[0])});function Zt(e,t){const n={type:"object",shape:e??{},...Sn(t)};return new o5e(n)}const _W=Mt("ZodUnion",(e,t)=>{gW.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>i8e(e,n,i,o),e.options=t.options});function s5e(e,t){return new _W({type:"union",options:e,...Sn(t)})}const r5e=Mt("ZodDiscriminatedUnion",(e,t)=>{_W.init(e,t),Bbe.init(e,t)});function lf(e,t,n){return new r5e({type:"union",options:t,discriminator:e,...Sn(n)})}const l5e=Mt("ZodIntersection",(e,t)=>{Rbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>o8e(e,n,i,o)});function a5e(e,t){return new l5e({type:"intersection",left:e,right:t})}const u5e=Mt("ZodRecord",(e,t)=>{$be.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>s8e(e,n,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function K7(e,t,n){return new u5e({type:"record",keyType:e,valueType:t,...Sn(n)})}const WC=Mt("ZodEnum",(e,t)=>{Obe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(i,o,s)=>Y3e(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const s={};for(const r of i)if(n.has(r))s[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new WC({...t,checks:[],...Sn(o),entries:s})},e.exclude=(i,o)=>{const s={...t.entries};for(const r of i)if(n.has(r))delete s[r];else throw new Error(`Key ${r} not found in enum`);return new WC({...t,checks:[],...Sn(o),entries:s})}});function xo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new WC({type:"enum",entries:n,...Sn(t)})}const c5e=Mt("ZodLiteral",(e,t)=>{Pbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>J3e(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function qn(e,t){return new c5e({type:"literal",values:Array.isArray(e)?e:[e],...Sn(t)})}const d5e=Mt("ZodTransform",(e,t)=>{zbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>e8e(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new YH(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(O0(s,n.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(O0(r))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function f5e(e){return new d5e({type:"transform",transform:e})}const MW=Mt("ZodOptional",(e,t)=>{vW.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AW(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function VN(e){return new MW({type:"optional",innerType:e})}const h5e=Mt("ZodExactOptional",(e,t)=>{jbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AW(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function p5e(e){return new h5e({type:"optional",innerType:e})}const m5e=Mt("ZodNullable",(e,t)=>{Hbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>r8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function KN(e){return new m5e({type:"nullable",innerType:e})}const g5e=Mt("ZodDefault",(e,t)=>{Wbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>a8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function v5e(e,t){return new g5e({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():tW(t)}})}const y5e=Mt("ZodPrefault",(e,t)=>{qbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>u8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function k5e(e,t){return new y5e({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():tW(t)}})}const IW=Mt("ZodNonOptional",(e,t)=>{Ube.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>l8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function b5e(e,t){return new IW({type:"nonoptional",innerType:e,...Sn(t)})}const w5e=Mt("ZodCatch",(e,t)=>{Vbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>c8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function C5e(e,t){return new w5e({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const A5e=Mt("ZodPipe",(e,t)=>{Kbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>d8e(e,n,i,o),e.in=t.in,e.out=t.out});function ZN(e,t){return new A5e({type:"pipe",in:e,out:t})}const x5e=Mt("ZodReadonly",(e,t)=>{Zbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>f8e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function S5e(e){return new x5e({type:"readonly",innerType:e})}const _5e=Mt("ZodCustom",(e,t)=>{Gbe.init(e,t),Do.init(e,t),e._zod.processJSONSchema=(n,i,o)=>X3e(e,n)});function M5e(e,t={}){return j3e(_5e,e,t)}function I5e(e){return H3e(e)}const Nh=Ot().min(1),Z7=Ot().min(1),_v=Ot().min(1),Dh=Ot().min(1),ql=Ot().min(1),T5e=/^[A-Za-z0-9._-]{1,128}$/;function E5e(e){return T5e.test(e)&&e!=="."&&e!==".."}const TW=lf("kind",[Zt({kind:qn("user"),payload:Ss().optional()}),Zt({kind:qn("cron"),taskId:Dh.optional(),payload:Ss().optional()}),Zt({kind:qn("task"),taskId:Dh,payload:Ss().optional()}),Zt({kind:qn("hook"),payload:Ss().optional()}),Zt({kind:qn("compaction"),payload:Ss().optional()}),Zt({kind:qn("side"),payload:Ss().optional()}),Zt({kind:qn("other"),payload:Ss().optional()})]),L5e=Zt({inputTokens:vn().optional(),outputTokens:vn().optional(),cachedTokens:vn().optional(),cost:vn().optional()}),e0=Zt({inputOther:vn(),output:vn(),inputCacheRead:vn(),inputCacheCreation:vn()}),N5e=Zt({llmFirstTokenLatencyMs:vn().optional(),llmStreamDurationMs:vn().optional(),llmRequestBuildMs:vn().optional(),llmServerFirstTokenMs:vn().optional(),llmServerDecodeMs:vn().optional(),llmClientConsumeMs:vn().optional()}),D5e=Zt({failedAttempt:vn(),nextAttempt:vn(),maxAttempts:vn(),delayMs:vn(),errorName:Ot(),errorMessage:Ot(),statusCode:vn().optional()}),EW=xo(["queued","running","completed","failed","cancelled"]),F5e=xo(["running","completed","interrupted","failed"]),B5e=Zt({kind:qn("text"),frameId:_v,role:xo(["assistant","user"]),text:Ot(),attachmentIds:Ii(Ot()).optional(),taskId:Dh.optional(),promptIds:Ii(Ot()).optional()}),R5e=Zt({kind:qn("thinking"),frameId:_v,text:Ot()}),$5e=Zt({agentId:ql,role:xo(["child","member"]).optional()}),O5e=Zt({kind:xo(["stdout","stderr","progress","status","custom"]),text:Ot().optional(),percent:vn().optional(),customKind:Ot().optional(),customData:Ss().optional()}),P5e=Zt({kind:qn("tool"),frameId:_v,toolCallId:Ot(),name:Ot(),view:Ot().optional(),state:xo(["running","done","error"]),input:Ss().optional(),output:Ss().optional(),display:Ss().optional(),error:Ot().optional(),inputText:Ot().optional(),progress:O5e.optional(),taskId:Dh.optional(),approvalId:Ot().optional(),todoId:Ot().optional(),agentRefs:Ii($5e).optional()}),G7=Zt({interactionId:Ot(),interactionKind:xo(["approval","question"]),toolCallId:Ot().optional(),state:xo(["pending","approved","rejected","cancelled","answered","dismissed"]),request:Ss().optional(),response:Ss().optional()}),z5e=Zt({kind:qn("notice"),frameId:_v,level:xo(["error","warning","info"]),source:Ot().optional(),message:Ot(),detail:Ss().optional()}),LW=lf("kind",[B5e,R5e,P5e,z5e]),NW=Zt({kind:qn("step"),stepId:Z7,turnId:Nh,ordinal:vn().int(),state:F5e,frames:Ii(LW),startedAt:Ot().optional(),endedAt:Ot().optional(),usage:e0.optional(),finishReason:Ot().optional(),timing:N5e.optional(),retry:D5e.optional(),endReason:Ot().optional(),endMessage:Ot().optional()}),DW=Zt({kind:qn("turn"),turnId:Nh,ordinal:vn().int(),state:EW,origin:TW,prompt:Ot().optional(),attachmentIds:Ii(Ot()).optional(),steps:Ii(NW),startedAt:Ot().optional(),endedAt:Ot().optional(),usage:L5e.optional(),durationMs:vn().optional(),error:Ot().optional()}),FW=Zt({kind:qn("marker"),markerId:Ot(),marker:Ot(),payload:Ss().optional(),at:Ot().optional()}),BW=Zt({kind:qn("taskref"),refId:Ot(),taskId:Dh,at:Ot().optional()}),RW=lf("kind",[DW,FW,BW]),Q7=Zt({taskId:Dh,kind:xo(["shell","subagent","tool","other"]),state:xo(["running","completed","failed","timed_out","killed","lost"]),detached:Sv(),description:Ot().optional(),agentId:ql.optional(),outputTail:Ot(),startedAt:Ot().optional(),endedAt:Ot().optional(),resultSummary:Ot().optional(),error:Ot().optional(),stateReason:Ot().optional(),usage:e0.optional(),model:Ot().optional(),thinkingEffort:Ot().optional()}),$W=Zt({objective:Ot(),status:xo(["active","paused","blocked","complete"]),completionCriterion:Ot().optional(),budgetUsed:vn().optional(),budgetLimit:vn().optional()}),j5e=Zt({plan:Zt({reviewPath:Ot().optional(),version:vn().optional()}).optional(),swarm:Zt({trigger:Ot().optional()}).optional(),tower:Zt({}).optional()}),H5e=Zt({plan:Zt({reviewPath:Ot().optional(),version:vn().optional()}).nullable().optional(),swarm:Zt({trigger:Ot().optional()}).nullable().optional(),tower:Zt({}).nullable().optional()}),W5e=lf("kind",[Zt({kind:qn("idle")}),Zt({kind:qn("running"),turnId:vn(),step:vn(),stepId:Ot(),since:vn()}),Zt({kind:qn("streaming"),turnId:vn(),step:vn(),stepId:Ot(),stream:xo(["assistant","thinking","tool_call"]),toolCallId:Ot().optional(),toolName:Ot().optional(),since:vn()}),Zt({kind:qn("tool_call"),turnId:vn(),step:vn(),toolCallId:Ot(),name:Ot(),since:vn()}),Zt({kind:qn("retrying"),turnId:vn(),step:vn(),stepId:Ot(),failedAttempt:vn(),nextAttempt:vn(),maxAttempts:vn(),delayMs:vn(),errorName:Ot().optional(),statusCode:vn().optional(),since:vn()}),Zt({kind:qn("awaiting_approval"),turnId:vn(),step:vn().optional(),approval:Ss().optional(),since:vn()}),Zt({kind:qn("interrupted"),turnId:vn(),step:vn().optional(),reason:xo(["aborted","max_steps","error"]),message:Ot().optional(),at:vn()}),Zt({kind:qn("ended"),turnId:vn(),reason:xo(["completed","cancelled","failed","blocked"]),durationMs:vn().optional(),at:vn()})]),q5e=Zt({byModel:K7(Ot(),e0).optional(),currentTurn:e0.optional(),total:e0.optional()}),U5e=Zt({model:Ot().optional(),thinkingEffort:Ot().optional(),usage:q5e.optional(),contextTokens:vn().optional(),maxContextTokens:vn().optional(),contextUsage:vn().optional(),permission:xo(["manual","yolo","auto"]).optional(),phase:W5e.optional()}),Y7=Zt({goal:$W.optional(),modes:j5e.optional(),activity:xo(["idle","turn","disposing","unknown"]).optional(),agent:U5e.optional()}),V5e=Y7.extend({goal:$W.nullable().optional(),modes:H5e.optional()}),Gk=Zt({attachmentId:Ot(),mediaType:Ot(),name:Ot().optional(),size:vn().optional(),source:lf("kind",[Zt({kind:qn("url"),url:Ot()}),Zt({kind:qn("file"),fileId:Ot()}),Zt({kind:qn("session_media"),fileId:Ot()})]).optional(),placeholder:Ot().optional()}),K5e=Zt({title:Ot(),status:xo(["pending","in_progress","done"])}),J7=Zt({todoId:Ot(),items:Ii(K5e),updatedAt:Ot().optional()}),X7=Zt({promptId:Ot(),status:xo(["running","queued","blocked","completed","failed","aborted"]),userMessageId:Ot().optional(),content:Ss().optional(),createdAt:Ot(),finishedAt:Ot().optional(),steeredAt:Ot().optional()}),OW=Zt({items:Ii(RW),tasks:Ii(Q7),interactions:Ii(G7).default([]),attachments:Ii(Gk).default([]),todos:Ii(J7).default([]),prompts:Ii(X7).default([]),meta:Y7,hasMoreOlder:Sv().optional()}),Z5e=DW.omit({steps:!0}),G5e=NW.omit({frames:!0}),Q5e=lf("type",[Zt({type:qn("frame"),turnId:Nh,stepId:Z7,frameId:_v}),Zt({type:qn("task"),taskId:Dh})]),ex=lf("op",[Zt({op:qn("reset"),agentId:ql,snapshot:OW}),Zt({op:qn("turn.upsert"),turn:Z5e}),Zt({op:qn("step.upsert"),turnId:Nh,step:G5e}),Zt({op:qn("frame.upsert"),turnId:Nh,stepId:Z7,frame:LW}),Zt({op:qn("append"),target:Q5e,offset:vn().int().nonnegative(),text:Ot()}),Zt({op:qn("marker.upsert"),item:FW,beforeTurn:vn().int().optional()}),Zt({op:qn("taskref.upsert"),item:BW,beforeTurn:vn().int().optional()}),Zt({op:qn("task.upsert"),task:Q7}),Zt({op:qn("interaction.upsert"),interaction:G7}),Zt({op:qn("attachment.upsert"),attachment:Gk}),Zt({op:qn("todo.upsert"),todo:J7}),Zt({op:qn("prompt.upsert"),prompt:X7}),Zt({op:qn("meta.merge"),meta:V5e}),Zt({op:qn("items.remove"),ids:Ii(Ot())})]);Zt({agentId:ql,ops:Ii(ex)});const Y5e=xo(["off","turn","block","delta"]),E1=vn().int().nonnegative(),J5e=K7(Ot(),Y5e);Zt({session_id:Ot().min(1),transcript:J5e,transcript_since:K7(Ot(),E1).optional()});Zt({agent_id:ql,before_turn:Ot().min(1).optional(),after_turn:Ot().min(1).optional(),page_size:vn().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),E5e(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const X5e=Zt({agentId:ql,type:xo(["main","sub","independent"]).optional(),parentAgentId:ql.optional(),label:Ot().optional(),createdAt:Ot().optional(),disposedAt:Ot().optional()}),ewe=Zt({agent_id:ql,items:Ii(RW),has_more:Sv(),tasks:Ii(Q7),interactions:Ii(G7).default([]),attachments:Ii(Gk).default([]),todos:Ii(J7).default([]),prompts:Ii(X7).default([]),meta:Y7,agents:Ii(X5e),pending_interactions:Ii(Ot()),seq:E1.optional()});Zt({agent_id:ql,batches:Ii(Zt({seq:E1,ops:Ii(ex)})),latest_seq:E1,complete:Sv()});const twe=Zt({turn_id:Nh,ordinal:vn().int(),state:EW,origin:TW,prompt:Ot(),attachment_ids:Ii(Ot()).optional(),started_at:Ot().optional()});Zt({agents:Ii(Zt({agent_id:ql,messages:Ii(twe),attachments:Ii(Gk).default([])}))});const nwe=Zt({state:xo(["pending","approved","rejected","cancelled"]),selected_option:Ot().optional(),feedback:Ot().optional()}),iwe=Zt({tool_call_id:Ot(),turn_id:Nh,source:xo(["interaction","display","output"]),plan:Ot(),path:Ot().optional(),options:Ii(Zt({label:Ot(),description:Ot().optional()})).optional(),review:nwe.optional()});Zt({agent_id:ql,plans:Ii(iwe)});const owe=Zt({agent_id:ql,snapshot:OW,has_more_older:Sv(),seq:E1.optional()}),swe=Zt({agent_id:ql,ops:Ii(ex),seq:E1.optional()}),PW=owe.extend({type:qn("transcript.reset")}),zW=swe.extend({type:qn("transcript.ops")});lf("type",[PW,zW]);const GN=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),rwe=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),lwe=new Set(["server_hello","ack","ping","resync_required","error","pong"]),awe=new Set(["assistant.delta","thinking.delta"]);function uwe(e,t){if(lwe.has(e))return{route:"ignore"};const n=e.startsWith("event."),i=n?e.slice(6):e;return awe.has(i)?cwe(t)?{route:"agent",agentType:i}:{route:"protocol"}:n?rwe.has(i)?{route:"protocol"}:GN.has(i)?{route:"agent",agentType:i}:{route:"protocol"}:GN.has(i)?{route:"agent",agentType:i}:{route:"agent",agentType:i}}function cwe(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}const dwe="kimi-code.bearer.",fwe=3e4;class QN{constructor(t){this.opts=t,this.tracer=t.tracer??$7}ws=null;connected=!1;closed=!1;subscriptions=new Map;transcriptSubscriptions=new Map;sideChannelAgents=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;clientHelloId=null;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;tracer;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),this.tracer.wsEvent?.({kind:"lifecycle",event:"connect",detail:{url:this.opts.wsUrl,attempt:this.reconnectAttempts}});const t=this.opts.credentialStore?.getToken(),n=t!==void 0?[`${dwe}${t}`]:void 0,i=new WebSocket(this.opts.wsUrl,n);this.ws=i,i.onopen=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"open"})},i.onmessage=o=>{this.lastActivityAt=Date.now();try{const s=JSON.parse(String(o.data));this.tracer.wsEvent?.({kind:"in",frame:s}),this.handleFrame(s)}catch(s){this.tracer.wsEvent?.({kind:"lifecycle",event:"parse-error",detail:{error:String(s)}}),this.opts.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},i.onerror=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"error"}),this.opts.handlers.onError(0,"WebSocket error",!1)},i.onclose=o=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"close",detail:o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0}),this.connected=!1,this.ws=null,this.opts.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,this.tracer.wsEvent?.({kind:"lifecycle",event:"reconnect-scheduled",detail:{delayMs:n,attempt:this.reconnectAttempts}}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const i=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);i!==-1&&this.pendingSubscriptions.splice(i,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(i=>i.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,i){let o=this.transcriptSubscriptions.get(t);o===void 0&&(o=new Map,this.transcriptSubscriptions.set(t,o)),o.set(n,i!==void 0?{sinceSeq:i}:{}),this.connected&&this.sendTranscriptSubscribe(t,n)}unsubscribeTranscript(t,n){const i=this.transcriptSubscriptions.get(t);if(i!==void 0)if(n===void 0)this.transcriptSubscriptions.delete(t);else{for(const o of n)i.delete(o);i.size===0&&this.transcriptSubscriptions.delete(t)}!this.connected||!this.ws||this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}markSideChannelAgent(t,n){if(!this.opts.mainAgentOnly)return;let i=this.sideChannelAgents.get(t);if(i===void 0&&(i=new Set,this.sideChannelAgents.set(t,i)),i.has(n))return;i.add(n);const o=this.subscriptions.get(t);this.connected&&o!==void 0&&this.sendSubscribe([t],{[t]:o})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,i){const o=ey(t,n),s=this.terminalAttachments.get(o),r=i??s?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,i){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:i}})}terminalResize(t,n,i,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:i,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(ey(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(ey(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,fwe),i=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:i}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.opts.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,i=t.type;if(i==="transcript.reset"){const o=PW.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const r=o.data;this.opts.handlers.onTranscriptReset?.(s,r.agent_id,{...r.snapshot,hasMoreOlder:r.has_more_older},r.seq);const l=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==void 0&&r.seq!==void 0&&(l.sinceSeq=r.seq);return}if(i==="transcript.ops"){const o=zW.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const r=o.data,l=this.opts.handlers.onTranscriptOps?.(s,r.agent_id,r.ops,r.seq),a=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==!1&&a!==void 0&&r.seq!==void 0&&(a.sinceSeq=r.seq);return}switch(i){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.opts.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.opts.handlers.onRawAgentEvent?this.opts.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.opts.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":n.id===this.clientHelloId&&(this.clientHelloId=null,n.code===0&&this.opts.handlers.onReplayComplete?.());break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,r=n.seq,l=ey(o,s),a=this.terminalAttachments.get(l);a&&this.terminalAttachments.set(l,{...a,lastSeq:Math.max(a.lastSeq,r)});const u=typeof n.payload?.data=="string"?n.payload.data:"";this.opts.handlers.onTerminalOutput?.(o,s,u,r);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,r=n.payload?.exit_code,l=typeof r=="number"?r:null;this.opts.handlers.onTerminalExit?.(o,s,l);break}default:{this.trackCursor(n);const o=n.type,s=uwe(o,n.payload);if(s.route==="protocol"){this.opts.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.opts.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const r=n,l=n;this.opts.handlers.onRawAgentEvent({type:s.agentType,seq:r.seq,session_id:r.session_id,timestamp:r.timestamp,payload:r.payload,...l.volatile!==void 0?{volatile:l.volatile}:{},...l.offset!==void 0?{offset:l.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.opts.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;const i=this.nextId();this.clientHelloId=i,this.send({type:"client_hello",id:i,payload:{client_id:this.opts.clientId,subscriptions:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}});for(const o of this.transcriptSubscriptions.keys())this.sendTranscriptSubscribe(o);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}})}rawAgentFilter(t){return Object.fromEntries(t.map(n=>[n,["main",...this.sideChannelAgents.get(n)??[]]]))}sendTranscriptSubscribe(t,n){const i=this.transcriptSubscriptions.get(t);if(i===void 0||i.size===0)return;const o={},s={};for(const[r,l]of i)o[r]="delta",l.sinceSeq!==void 0&&(n===void 0||n===r)&&(s[r]=l.sinceSeq);this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:o,...Object.keys(s).length>0?{transcript_since:s}:{}}})}sendTerminalAttach(t,n,i){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:i>0?i:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,i=t.seq;if(typeof n!="string"||typeof i!="number")return;const o=this.subscriptions.get(n);if(!o||i<=o.seq&&o.epoch!==void 0)return;const s=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(i,o.seq),epoch:s})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),this.tracer.wsEvent?.({kind:"out",frame:t})}catch{}}nextId(){return`c_${++this.msgSeq}`}}function ey(e,t){return`${e}\0${t}`}async function hwe(e,t,n){const i=await e.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),o=ewe.parse(i),s={items:o.items,tasks:o.tasks,interactions:o.interactions,attachments:o.attachments,todos:o.todos,prompts:o.prompts,meta:o.meta,hasMoreOlder:o.has_more};return{agentId:o.agent_id,...s,agents:o.agents,pendingInteractions:o.pending_interactions,...o.seq!==void 0?{seq:o.seq}:{}}}const D8=10485760,pwe=5e3,YN=40001;function mwe(e,t){if(e===void 0)return t;let n;const i=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(i!==void 0)try{n=decodeURIComponent(i.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function gwe(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function F8(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function JN(e){return e==="auto_compact"||e==="manual_compact"}class vwe{constructor(t){this.opts=t,this.tracer=t.tracer??$7,this.http=new bN({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore}),this.httpV2=new bN({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore,restBasePath:"/api/v2"})}http;httpV2;tracer;async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,experimentalFlags:t.experimental_flags??{},backend:t.backend==="v2"?"v2":"v1",webTitle:t.web_title??""}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},i=await this.http.get("/sessions",n);return{items:i.items.map(fu),hasMore:i.has_more}}async listSessionsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),include:t?.include,"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionIdsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),fields:"id,archived","workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionGroupsV2(t){const n={view:"by_workspace","group.page_size":t?.groupPageSize,"meta.has_prompt":t?.hasPrompt===void 0?void 0:String(t.hasPrompt),sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,"meta.archived":t?.archived===void 0?void 0:String(t.archived),"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{groups:i.groups,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const i=await this.http.post("/sessions",n);return fu(i)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return fu(n)}async updateSession(t,n){const i={};n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(i.agent_config=o);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,i);return fu(s)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return ZH(n)}async getSessionPlans(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript/plan`,{agent_id:n.agentId,tool_call_id:n.toolCallId});return i.plans.map(o=>({agentId:i.agent_id,toolCallId:o.tool_call_id,turnId:o.turn_id,source:o.source,plan:o.plan,...o.path!==void 0?{path:o.path}:{},...o.options!==void 0?{options:o.options.map(s=>({label:s.label,...s.description!==void 0?{description:s.description}:{}}))}:{},...o.review!==void 0?{review:{state:o.review.state,...o.review.selected_option!==void 0?{selectedOption:o.review.selected_option}:{},...o.review.feedback!==void 0?{feedback:o.review.feedback}:{}}}:{}}))}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return fu(n)}async archiveSessions(t){return this.httpV2.post("/sessions:archive",{ids:t})}async restoreSessions(t){return this.httpV2.post("/sessions:restore",{ids:t})}async listMessages(t,n){const i={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,i);return{items:o.items.map(VH),hasMore:o.has_more}}async getSessionTranscript(t,n){return hwe(this.http,t,n)}async exportSession(t,n,i){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` -`).length,r=`/sessions/${encodeURIComponent(t)}/export`,l={web_log_bytes:o,web_log_entries:s},a=i?.desktop===!0;let u;try{u=await this.http.postZip(r,{web_log:n,...a?{desktop:!0}:{}},l)}catch(d){if(a&&qi(d)&&d.code===YN)u=await this.http.postZip(r,{web_log:n},l);else throw d}const c=`${t}.zip`;return{blob:u.blob,fileName:mwe(u.contentDisposition,c)}}async submitPrompt(t,n){const i=Date.now();this.tracer.traceKeyEvent?.("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,u4e(n));return this.tracer.traceKeyEvent?.("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-i}),{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}catch(o){throw this.tracer.traceKeyEvent?.("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-i,...gwe(o)}),o}}async steerPrompts(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:i.steered,promptIds:i.prompt_ids}}async abortPrompt(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:i.aborted,atSeq:i.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async generateSessionTitle(t,n){try{const i={};n?.force===!0&&(i.force=!0),n?.source!==void 0&&(i.source=n.source);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,i);return typeof o?.title=="string"&&o.title.length>0?o.title:null}catch{return null}}async forkSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,i,{timeoutMs:vN});return fu(o)}async createChildSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,i,{timeoutMs:vN});return fu(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(fu)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,c4e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,g4e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const i={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,i)).items.map(s=>OC(s))}async getTask(t,n,i){const o={with_output:i?.withOutput,output_bytes:i?.outputBytes},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return OC(s)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async detachTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:detach`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(F8)}async createTerminal(t,n={}){const i={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,i);return F8(o)}async getTerminal(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return F8(i)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async activateSkill(t,n,i,o){const s={};i!==void 0&&i.length>0&&(s.args=i),o!==void 0&&o.length>0&&(s.attachments=o.map(KH));const r=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s);return{activated:r.activated,skillName:r.skill_name}}async listCapabilities(){return(await this.http.get("/capabilities")).capabilities??[]}async getCapability(t){return this.http.get(`/capabilities/${encodeURIComponent(t)}`)}async installCapability(t){return this.http.post(`/capabilities/${encodeURIComponent(t)}:install`,{})}async listPlugins(){return(await this.http.get("/plugins")).plugins??[]}async listPluginMarketplace(){return(await this.http.get("/plugins/marketplace")).entries??[]}async installPlugin(t){return this.http.post("/plugins",{source:t})}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:${n?"enable":"disable"}`,{})}async removePlugin(t){return this.http.post(`/plugins/${encodeURIComponent(t)}:remove`,{})}async listDirectory(t,n){const i={};n.path!==void 0&&(i.path=n.path),n.depth!==void 0&&(i.depth=n.depth),n.includeGitStatus!==void 0&&(i.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,i),s=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(AN)])):void 0;return{items:o.items.map(AN),childrenByPath:s,truncated:o.truncated}}async readFile(t,n){const i={path:n.path};n.offset!==void 0&&(i.offset=n.offset),n.length!==void 0&&(i.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,i);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:search",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async suggestFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:suggest",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const i={pattern:n.pattern};n.regex!==void 0&&(i.regex=n.regex),n.caseSensitive!==void 0&&(i.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,i);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const i={};n!==void 0&&(i.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,i);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:i.path,diff:i.diff,truncated:i.truncated??!1}}getFileDownloadUrl(t,n){const i=n.split("/").map(o=>encodeURIComponent(o)).join("/");return fd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/fs/${i}:download`)}async openFile(t,n){const i={path:n.path};return n.line!==void 0&&(i.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,i)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,i,o){const s={app_id:n,path:i};o!==void 0&&(s.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,s)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Xg)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const i=await this.http.post("/workspaces",n);return Xg(i)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const i=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Xg(i)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(i=>({name:i.name,path:i.path,isDir:i.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(y4e)}async listProviders(){return(await this.http.get("/providers")).items.map(yp)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),i=yp(n);return n.api_key!==void 0?{...i,apiKey:n.api_key}:i}async addProvider(t){const n={id:t.id??"",type:t.type,models:(t.models??[]).map(o=>{const s={model:o.model,max_context_size:o.maxContextSize};return o.displayName!==void 0&&(s.display_name=o.displayName),o.capabilities!==void 0&&(s.capabilities=o.capabilities),o.maxOutputSize!==void 0&&(s.max_output_size=o.maxOutputSize),o.supportEfforts!==void 0&&(s.support_efforts=o.supportEfforts),o.adaptiveThinking!==void 0&&(s.adaptive_thinking=o.adaptiveThinking),s})};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const i=await this.http.post("/providers",n);return yp(i)}async updateProvider(t,n){const i={type:n.type,models:(n.models??[]).map(s=>{const r={model:s.model,max_context_size:s.maxContextSize};return s.displayName!==void 0&&(r.display_name=s.displayName),s.capabilities!==void 0&&(r.capabilities=s.capabilities),s.maxOutputSize!==void 0&&(r.max_output_size=s.maxOutputSize),s.supportEfforts!==void 0&&(r.support_efforts=s.supportEfforts),s.adaptiveThinking!==void 0&&(r.adaptive_thinking=s.adaptiveThinking),r})};n.newId!==void 0&&(i.new_id=n.newId),n.apiKey!==void 0&&(i.api_key=n.apiKey),n.baseUrl!==void 0&&(i.base_url=n.baseUrl),n.defaultModel!==void 0&&(i.default_model=n.defaultModel);const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,i);return{provider:yp(o.provider)}}async deleteProvider(t){return await this.http.delete(`/providers/${encodeURIComponent(t)}`),{deleted:t}}async listCatalogProviders(){return(await this.http.get("/catalog/providers")).items.map(xN)}async getCatalogProvider(t){const n=await this.http.get(`/catalog/providers/${encodeURIComponent(t)}`);return xN(n)}async importCatalogProvider(t){const n={catalog_id:t.catalogId};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.id!==void 0&&(n.id=t.id);const i=await this.http.post("/providers:import_catalog",n);return{provider:yp(i.provider),modelsImported:i.models_imported}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const i=await this.http.post("/providers:import_registry",n);return{providers:i.providers.map(yp),modelsImported:i.models_imported}}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return B8(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return B8(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return B8(t)}async getConfig(){const t=await this.http.get("/config");return PC(t)}async setConfig(t){const n={},i={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[s,r]of Object.entries(t)){const l=i[s];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return PC(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(t){let n;try{n=await this.http.post("/oauth/login",t===void 0?{}:{region:t})}catch(i){if(t!==void 0&&qi(i)&&i.code===YN)n=await this.http.post("/oauth/login",{});else throw i}return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at,errorMessage:t.error_message}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async getUsage(){const t=await this.http.get("/oauth/usage");if(t.kind==="error")return{kind:"error",message:t.message,status:t.status};const n=i=>({name:i.name,window:i.window,used:i.used,limit:i.limit,resetAt:i.reset_at});return{kind:"ok",summary:t.summary===null?null:n(t.summary),limits:t.limits.map(n),extraUsage:t.extra_usage===null?null:{balanceCents:t.extra_usage.balance_cents,totalCents:t.extra_usage.total_cents,monthlyChargeLimitEnabled:t.extra_usage.monthly_charge_limit_enabled,monthlyChargeLimitCents:t.extra_usage.monthly_charge_limit_cents,monthlyUsedCents:t.extra_usage.monthly_used_cents,currency:t.extra_usage.currency}}}async getUserInfo(){return this.http.get("/oauth/userinfo")}async getOAuthRegion(){try{const t=await Promise.race([this.http.get("/oauth/region"),new Promise((n,i)=>{setTimeout(()=>i(new Error("oauth region probe timed out")),pwe)})]);return t.region==="mainland-cn"||t.region==="global"?t.region:null}catch{return null}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const i=await this.http.postForm("/files",n,t.onProgress===void 0?void 0:{onUploadProgress:t.onProgress});return{id:i.id,name:i.name,mediaType:i.media_type,size:i.size}}getFileUrl(t){return fd(this.opts.origin,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}getSessionMediaUrl(t,n){return fd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async getSessionMediaBlob(t,n){return this.http.getBlob(`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async readHostFileContent(t){const n=await this.http.getBlob("/fs:content",{path:t},{maxBytes:D8});if(n.size>D8)throw new O7({size:n.size,limit:D8});const i=n.type,o=!ywe(i),s=i||(o?"application/octet-stream":"text/plain");if(o){const l=await kwe(n);return{path:t,content:l,encoding:"base64",mime:s,isBinary:!0,size:n.size}}const r=await n.text();return{path:t,content:r,encoding:"utf-8",mime:s,isBinary:!1,size:n.size}}connectEvents(t){const n=mN(this.opts.origin,this.opts.identity.clientId),i=this.opts.projectorFactory(),o=new QN({wsUrl:n,clientId:this.opts.identity.clientId,tracer:this.tracer,credentialStore:this.opts.credentialStore,mainAgentOnly:this.opts.mainAgentOnly,handlers:{onWireEvent:s=>{const r=k4e(s),l=b4e(s),a=v4e(s);a.type==="historyCompacted"&&!JN(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:s=>{const{type:r,seq:l,session_id:a,payload:u,offset:c}=s,d=i.project(r,u,a,{offset:c});for(const f of d){const h=u?.turnId,m=f.type==="assistantDelta"&&typeof h=="number"&&typeof c=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:c,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!JN(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:m})}},onResync:(s,r,l)=>{i.reset(s),t.onResync(s,r,l)},onConnectionState:s=>{t.onConnectionChange(s)},onReplayComplete:()=>{t.onReplayComplete?.()},onError:(s,r,l)=>{t.onError(s,r,l)},onTerminalOutput:(s,r,l,a)=>{t.onTerminalOutput?.(s,r,l,a)},onTerminalExit:(s,r,l)=>{t.onTerminalExit?.(s,r,l)},onTranscriptReset:(s,r,l,a)=>{t.onTranscriptReset?.(s,r,l,a)},onTranscriptOps:(s,r,l,a)=>t.onTranscriptOps?.(s,r,l,a)??!0}});return o.connect(),{subscribe(s,r){o.subscribe(s,r??{seq:0})},unsubscribe(s){o.unsubscribe(s),i.forgetSession(s)},subscribeTranscript(s,r,l){o.subscribeTranscript(s,r,l)},unsubscribeTranscript(s,r){o.unsubscribeTranscript(s,r)},bindNextPromptId(s,r){i.bindNextPromptId(s,r)},abort(s,r){o.abort(s,r)},terminalAttach(s,r,l){o.terminalAttach(s,r,l)},terminalInput(s,r,l){o.terminalInput(s,r,l)},terminalResize(s,r,l,a){o.terminalResize(s,r,l,a)},terminalDetach(s,r){o.terminalDetach(s,r)},terminalClose(s,r){o.terminalClose(s,r)},markSideChannelAgent(s,r){o.markSideChannelAgent(s,r),i.markSideChannelAgent(r)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}connectTranscriptChannel(t){const n=`${this.opts.identity.clientId}-transcript`,i=new QN({wsUrl:mN(this.opts.origin,n),clientId:n,tracer:this.tracer,credentialStore:this.opts.credentialStore,handlers:{onWireEvent:()=>{},onResync:()=>{},onConnectionState:o=>t.onConnectionState?.(o),onError:(o,s,r)=>t.onError?.(o,s,r),onTranscriptReset:t.onTranscriptReset,onTranscriptOps:t.onTranscriptOps}});return i.connect(),{subscribe:()=>{},unsubscribe:()=>{},subscribeTranscript:(o,s,r)=>i.subscribeTranscript(o,s,r),unsubscribeTranscript:(o,s)=>i.unsubscribeTranscript(o,s),bindNextPromptId:()=>{},abort:()=>{},terminalAttach:()=>{},terminalInput:()=>{},terminalResize:()=>{},terminalDetach:()=>{},terminalClose:()=>{},markSideChannelAgent:()=>{},health:()=>i.health(),reconnect:()=>i.reconnect(),close:()=>i.close()}}}function B8(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}function ywe(e){const t=e.toLowerCase().split(";")[0].trim();return t===""||t==="text/plain"||t.startsWith("text/")?!0:/(json|xml|javascript|typescript|x-yaml|yaml|svg|x-sh|x-python|markdown|csv|html|css)$/.test(t)}function kwe(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const o=typeof i.result=="string"?i.result:"";t(o.slice(o.indexOf(",")+1))},i.onerror=()=>n(i.error),i.readAsDataURL(e)})}const bwe="main",wwe=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function R8(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function Cwe(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function XN(){return{turnPromptId:new Map,currentPromptId:void 0,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",subagentMeta:new Map,restartedThisRun:new Set,settledByKernel:new Set,retiredBindings:new Set,registrationSeq:0,registrationOrderByKey:new Map,retryActive:!1}}function yr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Xs(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Xl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Awe(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,i=n&&typeof n=="object"?n:{},o=yr(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const s=yr(t,"goalId")??yr(t,"goal_id")??"goal",r=yr(t,"objective")??"";return{goalId:s,objective:r,completionCriterion:yr(t,"completionCriterion")??yr(t,"completion_criterion"),status:o,turnsUsed:Xs(t,"turnsUsed")??Xs(t,"turns_used")??0,tokensUsed:Xs(t,"tokensUsed")??Xs(t,"tokens_used")??0,wallClockMs:Xs(t,"wallClockMs")??Xs(t,"wall_clock_ms")??0,terminalReason:yr(t,"terminalReason")??yr(t,"terminal_reason"),budget:{tokenBudget:Xl(i,"tokenBudget")??Xl(i,"token_budget"),remainingTokens:Xl(i,"remainingTokens")??Xl(i,"remaining_tokens"),turnBudget:Xl(i,"turnBudget")??Xl(i,"turn_budget"),remainingTurns:Xl(i,"remainingTurns")??Xl(i,"remaining_turns"),wallClockBudgetMs:Xl(i,"wallClockBudgetMs")??Xl(i,"wall_clock_budget_ms"),remainingWallClockMs:Xl(i,"remainingWallClockMs")??Xl(i,"remaining_wall_clock_ms"),overBudget:i.overBudget===!0||i.over_budget===!0}}}function nd(e,t,n,i,o){if(typeof i!="string"||i.length===0)return null;const r={...t.subagentMeta.get(i)??{id:i,agentId:i,sessionId:n,kind:"subagent",description:e("tasks.dockSubagent"),status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:i,sessionId:n,kind:"subagent"};return t.subagentMeta.set(i,r),r}function xwe(e,t,n){if(t==="turn.step.started")return null;if(t==="tool.use"||t==="tool.call.started"){const i=yr(n,"name")??yr(n,"toolName")??"tool",o=BO(e,Swe(i)),s=_we(e,i,n.args??n.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(t==="tool.progress"){const i=n.update;if(i&&typeof i=="object"){const s=yr(i,"text");if(s)return $8(s);const r=yr(i,"message");if(r)return $8(r)}const o=yr(n,"message");if(o)return $8(o)}return null}function Swe(e){return e.replace(/_\d+$/,"")}const eD=2e3;function $8(e){return e.length>eD?`${e.slice(0,eD)}…`:e}function _we(e,t,n){if(n==null)return"";const i=typeof n=="string"?n:JSON.stringify(n);return _6(e,t,i)}function Mwe(e,t,n,i,o,s,r){if(r.has(i)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const h=yr(s,"delta");if(!h)return[];const m=t.subagentMeta.get(i),g=nd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:m?.startedAt??new Date().toISOString()}),v=[];return g&&v.push({type:"taskCreated",sessionId:n,task:g}),v.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:h,stream:"stdout",kind:"text"}),v}const l=xwe(e,o,s);if(l===null||l.length===0)return[];const a=o==="tool.progress"?s.update:void 0,u=a!=null&&typeof a=="object"?a.replace===!0:!1,c=t.subagentMeta.get(i),d=nd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:c?.startedAt??new Date().toISOString()}),f=[];return d&&f.push({type:"taskCreated",sessionId:n,task:d}),f.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:l,stream:"stdout",replace:u}),f}function Iwe(e){return Array.isArray(e)?e.map(t=>P7(t)):[]}function Twe(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}const Ewe=new Set(["session.meta.updated","goal.updated","compaction.completed","compaction.started","compaction.cancelled","compaction.blocked","hook.result","mcp.server.status","skill.activated","tool.list.updated"]);function Lwe(e,t,n){switch(e){case"session.meta.updated":{const i=t?.patch?.title??t?.title,o=t?.patch?.lastPrompt,s={};return typeof i=="string"&&i.length>0&&(s.title=i),typeof o=="string"&&(s.lastPrompt=o),s.title!==void 0||s.lastPrompt!==void 0?[{type:"sessionMetaUpdated",sessionId:n,...s}]:[]}case"goal.updated":{const i=Awe(t?.snapshot??null);return[{type:"goalUpdated",sessionId:n,goal:i?.status==="complete"?null:i}]}case"compaction.completed":{const i=t?.result??{};return[{type:"compactionCompleted",sessionId:n,tokensBefore:typeof i.tokensBefore=="number"?i.tokensBefore:void 0,tokensAfter:typeof i.tokensAfter=="number"?i.tokensAfter:void 0,summary:typeof i.summary=="string"?i.summary:void 0},{type:"historyCompacted",sessionId:n,beforeSeq:0,reason:"auto_compact"}]}case"compaction.started":return[{type:"compactionStarted",sessionId:n,trigger:t?.trigger==="manual"?"manual":"auto",instruction:typeof t?.instruction=="string"?t.instruction:void 0}];case"compaction.cancelled":return[{type:"compactionCancelled",sessionId:n}];default:return[]}}function Nwe(e){const{t}=e,n=new Map,i=new Set;function o(f){let h=n.get(f);return h||(h=XN(),n.set(f,h)),h}function s(f){n.set(f,XN())}function r(f){n.delete(f)}function l(f){return n.has(f)}function a(f){i.add(f)}function u(f,h){const m=o(f);m.currentPromptId=h}function c(f,h,m,g){try{return d(f,h,m,g)}catch(v){return vu("[agentProjector] Error projecting event:",f,v instanceof Error?v.message:v),[]}}function d(f,h,m,g){if(Ewe.has(f))return Lwe(f,h,m);const v=o(m),y=h,b=[],w=y?.agentId;if(typeof w=="string"&&w!==bwe){const C=i.has(w);if(f==="prompt.submitted"){if(!C)return[];const T=y?.promptId,N=y?.userMessageId;if(!T||!N)return[];const I=Iwe(y?.content);return I.length===0?[]:[{type:"messageCreated",agentId:w,message:{id:N,sessionId:m,role:"user",content:I,createdAt:typeof y?.createdAt=="string"?y.createdAt:new Date().toISOString(),promptId:T}}]}if(C&&(f==="thinking.delta"||f==="assistant.delta")){const T=y?.delta??"";return T?[{type:"agentDelta",sessionId:m,agentId:w,delta:{[f==="thinking.delta"?"thinking":"text"]:T}}]:[]}if(C&&f==="turn.ended")return[{type:"agentTurnEnded",sessionId:m,agentId:w,reason:y?.reason}];if(wwe.has(f))return Mwe(t,v,m,w,f,y??{},i)}switch(f){case"turn.started":{const C=y?.turnId,T=v.currentPromptId??R8("pr_");v.currentPromptId=T,C!==void 0&&v.turnPromptId.set(C,T),b.push({type:"turnActiveChanged",sessionId:m,active:!0});break}case"turn.step.started":case"thinking.delta":case"assistant.delta":case"tool.use":case"tool.call.started":case"tool.call.delta":case"tool.progress":case"tool.result":break;case"turn.step.completed":{const C=Cwe(y?.usage);v.totalInput+=C.input,v.totalOutput+=C.output,v.totalCacheRead+=C.cacheRead,v.totalCacheCreate+=C.cacheCreate;break}case"agent.status.updated":{y?.model&&(v.model=y.model),y?.contextTokens!==void 0&&(v.contextTokens=y.contextTokens),y?.maxContextTokens!==void 0&&(v.contextLimit=y.maxContextTokens);const C=y?.phase;C!=null&&C.kind==="retrying"?(v.retryActive=!0,b.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:Xs(C,"failedAttempt")??0,nextAttempt:Xs(C,"nextAttempt")??0,maxAttempts:Xs(C,"maxAttempts")??0,delayMs:Xs(C,"delayMs")??0,errorName:yr(C,"errorName"),statusCode:Xs(C,"statusCode"),turnId:Xs(C,"turnId")}})):v.retryActive&&C!==void 0&&C!==null&&typeof C.kind=="string"&&(v.retryActive=!1,b.push({type:"turnRetry",sessionId:m,retry:void 0})),b.push({type:"sessionUsageUpdated",sessionId:m,usage:Twe(v),model:v.model||void 0,swarmMode:y?.swarmMode===!0?!0:y?.swarmMode===!1?!1:void 0,planMode:y?.planMode===!0?!0:y?.planMode===!1?!1:void 0,thinking:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:void 0});break}case"turn.ended":{const C=y?.turnId,T=(C!==void 0?v.turnPromptId.get(C):void 0)??v.currentPromptId;b.push({type:"turnActiveChanged",sessionId:m,active:!1,reason:y?.reason,promptId:T}),v.turnCount++,v.currentPromptId=void 0;break}case"prompt.completed":{const C=y?.promptId;typeof C=="string"&&C.length>0&&b.push({type:"promptCompleted",sessionId:m,promptId:C,reason:y?.reason??"completed"});break}case"prompt.aborted":{const C=y?.promptId;typeof C=="string"&&C.length>0&&b.push({type:"promptAborted",sessionId:m,promptId:C});break}case"turn.step.retrying":{v.retryActive=!0,b.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:Xs(y??{},"failedAttempt")??0,nextAttempt:Xs(y??{},"nextAttempt")??0,maxAttempts:Xs(y??{},"maxAttempts")??0,delayMs:Xs(y??{},"delayMs")??0,errorName:yr(y??{},"errorName"),statusCode:Xs(y??{},"statusCode"),turnId:typeof y?.turnId=="number"?y.turnId:void 0}});break}case"turn.step.interrupted":break;case"subagent.spawned":{const C=typeof y?.subagentId=="string"&&y.subagentId.length>0?y.subagentId:R8("task_"),T=typeof y?.taskId=="string"&&y.taskId.length>0?y.taskId:void 0,N=T!==void 0&&T!==C?v.subagentMeta.get(T):void 0,I=v.subagentMeta.get(C);N!==void 0&&v.subagentMeta.delete(T),T!==void 0&&!v.registrationOrderByKey.has(T)&&v.registrationOrderByKey.set(T,++v.registrationSeq);const S=I===void 0||N===void 0?I??N:{...I,createdAt:N.createdAt,startedAt:N.startedAt??I.startedAt,runInBackground:!0,backgroundTaskId:I.backgroundTaskId??T},_=S?.backgroundTaskId??(S!==void 0&&T!==void 0&&S.id===T?T:void 0),x=T!==void 0?v.registrationOrderByKey.get(T):void 0,E=_!==void 0?v.registrationOrderByKey.get(_):void 0,M=v.retiredBindings.has(T??"")||x!==void 0&&E!==void 0&&x0?y.model:S?.model,thinkingEffort:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:S?.thinkingEffort,parentToolCallId:typeof y?.parentToolCallId=="string"?y.parentToolCallId:S?.parentToolCallId,swarmIndex:typeof y?.swarmIndex=="number"?y.swarmIndex:S?.swarmIndex,runInBackground:R?y?.runInBackground===!0||y?.runInBackground===void 0&&S?.runInBackground===!0:y?.runInBackground===!0||S?.runInBackground===!0,outputPreview:R?void 0:S?.outputPreview,outputBytes:R?void 0:S?.outputBytes,outputLines:R?void 0:S?.outputLines,suspendedReason:R?void 0:S?.suspendedReason,text:R?void 0:S?.text,backgroundTaskId:M?S?.backgroundTaskId:R?T:T??S?.backgroundTaskId};v.subagentMeta.set(z.id,z),b.push({type:"taskCreated",sessionId:m,task:z});break}case"subagent.started":{const C=typeof y?.subagentId=="string"?y.subagentId:void 0,T=C!==void 0&&(v.subagentMeta.get(C)?.status!==void 0&&v.subagentMeta.get(C).status!=="running"||v.settledByKernel.has(C));T&&v.settledByKernel.delete(C);const N=nd(t,v,m,y?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString(),suspendedReason:void 0,...T?{createdAt:new Date().toISOString(),completedAt:void 0,completedAtEstimated:void 0,outputPreview:void 0,outputBytes:void 0,outputLines:void 0,text:void 0}:{}});T&&C!==void 0&&v.restartedThisRun.add(C),N&&b.push({type:"taskCreated",sessionId:m,task:N});break}case"subagent.suspended":{const C=nd(t,v,m,y?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof y?.reason=="string"?y.reason:void 0});C&&b.push({type:"taskCreated",sessionId:m,task:C});break}case"subagent.completed":{const C=typeof y?.resultSummary=="string"?y.resultSummary:void 0,T=nd(t,v,m,y?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:C});T&&b.push({type:"taskCreated",sessionId:m,task:T}),T!==null&&v.restartedThisRun.delete(T.id),b.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"completed",outputPreview:C});break}case"subagent.failed":{const C=typeof y?.error=="string"?y.error:void 0,T=nd(t,v,m,y?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:C});T&&b.push({type:"taskCreated",sessionId:m,task:T}),T!==null&&v.restartedThisRun.delete(T.id),b.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"failed",outputPreview:C});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:y?.code,message:y?.message,name:y?.name,details:y?.details,retryable:y?.retryable}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:y?.message}});break}case"task.started":case"background.task.started":{const C=y?.info??{},T=typeof C.startedAt=="number"?new Date(C.startedAt).toISOString():void 0,N=typeof C.taskId=="string"?C.taskId:typeof C.taskId=="number"?String(C.taskId):R8("task_"),I=typeof C.description=="string"?C.description:typeof C.command=="string"?C.command:t("tasks.defaultDescription");if(C.kind==="agent"){const _=typeof C.agentId=="string"&&C.agentId.length>0?C.agentId:void 0;if(_!==void 0){const x=v.subagentMeta.get(_),E=v.registrationOrderByKey.get(N),M=x?.backgroundTaskId!==void 0?v.registrationOrderByKey.get(x.backgroundTaskId):void 0;if(v.retiredBindings.has(N)||E!==void 0&&M!==void 0&&EM.backgroundTaskId===N);if(x===void 0&&(v.retiredBindings.has(N)||v.registrationOrderByKey.has(N)&&v.registrationOrderByKey.get(N)0&&v.settledByKernel.add(C.agentId),b.push({type:"taskCompleted",sessionId:m,taskId:typeof C.taskId=="string"?C.taskId:typeof C.taskId=="number"?String(C.taskId):"",status:C.status==="killed"?"cancelled":T?"failed":"completed"});break}}return b}return{project:c,bindNextPromptId:u,reset:s,forgetSession:r,markSideChannelAgent:a,hasSessionState:l}}function Dwe(e){return new vwe({origin:e.origin,identity:e.identity,tracer:e.tracer,credentialStore:e.credentialStore,projectorFactory:()=>Nwe({t:e.t}),mainAgentOnly:e.mainAgentOnly})}const Fwe={t:e=>e},tD="Sub Agent";function Bwe(){return{sessions:[],activeSessionId:void 0,approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},turnErrorBySession:{},turnRetryBySession:{},compactionBySession:{},warnings:[]}}function Rwe(e){return{...e,sessions:e.sessions,approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},turnErrorBySession:{...e.turnErrorBySession},turnRetryBySession:{...e.turnRetryBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function $we(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const i=e.lastSeqBySession[t]??0;n>i&&(e.lastSeqBySession[t]=n)}}function ty(e,t){const n=e.sessions.find(i=>i.id===t.sessionId)?.lastSeq??0;return t.seq>Math.max(e.lastSeqBySession[t.sessionId]??0,n)}const Owe={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function qC(e,t){const n=[],i=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};i(t("warnings.details.code"),e.code);const o=e.details??{};i(t("warnings.details.status"),o.statusCode),i(t("warnings.details.requestId"),o.requestId),i(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(o))r==="statusCode"||r==="requestId"||i(r,l);const s=(e.code!==void 0?Owe[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${s}`),message:e.message,details:n.length>0?n:void 0}}function Pwe(e,t,n,i=Fwe){const o=Rwe(e);switch($we(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(r=>r.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?{...t.session,pullRequest:s.pullRequest}:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],delete o.turnErrorBySession[s],delete o.turnRetryBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{if(!ty(e,n))break;let s;o.sessions=o.sessions.map(r=>r.id!==t.sessionId?r:(s=t.pendingInteraction??(t.busy?r.pendingInteraction:"none"),{...r,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?r.mainTurnActive:!1),pendingInteraction:s,lastTurnReason:t.lastTurnReason})),s==="none"?(delete o.approvalsBySession[t.sessionId],delete o.questionsBySession[t.sessionId]):s==="question"&&delete o.approvalsBySession[t.sessionId],t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&(delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId]);break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const r=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:r}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,{[s]:r,...l}=o.compactionBySession;o.compactionBySession=l;break}case"compactionCancelled":{const{[t.sessionId]:s,...r}=o.compactionBySession;o.compactionBySession=r;break}case"messageCreated":case"messageUpdated":case"assistantDelta":case"toolOutput":break;case"approvalRequested":{const s=t.sessionId,r=o.approvalsBySession[s]??[];r.some(u=>u.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...r,t.approval]);const a=t.approval.display;a?.kind==="plan_review"&&typeof a.plan=="string"&&a.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:a.plan,path:typeof a.path=="string"?a.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,r=t.approvalId,l=o.approvalsBySession[s]??[];o.approvalsBySession[s]=l.filter(a=>a.approvalId!==r);break}case"questionRequested":{const s=t.sessionId,r=o.questionsBySession[s]??[];r.some(a=>a.questionId===t.question.questionId)||(o.questionsBySession[s]=[...r,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,r=t.questionId,l=o.questionsBySession[s]??[];o.questionsBySession[s]=l.filter(a=>a.questionId!==r);break}case"taskCreated":{const s=t.sessionId,r=o.tasksBySession[s]??[],l=r.findIndex(f=>f.id===t.task.id),a=t.task.backgroundTaskId===void 0?-1:r.findIndex(f=>f.id===t.task.backgroundTaskId),u=a!==-1&&l!==-1&&a!==l?r[a]:void 0,c=u!==void 0?r.filter((f,h)=>h!==a):r,d=c.findIndex(f=>f.id===t.task.id||t.task.backgroundTaskId!==void 0&&f.id===t.task.backgroundTaskId);if(d===-1)o.tasksBySession[s]=[...c,t.task];else{const f=[...c],h=c[d],m=t.task.backgroundTaskId!==void 0&&(t.task.backgroundTaskId===h.backgroundTaskId||h.id===t.task.backgroundTaskId)||h.id===t.task.id&&(h.kind!=="subagent"||h.agentId===void 0),g=(m&&h.status!=="running"?h:void 0)??(u!==void 0&&u.status!=="running"?u:void 0),v=g!==void 0&&(t.task.status==="running"||t.task.status!==g.status),y=!m&&h.status!=="running"||t.task.backgroundTaskId!==void 0&&h.backgroundTaskId!==void 0&&t.task.backgroundTaskId!==h.backgroundTaskId,b=m&&h.completedAt!==void 0&&h.completedAtEstimated!==!0;f[d]={...t.task,status:v?g.status:t.task.status,subagentPhase:v?g.subagentPhase:t.task.subagentPhase,completedAt:v?g.completedAt:b?h.completedAt:t.task.completedAt,completedAtEstimated:v?g.completedAtEstimated:b?h.completedAtEstimated:t.task.completedAtEstimated,outputLines:v?g.outputLines:y?u?.outputLines??t.task.outputLines:h.outputLines??u?.outputLines??t.task.outputLines,text:v?g.text:y?u?.text??t.task.text:h.text??u?.text??t.task.text,outputPreview:v?g.outputPreview:t.task.outputPreview??(y?u?.outputPreview:h.outputPreview??u?.outputPreview),outputBytes:v?g.outputBytes:t.task.outputBytes??(y?u?.outputBytes:h.outputBytes??u?.outputBytes),description:t.task.description===tD&&h.description!==tD?h.description:t.task.description,swarmIndex:t.task.swarmIndex??h.swarmIndex,parentToolCallId:t.task.parentToolCallId??h.parentToolCallId,subagentType:t.task.subagentType??h.subagentType,model:t.task.model??h.model,thinkingEffort:t.task.thinkingEffort??h.thinkingEffort,runInBackground:y?t.task.runInBackground:t.task.runInBackground??h.runInBackground,backgroundTaskId:y?t.task.backgroundTaskId:t.task.backgroundTaskId??h.backgroundTaskId,agentId:t.task.agentId??h.agentId},o.tasksBySession[s]=f}break}case"taskProgress":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>{if(l.id!==t.taskId)return l;if(l.kind==="subagent"&&t.kind==="text")return{...l,text:(l.text??"")+t.outputChunk};const a=l.outputLines??[];if(t.replace===!0){const c=a.length>0?[...a.slice(0,-1),t.outputChunk]:[t.outputChunk];return{...l,outputLines:c}}if(a.at(-1)===t.outputChunk)return l;const u=[...a,t.outputChunk];return{...l,outputLines:l.kind==="subagent"?u:u.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>l.id!==t.taskId&&l.backgroundTaskId!==t.taskId||t.status==="completed"&&(l.status==="cancelled"||l.status==="failed")||t.status==="failed"&&l.status==="cancelled"?l:{...l,status:t.status,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,outputPreview:t.outputPreview??l.outputPreview,outputBytes:t.outputBytes??l.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{if(!ty(e,n))break;if(o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active)o.turnActiveBySession[t.sessionId]=!0,delete o.turnErrorBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];else{delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];const s=t.reason===void 0||t.reason==="completed"?"completed":"failed",r=o.tasksBySession[t.sessionId];r!==void 0&&(o.tasksBySession[t.sessionId]=r.map(l=>l.kind!=="subagent"||l.status!=="running"||l.runInBackground===!0?l:{...l,status:s,subagentPhase:s,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,suspendedReason:void 0}))}break}case"turnRetry":{if(!ty(e,n))break;t.retry===void 0?delete o.turnRetryBySession[t.sessionId]:o.turnRetryBySession[t.sessionId]=t.retry;break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError){if(ty(e,n)){if(n.sessionId!==void 0){const r=s.details??{};o.turnErrorBySession[n.sessionId]={code:s.code,message:s.message,name:s.name,retryable:s.retryable,statusCode:typeof r.statusCode=="number"?r.statusCode:void 0,requestId:typeof r.requestId=="string"?r.requestId:void 0}}(n.sessionId===void 0||n.sessionId!==e.activeSessionId)&&(o.warnings=[...o.warnings,qC(s,i.t)])}}else if(s&&s._agentWarning){const r=s.message??s.code??i.t("warnings.agentWarningFallback");o.warnings=[...o.warnings,`${i.t("warnings.noteLabel")}: ${r}`]}else{const r=s?.type??"(unknown)";o.warnings=[...o.warnings,i.t("warnings.unhandledEvent",{type:r})]}break}}return o}function zwe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n]*)>([\s\S]*?)<\/notification>/g,Hwe=/([\w-]+)="([^"]*)"/g,Wwe=/]*)>[\s\S]*?<\/output-file>/,qwe=/]*)>([\s\S]*?)<\/output-preview>/,Uwe=/^Title: (.*)$/m,Vwe=/^Severity: (.*)$/m;function Zy(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function O8(e){const t={};for(const n of e.matchAll(Hwe))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=Zy(n[2]));return t}function Kwe(e,t,n){const i=O8(e),o=Uwe.exec(t)?.[1]?.trim()??"",s=Vwe.exec(t)?.[1]?.trim()??"";let r=t.split(` -`).filter(f=>!f.startsWith("Title: ")&&!f.startsWith("Severity: ")).join(` -`);const l=r.search(/^<\w/m);l!==-1&&(r=r.slice(0,l)),r=r.trim();const a=Wwe.exec(t),u=a?(()=>{const f=O8(a[1]??""),h=Number(f.bytes);return f.path!==void 0&&f.path!==""?{path:f.path,bytes:Number.isFinite(h)?h:void 0}:void 0})():void 0,c=qwe.exec(t),d=c?(()=>{const f=O8(c[1]??""),h=(c[2]??"").replace(/^\n/,""),m=h.indexOf(` -`),g=Zy(m===-1?"":h.slice(m+1)).replace(/\n$/,""),v=Number(f.bytes),y=Number(f.total_bytes);return{text:g,bytes:Number.isFinite(v)?v:void 0,totalBytes:Number.isFinite(y)?y:void 0,truncated:f.truncated==="true"?!0:f.truncated==="false"?!1:void 0}})():void 0;return{id:i.id??"",category:i.category??"",type:i.type??"",sourceKind:i.source_kind??"",sourceId:i.source_id??"",agentId:i.agent_id,title:Zy(o),severity:s,body:Zy(r),outputFile:u,outputPreview:d,raw:n}}function Zwe(e){if(!e.includes("nD||s>nD||(o+1)*(s+1)>Ywe)return null;const r=Array.from({length:o+1},()=>Array.from({length:s+1},()=>0));for(let h=1;h<=o;h++)for(let m=1;m<=s;m++)r[h][m]=n[h-1]===i[m-1]?r[h-1][m-1]+1:Math.max(r[h-1][m],r[h][m-1]);const l=[];let a=o,u=s;for(;a>0||u>0;)a>0&&u>0&&n[a-1]===i[u-1]?(l.push({type:"context",text:n[a-1]}),a--,u--):u>0&&(a===0||r[a][u-1]>=r[a-1][u])?(l.push({type:"add",text:i[u-1]}),u--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const c=[];let d=1,f=1;for(const h of l)h.type==="context"?(c.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(c.push({type:"add",text:h.text,newNo:f}),f++):(c.push({type:"del",text:h.text,oldNo:d}),d++);return c}const iD=500;function oD(e,t){const n=[],i=Bu(e),o=Bu(t),s=Math.min(i.length,iD),r=Math.min(o.length,iD);for(let l=1;l<=s;l++)n.push({type:"del",text:i[l-1],oldNo:l});i.length>s&&n.push({type:"context",text:`… ${i.length-s} more lines …`});for(let l=1;l<=r;l++)n.push({type:"add",text:o[l-1],newNo:l});return o.length>r&&n.push({type:"context",text:`… ${o.length-r} more lines …`}),n}function WW(e){let t=0,n=0;for(const i of e)i.type==="add"?t++:i.type==="del"&&n++;return{added:t,removed:n}}const Jwe=/^read[_-]?media(?:file)?$/i,Xwe=/^data:([^;]+);base64,(.*)$/s,eCe=/^<(image|video|audio)\s+path="([^"]+)">$/,tCe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,nCe=/Mime type:\s*([^.\s]+)/i,iCe=/Size:\s*(\d+)\s*bytes/i,oCe=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,sCe="Image compressed to fit model limits:",rCe=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function lCe(e){return e.includes(sCe)?e.replace(rCe,""):e}function aCe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function sD(e){const t=tCe.exec(e.trim());return t?{kind:t[1],path:aCe(t[2])}:null}const qW=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,uCe=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function VC(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),i=n>0?t.slice(0,n):t;return qW.test(i)?i:void 0}const cCe=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function rD(e){const t=cCe.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",i=uCe.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:i!==void 0&&qW.test(i)?i:void 0}}const dCe=/(?=0&&e[i]==="\\";)n+=1,i-=1;return n%2===1}function UW(e){let t="",n=0,i=0;for(;i0?t:void 0}return[JSON.stringify(e)]}}function bCe(e,t){if(Mr(e)==="task")for(const n of t??[]){const i=/^agent_id:\s*(\S+)\s*$/.exec(n);if(i?.[1])return i[1]}}function wCe(e,t){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,kind:e.kind,subagentType:e.subagentType,prompt:e.command??t,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase??"working",status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function VW(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const i=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:i,diff:t.diff};const o=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,s=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(o!==void 0&&s!==void 0){const r=y4(o,s)??oD(o,s);return{kind:"diff",path:i,diff:r}}return{kind:"diff",path:i,diff:[]}}if(n==="file_io"){const i=typeof t.path=="string"?t.path:"",o=typeof t.operation=="string"?t.operation:"";if(o==="write"&&typeof t.content=="string")return{kind:"file",path:i,content:t.content};if(o==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=y4(t.before,t.after)??oD(t.before,t.after);return{kind:"diff",path:i,diff:r}}const s=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o||n,path:i,detail:s}}if(n==="shell"||n==="command"){const i=typeof t.command=="string"?t.command:e.action;return{kind:"shell",command:i,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:sre(i)}}if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(s=>{const r=s??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const i=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},u=typeof a.label=="string"?a.label:"";if(!u)return null;const c=typeof a.description=="string"?a.description:void 0;return{label:u,description:c}}).filter(l=>l!==null);return{kind:"plan_review",plan:i,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function KW(e){const t=` -`,n=` -`,i=e.indexOf(t),o=e.lastIndexOf(n);return i>=0&&o>=i+t.length?e.slice(i+t.length,o):CCe(e)}function CCe(e){const t=e.split(` -`);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` -`):e}function ACe(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function xCe(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` -`);return KW(t)}function SCe(e,t){const n=e.metadata?.origin??{},i=xCe(e);return t==="cron_missed"?{text:i,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:i,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function _Ce(e,t,n){const{text:i,cron:o}=SCe(e,n);return{id:e.id,role:"cron",no:t,text:i,createdAt:e.createdAt,cron:o}}function MCe(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function ICe(e){return e.metadata?.origin?.kind==="compaction_summary"}function TCe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function ECe(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function LCe(e){const t=[];for(const n of e){const i=t.at(-1);n.type==="text"&&i?.type==="text"?i.text+=n.text:n.type==="thinking"&&i?.type==="thinking"?i.thinking+=n.thinking:n.type==="thinking"?t.push({type:"thinking",thinking:n.thinking}):t.push({...n})}return JSON.stringify(t)}function Qk(e,t,n,i=!0,o={},s={},r){const l=[];let a=r?.startNo??1;const u=r?.collect,c=new Map;for(const g of t)c.set(g.toolCallId,g);let d=null;function f(g=!1){if(!d)return;const v=d;if(d=null,!g&&v.blocks.length===0&&v.textParts.length===0&&v.thinkingParts.length===0&&v.tools.length===0)return;if(!g||!i)for(let b=0;bN.kind==="tool"&&N.tool.id===C.id);T&&T.kind==="tool"&&(T.tool=C)}const y={id:v.id,role:"assistant",no:a++,text:v.textParts.join(` -`),thinking:v.thinkingParts.length>0?v.thinkingParts.join(` -`):void 0,tools:v.tools.length>0?v.tools:void 0,blocks:v.blocks.length>0?v.blocks:void 0,approval:v.approval,approvalId:v.approvalId,durationMs:v.durationMs,createdAt:v.createdAt,endedAt:v.endedAt,goalContinuation:v.goalContinuation};l.push(y),u?.(y,v.sources)}function h(g,v){let y=null;for(const b of v)if(b.type==="text"){if(b.text){y==="text"?g.textParts[g.textParts.length-1]+=b.text:g.textParts.push(b.text);const w=g.blocks.at(-1);w&&w.kind==="text"?w.text+=(y==="text"?"":` -`)+b.text:g.blocks.push({kind:"text",text:b.text}),y="text"}}else if(b.type==="thinking"){if(b.thinking){y==="thinking"?g.thinkingParts[g.thinkingParts.length-1]+=b.thinking:g.thinkingParts.push(b.thinking);const w=g.blocks.at(-1);if(w&&w.kind==="thinking"){w.thinking+=(y==="thinking"?"":` -`)+b.thinking;const C=[w.startedAt,b.startedAt].filter(I=>I!==void 0).sort()[0],T=w.startedAt!==void 0&&w.durationMs===void 0||b.startedAt!==void 0&&b.durationMs===void 0,N=[w,b].flatMap(I=>I.startedAt!==void 0&&I.durationMs!==void 0?[Date.parse(I.startedAt)+I.durationMs]:[]);w.startedAt=C,w.durationMs=!T&&C!==void 0&&N.length>0?Math.max(...N)-Date.parse(C):void 0}else g.blocks.push({kind:"thinking",thinking:b.thinking,startedAt:b.startedAt,durationMs:b.durationMs});y="thinking"}}else if(b.type==="toolUse"){y=null;const w=c.get(b.toolCallId),C=b.toolName==="ExitPlanMode"?s[b.toolCallId]:void 0,T={id:b.toolCallId,name:b.toolName,arg:typeof b.input=="string"?b.input:JSON.stringify(b.input),agentId:Mr(b.toolName)==="task"?b.agentRefs?.find(N=>N.role!=="member")?.agentId??b.agentRefs?.[0]?.agentId:void 0,status:"running",output:b.outputLines,plan:C,planPath:b.toolName==="ExitPlanMode"?C?.path??o[b.toolCallId]?.path:void 0};g.tools.push(T),g.blocks.push({kind:"tool",tool:T}),w&&(g.approval=VW(w),g.approvalId=w.approvalId)}else if(b.type==="toolResult"){y=null;const w=g.tools.findIndex(C=>C.id===b.toolCallId);if(w!==-1){const C=g.tools[w],T=tx(b.output),N={...C,status:b.isError?"error":"ok",output:T,media:b.isError?void 0:kCe(C.name,b.output),agentId:C.agentId??bCe(C.name,T)};N.name==="ExitPlanMode"&&!N.planPath&&(N.planPath=ECe(N.output)),g.tools[w]=N;const I=g.blocks.find(S=>S.kind==="tool"&&S.tool.id===b.toolCallId);I&&I.kind==="tool"&&(I.tool=N)}}else y=null}function m(g,v){if(g.type==="image"||g.type==="video"){const y=g.type,b=g.source;if(b.kind==="url")return{url:b.url,kind:y};if(b.kind==="base64")return{url:`data:${b.mediaType};base64,${b.data}`,kind:y};if(b.kind==="file"&&n)return{url:n(b.fileId),kind:y,fileId:b.fileId};if(b.kind==="sessionMedia")return{url:r?.getSessionMediaUrl?.(v,b.fileId)??"",kind:y,fileId:b.fileId,sessionId:v}}if(g.type==="file"&&n){if(g.mediaType.startsWith("image/"))return{url:n(g.fileId),kind:"image",fileId:g.fileId};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video",fileId:g.fileId}}}for(const g of e){if(g.role==="system")continue;if(ICe(g)){f();const C=g.metadata?.[jW],T={id:g.id,role:"compaction",no:a,text:g.content.filter(N=>N.type==="text").map(N=>N.text).join(` -`),compaction:{trigger:C?.trigger,tokensBefore:C?.tokensBefore,tokensAfter:C?.tokensAfter}};l.push(T),u?.(T,[g]);continue}if(g.role==="user"){const C=ACe(g),T=g.metadata?.origin?.kind,N=T==="skill_activation"&&g.metadata?.origin?.trigger!=="user-slash";if(C===void 0&&(T==="injection"||N))continue;if(C===void 0&&(T==="task"||T==="background_task"||T==="task_notification")){const Q=g.content.filter(ge=>ge.type==="text").map(ge=>ge.text).join(` -`),te=Gwe(g.metadata),X=te!==void 0?[te]:Zwe(Q);if(X.length>0){d??={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt};for(const ge of X)d.blocks.push({kind:"notification",notification:{...ge,createdAt:g.createdAt}})}continue}if(f(),C!==void 0){const Q=_Ce(g,a++,C);l.push(Q),u?.(Q,[g]);continue}if(T==="system_trigger"&&g.metadata?.origin?.name==="goal_continuation"){d={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt,goalContinuation:!0};continue}if(!MCe(g))continue;const I=g.metadata?.origin,S=I?.kind==="skill_activation"&&I?.trigger==="user-slash",_=I?.kind==="plugin_command"&&I?.trigger==="user-slash",x=[],E=[];for(const Q of g.content){if(Q.type==="text")if(S){const X=sD(Q.text);if(X&&(X.kind==="video"||X.kind==="image")&&n){const ue=VC(X.path);if(ue){E.push({url:n(ue),kind:X.kind,fileId:ue});continue}}const ge=rD(Q.text);ge&&E.push({kind:"file",url:ge.fileId&&n?n(ge.fileId):"",fileId:ge.fileId,name:ge.name,mediaType:ge.mediaType,size:ge.size})}else if(_)x.push(I.commandArgs??"");else{const X=sD(Q.text);if(X&&(X.kind==="video"||X.kind==="image")&&n){const se=VC(X.path);if(se){E.push({url:n(se),kind:X.kind,fileId:se});continue}}const ge=rD(Q.text);if(ge){E.push({kind:"file",url:ge.fileId&&n?n(ge.fileId):"",fileId:ge.fileId,name:ge.name,mediaType:ge.mediaType,size:ge.size});continue}const ue=lCe(Q.text);if(ue!==Q.text&&ue.trim().length===0)continue;x.push(ue)}const te=m(Q,g.sessionId);if(te){E.push({url:te.url,kind:te.kind,name:Q.type==="file"?Q.name:void 0,fileId:te.fileId,sessionId:te.sessionId});continue}Q.type==="file"&&n&&E.push({kind:"file",url:n(Q.fileId),fileId:Q.fileId,name:Q.name,mediaType:Q.mediaType||void 0,size:Q.size})}const M=S?I?.skillArgs??"":x.join(` -`),R=pCe(M),q=mCe(M),z=E.filter(Q=>Q.kind==="file"),O=E.filter(Q=>Q.kind==="image"||Q.kind==="video"),B=[...R].some(Q=>Q<=z.length),P=[...q].some(Q=>Q<=O.length),H=B||P?E:[];let j=0,Z=0;const ie=E.filter(Q=>Q.kind==="file"?(j+=1,!(B&&R.has(j))):Q.kind==="image"||Q.kind==="video"?(Z+=1,!(P&&q.has(Z))):!0),W={id:g.id,role:"user",no:a++,text:M,attachments:ie.length>0?ie:void 0,inlineAttachments:H.length>0?H:void 0,skillActivation:S?{name:I.skillName,args:I.skillArgs}:void 0,pluginCommand:_?{pluginId:I.pluginId,commandName:I.commandName,args:I.commandArgs}:void 0,createdAt:g.createdAt};l.push(W),u?.(W,[g]);continue}if(g.role==="tool"){d&&(d.sources.push(g),h(d,g.content),d.endedAt=g.createdAt);continue}const v=g.promptId;TCe(d,v)?d!==null&&d.promptId===void 0&&v!==void 0&&(d.promptId=v):(f(),d={id:g.id,promptId:v,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[],durationMs:g.durationMs,createdAt:g.createdAt});const b=d;if(b===null)continue;const w=LCe(g.content);b.promptId!==void 0&&b.seenSigs.has(w)||(b.seenSigs.add(w),b.sources.push(g),g.durationMs!==void 0&&(b.durationMs=g.durationMs),h(b,g.content),g.endedAt!==void 0?b.endedAt=g.endedAt:g.id!==b.id&&(b.endedAt=g.createdAt))}return f(!0),l}function ZW(e,t,n){return e.state==="running"&&e.frames.at(-1)===t&&!n}function NCe(e,t){if(t.size===0)return;let n=!1;for(const l of t.values())if(l.settledAt===void 0){n=!0;break}if(!n)return;const i=new Date().toISOString(),o=e.items.findLast(l=>l.kind==="turn"&&l.state==="running"),s=o?.kind==="turn"?o.steps.findLast(l=>l.state==="running"):void 0,r=e.interactions.some(l=>l.state==="pending");for(const l of e.items)if(l.kind==="turn")for(const a of l.steps){const u=r&&a===s;for(const c of a.frames){if(c.kind!=="thinking")continue;const d=t.get(c.frameId);d===void 0||d.settledAt!==void 0||ZW(a,c,u)||(d.settledAt=i)}}}function DCe(e,t){if(t.size===0)return;const n=new Set;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind==="thinking"&&n.add(s.frameId);for(const i of[...t.keys()])n.has(i)||t.delete(i)}function FCe(e,t,n,i){const o=e.items.filter(d=>d.kind==="turn"),s=o[0]?.turnId,r=o.length===1?s:void 0,l=new Map(e.tasks.map(d=>[d.taskId,d])),a=new Map(e.prompts.map(d=>[d.promptId,d])),u=e.items.flatMap(d=>d.kind==="turn"?nx(d,e.attachments,l,d.turnId===s?n?.createdAt:void 0,d.turnId===r?n?.disposedAt:void 0,i?.sessionId,{promptById:a}):[]),c=e.meta.activity==="turn";return Qk(u,[],t,c,{},{},{getSessionMediaUrl:i?.getSessionMediaUrl}).map(RCe)}function nx(e,t,n,i,o,s="",r){const l=[],a=new Map(t.map(v=>[v.attachmentId,v])),u=KC([e.startedAt,...e.steps.map(v=>v.startedAt),i])??"",c=lD(e.endedAt)??lD(o),d=e.turnId,f=e.origin.payload??e.origin,h=(e.attachmentIds??[]).length>0;if(e.prompt!==void 0&&e.prompt.length>0||h){const v=e.prompt!==void 0&&e.prompt.length>0?[{type:"text",text:e.prompt}]:[];for(const y of e.attachmentIds??[]){const b=aD(a.get(y));b!==void 0&&v.push(b)}l.push({id:`${e.turnId}:input`,sessionId:s,role:"user",content:v,createdAt:u,promptId:d,metadata:r?.includeOrigin===!0||e.origin.kind==="task"&&(e.prompt??"").includes("0;if(y.text.length===0&&!b)continue;if(y.role==="user"){if(y.taskId!==void 0){const T=BCe(y.taskId,y.text,n.get(y.taskId));l.push({id:y.frameId,sessionId:"",role:"user",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d,metadata:{origin:{kind:"task",taskId:y.taskId},[HW]:T}});continue}const w=y.text.length>0?[{type:"text",text:y.text}]:[];for(const T of y.attachmentIds??[]){const N=aD(a.get(T));N!==void 0&&w.push(N)}const C=y.promptIds?.map(T=>r?.promptById?.get(T)).find(T=>T!==void 0);l.push({id:y.frameId,sessionId:s,role:"user",content:w,createdAt:C?.createdAt??v.startedAt??u,promptId:d});continue}l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d})}else if(y.kind==="thinking"){if(y.text.length===0)continue;const b=r?.pendingInteractionAtByStepId?.get(v.stepId),w=ZW(v,y,b!==void 0),C=r?.thinkingTiming,T=C?.get(y.frameId);let N,I;if(T!==void 0)T.settledAt===void 0&&!w&&(T.settledAt=new Date().toISOString()),N=T.startedAt,I=P8(T.startedAt,T.settledAt);else if(C!==void 0&&w){const S=new Date().toISOString();C.set(y.frameId,{startedAt:S}),N=S}else N=v.startedAt,I=P8(v.startedAt,KC([v.endedAt,b]));l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"thinking",thinking:y.text,startedAt:N,durationMs:I}],createdAt:v.startedAt??u,promptId:d})}else y.kind==="tool"&&(l.push({id:`${y.frameId}:call`,sessionId:"",role:"assistant",content:[{type:"toolUse",toolCallId:y.toolCallId,toolName:y.name,input:y.input??y.display??{},outputLines:y.state==="running"?tx(y.output):void 0,agentRefs:y.agentRefs}],createdAt:v.startedAt??u,promptId:d}),y.state!=="running"&&l.push({id:`${y.frameId}:result`,sessionId:"",role:"tool",content:[{type:"toolResult",toolCallId:y.toolCallId,output:y.output??y.error??"",isError:y.state==="error"}],createdAt:v.endedAt??v.startedAt??u,promptId:d}));const m=e.durationMs??P8(u||void 0,c),g=l.findLastIndex(v=>v.role==="assistant");return g>=0&&(m!==void 0||c!==void 0)&&(l[g]={...l[g],durationMs:m,endedAt:c??l[g].endedAt}),l}function BCe(e,t,n){const[i="",...o]=t.split(` -`),s=n?.state??"info";return{id:`task:${e}:${s}`,category:"task",type:`task.${s}`,sourceKind:n?.kind==="subagent"?"subagent":"background_task",sourceId:e,agentId:n?.agentId,title:i.trim(),severity:s==="completed"?"info":"warning",body:o.join(` -`).trim(),raw:t}}function RCe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function KC(e){let t;for(const n of e){if(n===void 0)continue;const i=Date.parse(n);Number.isFinite(i)&&(t===void 0||i=0?n:void 0}const uD=6e3,ZC=256*1024,$Ce=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function cD(e,t){return t===0?e:e-1}function OCe(e,t){const n=Bu(t),i=[];let o=0;for(const s of e){if(s.type==="hunk"){const r=$Ce.exec(s.text);if(!r)return null;const l=cD(Number(r[1]),r[2]===void 0?1:Number(r[2])),a=cD(Number(r[3]),r[4]===void 0?1:Number(r[4]));if(an.length)return null;for(;o=n.length||n[o]!==s.text)return null;o++,s.type==="context"&&i.push(s.text)}for(;oZC||Bu(n).length>uD)return null;const i=OCe(e,n);return i===null||i.length>ZC||Bu(i).length>uD?null:{before:i,after:n}}const zCe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function jCe(e){return zCe.has(e.type)}const HCe=50,WCe=100,GC=32*1024,qCe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,HCe)},cancelTask(e){clearTimeout(e)}};function UCe(e,t,n={}){const i=n.scheduler??qCe,o=Math.max(1,Math.floor(n.maxItemsPerSlice??WCe)),s=[];let r=0,l=null,a=null,u=0,c=!1;const d=()=>s.length-r,f=()=>{u+=1,l!==null&&(i.cancelFrame(l),l=null),a!==null&&(i.cancelTask(a),a=null)},h=()=>{r===s.length?(s.length=0,r=0):r>=1024&&(s.splice(0,r),r=0)};let m;const g=()=>{if(c||l!==null||a!==null||d()===0)return;const y=++u,b=()=>{y===u&&m()};l=i.requestFrame(b),a=i.requestTask(b)};m=()=>{f();let y=0;for(;!c&&y{if(!c){if(t(y)){const b=s.length>r?s.at(-1):void 0,w=b===void 0?void 0:n.coalesce?.(b,y);w===void 0?s.push(y):s[s.length-1]=w,g();return}if(d()===0){e(y);return}s.push(y),m()}});return v.flush=()=>{if(!c){for(f();!c&&r{if(c||d()===0)return;let b=r;for(let w=r;w{c||(c=!0,f(),s.length=0,r=0)},v}function QC(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function VCe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,i=QC(t);if(n===void 0||i===void 0||n.kind!==i.kind||i.value.length<=GC)return[e];const o=[];let s=0;for(;ss&&/[\uD800-\uDBFF]/u.test(i.value[r-1])&&/[\uDC00-\uDFFF]/u.test(i.value[r])&&(r-=1);const l=i.value.slice(s,r);o.push({appEvent:{...t,delta:i.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+s}}}),s=r}return o}function KCe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,i=t.meta.stream,o=QC(e.appEvent),s=QC(t.appEvent);if(n===void 0||i===void 0||o===void 0||s===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==i.turnId||n.kind!==i.kind||o.kind!==s.kind||n.kind!==o.kind||i.kind!==s.kind||i.offset!==n.offset+o.value.length||o.value.length+s.value.length>GC)return;const r=o.value+s.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}function ZCe(e,t){const i=e.items.filter(d=>d.kind==="turn")[0]?.turnId,o=new Map(e.tasks.map(d=>[d.taskId,d])),s=new Map(e.prompts.map(d=>[d.promptId,d])),r=d=>d.kind==="turn"?d.origin.payload??d.origin:void 0,l=new Set,a=e.items.flatMap((d,f)=>{if(d.kind==="turn"){const h=d.startedAt!==void 0||d.steps.some(m=>m.startedAt!==void 0);return GCe(d,e.attachments,o,d.turnId===i&&!h&&e.hasMoreOlder!==!0?t.agentCreatedAt:void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s)}if(d.kind==="marker"&&d.marker==="compaction"){const h=QCe(d.payload,d.at,t.sessionId,d.markerId,JCe(e.items,f));return h===void 0?[]:[h]}if(d.kind==="marker"&&d.marker==="cron.fired"){const h=d.payload,m=h?.origin?.jobId,g=typeof h?.prompt=="string"?h.prompt:void 0,v=e.items.slice(f+1).find(b=>{if(b.kind!=="turn"||l.has(b.turnId))return!1;const w=r(b);return w?.kind==="cron_job"&&(m===void 0||w.jobId===m)&&(g===void 0||b.kind==="turn"&&KW(b.prompt??"")===g)});if(v!==void 0&&v.kind==="turn")return l.add(v.turnId),[];const y=YCe(d.payload,d.at,t.sessionId,d.markerId);return y===void 0?[]:[y]}return[]}),u=e.interactions.map(d=>Ep(d,t.sessionId)).filter(d=>d!==void 0),c=e.meta.activity==="turn";return Qk(a,u,t.getFileUrl,c,t.planReviewByToolCallId??{},t.plansByToolCallId??{},{getSessionMediaUrl:t.getSessionMediaUrl}).map(tAe)}function GCe(e,t,n,i,o,s,r,l,a){const u=e.origin.payload??e.origin,c=u?.kind;return[...e.prompt===void 0&&c==="system_trigger"?[{id:`${e.turnId}:origin`,sessionId:s,role:"user",content:[],createdAt:KC([e.startedAt,...e.steps.map(f=>f.startedAt),i])??"",promptId:e.turnId,metadata:{origin:u}}]:[],...nx(e,t,n,i,o,s,{includeOrigin:!0,pendingInteractionAtByStepId:r,thinkingTiming:l,promptById:a})]}function QCe(e,t,n,i,o){const s=e;if(s?.phase!=="completed")return;const r=s.result??{},l={trigger:o,tokensBefore:typeof r.tokensBefore=="number"?r.tokensBefore:void 0,tokensAfter:typeof r.tokensAfter=="number"?r.tokensAfter:void 0};return{id:i,sessionId:n,role:"assistant",content:typeof r.summary=="string"?[{type:"text",text:r.summary}]:[],createdAt:t??"",metadata:{origin:{kind:"compaction_summary"},[jW]:l}}}function YCe(e,t,n,i){const o=e,s=o?.origin;if(!(s?.kind!=="cron_job"||typeof o?.prompt!="string"))return{id:i,sessionId:n,role:"user",content:[{type:"text",text:o.prompt}],createdAt:t??"",metadata:{origin:s}}}function JCe(e,t){for(let n=t-1;n>=0;n--){const i=e[n];if(i?.kind!=="marker"||i.marker!=="compaction")continue;const o=i.payload;if(o?.phase==="started")return o.trigger==="manual"?"manual":"auto"}return"auto"}function Ep(e,t){if(e.interactionKind!=="approval"||e.state!=="pending")return;const n=e.request??{};if(typeof n.toolName!="string"||typeof n.action!="string")return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:void 0;if(i!==void 0)return{approvalId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:void 0,toolCallId:i,toolName:n.toolName,action:n.action,display:n.display,expiresAt:"",createdAt:""}}function Um(e,t){if(e.interactionKind!=="question"||e.state!=="pending")return;const n=e.request??{};if(!Array.isArray(n.questions))return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:typeof n.tool_call_id=="string"?n.tool_call_id:void 0;return{questionId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:typeof n.turn_id=="number"?n.turn_id:void 0,toolCallId:i,questions:n.questions.map(XCe),createdAt:""}}function XCe(e){const t=Array.isArray(e.options)?e.options:[];return{id:typeof e.id=="string"?e.id:"",question:typeof e.question=="string"?e.question:"",header:typeof e.header=="string"?e.header:void 0,body:typeof e.body=="string"?e.body:void 0,options:t.map(eAe),multiSelect:e.multi_select===!0,allowOther:e.allow_other===!0,otherLabel:typeof e.other_label=="string"?e.other_label:void 0,otherDescription:typeof e.other_description=="string"?e.other_description:void 0}}function eAe(e){const t=e??{};return{id:typeof t.id=="string"?t.id:"",label:typeof t.label=="string"?t.label:"",description:typeof t.description=="string"?t.description:void 0,recommended:t.recommended===!0||t.is_recommended===!0}}function tAe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function nAe(){let e=[];const t=(n,i)=>{const s=ZCe(n,i).map((r,l)=>{const a=JSON.stringify(r),u=e[l],c=u!==void 0&&u.fingerprint===a?u.turn:r;return e[l]={turn:c,fingerprint:a},c});return e.length=s.length,s};return t.reset=()=>{e=[]},t}function iAe(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function oAe(e){const t=[];if(!e)return t;let n=0,i=0,o=!1;for(const s of e.split(` -`)){if(s.startsWith("diff --git")){o=!1;continue}if(!o&&iAe(s))continue;if(s.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(s);a&&(n=Number.parseInt(a[1],10),i=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:s});continue}if(!o||s.startsWith("\\"))continue;const r=s.charAt(0),l=s.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:i}),i+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:i}),n+=1,i+=1)}return t}function dD(e){return e?e.split(` -`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function sAe(e){return e.suspendedReason||dD(e.text)||dD(e.outputLines?.join(` -`))||e.summary||""}function rAe(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` -`):e.summary??""}function lAe(e){return e==="completed"?"completed":e==="failed"?"failed":e==="aborted"?"cancelled":"working"}function fD(e,t){return{id:e.agentId??e.item??`result-${t}`,agentId:e.agentId,name:e.item??`subagent ${t+1}`,activity:e.body.split(` -`)[0]??"",phase:lAe(e.outcome),body:e.body}}function aAe(e,t){return!!(t.agentId&&e.agentId===t.agentId||t.item&&e.name.includes(t.item))}function uAe(e,t){const n=e.map(o=>({id:o.id,agentId:o.agentId,name:o.name,activity:sAe(o),phase:o.phase,body:rAe(o)}));if(!t)return n;const i=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(s=>aAe(s,o))).map((o,s)=>fD(o,s));return n.length>0?[...n,...i]:t.subagents.map((o,s)=>fD(o,s))}const cAe=["queued","working","suspended","completed","failed","cancelled"];function GW(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function dAe(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function fAe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const i=n.parentToolCallId??"swarm",o=t.get(i)??[];o.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:GW(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(i,o)}return[...t.entries()].map(([n,i])=>{const o=i.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),s=dAe();for(const r of o)s[r.phase]++;return{id:n,members:o,counts:s}}).filter(n=>n.members.length>1).toSorted((n,i)=>{const o=n.members.at(0)?.swarmIndex??0,s=i.members.at(0)?.swarmIndex??0;return o!==s?o-s:n.id.localeCompare(i.id)})}function hAe(e){let t=0,n=0;for(const i of e){n+=i.members.length;for(const o of cAe)(o==="completed"||o==="failed"||o==="cancelled")&&(t+=i.counts[o])}return{done:t,total:n}}function pAe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const i=t.get(n.parentToolCallId)??[];i.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:GW(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,i)}for(const[n,i]of t)t.set(n,i.toSorted((o,s)=>o.swarmIndex-s.swarmIndex||o.id.localeCompare(s.id)));return t}function ix(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function QW(e){for(const t of["path","file_path","filePath","filename"]){const n=e[t];if(typeof n=="string"&&n.length>0)return n}}const pg=100*1024;function YW(e){const t=Mr(e.name);if(t!=="edit"&&t!=="multi_edit")return null;const n=ix(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const l=typeof n.old_string=="string"?n.old_string:void 0,a=typeof n.new_string=="string"?n.new_string:void 0;return l===void 0||a===void 0||l.length>pg||a.length>pg?null:y4(l,a)}const i=Array.isArray(n.edits)?n.edits:void 0;if(!i||i.length===0)return null;const o=[];let s=0,r=0;for(const l of i){if(!l||typeof l!="object")return null;const a=l;if(a.replace_all===!0)return null;const u=typeof a.old_string=="string"?a.old_string:void 0,c=typeof a.new_string=="string"?a.new_string:void 0;if(u===void 0||c===void 0||u.length>pg||c.length>pg)return null;const d=y4(u,c);if(d===null)return null;o.length>0&&o.push({type:"hunk",text:"···"});for(const f of d)o.push({...f,oldNo:f.oldNo!==void 0?f.oldNo+s:void 0,newNo:f.newNo!==void 0?f.newNo+r:void 0});s+=Bu(u).length,r+=Bu(c).length}return o}const mAe=5e3;function gAe(e){if(Mr(e.name)!=="write")return null;const t=ix(e.arg);return!t||typeof t.content!="string"||t.content.length>pg||t.content.split(` -`).length>mAe?null:{content:t.content,path:QW(t)}}function hD(e){const t=ix(e.arg);return t?QW(t):void 0}function vAe(e){switch(e){case"running":return"running";case"completed":return"completed";case"killed":return"cancelled";default:return"failed"}}function yAe(e,t){return t==="running"?e.stateReason!==void 0?"suspended":"working":t}function kAe(e){return e==="subagent"?"subagent":e==="shell"?"bash":"tool"}function bAe(e){return JW(e).parents}function JW(e){const t=new Map,n=new Map;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind!=="tool"||s.agentRefs===void 0||s.agentRefs.forEach((r,l)=>{t.set(r.agentId,s.toolCallId),n.set(r.agentId,l)});return{parents:t,swarmIndexes:n}}function wAe(e,t,n){const i=JW(e);let o=i.parents,s=i.swarmIndexes;if(n!==void 0){for(const[u,c]of i.parents)n.parents.set(u,c);for(const[u,c]of i.swarmIndexes)n.swarmIndexes.set(u,c);o=n.parents,s=n.swarmIndexes}const r=e.tasks.map(u=>{const c=vAe(u.state);return{id:u.taskId,agentId:u.agentId,sessionId:t,kind:kAe(u.kind),description:u.description??"",status:c,createdAt:u.startedAt??"",startedAt:u.startedAt,completedAt:u.endedAt,outputPreview:u.outputTail.length>0?u.outputTail:void 0,text:u.resultSummary,subagentPhase:u.kind==="subagent"?yAe(u,c):void 0,suspendedReason:c==="running"?u.stateReason:void 0,model:u.model,thinkingEffort:u.thinkingEffort,runInBackground:u.detached,parentToolCallId:u.agentId!==void 0?o.get(u.agentId):void 0,swarmIndex:u.agentId!==void 0?s.get(u.agentId):void 0}}),l=new Map;r.forEach((u,c)=>{u.agentId!==void 0&&u.id===u.agentId&&l.set(u.agentId,c)});const a=new Set;return r.forEach((u,c)=>{if(u.agentId===void 0||u.id===u.agentId)return;const d=l.get(u.agentId);if(d===void 0)return;const f=r[d],h=u.completedAt!==void 0&&f.startedAt!==void 0&&u.completedAt>=f.startedAt,m=f.status==="running"&&u.status!=="running"&&h;r[d]={...f,backgroundTaskId:u.status==="running"||h?u.id:void 0,status:m?u.status:f.status,subagentPhase:m?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":f.subagentPhase,description:f.description.length>0?f.description:u.description,model:f.model??u.model,thinkingEffort:f.thinkingEffort??u.thinkingEffort,completedAt:h?u.completedAt??f.completedAt:f.completedAt,outputPreview:h?f.outputPreview??u.outputPreview:f.outputPreview,text:h?f.text??u.text:f.text},a.add(c)}),r.filter((u,c)=>!a.has(c))}function CAe(){let e=[],t=null,n=null,i=null,o,s,r=!0;const l=new WeakMap,a=u=>{const{messages:c,approvals:d}=u,f=u.sessionActive??!0,h=u.planReviewByToolCallId??{},m=u.plansByToolCallId??{},g=(S,_)=>l.set(S,_);let v=n!==null;if(v){const S=n,_=Object.keys(h);v=_.length===Object.keys(S).length&&_.every(x=>h[x]===S[x])}let y=i!==null;if(y){const S=i,_=Object.keys(m);y=_.length===Object.keys(S).length&&_.every(x=>m[x]===S[x])}const b=e.length>0&&d===t&&v&&y&&u.getFileUrl===o&&u.getSessionMediaUrl===s;let w=0,C=0,T=1;if(b){let S=-1;for(let _=e.length-1;_>=0;_--)if(e[_].role==="assistant"){S=_;break}for(let _=0;_0?[...e.slice(0,w),...N]:N;return e=I,t=d,n={...h},i={...m},o=u.getFileUrl,s=u.getSessionMediaUrl,r=f,I};return a.reset=()=>{e=[],t=null,n=null,i=null,o=void 0,r=!0},a}function AAe(e){const t=new Map;let n=0;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.role==="compaction"||o.goalContinuation===!0)break;o.role==="user"&&(n++,t.set(o.id,n))}return t}const XW=["light","dark","system"],xAe=["small","medium","large","xlarge"],z8="medium",eq="kimi-web.color-scheme",YC="kimi-web.font-scale",pD="kimi-web.ui-font-size";function JC(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ox(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function SAe(e){try{globalThis.localStorage.removeItem(e)}catch{}}function _Ae(){const e=JC(eq);return e&&XW.includes(e)?e:"system"}const ny={light:"#ffffff",dark:"#121212"};function MAe(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?ny.dark:e==="light"?ny.light:null;t.forEach(i=>{const s=(i.getAttribute("media")??"").includes("dark")?ny.dark:ny.light;i.setAttribute("content",n??s)})}function tq(e){return xAe.includes(e)}function IAe(e){return e<=13?"small":e<=15?"medium":e<=17?"large":"xlarge"}function TAe(){const e=JC(YC);if(e==="xxlarge")return"xlarge";if(e!==null)return tq(e)?e:z8;const t=JC(pD);if(t===null)return z8;const n=Number(t),i=Number.isFinite(n)?IAe(n):z8;return ox(YC,i),SAe(pD),i}function EAe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=e)}const sx=V(_Ae()),rx=V(TAe());let mD=!1;function LAe(){mD||(mD=!0,We(sx,MAe,{immediate:!0}),We(rx,EAe,{immediate:!0}))}function NAe(e){XW.includes(e)&&(sx.value=e,ox(eq,e))}function DAe(e){tq(e)&&(rx.value=e,ox(YC,e))}function X1(){return LAe(),{colorScheme:sx,fontScale:rx,setColorScheme:NAe,setFontScale:DAe}}const iy=V(!1);let gD=!1;function j8(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Yk(){return!gD&&typeof window<"u"&&typeof document<"u"&&(gD=!0,iy.value=j8(),new MutationObserver(()=>{iy.value=j8()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{iy.value=j8()})),iy}const nq="kimi-web.sidebar-multi-tab";function FAe(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function BAe(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function RAe(){return FAe(nq)==="1"}const iq=V(RAe());function $Ae(e){iq.value=e,BAe(nq,e?"1":"0")}function em(){return{sidebarTabs:iq,setSidebarTabs:$Ae}}const vD=document.createElement("i");function OAe(e){const t="&"+e+";";vD.innerHTML=t;const n=vD.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ru(e,t,n,i){const o=e.length;let s=0,r;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),e.splice(...r);else for(n&&e.splice(t,n);s0?(Ru(e,e.length,0,t),e):t}const yD={}.hasOwnProperty;function PAe(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function ho(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return r;function r(a){return Bi(a)?(e.enter(n),l(a)):t(a)}function l(a){return Bi(a)&&s++r))return;const I=t.events.length;let S=I,_,x;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(_){x=t.events[S][1].end;break}_=!0}for(y(i),N=I;Nw;){const T=n[C];t.containerState=T[1],T[0].exit.call(t,e)}n.length=w}function b(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function YAe(e,t,n){return ho(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bD(e){if(e===null||ml(e)||VAe(e))return 1;if(UAe(e))return 2}function ax(e,t,n){const i=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},f={...e[n][1].start};wD(d,-a),wD(f,a),r={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:a>1?"strong":"emphasis",start:{...r.start},end:{...l.end}},e[i][1].end={...r.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=la(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=la(u,[["enter",o,t],["enter",r,t],["exit",r,t],["enter",s,t]]),u=la(u,ax(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=la(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=la(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Ru(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&Bi(N)?ho(e,b,"linePrefix",s+1)(N):b(N)}function b(N){return N===null||Pn(N)?e.check(CD,g,C)(N):(e.enter("codeFlowValue"),w(N))}function w(N){return N===null||Pn(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),w)}function C(N){return e.exit("codeFenced"),t(N)}function T(N,I,S){let _=0;return x;function x(z){return N.enter("lineEnding"),N.consume(z),N.exit("lineEnding"),E}function E(z){return N.enter("codeFencedFence"),Bi(z)?ho(N,M,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):M(z)}function M(z){return z===l?(N.enter("codeFencedFenceSequence"),R(z)):S(z)}function R(z){return z===l?(_++,N.consume(z),R):_>=r?(N.exit("codeFencedFenceSequence"),Bi(z)?ho(N,q,"whitespace")(z):q(z)):S(z)}function q(z){return z===null||Pn(z)?(N.exit("codeFencedFence"),I(z)):S(z)}}}function u6e(e,t,n){const i=this;return o;function o(r){return r===null?n(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}const H8={name:"codeIndented",tokenize:d6e},c6e={partial:!0,tokenize:f6e};function d6e(e,t,n){const i=this;return o;function o(u){return e.enter("codeIndented"),ho(e,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?r(u):n(u)}function r(u){return u===null?a(u):Pn(u)?e.attempt(c6e,r,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Pn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function f6e(e,t,n){const i=this;return o;function o(r){return i.parser.lazy[i.now().line]?n(r):Pn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):ho(e,s,"linePrefix",5)(r)}function s(r){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(r):Pn(r)?o(r):n(r)}}const h6e={name:"codeText",previous:m6e,resolve:p6e,tokenize:g6e};function p6e(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=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 tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Vm(this.left,i),s.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),Vm(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vm(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=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}function aq(e,t,n,i,o,s,r,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(y){return y===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(y),e.exit(s),f):y===null||y===32||y===41||XC(y)?n(y):(e.enter(i),e.enter(r),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function f(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(l),f(y)):y===null||y===60||Pn(y)?n(y):(e.consume(y),y===92?m:h)}function m(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function g(y){return!c&&(y===null||y===41||ml(y))?(e.exit("chunkString"),e.exit(l),e.exit(r),e.exit(i),t(y)):c999||h===null||h===91||h===93&&!a||h===94&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(h):h===93?(e.exit(s),e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):Pn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Pn(h)||l++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!Bi(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}}function cq(e,t,n,i,o,s){let r;return l;function l(f){return f===34||f===39||f===40?(e.enter(i),e.enter(o),e.consume(f),e.exit(o),r=f===40?41:f,a):n(f)}function a(f){return f===r?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),t):(e.enter(s),u(f))}function u(f){return f===r?(e.exit(s),a(r)):f===null?n(f):Pn(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ho(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===r||f===null||Pn(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===r||f===92?(e.consume(f),c):c(f)}}function t0(e,t){let n;return i;function i(o){return Pn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Bi(o)?ho(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const x6e={name:"definition",tokenize:_6e},S6e={partial:!0,tokenize:M6e};function _6e(e,t,n){const i=this;let o;return s;function s(h){return e.enter("definition"),r(h)}function r(h){return uq.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return o=lx(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return ml(h)?t0(e,u)(h):u(h)}function u(h){return aq(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(S6e,d,d)(h)}function d(h){return Bi(h)?ho(e,f,"whitespace")(h):f(h)}function f(h){return h===null||Pn(h)?(e.exit("definition"),i.parser.defined.push(o),t(h)):n(h)}}function M6e(e,t,n){return i;function i(l){return ml(l)?t0(e,o)(l):n(l)}function o(l){return cq(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Bi(l)?ho(e,r,"whitespace")(l):r(l)}function r(l){return l===null||Pn(l)?t(l):n(l)}}const I6e={name:"hardBreakEscape",tokenize:T6e};function T6e(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Pn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const E6e={name:"headingAtx",resolve:L6e,tokenize:N6e};function L6e(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Ru(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function N6e(e,t,n){let i=0;return o;function o(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),r(c)}function r(c){return c===35&&i++<6?(e.consume(c),r):c===null||ml(c)?(e.exit("atxHeadingSequence"),l(c)):n(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||Pn(c)?(e.exit("atxHeading"),t(c)):Bi(c)?ho(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||ml(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}const D6e=["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"],xD=["pre","script","style","textarea"],F6e={concrete:!0,name:"htmlFlow",resolveTo:$6e,tokenize:O6e},B6e={partial:!0,tokenize:z6e},R6e={partial:!0,tokenize:P6e};function $6e(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 O6e(e,t,n){const i=this;let o,s,r,l,a;return u;function u(W){return c(W)}function c(W){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(W),d}function d(W){return W===33?(e.consume(W),f):W===47?(e.consume(W),s=!0,g):W===63?(e.consume(W),o=3,i.interrupt?t:j):bu(W)?(e.consume(W),r=String.fromCharCode(W),v):n(W)}function f(W){return W===45?(e.consume(W),o=2,h):W===91?(e.consume(W),o=5,l=0,m):bu(W)?(e.consume(W),o=4,i.interrupt?t:j):n(W)}function h(W){return W===45?(e.consume(W),i.interrupt?t:j):n(W)}function m(W){const Q="CDATA[";return W===Q.charCodeAt(l++)?(e.consume(W),l===Q.length?i.interrupt?t:M:m):n(W)}function g(W){return bu(W)?(e.consume(W),r=String.fromCharCode(W),v):n(W)}function v(W){if(W===null||W===47||W===62||ml(W)){const Q=W===47,te=r.toLowerCase();return!Q&&!s&&xD.includes(te)?(o=1,i.interrupt?t(W):M(W)):D6e.includes(r.toLowerCase())?(o=6,Q?(e.consume(W),y):i.interrupt?t(W):M(W)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(W):s?b(W):w(W))}return W===45||Oa(W)?(e.consume(W),r+=String.fromCharCode(W),v):n(W)}function y(W){return W===62?(e.consume(W),i.interrupt?t:M):n(W)}function b(W){return Bi(W)?(e.consume(W),b):x(W)}function w(W){return W===47?(e.consume(W),x):W===58||W===95||bu(W)?(e.consume(W),C):Bi(W)?(e.consume(W),w):x(W)}function C(W){return W===45||W===46||W===58||W===95||Oa(W)?(e.consume(W),C):T(W)}function T(W){return W===61?(e.consume(W),N):Bi(W)?(e.consume(W),T):w(W)}function N(W){return W===null||W===60||W===61||W===62||W===96?n(W):W===34||W===39?(e.consume(W),a=W,I):Bi(W)?(e.consume(W),N):S(W)}function I(W){return W===a?(e.consume(W),a=null,_):W===null||Pn(W)?n(W):(e.consume(W),I)}function S(W){return W===null||W===34||W===39||W===47||W===60||W===61||W===62||W===96||ml(W)?T(W):(e.consume(W),S)}function _(W){return W===47||W===62||Bi(W)?w(W):n(W)}function x(W){return W===62?(e.consume(W),E):n(W)}function E(W){return W===null||Pn(W)?M(W):Bi(W)?(e.consume(W),E):n(W)}function M(W){return W===45&&o===2?(e.consume(W),O):W===60&&o===1?(e.consume(W),B):W===62&&o===4?(e.consume(W),Z):W===63&&o===3?(e.consume(W),j):W===93&&o===5?(e.consume(W),H):Pn(W)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(B6e,ie,R)(W)):W===null||Pn(W)?(e.exit("htmlFlowData"),R(W)):(e.consume(W),M)}function R(W){return e.check(R6e,q,ie)(W)}function q(W){return e.enter("lineEnding"),e.consume(W),e.exit("lineEnding"),z}function z(W){return W===null||Pn(W)?R(W):(e.enter("htmlFlowData"),M(W))}function O(W){return W===45?(e.consume(W),j):M(W)}function B(W){return W===47?(e.consume(W),r="",P):M(W)}function P(W){if(W===62){const Q=r.toLowerCase();return xD.includes(Q)?(e.consume(W),Z):M(W)}return bu(W)&&r.length<8?(e.consume(W),r+=String.fromCharCode(W),P):M(W)}function H(W){return W===93?(e.consume(W),j):M(W)}function j(W){return W===62?(e.consume(W),Z):W===45&&o===2?(e.consume(W),j):M(W)}function Z(W){return W===null||Pn(W)?(e.exit("htmlFlowData"),ie(W)):(e.consume(W),Z)}function ie(W){return e.exit("htmlFlow"),t(W)}}function P6e(e,t,n){const i=this;return o;function o(r){return Pn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s):n(r)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}function z6e(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Jk,t,n)}}const j6e={name:"htmlText",tokenize:H6e};function H6e(e,t,n){const i=this;let o,s,r;return l;function l(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),a}function a(j){return j===33?(e.consume(j),u):j===47?(e.consume(j),T):j===63?(e.consume(j),w):bu(j)?(e.consume(j),S):n(j)}function u(j){return j===45?(e.consume(j),c):j===91?(e.consume(j),s=0,m):bu(j)?(e.consume(j),b):n(j)}function c(j){return j===45?(e.consume(j),h):n(j)}function d(j){return j===null?n(j):j===45?(e.consume(j),f):Pn(j)?(r=d,B(j)):(e.consume(j),d)}function f(j){return j===45?(e.consume(j),h):d(j)}function h(j){return j===62?O(j):j===45?f(j):d(j)}function m(j){const Z="CDATA[";return j===Z.charCodeAt(s++)?(e.consume(j),s===Z.length?g:m):n(j)}function g(j){return j===null?n(j):j===93?(e.consume(j),v):Pn(j)?(r=g,B(j)):(e.consume(j),g)}function v(j){return j===93?(e.consume(j),y):g(j)}function y(j){return j===62?O(j):j===93?(e.consume(j),y):g(j)}function b(j){return j===null||j===62?O(j):Pn(j)?(r=b,B(j)):(e.consume(j),b)}function w(j){return j===null?n(j):j===63?(e.consume(j),C):Pn(j)?(r=w,B(j)):(e.consume(j),w)}function C(j){return j===62?O(j):w(j)}function T(j){return bu(j)?(e.consume(j),N):n(j)}function N(j){return j===45||Oa(j)?(e.consume(j),N):I(j)}function I(j){return Pn(j)?(r=I,B(j)):Bi(j)?(e.consume(j),I):O(j)}function S(j){return j===45||Oa(j)?(e.consume(j),S):j===47||j===62||ml(j)?_(j):n(j)}function _(j){return j===47?(e.consume(j),O):j===58||j===95||bu(j)?(e.consume(j),x):Pn(j)?(r=_,B(j)):Bi(j)?(e.consume(j),_):O(j)}function x(j){return j===45||j===46||j===58||j===95||Oa(j)?(e.consume(j),x):E(j)}function E(j){return j===61?(e.consume(j),M):Pn(j)?(r=E,B(j)):Bi(j)?(e.consume(j),E):_(j)}function M(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),o=j,R):Pn(j)?(r=M,B(j)):Bi(j)?(e.consume(j),M):(e.consume(j),q)}function R(j){return j===o?(e.consume(j),o=void 0,z):j===null?n(j):Pn(j)?(r=R,B(j)):(e.consume(j),R)}function q(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||ml(j)?_(j):(e.consume(j),q)}function z(j){return j===47||j===62||ml(j)?_(j):n(j)}function O(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function B(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),P}function P(j){return Bi(j)?ho(e,H,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):H(j)}function H(j){return e.enter("htmlTextData"),r(j)}}const ux={name:"labelEnd",resolveAll:V6e,resolveTo:K6e,tokenize:Z6e},W6e={tokenize:G6e},q6e={tokenize:Q6e},U6e={tokenize:Y6e};function V6e(e){let t=-1;const n=[];for(;++t=3&&(u===null||Pn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),i++,a):(e.exit("thematicBreakSequence"),Bi(u)?ho(e,l,"whitespace")(u):l(u))}}const tl={continuation:{tokenize:l7e},exit:u7e,name:"list",tokenize:r7e},o7e={partial:!0,tokenize:c7e},s7e={partial:!0,tokenize:a7e};function r7e(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,r=0;return l;function l(h){const m=i.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||h===i.containerState.marker:eA(h)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Gy,n,u)(h):u(h);if(!i.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return eA(h)&&++r<10?(e.consume(h),a):(!i.interrupt||r<2)&&(i.containerState.marker?h===i.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||h,e.check(Jk,i.interrupt?n:c,e.attempt(o7e,f,d))}function c(h){return i.containerState.initialBlankLine=!0,s++,f(h)}function d(h){return Bi(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function l7e(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Jk,o,s);function o(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,ho(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Bi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(s7e,t,r)(l))}function r(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,ho(e,e.attempt(tl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function a7e(e,t,n){const i=this;return ho(e,o,"listItemIndent",i.containerState.size+1);function o(s){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(s):n(s)}}function u7e(e){e.exit(this.containerState.type)}function c7e(e,t,n){const i=this;return ho(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const r=i.events[i.events.length-1];return!Bi(s)&&r&&r[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const SD={name:"setextUnderline",resolveTo:d7e,tokenize:f7e};function d7e(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const r={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",r,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=r,e.push(["exit",r,t]),e}function f7e(e,t,n){const i=this;let o;return s;function s(u){let c=i.events.length,d;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){d=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),o=u,r(u)):n(u)}function r(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===o?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Bi(u)?ho(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Pn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const h7e={tokenize:p7e};function p7e(e){const t=this,n=e.attempt(Jk,i,e.attempt(this.parser.constructs.flowInitial,o,ho(e,e.attempt(this.parser.constructs.flow,o,e.attempt(k6e,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const m7e={resolveAll:fq()},g7e=dq("string"),v7e=dq("text");function dq(e){return{resolveAll:fq(e==="text"?y7e:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,r,l);return r;function r(c){return u(c)?s(c):l(c)}function l(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=o[c];let f=-1;if(d)for(;++f-1){const l=r[0];typeof l=="string"?r[0]=l.slice(i):r.shift()}s>0&&r.push(e[o].slice(0,s))}return r}function L7e(e,t){let n=-1;const i=[];let o;for(;++n>1}};Js.from=function(e){if(e instanceof Js)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Js(t)};function hq(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),s=t.child(i);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let r=o.text,l=s.text,a=0;for(;r[a]==l[a];a++)n++;return a&&a0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,i--;return d&&f&&d=56320&&e<57344}function gq(e){return e>=55296&&e<56320}class Xt{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;it&&i(a,o+l,s||null,r)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,t-c),Math.min(a.content.size,n-c),i,o+c)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,o){let s="",r=!0;return this.nodesBetween(t,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(t,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(r?r=!1:s+=i),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(o[o.length-1]=n.withText(n.text+i.text),s=1);st)for(let s=0,r=0;rt&&((rn)&&(l.isText?l=l.cut(Math.max(0,t-r),Math.min(l.text.length,n-r)):l=l.cut(Math.max(0,t-r-1),Math.min(l.content.size,n-r-1))),i.push(l),o+=l.nodeSize),r=a}return new Xt(i,o)}cutByIndex(t,n){return t==n?Xt.empty:t==0&&n==this.content.length?this:new Xt(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return o[t]=n,new Xt(o,s)}addToStart(t){return new Xt([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Xt(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=t)return s==t?oy(n+1,s):oy(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return Xt.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return Xt.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Xt.empty;let n,i=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;ni.type.rank-o.type.rank),n}}Pi.none=[];class P0 extends Error{}class hn{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=yq(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new hn(i,this.openStart,this.openEnd)}removeBetween(t,n){return new hn(vq(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return hn.empty;let i=n.openStart||0,o=n.openEnd||0;if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new hn(Xt.fromJSON(t,n.content),i,o)}static maxOpen(t,n=!0){let i=0,o=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new hn(t,i,o)}}hn.empty=new hn(Xt.empty,0,0);function vq(e,t,n){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i),{index:r,offset:l}=e.findIndex(n);if(o==t||s.isText){if(l!=n&&!e.child(r).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(vq(s.content,t-o-1,n-o-1)))}function yq(e,t,n,i,o,s){let{index:r,offset:l}=e.findIndex(t),a=e.maybeChild(r);if(l==t||a.isText)return s&&i<=0&&o<=0&&!s.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=yq(a.content,t-l-1,n,r==0?i-1:0,r==e.childCount-1?o-1:0,a);return u&&e.replaceChild(r,a.copy(u))}function B7e(e,t,n){if(n.openStart>e.depth)throw new P0("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new P0("Inconsistent open depths");return kq(e,t,n,0)}function kq(e,t,n,i){let o=e.index(i),s=e.node(i);if(o==t.index(i)&&i=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function n0(e,t,n,i){let o=(t||e).node(n),s=0,r=t?t.index(n):o.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(vh(e.nodeAfter,i),s++));for(let l=s;lo&&nA(e,t,o+1),r=i.depth>o&&nA(n,i,o+1),l=[];return n0(null,e,o,l),s&&r&&t.index(o)==n.index(o)?(bq(s,r),vh(yh(s,wq(e,t,n,i,o+1)),l)):(s&&vh(yh(s,b4(e,t,o+1)),l),n0(t,n,o,l),r&&vh(yh(r,b4(n,i,o+1)),l)),n0(i,null,o,l),new Xt(l)}function b4(e,t,n){let i=[];if(n0(null,e,n,i),e.depth>n){let o=nA(e,t,n+1);vh(yh(o,b4(e,t,n+1)),i)}return n0(t,null,n,i),new Xt(i)}function R7e(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)o=t.node(s).copy(Xt.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class z0{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],o=t.child(n);return i?t.child(n).cut(i):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new P7e(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],o=0,s=n;for(let r=t;;){let{index:l,offset:a}=r.content.findIndex(s),u=s-a;if(i.push(r,l,o+a),!u||(r=r.child(l),r.isText))break;s=u-1,o+=a+1}return new z0(n,i,s)}static resolveCached(t,n){let i=MD.get(t);if(i)for(let s=0;st&&this.nodesBetween(t,n,s=>(i.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Cq(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=Xt.empty,o=0,s=i.childCount){let r=this.contentMatchAt(t).matchFragment(i,o,s),l=r&&r.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let o=Xt.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};kh.prototype.text=void 0;class w4 extends kh{constructor(t,n,i,o){if(super(t,n,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Cq(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new w4(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new w4(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Cq(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Fh{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new j7e(t,n);if(i.next==null)return Fh.empty;let o=Aq(i);i.next&&i.err("Unexpected trailing text");let s=Z7e(K7e(o));return G7e(s,i),s}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let o=0;o{let s=o+(i.validEnd?"*":" ")+" ";for(let r=0;r"+t.indexOf(i.next[r].next);return s}).join(` -`)}}Fh.empty=new Fh(!0);class j7e{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Aq(e){let t=[];do t.push(H7e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function H7e(e){let t=[];do t.push(W7e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function W7e(e){let t=V7e(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=q7e(e,t);else break;return t}function ID(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function q7e(e,t){let n=ID(e),i=n;return e.eat(",")&&(e.next!="}"?i=ID(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function U7e(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let s in n){let r=n[s];r.isInGroup(t)&&o.push(r)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function V7e(e){if(e.eat("(")){let t=Aq(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=U7e(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function K7e(e){let t=[[]];return o(s(e,0),n()),t;function n(){return t.push([])-1}function i(r,l,a){let u={term:a,to:l};return t[r].push(u),u}function o(r,l){r.forEach(a=>a.to=l)}function s(r,l){if(r.type=="choice")return r.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(r.type=="seq")for(let a=0;;a++){let u=s(r.exprs[a],l);if(a==r.exprs.length-1)return u;o(u,l=n())}else if(r.type=="star"){let a=n();return i(l,a),o(s(r.expr,a),a),[i(a)]}else if(r.type=="plus"){let a=n();return o(s(r.expr,l),a),o(s(r.expr,a),a),[i(a)]}else{if(r.type=="opt")return[i(l)].concat(s(r.expr,l));if(r.type=="range"){let a=l;for(let u=0;u{e[r].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||o.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=t[i.join(",")]=new Fh(i.indexOf(e.length-1)>-1);for(let r=0;r-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:_q(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new kh(this,this.computeAttrs(t),Xt.from(n),Pi.setFrom(i))}createChecked(t=null,n,i){return n=Xt.from(n),this.checkContent(n),new kh(this,this.computeAttrs(t),n,Pi.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=Xt.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(Xt.empty,!0);return s?new kh(this,t,n.append(s),Pi.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;ni[s]=new Tq(s,n,r));let o=n.spec.topNode||"doc";if(!i[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function Q7e(e,t,n){let i=n.split("|");return o=>{let s=o===null?"null":typeof o;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${s}`)}}class Y7e{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?Q7e(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class Xk{constructor(t,n,i,o){this.name=t,this.rank=n,this.schema=i,this.spec=o,this.attrs=Iq(t,o.attrs),this.excluded=null;let s=Sq(this.attrs);this.instance=s?new Pi(this,s):null}create(t=null){return!t&&this.instance?this.instance:new Pi(this,_q(this.attrs,t))}static compile(t,n){let i=Object.create(null),o=0;return t.forEach((s,r)=>i[s]=new Xk(s,o++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class J7e{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=Js.from(t.nodes),n.marks=Js.from(t.marks||{}),this.nodes=ED.compile(this.spec.nodes,this),this.marks=Xk.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],r=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[r]||(i[r]=Fh.parse(r,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?LD(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],r=s.spec.excludes;s.excluded=r==null?[s]:r==""?[]:LD(this,r.split(" "))}this.nodeFromJSON=o=>kh.fromJSON(this,o),this.markFromJSON=o=>Pi.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof ED){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,o)}text(t,n){let i=this.nodes.text;return new w4(i,i.defaultAttrs,t,Pi.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function LD(e,t){let n=[];for(let i=0;i-1)&&n.push(r=a)}if(!r)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function X7e(e){return e.tag!=null}function exe(e){return e.style!=null}let Eq=class oA{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(o=>{if(X7e(o))this.tags.push(o);else if(exe(o)){let s=/[^=]*/.exec(o.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=t.nodes[o.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let i=new DD(this,n,!1);return i.addAll(t,Pi.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new DD(this,n,!0);return i.addAll(t,Pi.none,n.from,n.to),hn.maxOpen(i.finish())}matchTag(t,n,i){for(let o=i?this.tags.indexOf(i)+1:0;ot.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(r.getAttrs){let a=r.getAttrs(n);if(a===!1)continue;r.attrs=a||void 0}return r}}}static schemaRules(t){let n=[];function i(o){let s=o.priority==null?50:o.priority,r=0;for(;r{i(r=FD(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})}for(let o in t.nodes){let s=t.nodes[o].spec.parseDOM;s&&s.forEach(r=>{i(r=FD(r)),r.node||r.ignore||r.mark||(r.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new oA(t,oA.schemaRules(t)))}};const Lq={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},txe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Nq={ol:!0,ul:!0},j0=1,sA=2,i0=4;function ND(e,t,n){return t!=null?(t?j0:0)|(t==="full"?sA:0):e&&e.whitespace=="pre"?j0|sA:n&~i0}class sy{constructor(t,n,i,o,s,r){this.type=t,this.attrs=n,this.marks=i,this.solid=o,this.options=r,this.content=[],this.activeMarks=Pi.none,this.match=s||(r&i0?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Xt.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,o;return(o=i.findWrapping(t.type))?(this.match=i,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&j0)){let i=this.content[this.content.length-1],o;if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=Xt.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(Xt.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Lq.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class DD{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,r=ND(null,n.preserveWhitespace,0)|(i?i0:0);o?s=new sy(o.type,o.attrs,Pi.none,!0,n.topMatch||o.type.contentMatch,r):i?s=new sy(null,null,Pi.none,!0,null,r):s=new sy(t.schema.topNodeType,null,Pi.none,!0,null,r),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,o=this.top,s=o.options&sA?"full":this.localPreserveWS||(o.options&j0)>0,{schema:r}=this.parser;if(s==="full"||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,` -`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(u)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(t,n,i,o){let s,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let a=this.enter(r,n.attrs||null,i,n.preserveWhitespace);a&&(s=!0,i=a)}else{let a=this.parser.schema.marks[n.mark];i=i.concat(a.create(n.attrs))}let l=this.top;if(r&&r.isLeaf)this.findInside(t);else if(o)this.addElement(t,i,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,i,!1));else{let a=t;typeof n.contentElement=="string"?a=t.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(t):n.contentElement&&(a=n.contentElement),this.findAround(t,a,!0),this.addAll(a,i),this.findAround(t,a,!1)}s&&this.sync(l)&&this.open--}addAll(t,n,i,o){let s=i||0;for(let r=i?t.childNodes[i]:t.firstChild,l=o==null?null:t.childNodes[o];r!=l;r=r.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(r,n);this.findAtPoint(t,s)}findPlace(t,n,i){let o,s;for(let r=this.open,l=0;r>=0;r--){let a=this.nodes[r],u=a.findWrapping(t);if(u&&(!o||o.length>u.length+l)&&(o=u,s=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!o)return null;this.sync(s);for(let r=0;r(r.type?r.type.allowsMarkType(u.type):BD(u.type,t))?(a=u.addToSet(a),!1):!0),this.nodes.push(new sy(t,n,a,o,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=j0)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let o=i.length-1;o>=0;o--)t+=i[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,o=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(o?0:1),r=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(r(l-1,a))return!0;return!1}else{let c=a>0||a==0&&o?this.nodes[a].type:i&&a>=s?i.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function nxe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&Nq.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function ixe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function FD(e){let t={};for(let n in e)t[n]=e[n];return t}function BD(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let s=[],r=l=>{s.push(l);for(let a=0;a{if(s.length||r.marks.length){let l=0,a=0;for(;l=0;o--){let s=this.serializeMark(t.marks[o],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(t,n,i={}){let o=this.marks[t.type.name];return o&&Qy(ry(i),o(t,n),null,t.attrs)}static renderSpec(t,n,i=null,o){return typeof n=="string"?{dom:t.createTextNode(n)}:Qy(t,n,i,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Eu(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=RD(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return RD(t.marks)}}function RD(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function ry(e){return e.document||window.document}const $D=new WeakMap;function oxe(e){let t=$D.get(e);return t===void 0&&$D.set(e,t=sxe(e)),t}function sxe(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let l,a=n?e.createElementNS(n,o):e.createElement(o),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:m}=Qy(e,f,n,i);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const Dq=65535,Fq=Math.pow(2,16);function rxe(e,t){return e+t*Fq}function OD(e){return e&Dq}function lxe(e){return(e-(e&Dq))/Fq}const Bq=1,Rq=2,Yy=4,$q=8;class rA{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&$q)>0}get deletedBefore(){return(this.delInfo&(Bq|Yy))>0}get deletedAfter(){return(this.delInfo&(Rq|Yy))>0}get deletedAcross(){return(this.delInfo&Yy)>0}}class Nl{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Nl.empty)return Nl.empty}recover(t){let n=0,i=OD(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[l+s],c=this.ranges[l+r],d=a+u;if(t<=d){let f=u?t==a?-1:t==d?1:n:n,h=a+o+(f<0?0:c);if(i)return h;let m=t==(n<0?a:d)?null:rxe(l/3,t-a),g=t==a?Rq:t==d?Bq:Yy;return(n<0?t!=a:t!=d)&&(g|=$q),new rA(h,g,m)}o+=c-u}return i?t+o:new rA(t+o,0,null)}touches(t,n){let i=0,o=OD(n),s=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;lt)break;let u=this.ranges[l+s],c=a+u;if(t<=c&&l==o*3)return!0;i+=this.ranges[l+r]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let o=0,s=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t._maps[n].invert(),o!=null&&o>n?i-o-1:void 0)}}invert(){let t=new H0;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;is&&a!r.isAtom||!l.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),o),n.openStart,n.openEnd);return us.fromReplace(t,this.from,this.to,s)}invert(){return new xu(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new gd(n.pos,i.pos,this.mark)}merge(t){return t instanceof gd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new gd(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new gd(n.from,n.to,t.markFromJSON(n.mark))}}Ir.jsonID("addMark",gd);class xu extends Ir{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new hn(cx(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return us.fromReplace(t,this.from,this.to,i)}invert(){return new gd(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new xu(n.pos,i.pos,this.mark)}merge(t){return t instanceof xu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new xu(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new xu(n.from,n.to,t.markFromJSON(n.mark))}}Ir.jsonID("removeMark",xu);class vd extends Ir{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return us.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return us.fromReplace(t,this.pos,this.pos+1,new hn(Xt.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let o=0;oi.pos?null:new Pl(n.pos,i.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Pl(n.from,n.to,n.gapFrom,n.gapTo,hn.fromJSON(t,n.slice),n.insert,!!n.structure)}}Ir.jsonID("replaceAround",Pl);function lA(e,t,n){let i=e.resolve(t),o=n-t,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let r=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,o--}}return!1}function axe(e,t,n,i){let o=[],s=[],r,l;e.doc.nodesBetween(t,n,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let f=Math.max(u,t),h=Math.min(u+a.nodeSize,n),m=i.addToSet(d);for(let g=0;ge.step(a)),s.forEach(a=>e.step(a))}function uxe(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,(r,l)=>{if(!r.isInline)return;s++;let a=null;if(i instanceof Xk){let u=r.marks,c;for(;c=i.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(r.marks)&&(a=[i]):a=r.marks;if(a&&a.length){let u=Math.min(l+r.nodeSize,n);for(let c=0;ce.step(new xu(r.from,r.to,r.style)))}function dx(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),r=[],l=t+1;for(let a=0;a=0;a--)e.step(r[a])}function cxe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function fx(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,o=0,s=0;;--i){let r=e.$from.node(i),l=e.$from.index(i)+o,a=e.$to.indexAfter(i)-s;if(in;m--)g||i.index(m)>0?(g=!0,c=Xt.from(i.node(m).copy(c)),d++):a--;let f=Xt.empty,h=0;for(let m=s,g=!1;m>n;m--)g||o.after(m+1)=0;r--){if(i.size){let l=n[r].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=Xt.from(n[r].type.create(n[r].attrs,i))}let o=t.start,s=t.end;e.step(new Pl(o,s,o,s,new hn(i,0,0),n.length,!0))}function hxe(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(r,l)=>{let a=typeof o=="function"?o(r):o;if(r.isTextblock&&!r.hasMarkup(i,a)&&pxe(e.doc,e.mapping.slice(s).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",m=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&Pq(e,r,l,s),dx(e,e.mapping.slice(s).map(l,1),i,void 0,u===null);let c=e.mapping.slice(s),d=c.map(l,1),f=c.map(l+r.nodeSize,1);return e.step(new Pl(d,f,d+1,f-1,new hn(Xt.from(i.create(a,null,r.marks)),0,0),1,!0)),u===!0&&Oq(e,r,l,s),!1}})}function Oq(e,t,n,i){t.forEach((o,s)=>{if(o.isText){let r,l=/\r?\n|\r/g;for(;r=l.exec(o.text);){let a=e.mapping.slice(i).map(n+1+s+r.index);e.replaceWith(a,a+1,t.type.schema.linebreakReplacement.create())}}})}function Pq(e,t,n,i){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+s);e.replaceWith(r,r+1,t.type.schema.text(` -`))}})}function pxe(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function mxe(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let r=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,r);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Pl(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new hn(Xt.from(r),0,0),1,!0))}function Jy(e,t,n=1,i){let o=e.resolve(t),s=o.depth-n,r=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!r.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,c=n-2;u>s;u--,c--){let d=o.node(u),f=o.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=i&&i[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=i&&i[c]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let l=o.indexAfter(s),a=i&&i[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function gxe(e,t,n=1,i){let o=e.doc.resolve(t),s=Xt.empty,r=Xt.empty;for(let l=o.depth,a=o.depth-n,u=n-1;l>a;l--,u--){s=Xt.from(o.node(l).copy(s));let c=i&&i[u];r=Xt.from(c?c.type.create(c.attrs,r):o.node(l).copy(r))}e.step(new Ps(t,t,new hn(s.append(r),n,n),!0))}function zq(e,t){let n=e.resolve(t),i=n.index();return yxe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function vxe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o=0;o--){let s=i.index(o);if(i.node(o).canReplaceWith(s,s,n))return i.before(o+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let o=i.depth-1;o>=0;o--){let s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s=0;r--){let l=r==i.depth?0:i.pos<=(i.start(r+1)+i.end(r+1))/2?-1:1,a=i.index(r)+(l>0?1:0),u=i.node(r),c=!1;if(s==1)c=u.canReplace(a,a,o);else{let d=u.contentMatchAt(a).findWrapping(o.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?i.pos:l<0?i.before(r+1):i.after(r+1)}return null}function hx(e,t,n=t,i=hn.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return jq(o,s,i)?new Ps(t,n,i):new Cxe(o,s,i).fit()}function jq(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class Cxe{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=Xt.empty;for(let o=0;o<=t.depth;o++){let s=t.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=Xt.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;let s=this.placed,r=i.depth,l=o.depth;for(;r&&l&&s.childCount==1;)s=s.firstChild.content,r--,l--;let a=new hn(s,r,l);return t>-1?new Pl(i.pos,t,this.$to.pos,this.$to.end(),a,n):a.size||i.pos!=this.$to.pos?new Ps(i.pos,o.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,o=this.unplaced.openEnd;i1&&(o=0),s.type.spec.isolating&&o<=i){t=i;break}n=s.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let o,s=null;i?(s=V8(this.unplaced.content,i-1).firstChild,o=s.content):o=this.unplaced.content;let r=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(n==1&&(r?u.matchType(r.type)||(d=u.fillBefore(Xt.from(r),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:l,parent:s,inject:d};if(n==2&&r&&(c=u.findWrapping(r.type)))return{sliceDepth:i,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=V8(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new hn(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=V8(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new hn(mg(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new hn(mg(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g1||a==0||g.content.size)&&(d=v,c.push(Hq(g.mark(f.allowedMarks(g.marks)),u==1?a:0,u==l.childCount?h:-1)))}let m=u==l.childCount;m||(h=-1),this.placed=gg(this.placed,n,Xt.from(c)),this.frontier[n].match=d,m&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=l;g1&&o==this.$to.end(--i);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:o}=this.frontier[n],s=n=0;l--){let{match:a,type:u}=this.frontier[l],c=K8(t,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:r,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=gg(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let o=t.node(i),s=o.type.contentMatch.fillBefore(o.content,!0,t.index(i));this.openFrontierNode(o.type,o.attrs,s)}return t}openFrontierNode(t,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=gg(this.placed,this.depth,Xt.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Xt.empty,!0);n.childCount&&(this.placed=gg(this.placed,this.frontier.length,n))}}function mg(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(mg(e.firstChild.content,t-1,n)))}function gg(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(gg(e.lastChild.content,t-1,n)))}function V8(e,t){for(let n=0;n1&&(i=i.replaceChild(0,Hq(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(Xt.empty,!0)))),e.copy(i)}function K8(e,t,n,i,o){let s=e.node(t),r=o?e.indexAfter(t):e.index(t);if(r==s.childCount&&!n.compatibleContent(s.type))return null;let l=i.fillBefore(s.content,!0,r);return l&&!Axe(n,s.content,r)?l:null}function Axe(e,t,n){for(let i=n;i0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;r.indexOf(f)>-1?l=f:o.before(f)==h&&r.splice(1,0,-f)}let a=r.indexOf(l),u=[],c=i.openStart;for(let f=i.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==i.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=xxe(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(l)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=i.openStart;f>=0;f--){let h=(f+c+1)%(i.openStart+1),m=u[h];if(m)for(let g=0;g=0&&(e.replace(t,n,i),!(e.steps.length>d));f--){let h=r[f];h<0||(t=o.before(h),n=s.after(h))}}function Wq(e,t,n,i,o){if(ti){let s=o.contentMatchAt(0),r=s.fillBefore(e).append(e);e=r.append(s.matchFragment(r).fillBefore(Xt.empty,!0))}return e}function _xe(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=bxe(e.doc,t,i.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new hn(Xt.from(i),0,0))}function Mxe(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n);if(i.parent.isTextblock&&o.parent.isTextblock&&i.start()!=o.start()&&i.parentOffset==0&&o.parentOffset==0){let r=i.sharedDepth(n),l=!1;for(let a=i.depth;a>r;a--)i.node(a).type.spec.isolating&&(l=!0);for(let a=o.depth;a>r;a--)o.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);for(let a=o.depth;a>0&&n==o.start(a);a--)n=o.before(a);i=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=qq(i,o);for(let r=0;r0&&(a||i.node(l-1).canReplace(i.index(l-1),o.indexAfter(l-1))))return e.delete(i.before(l),o.after(l))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r&&i.start(r-1)==o.start(r-1)&&i.node(r-1).canReplace(i.index(r-1),o.index(r-1)))return e.delete(i.before(r),n);e.delete(t,n)}function qq(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let o=i;o>=0;o--){let s=e.start(o);if(st.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(s==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==s-1)&&n.push(o)}return n}class d1 extends Ir{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return us.fail("No node at attribute step's position");let i=Object.create(null);for(let s in n.attrs)i[s]=n.attrs[s];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return us.fromReplace(t,this.pos,this.pos+1,new hn(Xt.from(o),0,n.isLeaf?0:1))}getMap(){return Nl.empty}invert(t){return new d1(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new d1(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new d1(n.pos,n.attr,n.value)}}Ir.jsonID("attr",d1);class W0 extends Ir{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return us.ok(i)}getMap(){return Nl.empty}invert(t){return new W0(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new W0(n.attr,n.value)}}Ir.jsonID("docAttr",W0);let L1=class extends Error{};L1=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};L1.prototype=Object.create(Error.prototype);L1.prototype.constructor=L1;L1.prototype.name="TransformError";class Ixe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new H0}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new L1(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i{t=Math.min(t,l),n=Math.max(n,a)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=hn.empty){let o=hx(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new hn(Xt.from(i),0,0))}delete(t,n){return this.replace(t,n,hn.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return Sxe(this,t,n,i),this}replaceRangeWith(t,n,i){return _xe(this,t,n,i),this}deleteRange(t,n){return Mxe(this,t,n),this}lift(t,n){return dxe(this,t,n),this}join(t,n=1){return kxe(this,t,n),this}wrap(t,n){return fxe(this,t,n),this}setBlockType(t,n=t,i,o=null){return hxe(this,t,n,i,o),this}setNodeMarkup(t,n,i=null,o){return mxe(this,t,n,i,o),this}setNodeAttribute(t,n,i){return this.step(new d1(t,n,i)),this}setDocAttribute(t,n){return this.step(new W0(t,n)),this}addNodeMark(t,n){return this.step(new vd(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof Pi)n.isInSet(i.marks)&&this.step(new Bh(t,n));else{let o=i.marks,s,r=[];for(;s=n.isInSet(o);)r.push(new Bh(t,s)),o=s.removeFromSet(o);for(let l=r.length-1;l>=0;l--)this.step(r[l])}return this}split(t,n=1,i){return gxe(this,t,n,i),this}addMark(t,n,i){return axe(this,t,n,i),this}removeMark(t,n,i){return uxe(this,t,n,i),this}clearIncompatible(t,n,i){return dx(this,t,n,i),this}}const Z8=Object.create(null);class Vi{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new Txe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;s--){let r=n<0?Lp(t.node(0),t.node(s),t.before(s+1),t.index(s),n,i):Lp(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,i);if(r)return r}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new zl(t.node(0))}static atStart(t){return Lp(t,t,0,0,1)||new zl(t)}static atEnd(t){return Lp(t,t,t.content.size,t.childCount,-1)||new zl(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=Z8[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in Z8)throw new RangeError("Duplicate use of selection JSON ID "+t);return Z8[t]=n,n.prototype.jsonID=t,n}getBookmark(){return si.between(this.$anchor,this.$head).getBookmark()}}Vi.prototype.visible=!0;class Txe{constructor(t,n){this.$from=t,this.$to=n}}let PD=!1;function zD(e){!PD&&!e.parent.inlineContent&&(PD=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class si extends Vi{constructor(t,n=t){zD(t),zD(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return Vi.near(i);let o=t.resolve(n.map(this.anchor));return new si(o.parent.inlineContent?o:i,i)}replace(t,n=hn.empty){if(super.replace(t,n),n==hn.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof si&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new eb(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new si(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let o=t.resolve(n);return new this(o,i==n?o:t.resolve(i))}static between(t,n,i){let o=t.pos-n.pos;if((!i||o)&&(i=o>=0?1:-1),!n.parent.inlineContent){let s=Vi.findFrom(n,i,!0)||Vi.findFrom(n,-i,!0);if(s)n=s.$head;else return Vi.near(n,i)}return t.parent.inlineContent||(o==0?t=n:(t=(Vi.findFrom(t,-i,!0)||Vi.findFrom(t,i,!0)).$anchor,t.pos0?0:1);o>0?r=0;r+=o){let l=t.child(r);if(l.isAtom){if(!s&&Kn.isSelectable(l))return Kn.create(e,n-(o<0?l.nodeSize:0))}else{let a=Lp(e,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function jD(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(Vi.near(e.doc.resolve(r),n))}const HD=1,ly=2,WD=4;class Lxe extends Ixe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=ly,this}ensureMarks(t){return Pi.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ly)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~ly,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let i=this.selection;return n&&(t=t.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||Pi.none))),i.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,i){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(i==null&&(i=n),!t)return this.deleteRange(n,i);let s=this.storedMarks;if(!s){let r=this.doc.resolve(n);s=i==n?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,o.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Vi.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=WD,this}get scrolledIntoView(){return(this.updated&WD)>0}}function qD(e,t){return!t||!e?e:e.bind(t)}class vg{constructor(t,n,i){this.name=t,this.init=qD(n.init,i),this.apply=qD(n.apply,i)}}const Nxe=[new vg("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new vg("selection",{init(e,t){return e.selection||Vi.atStart(t.doc)},apply(e){return e.selection}}),new vg("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new vg("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class G8{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Nxe.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new vg(i.key,i.spec.state,i))})}}class nh{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let i=0;ii.toJSON())),t&&typeof t=="object")for(let i in t){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[i],s=o.spec.state;s&&s.toJSON&&(n[i]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new G8(t.schema,t.plugins),s=new nh(o);return o.fields.forEach(r=>{if(r.name=="doc")s.doc=kh.fromJSON(t.schema,n.doc);else if(r.name=="selection")s.selection=Vi.fromJSON(s.doc,n.selection);else if(r.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(i)for(let l in i){let a=i[l],u=a.spec.state;if(a.key==r.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[r.name]=u.fromJSON.call(a,t,n[l],s);return}}s[r.name]=r.init(t,s)}}),s}}function Uq(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):i=="handleDOMEvents"&&(o=Uq(o,t,{})),n[i]=o}return n}class tm{constructor(t){this.spec=t,this.props={},t.props&&Uq(t.props,this,this.props),this.key=t.key?t.key.key:Vq("plugin")}getState(t){return t[this.key]}}const Q8=Object.create(null);function Vq(e){return e in Q8?e+"$"+ ++Q8[e]:(Q8[e]=0,e+"$")}class mx{constructor(t="key"){this.key=Vq(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const aA=` - - - - -`,Kq=` - - - - -`,Zq='',Gq=` - - - -`,Qq=` - - -`,Yq='',Jq=` - - -`,Xq=` - - -`,eU=` - - -`,Dxe='',Fxe='',Bxe='',Rxe='',$xe='',Oxe={sm:14,md:16,lg:20},Pxe={file:aA,folder:Kq,skill:Zq,copy:Gq,check:Qq,"external-link":Yq,target:Jq,"file-edit":Xq,close:eU,attachment:Dxe,image:Fxe,video:Bxe,fullscreen:Rxe,quote:$xe};function Kr(e,t="md"){const n=Oxe[t];return Pxe[e].replace(/]*>/,i=>i.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^